Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.fdk
Class FdkSession

    java.lang.Object
      oracle.ifs.fdk.FdkSession

All Implemented Interfaces:
  LogInfo

Direct Known Subclasses:
  FdkSessionImpl

    public abstract class FdkSession

extends java.lang.Object
implements LogInfo

Represents an authenticated user session.

(Unpublished)

Field Summary
`protected java.lang.Thread` | `m_CurrentRequestThread`
`protected java.lang.String` | `m_Tag`

Constructor Summary
`FdkSession()`

Method Summary
`abstract void` | `beginRequest(boolean wait, long timeout, java.lang.String tag)` Notifies the session that a new request has begun.
`protected void` | `beginRequestCommon()` Protected method that subclasses MUST call when implementing beginRequest().
`abstract boolean` | `endRequest()` Notifies the session that the request has ended.
`long` | `getCreationTime()` Returns the time when this session was created.The time format is the same as `System.currentTimeMillis()`.
`static FdkSession` | `getCurrentSession()` Returns the current session for the ongoing request, or null if no session is available or cannot be determined.
`abstract java.lang.String` | `getDistinguishedName()` Returned the distinguished name for the authenticated user.
`abstract long` | `getId()` Returns this session identifier.
`abstract java.lang.Object` | `getInternalSession()` Returns the internal session associated with this user session.
`abstract long` | `getLastAccessTime()` Returns the time when the last request was completed by calling `endRequest()` on the current session.
`abstract ManagersFactory` | `getManagersFactory()` Returns the managers factory corresponding to this session.
`abstract long` | `getSessionTimeout()` Returns the session timeout, in seconds, for this session.
`abstract java.lang.Object` | `getState(java.lang.Object key)` Returns the value stored at the given key using `setState()`.
`java.lang.String` | `getTag()` Returns the tag for this session, set either when the session was created or when `beginRequest()` was called.
`abstract java.lang.String` | `getTrustedApplicationName()` Returns the name of the trusted application or `null` if the session was not created by a truested application.
`abstract java.lang.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
`abstract boolean` | `isConnected()` Returns true if this session is connected.
`abstract boolean` | `isGuest()` Returns true if the session is a guest/anonymous session.
`abstract boolean` | `isRequestInProgress()` Returns true if there is a request being serviced by this session.
`abstract boolean` | `isSystem()` Returns true if the session is a system session.
`abstract boolean` | `isTrustedApplication()` Returns true if the session was created by a trusted application.
`abstract void` | `registerForEvents(FdkSessionListener listener)` Registers a listener for events that may occur on this session.
`protected void` | `requestCleanup()` Request cleanup.
`abstract void` | `setLastAccessTimeUpdate(boolean update)` Sets whether the last access time will be updated when `endRequest()` is called on the current session.
`abstract void` | `setSessionTimeout(long timeout)` Sets the automatic session timeout for inactivity.
`abstract void` | `setState(java.lang.Object key, java.lang.Object value)` Sets a value representing a piece of state that makes sense to the application.
`abstract boolean` | `unregisterForEvents(FdkSessionListener listener)` Unregisters a previously registered listener.
`abstract boolean` | `verifyCredential(Credential credential)` Verifies that the given credential is valid for the user represented by this session.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface oracle.ifs.common.logging.LogInfo
`getSessionIdentifier, getUserIdentifier`

Field Detail

### m_CurrentRequestThread

    protected java.lang.Thread m_CurrentRequestThread

### m_Tag

    protected java.lang.String m_Tag

Constructor Detail

### FdkSession

    public FdkSession()

Method Detail

### getCurrentSession

    public static FdkSession getCurrentSession()

  Description copied from class: `FdkSession`
  Returns the current session for the ongoing request, or null if no session is available or cannot be determined. The current session is determined based on the calling thread. This call works only for callers that run in the request thread, not for child threads.

### getManagersFactory

    public abstract ManagersFactory getManagersFactory()
                                                throws FdkException

  Description copied from class: `FdkSession`
  Returns the managers factory corresponding to this session. There is only one instance of the managers factory per session, hence calling this method will always return the same instance.

  Throws:
    `FdkException`

### getInternalSession

    public abstract java.lang.Object getInternalSession()
                                                 throws FdkException

  Description copied from class: `FdkSession`
  Returns the internal session 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 underlying internal session 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.

  Throws:
    `FdkException`

### getId

    public abstract long getId()

  Description copied from class: `FdkSession`
  Returns this session identifier. The identifier is not persisted, it is unique in the context of a Java Virtual Machine and it may be the same between different runs of the software.

### getCreationTime

    public long getCreationTime()

  Description copied from class: `FdkSession`
  Returns the time when this session was created.The time format is the same as `System.currentTimeMillis()`.

### getLastAccessTime

    public abstract long getLastAccessTime()

  Description copied from class: `FdkSession`
  Returns the time when the last request was completed by calling `endRequest()` on the current session. The time format is the same as `System.currentTimeMillis()`.

### getTag

    public java.lang.String getTag()

  Description copied from class: `FdkSession`
  Returns the tag for this session, set either when the session was created or when `beginRequest()` was called.

### setLastAccessTimeUpdate

    public abstract void setLastAccessTimeUpdate(boolean update)

  Description copied from class: `FdkSession`
  Sets whether the last access time will be updated when `endRequest()` 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()`.

  Parameters:
    `update` - If `false` the last access time will not be updated, otherwise it will be updated.

