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 027 028 029 /** 030 * This interface defines a set of methods that may be safely called in an LDAP 031 * modify DN request without altering its contents. This interface must not be 032 * implemented by any class other than {@code ModifyDNRequest}. 033 * <BR><BR> 034 * This interface does not inherently provide the assurance of thread safety for 035 * the methods that it exposes, because it is still possible for a thread 036 * referencing the object which implements this interface to alter the request 037 * using methods not included in this interface. However, if it can be 038 * guaranteed that no thread will alter the underlying object, then the methods 039 * exposed by this interface can be safely invoked concurrently by any number of 040 * threads. 041 */ 042 public interface ReadOnlyModifyDNRequest 043 extends ReadOnlyLDAPRequest 044 { 045 /** 046 * Retrieves the current DN of the entry to move/rename. 047 * 048 * @return The current DN of the entry to move/rename. 049 */ 050 String getDN(); 051 052 053 054 /** 055 * Retrieves the new RDN for the entry. 056 * 057 * @return The new RDN for the entry. 058 */ 059 String getNewRDN(); 060 061 062 063 /** 064 * Indicates whether the current RDN value should be removed from the entry. 065 * 066 * @return {@code true} if the current RDN value should be removed from the 067 * entry, or {@code false} if not. 068 */ 069 boolean deleteOldRDN(); 070 071 072 073 /** 074 * Retrieves the new superior DN for the entry. 075 * 076 * @return The new superior DN for the entry, or {@code null} if the entry is 077 * not to be moved below a new parent. 078 */ 079 String getNewSuperiorDN(); 080 081 082 083 /** 084 * {@inheritDoc} 085 */ 086 ModifyDNRequest duplicate(); 087 088 089 090 /** 091 * {@inheritDoc} 092 */ 093 ModifyDNRequest duplicate(final Control[] controls); 094 095 096 097 /** 098 * Retrieves an LDIF modify DN change record with the contents of this modify 099 * DN request. 100 * 101 * @return An LDIF modify DN change record with the contents of this modify 102 * DN request. 103 */ 104 LDIFModifyDNChangeRecord toLDIFChangeRecord(); 105 106 107 108 /** 109 * Retrieves a string array whose lines contain an LDIF representation of the 110 * corresponding modify DN change record. 111 * 112 * @return A string array whose lines contain an LDIF representation of the 113 * corresponding modify DN change record. 114 */ 115 String[] toLDIF(); 116 117 118 119 /** 120 * Retrieves an LDIF string representation of this modify DN request. 121 * 122 * @return An LDIF string representation of this modify DN request. 123 */ 124 String toLDIFString(); 125 }