org.apache.directory.server.core.interceptor.context
Class RenameOperationContext

java.lang.Object
  extended by org.apache.directory.server.core.interceptor.context.AbstractOperationContext
      extended by org.apache.directory.server.core.interceptor.context.AbstractChangeOperationContext
          extended by org.apache.directory.server.core.interceptor.context.RenameOperationContext
All Implemented Interfaces:
ChangeOperationContext, OperationContext
Direct Known Subclasses:
MoveAndRenameOperationContext

public class RenameOperationContext
extends AbstractChangeOperationContext

A RenameService context used for Interceptors. It contains all the informations needed for the modify DN operation, and used by all the interceptors This is used when the modifyDN is about changing the RDN, not the base DN.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.server.core.interceptor.context.AbstractChangeOperationContext
logChange
 
Fields inherited from class org.apache.directory.server.core.interceptor.context.AbstractOperationContext
authorizedPrincipal, byPassed, dn, EMPTY_CONTROLS, entry, next, previous, requestControls, responseControls, session, throwReferral
 
Constructor Summary
RenameOperationContext(CoreSession session)
          Creates a new instance of RenameOperationContext.
RenameOperationContext(CoreSession session, org.apache.directory.shared.ldap.name.DN oldDn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean delOldDn)
          Creates a new instance of RenameOperationContext.
RenameOperationContext(CoreSession session, org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
           
 
Method Summary
 ClonedServerEntry getAlteredEntry()
          Returns the entry after it has been renamed and potentially changed for RDN alterations.
 boolean getDelOldDn()
           
 java.lang.String getName()
           
 org.apache.directory.shared.ldap.name.DN getNewDn()
           
 org.apache.directory.shared.ldap.name.RDN getNewRdn()
           
 void setAlteredEntry(ClonedServerEntry alteredEntry)
          Set the modified entry once the operation has been proceced on the backend.
 void setDelOldDn(boolean delOldDn)
          Set the flag to delete the old DN
 void setNewDn(org.apache.directory.shared.ldap.name.DN newDn)
          Set the new DN
 void setNewRdn(org.apache.directory.shared.ldap.name.RDN newRdn)
          Set the new RDN
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.server.core.interceptor.context.AbstractChangeOperationContext
getChangeLogEvent, isLogChange, setChangeLogEvent, setLogChange
 
Methods inherited from class org.apache.directory.server.core.interceptor.context.AbstractOperationContext
add, addRequestControl, addRequestControls, addResponseControl, delete, getByPassed, getDn, getEffectivePrincipal, getEntry, getFirstOperation, getLastOperation, getNextOperation, getPreviousOperation, getRequestControl, getResponseControl, getResponseControlCount, getResponseControls, getSession, hasBypass, hasEntry, hasRequestControl, hasRequestControls, hasResponseControl, hasResponseControls, ignoreReferral, isBypassed, isFirstOperation, isReferralIgnored, isReferralThrown, lookup, lookup, modify, newLookupContext, setAuthorizedPrincipal, setByPassed, setDn, setEntry, setNextOperation, setPreviousOperation, setRequestControls, setSession, throwReferral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.core.interceptor.context.OperationContext
add, addRequestControl, addRequestControls, addResponseControl, delete, getByPassed, getDn, getEffectivePrincipal, getEntry, getFirstOperation, getLastOperation, getNextOperation, getPreviousOperation, getRequestControl, getResponseControl, getResponseControlCount, getResponseControls, getSession, hasBypass, hasEntry, hasRequestControl, hasRequestControls, hasResponseControl, hasResponseControls, ignoreReferral, isBypassed, isFirstOperation, isReferralIgnored, isReferralThrown, lookup, lookup, modify, newLookupContext, setByPassed, setDn, setEntry, throwReferral
 

Constructor Detail

RenameOperationContext

public RenameOperationContext(CoreSession session)
Creates a new instance of RenameOperationContext.


RenameOperationContext

public RenameOperationContext(CoreSession session,
                              org.apache.directory.shared.ldap.name.DN oldDn,
                              org.apache.directory.shared.ldap.name.RDN newRdn,
                              boolean delOldDn)
Creates a new instance of RenameOperationContext.

Parameters:
oldDn - the dn of the entry before the rename
newRdn - the new RDN to use for the target
delOldDn - true if we delete the old RDN value

RenameOperationContext

public RenameOperationContext(CoreSession session,
                              org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
Method Detail

getDelOldDn

public boolean getDelOldDn()
Returns:
The delete old DN flag

setDelOldDn

public void setDelOldDn(boolean delOldDn)
Set the flag to delete the old DN

Parameters:
delOldDn - the flag to set

getNewDn

public org.apache.directory.shared.ldap.name.DN getNewDn()
                                                  throws java.lang.Exception
Returns:
The new DN either computed if null or already computed
Throws:
java.lang.Exception

getNewRdn

public org.apache.directory.shared.ldap.name.RDN getNewRdn()
Returns:
The new RDN

setNewRdn

public void setNewRdn(org.apache.directory.shared.ldap.name.RDN newRdn)
Set the new RDN

Parameters:
newRdn - The new RDN

setNewDn

public void setNewDn(org.apache.directory.shared.ldap.name.DN newDn)
Set the new DN

Parameters:
newDn - The new DN

getName

public java.lang.String getName()
Specified by:
getName in interface OperationContext
Specified by:
getName in class AbstractOperationContext
Returns:
the operation name

getAlteredEntry

public ClonedServerEntry getAlteredEntry()
Returns the entry after it has been renamed and potentially changed for RDN alterations.

Returns:
the new renamed entry

setAlteredEntry

public void setAlteredEntry(ClonedServerEntry alteredEntry)
Set the modified entry once the operation has been proceced on the backend.

Parameters:
alteredEntry - The modified entry

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.