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