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.api.ldap.model.message.AbandonableRequest |
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
|
void |
closeAllPagedSearches()
Close all the pending cursors for all the pending PagedSearches
|
org.apache.directory.api.ldap.model.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.api.ldap.model.message.AbandonableRequest> |
getOutstandingRequests() |
PagedSearchContext |
getPagedSearchContext(int contextId)
Get paged search context associated with an ID
|
Object |
getSaslProperty(String property)
Get a Sasl property's value
|
SearchRequestContainer |
getSearchRequest(int messageId)
Find the searchRequestContainer associated with a MessageID
|
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.api.ldap.model.message.AbandonableRequest request)
Registers an outstanding request which can be abandoned later.
|
void |
registerSearchRequest(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest,
org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> cursor)
Registers a new searchRequest
|
PagedSearchContext |
removePagedSearchContext(int 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.api.ldap.model.message.AbandonableRequest request)
Unregisters an outstanding request.
|
void |
unregisterSearchRequest(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest)
Unregisters a completed search 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.api.ldap.model.message.AbandonableRequest abandonOutstandingRequest(int messageId)
messageId
- The request ID to abandonpublic void registerOutstandingRequest(org.apache.directory.api.ldap.model.message.AbandonableRequest request)
request
- an outstanding request that can be abandonedpublic void unregisterOutstandingRequest(org.apache.directory.api.ldap.model.message.AbandonableRequest request)
request
- the request to unregisterpublic Map<Integer,org.apache.directory.api.ldap.model.message.AbandonableRequest> getOutstandingRequests()
public void registerSearchRequest(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest, org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> cursor)
searchRequest
- a new searchRequestcursor
- The cursor to registerpublic void unregisterSearchRequest(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest)
searchRequest
- the searchRequest to unregisterpublic SearchRequestContainer getSearchRequest(int messageId)
messageId
- the SearchRequestContainer MessageID we are looking forpublic org.apache.directory.api.ldap.model.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)
context
- The context to addpublic PagedSearchContext removePagedSearchContext(int contextId)
contextId
- The context ID to removepublic void closeAllPagedSearches() throws IOException
IOException
- If we've got an exception.public PagedSearchContext getPagedSearchContext(int contextId)
contextId
- The id for teh context we want to getpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.