001    /*
002     * Copyright 2007-2015 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2008-2015 UnboundID Corp.
007     *
008     * This program is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (GPLv2 only)
010     * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011     * as published by the Free Software Foundation.
012     *
013     * This program is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program; if not, see <http://www.gnu.org/licenses>.
020     */
021    package com.unboundid.ldap.sdk;
022    
023    
024    
025    import com.unboundid.ldif.LDIFModifyDNChangeRecord;
026    import com.unboundid.util.NotExtensible;
027    import com.unboundid.util.ThreadSafety;
028    import com.unboundid.util.ThreadSafetyLevel;
029    
030    
031    
032    /**
033     * This interface defines a set of methods that may be safely called in an LDAP
034     * modify DN request without altering its contents.  This interface must not be
035     * implemented by any class other than {@link ModifyDNRequest}.
036     * <BR><BR>
037     * This interface does not inherently provide the assurance of thread safety for
038     * the methods that it exposes, because it is still possible for a thread
039     * referencing the object which implements this interface to alter the request
040     * using methods not included in this interface.  However, if it can be
041     * guaranteed that no thread will alter the underlying object, then the methods
042     * exposed by this interface can be safely invoked concurrently by any number of
043     * threads.
044     */
045    @NotExtensible()
046    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
047    public interface ReadOnlyModifyDNRequest
048           extends ReadOnlyLDAPRequest
049    {
050      /**
051       * Retrieves the current DN of the entry to move/rename.
052       *
053       * @return  The current DN of the entry to move/rename.
054       */
055      String getDN();
056    
057    
058    
059      /**
060       * Retrieves the new RDN for the entry.
061       *
062       * @return  The new RDN for the entry.
063       */
064      String getNewRDN();
065    
066    
067    
068      /**
069       * Indicates whether the current RDN value should be removed from the entry.
070       *
071       * @return  {@code true} if the current RDN value should be removed from the
072       *          entry, or {@code false} if not.
073       */
074      boolean deleteOldRDN();
075    
076    
077    
078      /**
079       * Retrieves the new superior DN for the entry.
080       *
081       * @return  The new superior DN for the entry, or {@code null} if the entry is
082       *          not to be moved below a new parent.
083       */
084      String getNewSuperiorDN();
085    
086    
087    
088      /**
089       * {@inheritDoc}
090       */
091      ModifyDNRequest duplicate();
092    
093    
094    
095      /**
096       * {@inheritDoc}
097       */
098      ModifyDNRequest duplicate(final Control[] controls);
099    
100    
101    
102      /**
103       * Retrieves an LDIF modify DN change record with the contents of this modify
104       * DN request.
105       *
106       * @return  An LDIF modify DN change record with the contents of this modify
107       *          DN request.
108       */
109      LDIFModifyDNChangeRecord toLDIFChangeRecord();
110    
111    
112    
113      /**
114       * Retrieves a string array whose lines contain an LDIF representation of the
115       * corresponding modify DN change record.
116       *
117       * @return  A string array whose lines contain an LDIF representation of the
118       *          corresponding modify DN change record.
119       */
120      String[] toLDIF();
121    
122    
123    
124      /**
125       * Retrieves an LDIF string representation of this modify DN request.
126       *
127       * @return  An LDIF string representation of this modify DN request.
128       */
129      String toLDIFString();
130    }