001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 * Portions Copyright 2013-2016 ForgeRock AS.
016 */
017package org.opends.server.core;
018
019import java.util.List;
020import java.util.Map;
021
022import org.forgerock.opendj.ldap.schema.AttributeType;
023import org.opends.server.types.*;
024import org.forgerock.opendj.ldap.ByteString;
025import org.forgerock.opendj.ldap.DN;
026
027/**
028 * This abstract class wraps/decorates a given add operation.
029 * This class will be extended by sub-classes to enhance the
030 * functionality of the AddOperationBasis.
031 */
032public abstract class AddOperationWrapper extends
033    OperationWrapper<AddOperation> implements AddOperation
034{
035
036  /**
037   * Creates a new add operation based on the provided add operation.
038   *
039   * @param add The add operation to wrap
040   */
041  public AddOperationWrapper(AddOperation add)
042  {
043    super(add);
044  }
045
046  /** {@inheritDoc} */
047  @Override
048  public void addObjectClass(ObjectClass objectClass, String name)
049  {
050    getOperation().addObjectClass(objectClass, name);
051  }
052
053  /** {@inheritDoc} */
054  @Override
055  public void addRawAttribute(RawAttribute rawAttribute)
056  {
057    getOperation().addRawAttribute(rawAttribute);
058  }
059
060  /** {@inheritDoc} */
061  @Override
062  public DN getEntryDN()
063  {
064    return getOperation().getEntryDN();
065  }
066
067  /** {@inheritDoc} */
068  @Override
069  public Map<ObjectClass, String> getObjectClasses()
070  {
071    return getOperation().getObjectClasses();
072  }
073
074  /** {@inheritDoc} */
075  @Override
076  public Map<AttributeType, List<Attribute>> getOperationalAttributes()
077  {
078    return getOperation().getOperationalAttributes();
079  }
080
081  /** {@inheritDoc} */
082  @Override
083  public List<RawAttribute> getRawAttributes()
084  {
085    return getOperation().getRawAttributes();
086  }
087
088  /** {@inheritDoc} */
089  @Override
090  public ByteString getRawEntryDN()
091  {
092    return getOperation().getRawEntryDN();
093  }
094
095  /** {@inheritDoc} */
096  @Override
097  public Map<AttributeType, List<Attribute>> getUserAttributes()
098  {
099    return getOperation().getUserAttributes();
100  }
101
102  /** {@inheritDoc} */
103  @Override
104  public void removeAttribute(AttributeType attributeType)
105  {
106    getOperation().removeAttribute(attributeType);
107  }
108
109  /** {@inheritDoc} */
110  @Override
111  public void removeObjectClass(ObjectClass objectClass)
112  {
113    getOperation().removeObjectClass(objectClass);
114  }
115
116  /** {@inheritDoc} */
117  @Override
118  public void setAttribute(AttributeType attributeType,
119      List<Attribute> attributeList)
120  {
121    getOperation().setAttribute(attributeType, attributeList);
122  }
123
124  /** {@inheritDoc} */
125  @Override
126  public void setRawAttributes(List<RawAttribute> rawAttributes)
127  {
128    getOperation().setRawAttributes(rawAttributes);
129  }
130
131  /** {@inheritDoc} */
132  @Override
133  public void setRawEntryDN(ByteString rawEntryDN)
134  {
135    getOperation().setRawEntryDN(rawEntryDN);
136  }
137
138  /** {@inheritDoc} */
139  @Override
140  public String toString()
141  {
142    return getOperation().toString();
143  }
144
145}