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
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.core;
028    
029    import java.util.List;
030    import org.opends.server.types.ByteString;
031    import org.opends.server.types.DN;
032    import org.opends.server.types.Entry;
033    import org.opends.server.types.Modification;
034    import org.opends.server.types.RDN;
035    
036    /**
037     * This abstract class wraps/decorates a given moddn operation.
038     * This class will be extended by sub-classes to enhance the
039     * functionnality of the ModifyDNOperationBasis.
040     */
041    public abstract class ModifyDNOperationWrapper
042      extends OperationWrapper
043      implements ModifyDNOperation
044    {
045      ModifyDNOperation modifyDN;
046    
047      /**
048       * Creates a new moddn operation based on the provided moddn operation.
049       *
050       * @param modifyDN The moddn operation to wrap
051       */
052      public ModifyDNOperationWrapper(ModifyDNOperation modifyDN)
053      {
054        super(modifyDN);
055        this.modifyDN = modifyDN;
056      }
057    
058      /**
059       * {@inheritDoc}
060       */
061      public void addModification(Modification modification) {
062        modifyDN.addModification(modification);
063      }
064    
065      /**
066       * {@inheritDoc}
067       */
068      public boolean deleteOldRDN() {
069        return modifyDN.deleteOldRDN();
070      }
071    
072      /**
073       * {@inheritDoc}
074       */
075      public long getChangeNumber() {
076        return modifyDN.getChangeNumber();
077      }
078    
079      /**
080       * {@inheritDoc}
081       */
082      public DN getEntryDN() {
083        return modifyDN.getEntryDN();
084      }
085    
086      /**
087       * {@inheritDoc}
088       */
089      public List<Modification> getModifications() {
090        return modifyDN.getModifications();
091      }
092    
093      /**
094       * {@inheritDoc}
095       */
096      public RDN getNewRDN() {
097        return modifyDN.getNewRDN();
098      }
099    
100      /**
101       * {@inheritDoc}
102       */
103      public DN getNewSuperior() {
104        return modifyDN.getNewSuperior();
105      }
106    
107      /**
108       * {@inheritDoc}
109       */
110      public Entry getOriginalEntry() {
111        return modifyDN.getOriginalEntry();
112      }
113    
114      /**
115       * {@inheritDoc}
116       */
117      public DN getProxiedAuthorizationDN() {
118        return modifyDN.getProxiedAuthorizationDN();
119      }
120    
121      /**
122       * {@inheritDoc}
123       */
124      public ByteString getRawEntryDN() {
125        return modifyDN.getRawEntryDN();
126      }
127    
128      /**
129       * {@inheritDoc}
130       */
131      public ByteString getRawNewRDN() {
132        return modifyDN.getRawNewRDN();
133      }
134    
135      /**
136       * {@inheritDoc}
137       */
138      public ByteString getRawNewSuperior() {
139        return modifyDN.getRawNewSuperior();
140      }
141    
142      /**
143       * {@inheritDoc}
144       */
145      public Entry getUpdatedEntry() {
146        return modifyDN.getUpdatedEntry();
147      }
148    
149      /**
150       * {@inheritDoc}
151       */
152      public void setChangeNumber(long changeNumber) {
153        modifyDN.setChangeNumber(changeNumber);
154      }
155    
156      /**
157       * {@inheritDoc}
158       */
159      public void setDeleteOldRDN(boolean deleteOldRDN) {
160        modifyDN.setDeleteOldRDN(deleteOldRDN);
161      }
162    
163      /**
164       * {@inheritDoc}
165       */
166      public void setRawEntryDN(ByteString rawEntryDN) {
167        modifyDN.setRawEntryDN(rawEntryDN);
168      }
169    
170      /**
171       * {@inheritDoc}
172       */
173      public void setRawNewRDN(ByteString rawNewRDN) {
174        modifyDN.setRawNewRDN(rawNewRDN);
175      }
176    
177      /**
178       * {@inheritDoc}
179       */
180      public void setRawNewSuperior(ByteString rawNewSuperior) {
181        modifyDN.setRawNewSuperior(rawNewSuperior);
182      }
183    
184      /**
185       * {@inheritDoc}
186       */
187      public void setProxiedAuthorizationDN(DN dn)
188      {
189        modifyDN.setProxiedAuthorizationDN(dn);
190      }
191    
192      /**
193       * {@inheritDoc}
194       */
195      public DN getNewDN()
196      {
197        return modifyDN.getNewDN();
198      }
199    }