Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 7 (11.1.7)

E22562-07

oracle.apps.fnd.applcore.common
Class ApplSessionManagement

java.lang.Object
  extended by oracle.apps.fnd.applcore.common.ApplSessionManagement
All Implemented Interfaces:
java.io.Serializable, java.security.Principal, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener, LwsSessionContext

public class ApplSessionManagement
extends java.lang.Object
implements LwsSessionContext, javax.servlet.http.HttpSessionBindingListener, java.io.Serializable

The ApplSessionManagement class implements the LwsSessionContext interface, and handles all aspects of LwsSession management, including creating, attaching to, validating, and destroying the session object. This class is not intended to be accessed directly by product teams, it is for applcore use only. The ApplSessionUtil package provides api's that product teams can call to access ApplSession's.

See Also:
Serialized Form

Constructor Summary
ApplSessionManagement()
          The ApplSessionManagement Constructor.
ApplSessionManagement(java.lang.String sessionID)
          The ApplSessionManagement Constructor that takes a session ID.
 
Method Summary
 void attachSession(LwsSession session)
          Used if we need to attach a dummy session to the context.
 void attachSession(LwsSession session, java.sql.Connection conn)
          Implementation of the LwsSessionContext interface.
 void attachSession(LwsSession session, java.sql.Connection conn, LwsUser lwsUser, java.util.List<? extends LwsRole> roles)
          Version of attachSession that defaults to not passing in a HashMap of attributes to set.
 void attachSession(LwsSession session, java.sql.Connection conn, LwsUser lwsUser, java.util.List<? extends LwsRole> roles, java.util.HashMap attrs)
          Attaches the passed in session using the given connection, with the specified users and roles, and associates this session management object with that sssion.
 LwsSession createAttachedSession(java.sql.Connection conn)
          Creates an attached session based on the current session ID.
 LwsSession createAttachedSession(java.sql.Connection conn, java.util.HashMap attachAttrs)
          Same as createAttachedSession, but additionally includes a HashMap of attributes to pass to the actual attachSession.
 LwsSession createElevatedSession(LwsUser user, LwsUser submittingUser, java.util.List<java.lang.String> langAttrs, java.sql.Connection conn)
          Create an elevated session for the specified user.
 LwsSession createSession()
          Deprecated.  
 LwsSession createSession(java.sql.Connection conn)
          Deprecated.  
 LwsSession createSession(LwsUser user)
          Deprecated.  
 LwsSession createSession(LwsUser user, java.sql.Connection conn)
          Creates a session, without specifying any language attributes.
 LwsSession createSession(LwsUser user, java.util.List<java.lang.String> langAttrs, java.sql.Connection conn)
          The primary API for creating a session - takes in the specified user, an optional list of language attributes, and a connection.
 void destroySession()
          destroy the LWS session in the database.
 void destroySession(java.sql.Connection conn)
           
 void destroySession(java.sql.Connection conn, ApplSession session)
          destroys the specified session using the passed in connection.
 void detachSession()
          Implementation of the LwsSessionContext interface
 void detachSession(java.sql.Connection conn)
          Counterpart to attachSession, call detachSession on the connection that was attached to when finished.
 LwsSession getAttachedSession()
          returns the attached LWS session if the session is attached.
 java.lang.String getName()
          Implementation of the Principal interface
 boolean isAttached()
          checks if the LWS session of this context is in Attach state.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
          Implementation of HttpSessionBindingListener.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
          Implementation of HttpSessionBindingListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Constructor Detail

ApplSessionManagement

public ApplSessionManagement()
The ApplSessionManagement Constructor.


ApplSessionManagement

public ApplSessionManagement(java.lang.String sessionID)
The ApplSessionManagement Constructor that takes a session ID. No longer in use.

Method Detail

createSession

public LwsSession createSession(LwsUser user,
                                java.util.List<java.lang.String> langAttrs,
                                java.sql.Connection conn)
The primary API for creating a session - takes in the specified user, an optional list of language attributes, and a connection. The user should be of the ApplUser subclass, and must not be null. ### Does this need to be made thread-safe? when would multiple threads ### want to create attached sessions on the same ApplSessionManagement?

Parameters:
user - the user to attach as
langAttrs - the language attributes to set for the user.
conn - a database connection to use for the create
Returns:
the newly created ApplSession object

createElevatedSession

public LwsSession createElevatedSession(LwsUser user,
                                        LwsUser submittingUser,
                                        java.util.List<java.lang.String> langAttrs,
                                        java.sql.Connection conn)
Create an elevated session for the specified user. The user should be of the ApplUser subclass, and must not be null. You can pass in a connection here if one is available. The 'submittingUser' argument is used by ESS to create this session on behalf of someone else.

Parameters:
user - the user to attach as
submittingUser - the user this session is being used for
conn - a database connection to use for the create
Returns:
the newly created ApplSession object

createSession

public LwsSession createSession(LwsUser user,
                                java.sql.Connection conn)
Creates a session, without specifying any language attributes.

Parameters:
user - the user to attach as
conn - a database connection to use for the create
Returns:
the newly created ApplSession object
See Also:
createSession(oracle.apps.fnd.applcore.common.security.LwsUser, java.util.List, java.sql.Connection);

