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 Partition |
partition
The partition this operation will be applied on
|
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
|
protected PartitionTxn |
transaction
The transaction this operation is ran into
|
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.
|
String |
getNextInterceptor()
Gets the next interceptor in the list of interceptors.
|
org.apache.directory.api.ldap.model.entry.Entry |
getOriginalEntry() |
Partition |
getPartition() |
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.
|
PartitionTxn |
getTransaction() |
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 |
setPartition(Partition partition)
Set the Partition it's working on
|
void |
setRequestControls(Map<String,org.apache.directory.api.ldap.model.message.Control> requestControls) |
void |
setSession(CoreSession session) |
void |
setTransaction(PartitionTxn transaction) |
void |
throwReferral()
Set the throwReferral flag to true
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
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 List<String> interceptors
protected int currentInterceptor
protected LdapPrincipal authorizedPrincipal
protected CoreSession session
protected boolean throwReferral
protected PartitionTxn transaction
public AbstractOperationContext(CoreSession session)
session
- The session to usepublic AbstractOperationContext(CoreSession session, org.apache.directory.api.ldap.model.name.Dn dn)
session
- The session to usedn
- The associated Dnpublic CoreSession getSession()
getSession
in interface OperationContext
public void setSession(CoreSession session)
protected void setAuthorizedPrincipal(LdapPrincipal authorizedPrincipal)
public org.apache.directory.api.ldap.model.name.Dn getDn()
getDn
in interface OperationContext
public void setDn(org.apache.directory.api.ldap.model.name.Dn dn)
setDn
in interface OperationContext
dn
- The Dn to setpublic void addRequestControl(org.apache.directory.api.ldap.model.message.Control requestControl)
addRequestControl
in interface OperationContext
requestControl
- the request control to add to this operationpublic org.apache.directory.api.ldap.model.message.Control getRequestControl(String numericOid)
getRequestControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OIDpublic boolean hasRequestControl(String numericOid)
hasRequestControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OIDpublic boolean hasRequestControls()
hasRequestControls
in interface OperationContext
public void addResponseControl(org.apache.directory.api.ldap.model.message.Control responseControl)
addResponseControl
in interface OperationContext
responseControl
- the response control to add to this operationpublic org.apache.directory.api.ldap.model.message.Control getResponseControl(String numericOid)
getResponseControl
in interface OperationContext
numericOid
- the numeric OID of the control also known as it's type OIDpublic boolean hasResponseControl(String numericOid)
hasResponseControl
in interface OperationContext
numericOid
- 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 OperationContext
public boolean hasResponseControls()
hasResponseControls
in interface OperationContext
public int getResponseControlCount()
getResponseControlCount
in interface OperationContext
public void addRequestControls(org.apache.directory.api.ldap.model.message.Control[] requestControls)
addRequestControls
in interface OperationContext
requestControls
- the request controls to add to this operationpublic void setRequestControls(Map<String,org.apache.directory.api.ldap.model.message.Control> requestControls)
public 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 OperationContext
interceptors
- The list of interceptorspublic final String getNextInterceptor()
getNextInterceptor
in interface OperationContext
public int getCurrentInterceptor()
getCurrentInterceptor
in interface OperationContext
public void setCurrentInterceptor(int currentInterceptor)
setCurrentInterceptor
in interface OperationContext
currentInterceptor
- 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 OperationContext
dn
- The Dn for the entry to deleteorg.apache.directory.api.ldap.model.exception.LdapException
- If the deletion failedpublic org.apache.directory.api.ldap.model.entry.Entry lookup(LookupOperationContext lookupContext) throws org.apache.directory.api.ldap.model.exception.LdapException
lookup
in interface OperationContext
org.apache.directory.api.ldap.model.exception.LdapException
public LookupOperationContext newLookupContext(org.apache.directory.api.ldap.model.name.Dn dn, String... attributes)
newLookupContext
in interface OperationContext
public LdapPrincipal getEffectivePrincipal()
getEffectivePrincipal
in interface OperationContext
CoreSession.getAuthenticatedPrincipal()
,
CoreSession.getEffectivePrincipal()
public void setEntry(org.apache.directory.api.ldap.model.entry.Entry entry)
OperationContext
setEntry
in interface OperationContext
entry
- the entry to setpublic org.apache.directory.api.ldap.model.entry.Entry 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 ignoredpublic PartitionTxn getTransaction()
getTransaction
in interface OperationContext
public void setTransaction(PartitionTxn transaction)
setTransaction
in interface OperationContext
transaction
- the transaction to setpublic Partition getPartition()
getPartition
in interface OperationContext
public void setPartition(Partition partition)
setPartition
in interface OperationContext
partition
- The Partition this operation will be applied onCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.