public abstract class AbstractOperationContext extends Object implements OperationContext
| Modifier and Type | Field and Description |
|---|---|
protected LdapPrincipal |
authorizedPrincipal |
protected Collection<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 Map<String,org.apache.directory.shared.ldap.message.control.Control> |
requestControls
The associated request's controls
|
protected Map<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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.apache.directory.shared.ldap.entry.ServerEntry entry,
Collection<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,
Collection<String> byPassed) |
Collection<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 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(String numericOid)
Gets a request control if present for this request.
|
org.apache.directory.shared.ldap.message.control.Control |
getResponseControl(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,
Collection<String> byPassed)
Checks to see if an entry exists.
|
boolean |
hasRequestControl(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(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(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,
Collection<String> byPassed) |
ClonedServerEntry |
lookup(LookupOperationContext opContext) |
void |
modify(org.apache.directory.shared.ldap.name.DN dn,
List<org.apache.directory.shared.ldap.entry.Modification> mods,
Collection<String> byPassed) |
LookupOperationContext |
newLookupContext(org.apache.directory.shared.ldap.name.DN dn) |
protected void |
setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal) |
void |
setByPassed(Collection<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(Map<String,org.apache.directory.shared.ldap.message.control.Control> requestControls) |
protected void |
setSession(CoreSession session) |
void |
throwReferral()
Set the throwReferral flag to true
|
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 Map<String,org.apache.directory.shared.ldap.message.control.Control> requestControls
protected Map<String,org.apache.directory.shared.ldap.message.control.Control> responseControls
protected Collection<String> byPassed
protected LdapPrincipal authorizedPrincipal
protected CoreSession session
protected OperationContext next
protected OperationContext previous
protected boolean throwReferral
public AbstractOperationContext(CoreSession session)
public AbstractOperationContext(CoreSession session, org.apache.directory.shared.ldap.name.DN dn)
dn - The associated DNpublic CoreSession getSession()
OperationContextgetSession in interface OperationContextprotected void setSession(CoreSession session)
protected void setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal)
public org.apache.directory.shared.ldap.name.DN getDn()
getDn in interface OperationContextpublic void setDn(org.apache.directory.shared.ldap.name.DN dn)
setDn in interface OperationContextdn - The DN to setpublic void addRequestControl(org.apache.directory.shared.ldap.message.control.Control requestControl)
OperationContextaddRequestControl in interface OperationContextrequestControl - the request control to add to this operationpublic org.apache.directory.shared.ldap.message.control.Control getRequestControl(String numericOid)
OperationContextgetRequestControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic boolean hasRequestControl(String numericOid)
OperationContexthasRequestControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic boolean hasRequestControls()
OperationContexthasRequestControls in interface OperationContextpublic void addResponseControl(org.apache.directory.shared.ldap.message.control.Control responseControl)
OperationContextaddResponseControl in interface OperationContextresponseControl - the response control to add to this operationpublic org.apache.directory.shared.ldap.message.control.Control getResponseControl(String numericOid)
OperationContextgetResponseControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic boolean hasResponseControl(String numericOid)
OperationContexthasResponseControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic org.apache.directory.shared.ldap.message.control.Control[] getResponseControls()
OperationContextgetResponseControls in interface OperationContextpublic boolean hasResponseControls()
OperationContexthasResponseControls in interface OperationContextpublic int getResponseControlCount()
OperationContextgetResponseControlCount in interface OperationContextpublic void addRequestControls(org.apache.directory.shared.ldap.message.control.Control[] requestControls)
OperationContextaddRequestControls in interface OperationContextrequestControls - the request controls to add to this operationpublic void setRequestControls(Map<String,org.apache.directory.shared.ldap.message.control.Control> requestControls)
public abstract String getName()
getName in interface OperationContextpublic Collection<String> getByPassed()
getByPassed in interface OperationContextpublic void setByPassed(Collection<String> byPassed)
setByPassed in interface OperationContextbyPassed - the set of bypassed Interceptorspublic boolean isBypassed(String interceptorName)
isBypassed in interface OperationContextinterceptorName - the interceptorName of the Interceptor to check for bypasspublic boolean hasBypass()
hasBypass in interface OperationContextpublic boolean hasEntry(org.apache.directory.shared.ldap.name.DN dn,
Collection<String> byPassed)
throws Exception
OperationContexthasEntry in interface OperationContextdn - the distinguished name of the entry to checkbyPassed - collection of Interceptor's to bypass for this checkException - on failure to perform this operationpublic void add(org.apache.directory.shared.ldap.entry.ServerEntry entry,
Collection<String> byPassed)
throws Exception
add in interface OperationContextExceptionpublic void delete(org.apache.directory.shared.ldap.name.DN dn,
Collection<String> byPassed)
throws Exception
delete in interface OperationContextExceptionpublic void modify(org.apache.directory.shared.ldap.name.DN dn,
List<org.apache.directory.shared.ldap.entry.Modification> mods,
Collection<String> byPassed)
throws Exception
modify in interface OperationContextExceptionpublic LookupOperationContext newLookupContext(org.apache.directory.shared.ldap.name.DN dn)
newLookupContext in interface OperationContextpublic ClonedServerEntry lookup(LookupOperationContext opContext) throws Exception
lookup in interface OperationContextExceptionpublic ClonedServerEntry lookup(org.apache.directory.shared.ldap.name.DN dn, Collection<String> byPassed) throws Exception
lookup in interface OperationContextExceptionpublic LdapPrincipal getEffectivePrincipal()
OperationContextgetEffectivePrincipal in interface OperationContextCoreSession.getAuthenticatedPrincipal(),
CoreSession.getEffectivePrincipal()public boolean isFirstOperation()
OperationContextisFirstOperation in interface OperationContextpublic OperationContext getFirstOperation()
OperationContextgetFirstOperation in interface OperationContextpublic OperationContext getLastOperation()
OperationContextgetLastOperation in interface OperationContextpublic OperationContext getNextOperation()
OperationContextgetNextOperation in interface OperationContextprotected void setNextOperation(OperationContext next)
public OperationContext getPreviousOperation()
OperationContextgetPreviousOperation in interface OperationContextprotected void setPreviousOperation(OperationContext previous)
public void setEntry(ClonedServerEntry entry)
OperationContextsetEntry in interface OperationContextentry - the entry to setpublic ClonedServerEntry getEntry()
OperationContextClonedServerEntry.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 OperationContextpublic void throwReferral()
throwReferral in interface OperationContextpublic boolean isReferralThrown()
isReferralThrown in interface OperationContexttrue if the referrals are thrownpublic void ignoreReferral()
ignoreReferral in interface OperationContextpublic boolean isReferralIgnored()
isReferralIgnored in interface OperationContexttrue if the referrals are ignoredCopyright © 2003-2012 Apache Software Foundation. All Rights Reserved.