public class LdapSession extends Object
Constructor and Description |
---|
LdapSession(org.apache.mina.core.session.IoSession ioSession)
Creates a new instance of LdapSession associated with the underlying
connection (MINA IoSession) to the server.
|
Modifier and Type | Method and Description |
---|---|
void |
abandonAllOutstandingRequests()
Abandons all outstanding requests associated with this session.
|
org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest |
abandonOutstandingRequest(int messageId)
Abandons a specific request by messageId.
|
void |
addPagedSearchContext(PagedSearchContext context)
Add a new Paged Search context into the stored context.
|
void |
clearSaslProperties()
Clear all the Sasl values stored into the Map
|
org.apache.directory.shared.ldap.message.BindStatus |
getBindStatus() |
CoreSession |
getCoreSession()
Gets the logical core DirectoryService session associated with this
LdapSession.
|
String |
getCurrentMechanism()
Get the mechanism selected by a user during a SASL Bind negotiation.
|
org.apache.mina.core.session.IoSession |
getIoSession()
Gets the MINA IoSession associated with this LdapSession.
|
LdapServer |
getLdapServer() |
Map<Integer,org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest> |
getOutstandingRequests() |
PagedSearchContext |
getPagedSearchContext(int contextId)
Get paged search context associated with an ID
|
Object |
getSaslProperty(String property)
Get a Sasl property's value
|
boolean |
isAnonymous()
Check if the session is authenticated.
|
boolean |
isAuthenticated()
Check if the session is authenticated.
|
boolean |
isAuthPending()
Check if the session is processing a BindRequest, either Simple
or SASL
|
boolean |
isSaslAuthPending()
Check if the session is processing a SASL BindRequest
|
boolean |
isSimpleAuthPending()
Check if the session is processing a Simple BindRequest
|
void |
putSaslProperty(String property,
Object value)
Add a Sasl property and value
|
void |
registerOutstandingRequest(org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest request)
Registers an outstanding request which can be abandoned later.
|
PagedSearchContext |
removePagedSearchContext(long contextId)
Remove a Paged Search context from the map storing all of them.
|
void |
removeSaslProperty(String property)
Remove a property from the SaslProperty map
|
void |
setAnonymous()
Set the current BindStatus to Anonymous
|
void |
setAuthenticated()
Set the current BindStatus to authenticated
|
void |
setCoreSession(CoreSession coreSession)
Sets the logical core DirectoryService session.
|
void |
setLdapServer(LdapServer ldapServer)
Store a reference on the LdapServer intance
|
void |
setSaslAuthPending()
Set the current BindStatus to SASL authentication pending
|
void |
setSimpleAuthPending()
Set the current BindStatus to Simple authentication pending
|
String |
toString()
The principal and remote address associated with this session.
|
void |
unregisterOutstandingRequest(org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest request)
Unregisters an outstanding request.
|
public LdapSession(org.apache.mina.core.session.IoSession ioSession)
ioSession
- the MINA session associated this LdapSessionpublic boolean isAuthenticated()
true
if the session is not anonymouspublic boolean isAnonymous()
true
if the session is not anonymouspublic boolean isAuthPending()
true
if the session is in AuthPending statepublic boolean isSimpleAuthPending()
true
if the session is in AuthPending statepublic boolean isSaslAuthPending()
true
if the session is in AuthPending statepublic org.apache.mina.core.session.IoSession getIoSession()
public CoreSession getCoreSession()
public void setCoreSession(CoreSession coreSession)
coreSession
- the logical core DirectoryService sessionpublic void abandonAllOutstandingRequests()
public org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest abandonOutstandingRequest(int messageId)
messageId
- The request ID to abandonpublic void registerOutstandingRequest(org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest request)
request
- an outstanding request that can be abandonedpublic void unregisterOutstandingRequest(org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest request)
request
- the request to unregisterpublic Map<Integer,org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest> getOutstandingRequests()
public org.apache.directory.shared.ldap.message.BindStatus getBindStatus()
public void setSimpleAuthPending()
public void setSaslAuthPending()
public void setAnonymous()
public void setAuthenticated()
public String getCurrentMechanism()
public void putSaslProperty(String property, Object value)
property
- the property to addvalue
- the value for this propertypublic Object getSaslProperty(String property)
property
- the property to getpublic void clearSaslProperties()
public void removeSaslProperty(String property)
property
- the property to removepublic LdapServer getLdapServer()
public void setLdapServer(LdapServer ldapServer)
ldapServer
- the LdapServer instancepublic void addPagedSearchContext(PagedSearchContext context) throws Exception
context
- The context to addException
public PagedSearchContext removePagedSearchContext(long contextId)
contextId
- The context ID to removepublic PagedSearchContext getPagedSearchContext(int contextId)
contextId
- The id for teh context we want to getpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.