public abstract class ServerContext extends Object implements EventContext
| Modifier and Type | Field and Description |
|---|---|
protected Control[] |
connectControls
Connection level controls associated with the session
|
static String |
DELETE_OLD_RDN_PROP
property key used for deleting the old Rdn on a rename
|
protected static Control[] |
EMPTY_CONTROLS
Empty array of controls for use in dealing with them
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
objectClassAT
A reference to the ObjectClass AT
|
protected Control[] |
requestControls
The request controls to set on operations before performing them
|
protected Control[] |
responseControls
The response controls to set after performing operations
|
protected org.apache.directory.api.ldap.model.schema.SchemaManager |
schemaManager
The SchemManager instance
|
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPEAPPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES| Modifier | Constructor and Description |
|---|---|
|
ServerContext(DirectoryService service,
CoreSession session,
Name name) |
protected |
ServerContext(DirectoryService service,
Hashtable<String,Object> env)
Must be called by all subclasses to initialize the nexus proxy and the
environment settings to be used by this Context implementation.
|
|
ServerContext(DirectoryService service,
LdapPrincipal principal,
Name name)
Must be called by all subclasses to initialize the nexus proxy and the
environment settings to be used by this Context implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNamingListener(Name name,
int scope,
NamingListener namingListener) |
void |
addNamingListener(String name,
int scope,
NamingListener namingListener) |
Object |
addToEnvironment(String propName,
Object propVal) |
void |
bind(Name name,
Object obj) |
void |
bind(String name,
Object obj) |
void |
close() |
Name |
composeName(Name name,
Name prefix) |
String |
composeName(String name,
String prefix) |
Context |
createSubcontext(Name name) |
Context |
createSubcontext(String name) |
void |
destroySubcontext(Name name) |
void |
destroySubcontext(String name) |
protected void |
doAddOperation(org.apache.directory.api.ldap.model.name.Dn target,
org.apache.directory.api.ldap.model.entry.Entry entry)
Used to encapsulate [de]marshalling of controls before and after add operations.
|
protected BindOperationContext |
doBindOperation(org.apache.directory.api.ldap.model.name.Dn bindDn,
byte[] credentials,
String saslMechanism,
String saslAuthId)
Used to encapsulate [de]marshalling of controls before and after bind operations.
|
protected void |
doDeleteOperation(org.apache.directory.api.ldap.model.name.Dn target)
Used to encapsulate [de]marshalling of controls before and after delete operations.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
doGetRootDseOperation(org.apache.directory.api.ldap.model.name.Dn target) |
protected EntryFilteringCursor |
doListOperation(org.apache.directory.api.ldap.model.name.Dn target)
Used to encapsulate [de]marshalling of controls before and after list operations.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
doLookupOperation(org.apache.directory.api.ldap.model.name.Dn target)
Used to encapsulate [de]marshalling of controls before and after lookup operations.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
doLookupOperation(org.apache.directory.api.ldap.model.name.Dn target,
String[] attrIds)
Used to encapsulate [de]marshalling of controls before and after lookup operations.
|
protected void |
doModifyOperation(org.apache.directory.api.ldap.model.name.Dn dn,
List<org.apache.directory.api.ldap.model.entry.Modification> modifications)
Used to encapsulate [de]marshalling of controls before and after modify operations.
|
protected void |
doMove(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Dn target)
Used to encapsulate [de]marshalling of controls before and after moveAndRename operations.
|
protected void |
doMoveAndRenameOperation(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Dn parent,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
boolean delOldDn)
Used to encapsulate [de]marshalling of controls before and after moveAndRename operations.
|
protected void |
doRename(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
boolean delOldRdn)
Used to encapsulate [de]marshalling of controls before and after rename operations.
|
protected EntryFilteringCursor |
doSearchOperation(org.apache.directory.api.ldap.model.name.Dn dn,
org.apache.directory.api.ldap.model.message.AliasDerefMode aliasDerefMode,
org.apache.directory.api.ldap.model.filter.ExprNode filter,
SearchControls searchControls)
Used to encapsulate [de]marshalling of controls before and after list operations.
|
DirectoryService |
getDirectoryService() |
protected org.apache.directory.api.ldap.model.name.Dn |
getDn()
Gets the distinguished name of the entry associated with this Context.
|
Hashtable<String,Object> |
getEnvironment() |
protected Map<NamingListener,DirectoryListener> |
getListeners()
Allows subclasses to register and unregister listeners.
|
String |
getNameInNamespace() |
NameParser |
getNameParser(Name name)
Non-federated implementation presuming the name argument is not a
composite name spanning multiple namespaces but a compound name in
the same LDAP namespace.
|
NameParser |
getNameParser(String name)
Non-federated implementation presuming the name argument is not a
composite name spanning multiple namespaces but a compound name in
the same LDAP namespace.
|
abstract ServerContext |
getRootContext()
Gets a handle on the root context of the DIT.
|
DirectoryService |
getService()
Gets the
DirectoryService associated with this context. |
CoreSession |
getSession() |
protected void |
injectReferralControl(OperationContext opCtx)
Set the referral handling flag into the operation context using
the JNDI value stored into the environment.
|
NamingEnumeration |
list(Name name) |
NamingEnumeration |
list(String name) |
NamingEnumeration |
listBindings(Name name) |
NamingEnumeration |
listBindings(String name) |
Object |
lookup(Name name) |
Object |
lookup(String name) |
Object |
lookupLink(Name name) |
Object |
lookupLink(String name) |
void |
rebind(Name name,
Object obj) |
void |
rebind(String name,
Object obj) |
Object |
removeFromEnvironment(String propName) |
void |
removeNamingListener(NamingListener namingListener) |
void |
rename(Name oldName,
Name newName) |
void |
rename(String oldName,
String newName) |
boolean |
targetMustExist() |
void |
unbind(Name name) |
void |
unbind(String name) |
public static final String DELETE_OLD_RDN_PROP
protected static final Control[] EMPTY_CONTROLS
protected org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager
protected org.apache.directory.api.ldap.model.schema.AttributeType objectClassAT
protected Control[] requestControls
protected Control[] responseControls
protected Control[] connectControls
protected ServerContext(DirectoryService service, Hashtable<String,Object> env) throws Exception
Context.PROVIDER_URL key and value to determine the distinguished name
of the newly created context. It also checks to make sure the
referenced name actually exists within the system. This constructor
is used for all InitialContext requests.service - the parent service that manages this contextenv - the environment properties used by this context.NamingException - if the environment parameters are not set
correctly.Exceptionpublic ServerContext(DirectoryService service, LdapPrincipal principal, Name name) throws Exception
service - the directory service coreprincipal - the directory user principal that is propagatedname - the distinguished name of this contextNamingException - if there is a problem creating the new contextExceptionpublic ServerContext(DirectoryService service, CoreSession session, Name name) throws Exception
Exceptionprotected void injectReferralControl(OperationContext opCtx)
protected void doAddOperation(org.apache.directory.api.ldap.model.name.Dn target,
org.apache.directory.api.ldap.model.entry.Entry entry)
throws Exception
entry - target - Exceptionprotected void doDeleteOperation(org.apache.directory.api.ldap.model.name.Dn target)
throws Exception
target - Exceptionprotected EntryFilteringCursor doSearchOperation(org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.message.AliasDerefMode aliasDerefMode, org.apache.directory.api.ldap.model.filter.ExprNode filter, SearchControls searchControls) throws Exception
dn - aliasDerefMode - filter - searchControls - Exceptionprotected EntryFilteringCursor doListOperation(org.apache.directory.api.ldap.model.name.Dn target) throws Exception
Exceptionprotected org.apache.directory.api.ldap.model.entry.Entry doGetRootDseOperation(org.apache.directory.api.ldap.model.name.Dn target)
throws Exception
Exceptionprotected org.apache.directory.api.ldap.model.entry.Entry doLookupOperation(org.apache.directory.api.ldap.model.name.Dn target)
throws Exception
Exceptionprotected org.apache.directory.api.ldap.model.entry.Entry doLookupOperation(org.apache.directory.api.ldap.model.name.Dn target,
String[] attrIds)
throws Exception
Exceptionprotected BindOperationContext doBindOperation(org.apache.directory.api.ldap.model.name.Dn bindDn, byte[] credentials, String saslMechanism, String saslAuthId) throws Exception
Exceptionprotected void doMoveAndRenameOperation(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Dn parent,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
boolean delOldDn)
throws Exception
Exceptionprotected void doModifyOperation(org.apache.directory.api.ldap.model.name.Dn dn,
List<org.apache.directory.api.ldap.model.entry.Modification> modifications)
throws Exception
Exceptionprotected void doMove(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Dn target)
throws Exception
Exceptionprotected void doRename(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
boolean delOldRdn)
throws Exception
Exceptionpublic CoreSession getSession()
public DirectoryService getDirectoryService()
public abstract ServerContext getRootContext() throws NamingException
NamingException - if this failspublic DirectoryService getService()
DirectoryService associated with this context.protected org.apache.directory.api.ldap.model.name.Dn getDn()
public void close()
throws NamingException
close in interface ContextNamingExceptionContext.close()public String getNameInNamespace() throws NamingException
getNameInNamespace in interface ContextNamingExceptionContext.getNameInNamespace()public Hashtable<String,Object> getEnvironment()
getEnvironment in interface ContextContext.getEnvironment()public Object addToEnvironment(String propName, Object propVal) throws NamingException
addToEnvironment in interface ContextNamingExceptionContext.addToEnvironment(java.lang.String,
java.lang.Object)public Object removeFromEnvironment(String propName) throws NamingException
removeFromEnvironment in interface ContextNamingExceptionContext.removeFromEnvironment(java.lang.String)public Context createSubcontext(String name) throws NamingException
createSubcontext in interface ContextNamingExceptionContext.createSubcontext(java.lang.String)public Context createSubcontext(Name name) throws NamingException
createSubcontext in interface ContextNamingExceptionContext.createSubcontext(javax.naming.Name)public void destroySubcontext(String name) throws NamingException
destroySubcontext in interface ContextNamingExceptionContext.destroySubcontext(java.lang.String)public void destroySubcontext(Name name) throws NamingException
destroySubcontext in interface ContextNamingExceptionContext.destroySubcontext(javax.naming.Name)public void bind(String name, Object obj) throws NamingException
bind in interface ContextNamingExceptionContext.bind(java.lang.String, java.lang.Object)public void bind(Name name, Object obj) throws NamingException
bind in interface ContextNamingExceptionContext.bind(javax.naming.Name, java.lang.Object)public void rename(String oldName, String newName) throws NamingException
rename in interface ContextNamingExceptionContext.rename(java.lang.String, java.lang.String)public void rename(Name oldName, Name newName) throws NamingException
rename in interface ContextNamingExceptionContext.rename(javax.naming.Name, javax.naming.Name)public void rebind(String name, Object obj) throws NamingException
rebind in interface ContextNamingExceptionContext.rebind(java.lang.String, java.lang.Object)public void rebind(Name name, Object obj) throws NamingException
rebind in interface ContextNamingExceptionContext.rebind(javax.naming.Name, java.lang.Object)public void unbind(String name) throws NamingException
unbind in interface ContextNamingExceptionContext.unbind(java.lang.String)public void unbind(Name name) throws NamingException
unbind in interface ContextNamingExceptionContext.unbind(javax.naming.Name)public Object lookup(String name) throws NamingException
lookup in interface ContextNamingExceptionContext.lookup(java.lang.String)public Object lookup(Name name) throws NamingException
lookup in interface ContextNamingExceptionContext.lookup(javax.naming.Name)public Object lookupLink(String name) throws NamingException
lookupLink in interface ContextNamingExceptionContext.lookupLink(java.lang.String)public Object lookupLink(Name name) throws NamingException
lookupLink in interface ContextNamingExceptionContext.lookupLink(javax.naming.Name)public NameParser getNameParser(String name) throws NamingException
getNameParser in interface ContextNamingExceptionContext.getNameParser(java.lang.String)public NameParser getNameParser(Name name) throws NamingException
getNameParser in interface ContextNamingExceptionContext.getNameParser(javax.naming.Name)public NamingEnumeration list(String name) throws NamingException
list in interface ContextNamingExceptionContext.list(java.lang.String)public NamingEnumeration list(Name name) throws NamingException
list in interface ContextNamingExceptionContext.list(javax.naming.Name)public NamingEnumeration listBindings(String name) throws NamingException
listBindings in interface ContextNamingExceptionContext.listBindings(java.lang.String)public NamingEnumeration listBindings(Name name) throws NamingException
listBindings in interface ContextNamingExceptionContext.listBindings(javax.naming.Name)public String composeName(String name, String prefix) throws NamingException
composeName in interface ContextNamingExceptionContext.composeName(java.lang.String, java.lang.String)public Name composeName(Name name, Name prefix) throws NamingException
composeName in interface ContextNamingExceptionContext.composeName(javax.naming.Name,
javax.naming.Name)public void addNamingListener(Name name, int scope, NamingListener namingListener) throws NamingException
addNamingListener in interface EventContextNamingExceptionpublic void addNamingListener(String name, int scope, NamingListener namingListener) throws NamingException
addNamingListener in interface EventContextNamingExceptionpublic void removeNamingListener(NamingListener namingListener) throws NamingException
removeNamingListener in interface EventContextNamingExceptionpublic boolean targetMustExist()
throws NamingException
targetMustExist in interface EventContextNamingExceptionprotected Map<NamingListener,DirectoryListener> getListeners()
Copyright © 2021. All rights reserved.