public final class FdkGuestSessionImpl extends FdkSessionImpl
m_CurrentRequestThread, m_Tag| Modifier and Type | Method and Description |
|---|---|
void |
beginRequest(boolean wait,
long timeout,
String tag)
Notifies the session that a new request has begun.
|
void |
disconnectNotify()
Disconnects this user session.
|
boolean |
endRequest()
Notifies the session that the request has ended.
|
String |
getDistinguishedName()
Returned the distinguished name for the authenticated user.
|
long |
getId()
Returns this session identifier.
|
long |
getLastAccessTime()
Returns the time when the last request was completed by calling
endRequest() on the current session. |
LibrarySession |
getLibrarySession()
Returns the
LibrarySession associated with this user session. |
String |
getSessionIdentifier()
Get a String that identifies a user session.
|
long |
getSessionTimeout()
Returns the session timeout, in seconds, for this session.
|
Object |
getState(Object key)
Returns the value stored at the given key using
setState(). |
String |
getTrustedApplicationName()
Returns the name of the trusted application or
null if the
session was not created by a truested application. |
Item |
getUser(AttributeRequest[] attributes)
Returns the user for this session.
|
String |
getUserIdentifier()
Get a String that identifies a user.
|
String |
getUsername()
Returns the username for the authenticated user.
|
void |
httpBind()
Respond to a bind notification from the HttpSession
|
void |
httpUnbind()
Respond to an unbind notification from the HttpSession
|
boolean |
isConnected()
Returns true if this session is connected.
|
boolean |
isGuest()
Returns true if the session is a guest/anonymous session.
|
boolean |
isRequestInProgress()
Returns true if there is a request being serviced by this session.
|
boolean |
isSystem()
Returns true if the session is a system session.
|
boolean |
isTrustedApplication()
Returns true if the session was created by a trusted application.
|
void |
setLastAccessTimeUpdate(boolean update)
Sets whether the last access time will be updated when
endRequest() is called on the current session. |
void |
setSessionTimeout(long timeout)
Sets the automatic session timeout for inactivity.
|
void |
setState(Object key,
Object value)
Sets a value representing a piece of state that makes sense to the
application.
|
boolean |
verifyCredential(Credential credential)
Verifies that the given credential is valid for the user represented
by this session.
|
beginTransaction, commitTransaction, disconnect, getInternalSession, getManagersFactory, isTransactionInProgress, registerForEvents, rollbackTransaction, rollbackTransactionStack, unregisterForEventsbeginRequestCommon, getCreationTime, getCurrentSession, getTag, requestCleanuppublic long getId()
FdkSessiongetId in class FdkSessionpublic long getLastAccessTime()
FdkSessionendRequest() on the current session. The time format is the
same as System.currentTimeMillis().getLastAccessTime in class FdkSessionpublic void setLastAccessTimeUpdate(boolean update)
FdkSessionendRequest() is called on the current session. This is
useful behavior for requests that are not sent by the true end-user but
rather by a polling process for example.
Note that the behavior is changed on a per request basis, the default
behavior if the method is not called during a request is to always update
the last access time and the behavior is reset to the default when a
request is completed by calling endRequest().
setLastAccessTimeUpdate in class FdkSessionupdate - If false the last access time will not be
updated, otherwise it will be updated.public boolean isConnected()
FdkSessionisConnected in class FdkSessionpublic String getUsername()
FdkSessiongetUsername in class FdkSessionpublic String getDistinguishedName()
FdkSessiongetDistinguishedName in class FdkSessionpublic boolean isGuest()
FdkSessionisGuest in class FdkSessionpublic boolean isSystem()
isSystem in class FdkSessionpublic boolean isTrustedApplication()
isTrustedApplication in class FdkSessionpublic String getTrustedApplicationName()
null if the
session was not created by a truested application.getTrustedApplicationName in class FdkSessionpublic boolean verifyCredential(Credential credential)
FdkSessiontrue if the credential is
valid or false otherwise. The method can also throw a
FdkException if errors occur during the verification
process.verifyCredential in class FdkSessioncredential - The credential to verify.public boolean isRequestInProgress()
FdkSessionbeginRequest() and endRequest()isRequestInProgress in class FdkSessionpublic void beginRequest(boolean wait,
long timeout,
String tag)
throws FdkException
FdkSessionendRequest() must be
called from the same thread.beginRequest in class FdkSessionwait - Whether the calling thread should wait for the session
to finish any existing requests or should fail right away
if the session is busy. If wait is false, the
timeout value is ignored.timeout - If the caller chooses to wait, this is the timeout in
milliseconds before an error is returned if the session is
still busy. If the parameter is 0, the wait is indefinite.
If the timeout is -1 or any negative value the wait is
defaulted to a system chosen, sensible value.tag - A tag describing the application that is currently using
this session. The tag can be retrieved later on by
calling getTag().
Must not be null.FdkExceptionpublic boolean endRequest()
FdkSessionfalse
if there were no outstanding requests on the session or the current
thread did not own the session. The caller may interpret it as an error
or just ignore it, depending on its implementation.endRequest in class FdkSessionpublic void setSessionTimeout(long timeout)
FdkSessionIn addition, if the timeout is greater than zero, the session will not be disconnected when it gets the unbind even from the HttpSession, as it is assumed it is being managed by a different entity.
setSessionTimeout in class FdkSessiontimeout - Number of seconds to set the timeout to.public long getSessionTimeout()
FdkSessiongetSessionTimeout in class FdkSessionpublic void setState(Object key, Object value)
FdkSessiongetState().
It is recommended that applications store only one object as their state. The object can be a Map that contains other pieces of state.
setState in class FdkSessionkey - The key that identifies the piece of state. The namespace
for the key is not specified. It is recommended that a
package-like key name be used in order to avoid potential
conflicts.value - The value to store at the given key. If null,
the key will be removed.public Object getState(Object key)
FdkSessionsetState().
See the documentation of setState().getState in class FdkSessionkey - The key to retrieve the value for.public Item getUser(AttributeRequest[] attributes) throws FdkException
FdkSessionImplgetUser in class FdkSessionImplattributes - Optional attributes to be returned.FdkExceptionpublic LibrarySession getLibrarySession()
FdkSessionImplLibrarySession associated with this user session.
WARNING!
This method should not be called from client code, except for exceptional
circumstances where the caller understands the implications of using the
LibrarySession directly and opts out of using the framework.
If you need to use this method, please check with the developers of the framework for possible alternate ways of achieving the same result.
getLibrarySession in class FdkSessionImplpublic void disconnectNotify()
throws FdkException
FdkSessionImplFdkExceptionpublic void httpUnbind()
FdkSessionhttpUnbind in class FdkSessionpublic void httpBind()
FdkSessionhttpBind in class FdkSessionpublic String getUserIdentifier()
LogInfoCopyright © 2025. All rights reserved.