createSession

public LwsSession createSession(LwsUser user)
Deprecated. 

Create a session for the specified user. The user should be of the ApplUser subclass, and must not be null. Not in use.

Specified by:
createSession in interface LwsSessionContext
Returns:
a LWS session.

createSession

public LwsSession createSession()
Deprecated. 

Create a session using the user info from the current Subject. Not in use.

Specified by:
createSession in interface LwsSessionContext
Returns:
a LWS session.

createSession

public LwsSession createSession(java.sql.Connection conn)
Deprecated. 

Create a session using the user info from the Subject and using the passed in connection. Not in use


createAttachedSession

public LwsSession createAttachedSession(java.sql.Connection conn)
Creates an attached session based on the current session ID. If no session exists, a new one is created, otherwise a duplicate session of the existing object is created, attached to the passed in connection, and the session is returned. This assumes that if a session already exists that it is valid. ### Does this need to be made thread-safe? when would multiple threads ### want to create attached sessions on the same ApplSessionManagement?

Specified by:
createAttachedSession in interface LwsSessionContext
Parameters:
conn - the connection to attach to
Returns:
an attached ApplSession object

createAttachedSession

public LwsSession createAttachedSession(java.sql.Connection conn,
                                        java.util.HashMap attachAttrs)
Same as createAttachedSession, but additionally includes a HashMap of attributes to pass to the actual attachSession.

Parameters:
conn - the connection to attach to
HashMap - a HashMap of attributes to pass to the attach
Returns:
an attached ApplSession object

attachSession

public void attachSession(LwsSession session,
                          java.sql.Connection conn,
                          LwsUser lwsUser,
                          java.util.List<? extends LwsRole> roles,
                          java.util.HashMap attrs)
                   throws java.lang.Exception
Attaches the passed in session using the given connection, with the specified users and roles, and associates this session management object with that sssion. Also takes in an optional HashMap representing a list of session attributes to set.

Parameters:
session - the session to attach the connection to
conn - a database connection to attach to
user - the user to attach as
roles - the roles to attach to
attrs - session attributes to set when the session is attached
Throws:
java.lang.Exception

attachSession

public void attachSession(LwsSession session,
                          java.sql.Connection conn,
                          LwsUser lwsUser,
                          java.util.List<? extends LwsRole> roles)
                   throws java.lang.Exception
Version of attachSession that defaults to not passing in a HashMap of attributes to set.

Parameters:
session - the session to attach the connection to
conn - a database connection to attach to
user - the user to attach as
roles - the roles to attach to
Throws:
java.lang.Exception
See Also:
oracle.apps.fnd.applcore.common.ApplSessionManagement#attachSession(oracle.apps.fnd.applcore.common.ApplSession, java.sql.Connection, oracle.apps.fnd.applcore.common.security.LwsUser, java.util.List, java.util.HashMap);

attachSession

public void attachSession(LwsSession session,
                          java.sql.Connection conn)
                   throws java.lang.Exception
Implementation of the LwsSessionContext interface.

Specified by:
attachSession in interface LwsSessionContext
Throws:
java.lang.Exception - if it fails to perform session Attach.

attachSession

public void attachSession(LwsSession session)
                   throws java.lang.Exception
Used if we need to attach a dummy session to the context.

Throws:
java.lang.Exception

getAttachedSession

public LwsSession getAttachedSession()
Description copied from interface: LwsSessionContext
returns the attached LWS session if the session is attached.

Specified by:
getAttachedSession in interface LwsSessionContext
Returns:
the attached Session object. Raises an exception if there is no attached session.

isAttached

public boolean isAttached()
Description copied from interface: LwsSessionContext
checks if the LWS session of this context is in Attach state.

Specified by:
isAttached in interface LwsSessionContext
Returns:
a boolean indicating whether this object is currently attached

detachSession

public void detachSession()
Implementation of the LwsSessionContext interface

Specified by:
detachSession in interface LwsSessionContext

detachSession

public void detachSession(java.sql.Connection conn)
Counterpart to attachSession, call detachSession on the connection that was attached to when finished.


destroySession

public void destroySession()
Description copied from interface: LwsSessionContext
destroy the LWS session in the database.

When a user logs out, application should destroy the user's LWS session.

Specified by:
destroySession in interface LwsSessionContext
See Also:
destroySession(java.sql.Connection, oracle.apps.fnd.applcore.common.ApplSession);

destroySession

public void destroySession(java.sql.Connection conn)
See Also:
destroySession(java.sql.Connection, oracle.apps.fnd.applcore.common.ApplSession);

destroySession

public void destroySession(java.sql.Connection conn,
                           ApplSession session)
destroys the specified session using the passed in connection. Not currently part of the LwsSessionContext interface.

Parameters:
conn - the connection to use to destroy the session.
session - the session to destroy

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Implementation of HttpSessionBindingListener. Called when the session gets stored into an HttpSession.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Implementation of HttpSessionBindingListener. Called when the HttpSession that the session is associated with times out.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

getName

public java.lang.String getName()
Implementation of the Principal interface

Specified by:
getName in interface java.security.Principal

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 7 (11.1.7)

E22562-07

Copyright © 2013 Oracle. All Rights Reserved.