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 int |
currentInterceptor
The current interceptor position
|
protected org.apache.directory.api.ldap.model.name.Dn |
dn
The Dn associated with the context
|
protected static org.apache.directory.api.ldap.model.message.Control[] |
EMPTY_CONTROLS |
protected org.apache.directory.api.ldap.model.entry.Entry |
entry
The entry associated with the target entry of this OperationContext
|
protected List<String> |
interceptors
The interceptors to call for this operation
|
protected org.apache.directory.api.ldap.model.entry.Entry |
originalEntry
The original Entry
|
protected Map<String,org.apache.directory.api.ldap.model.message.Control> |
requestControls
The associated request's controls
|
protected Map<String,org.apache.directory.api.ldap.model.message.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.api.ldap.model.name.Dn dn)
Creates a new instance of AbstractOperationContext.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRequestControl(org.apache.directory.api.ldap.model.message.Control requestControl)
Adds a request control to this operation.
|
void |
addRequestControls(org.apache.directory.api.ldap.model.message.Control[] requestControls)
Adds many request controls to this operation.
|
void |
addResponseControl(org.apache.directory.api.ldap.model.message.Control responseControl)
Adds a response control to this operation.
|
void |
delete(org.apache.directory.api.ldap.model.name.Dn dn)
Process the delete for inner operations.
|
int |
getCurrentInterceptor() |
org.apache.directory.api.ldap.model.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.
|
org.apache.directory.api.ldap.model.entry.Entry |
getEntry()
Gets the server entry associated with the target Dn of this
OperationContext.
|
abstract String |
getName() |
String |
getNextInterceptor()
Gets the next interceptor in the list of interceptors.
|
org.apache.directory.api.ldap.model.entry.Entry |
getOriginalEntry() |
org.apache.directory.api.ldap.model.message.Control |
getRequestControl(String numericOid)
Gets a request control if present for this request.
|
org.apache.directory.api.ldap.model.message.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.api.ldap.model.message.Control[] |
getResponseControls()
Gets all the response controls producted during this operation.
|
CoreSession |
getSession()
Gets the session associated with this operation.
|
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 |
isReferralIgnored() |
boolean |
isReferralThrown() |
org.apache.directory.api.ldap.model.entry.Entry |
lookup(LookupOperationContext lookupContext) |
LookupOperationContext |
newLookupContext(org.apache.directory.api.ldap.model.name.Dn dn,
String... attributes) |
protected void |
setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal) |
void |
setCurrentInterceptor(int currentInterceptor)
Sets the current interceptor number to a new value.
|
void |
setDn(org.apache.directory.api.ldap.model.name.Dn dn)
Set the context Dn
|
void |
setEntry(org.apache.directory.api.ldap.model.entry.Entry entry)
Sets the server entry associated with the target Dn of this
OperationContext.
|
void |
setInterceptors(List<String> interceptors)
Sets the list of interceptors to go through for an operation
|
void |
setOriginalEntry(org.apache.directory.api.ldap.model.entry.Entry originalEntry) |
void |
setRequestControls(Map<String,org.apache.directory.api.ldap.model.message.Control> requestControls) |
void |
setSession(CoreSession session) |
void |
throwReferral()
Set the throwReferral flag to true
|
protected static final org.apache.directory.api.ldap.model.message.Control[] EMPTY_CONTROLS
protected org.apache.directory.api.ldap.model.name.Dn dn
protected org.apache.directory.api.ldap.model.entry.Entry entry
protected org.apache.directory.api.ldap.model.entry.Entry originalEntry
protected Map<String,org.apache.directory.api.ldap.model.message.Control> requestControls
protected Map<String,org.apache.directory.api.ldap.model.message.Control> responseControls
protected Collection<String> byPassed
protected int currentInterceptor
protected LdapPrincipal authorizedPrincipal
protected CoreSession session
protected boolean throwReferral
public AbstractOperationContext(CoreSession session)
public AbstractOperationContext(CoreSession session, org.apache.directory.api.ldap.model.name.Dn dn)
dn - The associated Dnpublic CoreSession getSession()
getSession in interface OperationContextpublic void setSession(CoreSession session)
protected void setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal)
public org.apache.directory.api.ldap.model.name.Dn getDn()
getDn in interface OperationContextpublic void setDn(org.apache.directory.api.ldap.model.name.Dn dn)
setDn in interface OperationContextdn - The Dn to setpublic void addRequestControl(org.apache.directory.api.ldap.model.message.Control requestControl)
addRequestControl in interface OperationContextrequestControl - the request control to add to this operationpublic org.apache.directory.api.ldap.model.message.Control getRequestControl(String numericOid)
getRequestControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic boolean hasRequestControl(String numericOid)
hasRequestControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic boolean hasRequestControls()
hasRequestControls in interface OperationContextpublic void addResponseControl(org.apache.directory.api.ldap.model.message.Control responseControl)
addResponseControl in interface OperationContextresponseControl - the response control to add to this operationpublic org.apache.directory.api.ldap.model.message.Control getResponseControl(String numericOid)
getResponseControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic boolean hasResponseControl(String numericOid)
hasResponseControl in interface OperationContextnumericOid - the numeric OID of the control also known as it's type OIDpublic org.apache.directory.api.ldap.model.message.Control[] getResponseControls()
getResponseControls in interface OperationContextpublic boolean hasResponseControls()
hasResponseControls in interface OperationContextpublic int getResponseControlCount()
getResponseControlCount in interface OperationContextpublic void addRequestControls(org.apache.directory.api.ldap.model.message.Control[] requestControls)
addRequestControls in interface OperationContextrequestControls - the request controls to add to this operationpublic void setRequestControls(Map<String,org.apache.directory.api.ldap.model.message.Control> requestControls)
public abstract String getName()
getName in interface OperationContextpublic org.apache.directory.api.ldap.model.entry.Entry getOriginalEntry()
public void setOriginalEntry(org.apache.directory.api.ldap.model.entry.Entry originalEntry)
originalEntry - the originalEntry to setpublic final void setInterceptors(List<String> interceptors)
setInterceptors in interface OperationContextinterceptors - The list of interceptorspublic final String getNextInterceptor()
getNextInterceptor in interface OperationContextpublic int getCurrentInterceptor()
getCurrentInterceptor in interface OperationContextpublic void setCurrentInterceptor(int currentInterceptor)
setCurrentInterceptor in interface OperationContextcurrentInterceptor - The new current interceptor valuepublic void delete(org.apache.directory.api.ldap.model.name.Dn dn)
throws org.apache.directory.api.ldap.model.exception.LdapException
delete in interface OperationContextorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic org.apache.directory.api.ldap.model.entry.Entry lookup(LookupOperationContext lookupContext) throws org.apache.directory.api.ldap.model.exception.LdapException
lookup in interface OperationContextorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic LookupOperationContext newLookupContext(org.apache.directory.api.ldap.model.name.Dn dn, String... attributes)
newLookupContext in interface OperationContextpublic LdapPrincipal getEffectivePrincipal()
getEffectivePrincipal in interface OperationContextCoreSession.getAuthenticatedPrincipal(),
CoreSession.getEffectivePrincipal()public void setEntry(org.apache.directory.api.ldap.model.entry.Entry entry)
OperationContextsetEntry in interface OperationContextentry - the entry to setpublic org.apache.directory.api.ldap.model.entry.Entry 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 © 2021. All rights reserved.