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