### isConnected

    public abstract boolean isConnected()

  Description copied from class: `FdkSession`
  Returns true if this session is connected.

### getUsername

    public abstract java.lang.String getUsername()

  Description copied from class: `FdkSession`
  Returns the username for the authenticated user. It is recommended that implementations cache the value so that a call to this method will not block if for example the underlying session is busy.

### getDistinguishedName

    public abstract java.lang.String getDistinguishedName()

  Description copied from class: `FdkSession`
  Returned the distinguished name for the authenticated user. For OID users this is equivalent to the OID GUID. It is recommended that implementations cache the value so that a call to this method will not block if for example the underlying session is busy.

### isGuest

    public abstract boolean isGuest()

  Description copied from class: `FdkSession`
  Returns true if the session is a guest/anonymous session.

### isSystem

    public abstract boolean isSystem()

  Description copied from class: `FdkSession`
  Returns true if the session is a system session.

### isTrustedApplication

    public abstract boolean isTrustedApplication()

  Description copied from class: `FdkSession`
  Returns true if the session was created by a trusted application.

### getTrustedApplicationName

    public abstract java.lang.String getTrustedApplicationName()

  Description copied from class: `FdkSession`
  Returns the name of the trusted application or `null` if the session was not created by a truested application.

### verifyCredential

    public abstract boolean verifyCredential(Credential credential)
                                      throws FdkException

  Description copied from class: `FdkSession`
  Verifies that the given credential is valid for the user represented by this session. Returns `true` if the credential is valid or `false` otherwise. The method can also throw a `FdkException` if errors occur during the verification process.

  Parameters:
    `credential` - The credential to verify.
  Throws:
    `FdkException`

### isRequestInProgress

    public abstract boolean isRequestInProgress()

  Description copied from class: `FdkSession`
  Returns true if there is a request being serviced by this session. See `beginRequest()` and `endRequest()`

### beginRequest

    public abstract void beginRequest(boolean wait,
                                      long timeout,
                                      java.lang.String tag)
                               throws FdkException

  Description copied from class: `FdkSession`
  Notifies the session that a new request has begun. The current thread becomes the owner of this session. `endRequest()` must be called from the same thread.

  Parameters:
    `wait` - 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`.
  Throws:
    `FdkException`

### beginRequestCommon

    protected void beginRequestCommon()

  Description copied from class: `FdkSession`
  Protected method that subclasses MUST call when implementing beginRequest().

### endRequest

    public abstract boolean endRequest()
                                throws FdkException

  Description copied from class: `FdkSession`
  Notifies the session that the request has ended. Returns `false` 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.

  Throws:
    `FdkException`

### setSessionTimeout

    public abstract void setSessionTimeout(long timeout)

  Description copied from class: `FdkSession`
  Sets the automatic session timeout for inactivity. A session that has a timeout greater than zero will automatically be disconnected if there is no activity for the specified number of seconds.

  In 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.

  Parameters:
    `timeout` - Number of seconds to set the timeout to.

### getSessionTimeout

    public abstract long getSessionTimeout()

  Description copied from class: `FdkSession`
  Returns the session timeout, in seconds, for this session. A zero return value means the session is not timed out by this framework. Note that the return value is meaningful only if the session is fully managed by the framework as there could be external entities (such as an HttpSession) that could have their own session timeouts which would in turn trigger this session to timeout.

### setState

    public abstract void setState(java.lang.Object key,
                                  java.lang.Object value)
                           throws FdkException

  Description copied from class: `FdkSession`
  Sets a value representing a piece of state that makes sense to the application. The value can be retrieved using `getState()`.

  It is recommended that applications store only one object as their state. The object can be a Map that contains other pieces of state.

  Parameters:
    `key` - 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.
  Throws:
    `FdkException`

### getState

    public abstract java.lang.Object getState(java.lang.Object key)
                                       throws FdkException

  Description copied from class: `FdkSession`
  Returns the value stored at the given key using `setState()`. See the documentation of `setState()`.

  Parameters:
    `key` - The key to retrieve the value for.
  Throws:
    `FdkException`

### registerForEvents

    public abstract void registerForEvents(FdkSessionListener listener)

  Description copied from class: `FdkSession`
  Registers a listener for events that may occur on this session. The listener must implement the `FdkSessionListener` interface.

  Parameters:
    `listener` - The listener to register. It must imlpement the `FdkSessionListener` interface.

### unregisterForEvents

    public abstract boolean unregisterForEvents(FdkSessionListener listener)

  Description copied from class: `FdkSession`
  Unregisters a previously registered listener. If the listener instance is not found, `false` is returned.

  Parameters:
    `listener` - The listener to register. It must imlpement the `FdkSessionListener` interface.

### httpBind

    public void httpBind()

  Description copied from class: `FdkSession`
  Respond to a bind notification from the HttpSession

### httpUnbind

    public void httpUnbind()

  Description copied from class: `FdkSession`
  Respond to an unbind notification from the HttpSession

### requestCleanup

    protected void requestCleanup()

  Description copied from class: `FdkSession`
  Request cleanup.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD