org.apache.directory.server.core.interceptor.context
Class ModifyOperationContext
java.lang.Object
org.apache.directory.server.core.interceptor.context.AbstractOperationContext
org.apache.directory.server.core.interceptor.context.AbstractChangeOperationContext
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
Method Summary |
static java.util.List<org.apache.directory.shared.ldap.entry.Modification> |
createModItems(ServerEntry serverEntry,
org.apache.directory.shared.ldap.entry.ModificationOperation modOp)
|
ClonedServerEntry |
getEntry()
Gets the server entry associated with the target DN of this
OperationContext. |
java.util.List<org.apache.directory.shared.ldap.entry.Modification> |
getModItems()
|
java.lang.String |
getName()
|
void |
setEntry(ClonedServerEntry entry)
Sets the server entry associated with the target DN of this
OperationContext. |
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.AbstractOperationContext |
add, addRequestControl, addRequestControls, addResponseControl, delete, getByPassed, getDn, getEffectivePrincipal, getFirstOperation, getLastOperation, getNextOperation, getPreviousOperation, getRequestControl, getResponseControl, getResponseControlCount, getResponseControls, getSession, hasBypass, hasEntry, hasRequestControl, hasRequestControls, hasResponseControl, hasResponseControls, isBypassed, isFirstOperation, lookup, lookup, modify, newLookupContext, setAuthorizedPrincipal, setByPassed, setDn, setNextOperation, setPreviousOperation, setRequestControls, setSession |
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, getFirstOperation, getLastOperation, getNextOperation, getPreviousOperation, getRequestControl, getResponseControl, getResponseControlCount, getResponseControls, getSession, hasBypass, hasEntry, hasRequestControl, hasRequestControls, hasResponseControl, hasResponseControls, isBypassed, isFirstOperation, lookup, lookup, modify, newLookupContext, setByPassed, setDn |
ModifyOperationContext
public ModifyOperationContext(CoreSession session)
- Creates a new instance of ModifyOperationContext.
ModifyOperationContext
public ModifyOperationContext(CoreSession session,
org.apache.directory.shared.ldap.name.LdapDN 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 modifiedmodItems
- the modifications to be performed on the entry
ModifyOperationContext
public ModifyOperationContext(CoreSession session,
org.apache.directory.shared.ldap.message.ModifyRequest modifyRequest)
throws java.lang.Exception
- Throws:
java.lang.Exception
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(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
setEntry
public void setEntry(ClonedServerEntry entry)
- Description copied from interface:
OperationContext
- Sets the server entry associated with the target DN of this
OperationContext.
- Specified by:
setEntry
in interface OperationContext
- Overrides:
setEntry
in class AbstractOperationContext
- Parameters:
entry
- the entry to set
getEntry
public ClonedServerEntry getEntry()
- Description copied from interface:
OperationContext
- Gets the server entry associated with the target DN of this
OperationContext. The entry associated with the DN may be altered
during the course of processing an LDAP operation through the
InterceptorChain. This place holder is put here to prevent the need
for repetitive lookups of the target entry. Furthermore the returned
entry may be altered by any Interceptor in the chain and this is why a
ClonedServerEntry is returned instead of a ServerEntry. A
ClonedServerEntry has an immutable reference to the original state of
the target entry. The original state can be accessed via a call to
ClonedServerEntry.getOriginalEntry()
. The return value may be
null in which case any lookup performed to access it may set it to
prevent the need for subsequent lookups.
Also note that during the course of handling some operations such as
those that rename, move or rename and move the entry, may alter the DN
of this entry. Interceptor implementors should not presume the DN or
the values contained in this entry are currently what is present in the
DIT. The original entry contained in the ClonedServerEntry shoudl be
used as the definitive source of information about the state of the
entry in the DIT before returning from the Partition subsystem.
- Specified by:
getEntry
in interface OperationContext
- Overrides:
getEntry
in class AbstractOperationContext
- Returns:
- the entry
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.