001    /*
002     * Copyright 2007-2016 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2008-2016 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 java.util.List;
026    
027    import com.unboundid.ldif.LDIFModifyChangeRecord;
028    
029    
030    
031    /**
032     * This interface defines a set of methods that may be safely called in an LDAP
033     * modify request without altering its contents.  This interface must not be
034     * implemented by any class other than {@code ModifyRequest}.
035     * <BR><BR>
036     * This interface does not inherently provide the assurance of thread safety for
037     * the methods that it exposes, because it is still possible for a thread
038     * referencing the object which implements this interface to alter the request
039     * using methods not included in this interface.  However, if it can be
040     * guaranteed that no thread will alter the underlying object, then the methods
041     * exposed by this interface can be safely invoked concurrently by any number of
042     * threads.
043     */
044    public interface ReadOnlyModifyRequest
045           extends ReadOnlyLDAPRequest
046    {
047      /**
048       * Retrieves the DN of the entry to modify.
049       *
050       * @return  The DN of the entry to modify.
051       */
052      String getDN();
053    
054    
055    
056      /**
057       * Retrieves the set of modifications for this modify request.  The returned
058       * list must not be altered.
059       *
060       * @return  The set of modifications for this modify request.
061       */
062      List<Modification> getModifications();
063    
064    
065    
066      /**
067       * {@inheritDoc}
068       */
069      ModifyRequest duplicate();
070    
071    
072    
073      /**
074       * {@inheritDoc}
075       */
076      ModifyRequest duplicate(final Control[] controls);
077    
078    
079    
080      /**
081       * Retrieves an LDIF modify change record with the contents of this modify
082       * request.
083       *
084       * @return  An LDIF modify change record with the contents of this modify
085       *          request.
086       */
087      LDIFModifyChangeRecord toLDIFChangeRecord();
088    
089    
090    
091      /**
092       * Retrieves a string array whose lines contain an LDIF representation of the
093       * corresponding modify change record.
094       *
095       * @return  A string array whose lines contain an LDIF representation of the
096       *          corresponding modify change record.
097       */
098      String[] toLDIF();
099    
100    
101    
102      /**
103       * Retrieves an LDIF string representation of this modify request.
104       *
105       * @return  An LDIF string representation of this modify request.
106       */
107      String toLDIFString();
108    }