|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.interceptor.context.AbstractOperationContext
public abstract class AbstractOperationContext
This abstract class stores common context elements, like the DN, which is used in all the contexts.
Field Summary | |
---|---|
protected LdapPrincipal |
authorizedPrincipal
|
protected java.util.Collection<java.lang.String> |
byPassed
the Interceptors bypassed by this operation |
protected org.apache.directory.shared.ldap.name.DN |
dn
The DN associated with the context |
protected static org.apache.directory.shared.ldap.message.control.Control[] |
EMPTY_CONTROLS
|
protected ClonedServerEntry |
entry
The entry associated with the target entry of this OperationContext |
protected OperationContext |
next
|
protected OperationContext |
previous
|
protected java.util.Map<java.lang.String,org.apache.directory.shared.ldap.message.control.Control> |
requestControls
The associated request's controls |
protected java.util.Map<java.lang.String,org.apache.directory.shared.ldap.message.control.Control> |
responseControls
The associated response's controls |
protected CoreSession |
session
The core session |
protected boolean |
throwReferral
A flag used to tell if we should consider referrals as standard entries |
Constructor Summary | |
---|---|
AbstractOperationContext(CoreSession session)
Creates a new instance of AbstractOperationContext. |
|
AbstractOperationContext(CoreSession session,
org.apache.directory.shared.ldap.name.DN dn)
Creates a new instance of AbstractOperationContext. |
Method Summary | |
---|---|
void |
add(org.apache.directory.shared.ldap.entry.ServerEntry entry,
java.util.Collection<java.lang.String> byPassed)
|
void |
addRequestControl(org.apache.directory.shared.ldap.message.control.Control requestControl)
Adds a request control to this operation. |
void |
addRequestControls(org.apache.directory.shared.ldap.message.control.Control[] requestControls)
Adds many request controls to this operation. |
void |
addResponseControl(org.apache.directory.shared.ldap.message.control.Control responseControl)
Adds a response control to this operation. |
void |
delete(org.apache.directory.shared.ldap.name.DN dn,
java.util.Collection<java.lang.String> byPassed)
|
java.util.Collection<java.lang.String> |
getByPassed()
Gets the set of bypassed Interceptors. |
org.apache.directory.shared.ldap.name.DN |
getDn()
|
LdapPrincipal |
getEffectivePrincipal()
Gets the effective principal for this operation which may not be the same as the authenticated principal when the session for this context has an explicit authorization id, or this operation was applied with the proxy authorization control. |
ClonedServerEntry |
getEntry()
Gets the server entry associated with the target DN of this OperationContext. |
OperationContext |
getFirstOperation()
Gets the first, direct operation issued against the DirectoryService. |
OperationContext |
getLastOperation()
Gets the last, operation issued on the DirectoryService. |
abstract java.lang.String |
getName()
|
OperationContext |
getNextOperation()
Gets the next, indirect operation issued on the DirectoryService. |
OperationContext |
getPreviousOperation()
Gets the previous, operation issued on the DirectoryService. |
org.apache.directory.shared.ldap.message.control.Control |
getRequestControl(java.lang.String numericOid)
Gets a request control if present for this request. |
org.apache.directory.shared.ldap.message.control.Control |
getResponseControl(java.lang.String numericOid)
Gets a response control if present for this request. |
int |
getResponseControlCount()
Checks the number of response controls have been generated for this operation. |
org.apache.directory.shared.ldap.message.control.Control[] |
getResponseControls()
Gets all the response controls producted during this operation. |
CoreSession |
getSession()
Gets the session associated with this operation. |
boolean |
hasBypass()
Checks to see if any Interceptors are bypassed by this operation. |
boolean |
hasEntry(org.apache.directory.shared.ldap.name.DN dn,
java.util.Collection<java.lang.String> byPassed)
Checks to see if an entry exists. |
boolean |
hasRequestControl(java.lang.String numericOid)
Checks to see if a request control is present on this request. |
boolean |
hasRequestControls()
Checks if any request controls exists for this operation. |
boolean |
hasResponseControl(java.lang.String numericOid)
Checks to see if a response control is present on this operation. |
boolean |
hasResponseControls()
Checks if any response controls have been generated for this operation. |
void |
ignoreReferral()
Set the throwReferral flag to false |
boolean |
isBypassed(java.lang.String interceptorName)
Checks to see if an Interceptor is bypassed for this operation. |
boolean |
isFirstOperation()
Checks to see if this operation is the first operation in a chain of operations performed on the DirectoryService. |
boolean |
isReferralIgnored()
|
boolean |
isReferralThrown()
|
ClonedServerEntry |
lookup(org.apache.directory.shared.ldap.name.DN dn,
java.util.Collection<java.lang.String> byPassed)
|
ClonedServerEntry |
lookup(LookupOperationContext opContext)
|
void |
modify(org.apache.directory.shared.ldap.name.DN dn,
java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods,
java.util.Collection<java.lang.String> byPassed)
|
LookupOperationContext |
newLookupContext(org.apache.directory.shared.ldap.name.DN dn)
|
protected void |
setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal)
|
void |
setByPassed(java.util.Collection<java.lang.String> byPassed)
Sets the set of bypassed Interceptors. |
void |
setDn(org.apache.directory.shared.ldap.name.DN dn)
Set the context DN |
void |
setEntry(ClonedServerEntry entry)
Sets the server entry associated with the target DN of this OperationContext. |
protected void |
setNextOperation(OperationContext next)
|
protected void |
setPreviousOperation(OperationContext previous)
|
void |
setRequestControls(java.util.Map<java.lang.String,org.apache.directory.shared.ldap.message.control.Control> requestControls)
|
protected void |
setSession(CoreSession session)
|
void |
throwReferral()
Set the throwReferral flag to true |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.directory.shared.ldap.message.control.Control[] EMPTY_CONTROLS
protected org.apache.directory.shared.ldap.name.DN dn
protected ClonedServerEntry entry
protected java.util.Map<java.lang.String,org.apache.directory.shared.ldap.message.control.Control> requestControls
protected java.util.Map<java.lang.String,org.apache.directory.shared.ldap.message.control.Control> responseControls
protected java.util.Collection<java.lang.String> byPassed
protected LdapPrincipal authorizedPrincipal
protected CoreSession session
protected OperationContext next
protected OperationContext previous
protected boolean throwReferral
Constructor Detail |
---|
public AbstractOperationContext(CoreSession session)
public AbstractOperationContext(CoreSession session, org.apache.directory.shared.ldap.name.DN dn)
dn
- The associated DNMethod Detail |
---|
public CoreSession getSession()
OperationContext
getSession
in interface OperationContext
protected void setSession(CoreSession session)
protected void setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal)
public org.apache.directory.shared.ldap.name.DN getDn()
getDn
in interface OperationContext
public void setDn(org.apache.directory.shared.ldap.name.DN dn)
setDn
in interface OperationContext
dn
- The DN to setpublic void addRequestControl(org.apache.directory.shared.ldap.message.control.Control requestControl)
OperationContext
addRequestControl
in interface OperationContext
requestControl
- the request control to add to this operationpublic org.apache.directory.shared.ldap.message.control.Control getRequestControl(java.lang.String numericOid)
OperationContext
getRequestControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OID
public boolean hasRequestControl(java.lang.String numericOid)
OperationContext
hasRequestControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OID
public boolean hasRequestControls()
OperationContext
hasRequestControls
in interface OperationContext
public void addResponseControl(org.apache.directory.shared.ldap.message.control.Control responseControl)
OperationContext
addResponseControl
in interface OperationContext
responseControl
- the response control to add to this operationpublic org.apache.directory.shared.ldap.message.control.Control getResponseControl(java.lang.String numericOid)
OperationContext
getResponseControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OID
public boolean hasResponseControl(java.lang.String numericOid)
OperationContext
hasResponseControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OID
public org.apache.directory.shared.ldap.message.control.Control[] getResponseControls()
OperationContext
getResponseControls
in interface OperationContext
public boolean hasResponseControls()
OperationContext
hasResponseControls
in interface OperationContext
public int getResponseControlCount()
OperationContext
getResponseControlCount
in interface OperationContext
public void addRequestControls(org.apache.directory.shared.ldap.message.control.Control[] requestControls)
OperationContext
addRequestControls
in interface OperationContext
requestControls
- the request controls to add to this operationpublic void setRequestControls(java.util.Map<java.lang.String,org.apache.directory.shared.ldap.message.control.Control> requestControls)
public abstract java.lang.String getName()
getName
in interface OperationContext
public java.util.Collection<java.lang.String> getByPassed()
getByPassed
in interface OperationContext
public void setByPassed(java.util.Collection<java.lang.String> byPassed)
setByPassed
in interface OperationContext
byPassed
- the set of bypassed Interceptorspublic boolean isBypassed(java.lang.String interceptorName)
isBypassed
in interface OperationContext
interceptorName
- the interceptorName of the Interceptor to check for bypass
public boolean hasBypass()
hasBypass
in interface OperationContext
public boolean hasEntry(org.apache.directory.shared.ldap.name.DN dn, java.util.Collection<java.lang.String> byPassed) throws java.lang.Exception
OperationContext
hasEntry
in interface OperationContext
dn
- the distinguished name of the entry to checkbyPassed
- collection of Interceptor
's to bypass for this check
java.lang.Exception
- on failure to perform this operationpublic void add(org.apache.directory.shared.ldap.entry.ServerEntry entry, java.util.Collection<java.lang.String> byPassed) throws java.lang.Exception
add
in interface OperationContext
java.lang.Exception
public void delete(org.apache.directory.shared.ldap.name.DN dn, java.util.Collection<java.lang.String> byPassed) throws java.lang.Exception
delete
in interface OperationContext
java.lang.Exception
public void modify(org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods, java.util.Collection<java.lang.String> byPassed) throws java.lang.Exception
modify
in interface OperationContext
java.lang.Exception
public LookupOperationContext newLookupContext(org.apache.directory.shared.ldap.name.DN dn)
newLookupContext
in interface OperationContext
public ClonedServerEntry lookup(LookupOperationContext opContext) throws java.lang.Exception
lookup
in interface OperationContext
java.lang.Exception
public ClonedServerEntry lookup(org.apache.directory.shared.ldap.name.DN dn, java.util.Collection<java.lang.String> byPassed) throws java.lang.Exception
lookup
in interface OperationContext
java.lang.Exception
public LdapPrincipal getEffectivePrincipal()
OperationContext
getEffectivePrincipal
in interface OperationContext
CoreSession.getAuthenticatedPrincipal()
,
CoreSession.getEffectivePrincipal()
public boolean isFirstOperation()
OperationContext
isFirstOperation
in interface OperationContext
public OperationContext getFirstOperation()
OperationContext
getFirstOperation
in interface OperationContext
public OperationContext getLastOperation()
OperationContext
getLastOperation
in interface OperationContext
public OperationContext getNextOperation()
OperationContext
getNextOperation
in interface OperationContext
protected void setNextOperation(OperationContext next)
public OperationContext getPreviousOperation()
OperationContext
getPreviousOperation
in interface OperationContext
protected void setPreviousOperation(OperationContext previous)
public void setEntry(ClonedServerEntry entry)
OperationContext
setEntry
in interface OperationContext
entry
- the entry to setpublic ClonedServerEntry getEntry()
OperationContext
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.
getEntry
in interface OperationContext
public void throwReferral()
throwReferral
in interface OperationContext
public boolean isReferralThrown()
isReferralThrown
in interface OperationContext
true
if the referrals are thrownpublic void ignoreReferral()
ignoreReferral
in interface OperationContext
public boolean isReferralIgnored()
isReferralIgnored
in interface OperationContext
true
if the referrals are ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |