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

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.ModifyOperationContext
All Implemented Interfaces:
ChangeOperationContext, OperationContext

public class ModifyOperationContext
extends AbstractChangeOperationContext

A Modify context used for Interceptors. It contains all the informations needed for the modify operation, and used by all the interceptors This context can use either Attributes or ModificationItem, but not both.

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
ModifyOperationContext(CoreSession session)
          Creates a new instance of ModifyOperationContext.
ModifyOperationContext(CoreSession session, org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> modItems)
          Creates a new instance of ModifyOperationContext.
ModifyOperationContext(CoreSession session, org.apache.directory.shared.ldap.message.internal.InternalModifyRequest modifyRequest)
           
 
Method Summary
static java.util.List<org.apache.directory.shared.ldap.entry.Modification> createModItems(org.apache.directory.shared.ldap.entry.ServerEntry serverEntry, org.apache.directory.shared.ldap.entry.ModificationOperation modOp)
           
 ClonedServerEntry getAlteredEntry()
          Returns the entry after it has been renamed and potentially changed for Rdn alterations.
 java.util.List<org.apache.directory.shared.ldap.entry.Modification> getModItems()
           
 java.lang.String getName()
           
 void setAlteredEntry(ClonedServerEntry alteredEntry)
          Set the modified entry once the operation has been proceced on the backend.
 void setModItems(java.util.List<org.apache.directory.shared.ldap.entry.Modification> modItems)
          Set the modified attributes
 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

ModifyOperationContext

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


ModifyOperationContext

public ModifyOperationContext(CoreSession session,
                              org.apache.directory.shared.ldap.name.DN dn,
                              java.util.List<org.apache.directory.shared.ldap.entry.Modification> modItems)
Creates a new instance of ModifyOperationContext.

Parameters:
dn - the dn of the entry to be modified
modItems - the modifications to be performed on the entry

ModifyOperationContext

public ModifyOperationContext(CoreSession session,
                              org.apache.directory.shared.ldap.message.internal.InternalModifyRequest modifyRequest)
                       throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setModItems

public void setModItems(java.util.List<org.apache.directory.shared.ldap.entry.Modification> modItems)
Set the modified attributes

Parameters:
modItems - The modified attributes

getModItems

public java.util.List<org.apache.directory.shared.ldap.entry.Modification> getModItems()
Returns:
The modifications

createModItems

public static java.util.List<org.apache.directory.shared.ldap.entry.Modification> createModItems(org.apache.directory.shared.ldap.entry.ServerEntry serverEntry,
                                                                                                 org.apache.directory.shared.ldap.entry.ModificationOperation modOp)
                                                                                          throws javax.naming.NamingException
Throws:
javax.naming.NamingException

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.