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.forgerock.opendj.ldap.schema.ObjectClass;
024import org.opends.server.types.*;
025import org.forgerock.opendj.ldap.ByteString;
026import org.forgerock.opendj.ldap.DN;
027
028/**
029 * This abstract class wraps/decorates a given add operation.
030 * This class will be extended by sub-classes to enhance the
031 * functionality of the AddOperationBasis.
032 */
033public abstract class AddOperationWrapper extends
034    OperationWrapper<AddOperation> implements AddOperation
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  @Override
047  public void addObjectClass(ObjectClass objectClass, String name)
048  {
049    getOperation().addObjectClass(objectClass, name);
050  }
051
052  @Override
053  public void addRawAttribute(RawAttribute rawAttribute)
054  {
055    getOperation().addRawAttribute(rawAttribute);
056  }
057
058  @Override
059  public DN getEntryDN()
060  {
061    return getOperation().getEntryDN();
062  }
063
064  @Override
065  public Map<ObjectClass, String> getObjectClasses()
066  {
067    return getOperation().getObjectClasses();
068  }
069
070  @Override
071  public Map<AttributeType, List<Attribute>> getOperationalAttributes()
072  {
073    return getOperation().getOperationalAttributes();
074  }
075
076  @Override
077  public List<RawAttribute> getRawAttributes()
078  {
079    return getOperation().getRawAttributes();
080  }
081
082  @Override
083  public ByteString getRawEntryDN()
084  {
085    return getOperation().getRawEntryDN();
086  }
087
088  @Override
089  public Map<AttributeType, List<Attribute>> getUserAttributes()
090  {
091    return getOperation().getUserAttributes();
092  }
093
094  @Override
095  public void removeAttribute(AttributeType attributeType)
096  {
097    getOperation().removeAttribute(attributeType);
098  }
099
100  @Override
101  public void removeObjectClass(ObjectClass objectClass)
102  {
103    getOperation().removeObjectClass(objectClass);
104  }
105
106  @Override
107  public void setAttribute(AttributeType attributeType,
108      List<Attribute> attributeList)
109  {
110    getOperation().setAttribute(attributeType, attributeList);
111  }
112
113  @Override
114  public void setRawAttributes(List<RawAttribute> rawAttributes)
115  {
116    getOperation().setRawAttributes(rawAttributes);
117  }
118
119  @Override
120  public void setRawEntryDN(ByteString rawEntryDN)
121  {
122    getOperation().setRawEntryDN(rawEntryDN);
123  }
124
125  @Override
126  public String toString()
127  {
128    return getOperation().toString();
129  }
130}