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

E22562-07

oracle.apps.fnd.applcore.common
Class ApplSession

java.lang.Object
  extended by oracle.apps.fnd.applcore.common.ApplSession
All Implemented Interfaces:
java.io.Serializable, LwsSession

public final class ApplSession
extends java.lang.Object
implements LwsSession, java.io.Serializable

Historically, the Context object has been the main window through which product teams access AOL/J functionality - it provided security API's and access to database connections and services like profiles and messages. In Fusion, this functionality is separated out into different components - services are a completely separate layer, authentication is handled by the JAZN layer, and we are left with an object that provides access to database connections and which stores and allows setting of the security context. Originally this was going to be handled by the XS lightweight session framework, but now we are planning to implement our own version of lightweight sessions. The ApplSession class is that implementation.

setting up the FND session corresponding to that authenticated user, and allows product teams access to that session and its attached connection.

When running from within an OC4J container, the ApplSession should always be available to product teams, assuming the application is properly configured. Cleanup should be handled automatically for product teams as well.

However, when running from a standalone java application, separate initialization and cleanup calls may be required - the ApplSessionUtil class provides an implementation of these.

See Also:
Serialized Form

Field Summary
static java.lang.String APPLICATION_DB
           
static java.lang.String APPLICATION_DB_DS
           
static java.lang.String APPLICATION_ENV_DB_DS
           
static boolean s_debugConn
           
static boolean s_debugNS
           
static boolean s_debugSess
           
 
Constructor Summary
ApplSession(java.lang.String sessionID, java.lang.String sessionCookie)
          ApplSession Constructor that takes in a session cookie as well.
ApplSession(java.lang.String sessionID, java.lang.String sessionCookie, ApplUser user, java.util.List<ApplRole> roles)
          ApplSession constructor that takes an ApplUser object and ApplRoles for performance reasons, so they won't need to be refetched later on.
 
Method Summary
 void attachSession(java.sql.Connection conn)
          Initializes the specified connection with the current session info.
 void attachSession(java.sql.Connection conn, java.util.List<? extends LwsRole> roles)
           
 void attachSession(java.sql.Connection conn, LwsUser lwsUser, java.util.List<? extends LwsRole> roles)
          Attaches the LWS session of this context to a db connection using the specified user and roles.
 void attachSession(java.sql.Connection conn, LwsUser lwsUser, java.util.List<? extends LwsRole> roles, java.util.HashMap attrs)
          Initializes the specified connection with the current session info.
 boolean checkSession()
          Check that the current session ID of this ApplSession object exists in the database and is valid.
 boolean checkSession(java.sql.Connection conn)
          Check that the current session ID of this ApplSession object exists in the database and is valid.
 boolean checkSessionIDExists(java.sql.Connection conn)
          Check if the Session ID Exists in DB to avoid clashes.
static void clearConnectionState(java.sql.Connection conn)
          This will clear out any leftover session state from a given connection.
 void detachSession()
          Deprecated.  
 void detachSession(java.sql.Connection conn)
          Detach from the currently attached session, which will cause any changes made to session attributes to be made visible to any other session.
 java.lang.String getAccessibilityMode()
          Get the current accessibility mode
 java.lang.String getAction()
          Tracing attributes - return the current ACTION.
 java.lang.String getAddtlCustomLevel()
          Return the current Additional Custom Level
 java.lang.Boolean getAnimationEnabled()
          Fetch the user preference attribute - AnimationEnabled.
 java.lang.Integer getApplicationID()
          Return the current application ID.
 java.lang.String getApplicationLanguage()
          Fetch the user preference attribute - ApplicationLanguage.
 java.lang.String getApplicationShortName()
          Return the current application short name.
 java.lang.String getAppStripes()
          Return the internal code indicating which applications stripes we have loaded roles for.
 java.lang.String getClientEncoding()
          Fetch the current client encoding.
 java.lang.String getColorContrast()
          Fetch the user preference attribute - ColorContrast.
 java.sql.Connection getConnection()
          Return a new connection, which has been initialized to reference the current ApplSession.
 java.lang.String getCurrency()
          Fetch the current currency.
 java.lang.String getDateFormat()
          Fetch the formatting string for date values.
 char getDecimalSeparator()
          Fetch the character used as the decimal separator.
 java.lang.String getDisplayNameLanguage()
          Fetch the value of the language for displaying the user name.
 java.lang.Boolean getEmbeddedHelpEnabled()
          Fetch the user preference attribute - EmbeddedHelpEnabled.
 java.lang.String getEnterpriseID()
          Return the current Enterprise ID
 java.lang.String getEnterpriseName()
          Return the current Enterprise Name
 java.lang.String getFontSize()
          Fetch the user preference attribute - FontSize.
 java.lang.String getFUSEUserFlag()
          Fetch the FUSE user flag for the current session, if defined.
 java.lang.String getGlobal()
          Return the constant "GLOBAL"
 char getGroupingSeparator()
          Fetch the character used as the grouping separator.
 java.lang.String getHistoryOverrideUserName()
          If the current session is being run by an administrator on behalf of another user, this returns the guid associated with the user originating the request.
 java.lang.String getImpersonatorUserName()
          Returns the impersonator user name if it's a proxy session
 java.lang.String getIndustry()
          Return the current Industry
 java.lang.String getIndustryInTerritory()
          Return the current Industry In Territory
 java.lang.String getIntegerFormat()
          Fetch the user preference attribute - IntegerFormat.
 java.lang.String getLanguage()
          Fetch the user's current language - this does not return the the database language, instead it returns the middle-tier language 'tag' representation.
 java.lang.String getLogoutURL()
          Fetch the logout URL for the current session, if defined.
 java.lang.String getModule()
          Tracing attributes - return the current MODULE.
 java.lang.String getNamespaceAttribute(java.lang.String namespaceName, java.lang.String attrName)
          Return the value from the specified namespace.
 java.lang.Integer getNamespaceAttributeNum(java.lang.String namespaceName, java.lang.String attrName)
          Return the value from the specified namespace as an Integer.
 java.util.List<java.lang.String> getNamespaceNames(java.sql.Connection conn)
          Return a list of the names of namespaces associated with this session.
 java.lang.String getNLSLang()
          Fetch the NLS_LANG value.
 java.lang.String getNLSLanguage()
          Fetch the NLS_LANGUAGE value.
 java.lang.String getNLSSort()
          Fetch the sorting behavior.
 java.lang.String getNumberFormat()
          Fetch the user preference attribute - NumberFormat.
 java.lang.String getProduct()
          Return the current Product
 java.lang.String getProductFamily()
          Return the current ProductFamily
 java.util.List<ApplRole> getRoles()
          Returns a List representing the user's active roles.
 java.util.List<ApplRole> getRoles(java.lang.String appID, java.sql.Connection conn)
          Takes in an application ID and a connection.
 java.lang.String getSandboxID()
          Get the current sandbox ID
 java.lang.String getSessionAttribute(java.lang.String attrName)
          Return the specified attribute from the FND_SESSION_NAMESPACE.
static oracle.j2ee.ws.common.context.ContextProvider getSessionContext()
          For use by code from the BPEL layer only.
 java.lang.String getSessionCookie()
          Return the session cookie associated with this lightweight session
 java.lang.String getSessionID()
          Return the ID of the current lightweight session.
 ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName)
          Returns the specified namespace.
 ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName, boolean refetch)
          Returns the specified namespace.
 ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName, java.sql.Connection conn, boolean refetch)
          Returns the specified namespace.
 java.lang.String getSite()
          Return the current Site
 java.lang.String getTerritory()
          Fetch the current territory setting.
 java.lang.String getTimeFormat()
          Fetch the formatting string for date values.
 java.lang.String getTimeZone()
          Fetch the value of the current timezone.
 java.lang.Integer getTraceLevel()
          Tracing attributes - return the current TRACE_LEVEL.
 ApplUser getUser()
          Returns the current ApplUser object.
 java.lang.String getUserDisplayName()
          Fetch the display name for the user, based on the DISPLAY_NAME_LANGUAGE
 java.lang.String getUserGuid()
          This returns the current applications user ID.
 java.lang.String getUserName()
          This returns the current application user name.
 ApplSessionNamespace initializeNamespace(java.lang.String namespaceName)
          Initialize a namespace for this session.
 boolean isAttached()
          Since we now decouple the session from its connection, this is meaningless.
static boolean isLogEnabled(java.util.logging.Level logLevel)
          For internal use - check if session logging is enabled.
 boolean isProxy()
          Get the whether it's a proxy session
 void loadAppRoles(java.sql.Connection conn)
          Loads the application roles for crm, fscm, and hcm into the current session's roles.
 void loadNamespace(java.lang.String nameSpace, java.sql.Connection conn)
          Internal API, created initially for BI usage.
static void log(java.util.logging.Level logLevel, java.lang.String logMessage)
          For internal use only - log to the session logger
static void log(java.util.logging.Level logLevel, java.lang.String logMessage, java.lang.Throwable logException)
          For internal use only - log to the session logger
static void logStackTrace(java.util.logging.Level logLevel, java.lang.String logMessage)
          For internal use only - log to the session logger and generate a debug exception to print out the current stack trace.
 boolean namespaceLoaded(java.lang.String namespace)
          Returns true if the namespace has ever been loaded
 void releaseConnection(java.sql.Connection conn)
          Release the connection obtained from getConnection, and clear out any pointers to the current session.
 void setAccessibilityMode(java.lang.String pAccessibilityMode)
          Set the current accessibility mode
 void setAction(java.lang.String pAction)
          Set the current action (used for tracing)
 void setAddtlCustomLevel(java.lang.String pAdditionalCustomLevel)
          Update the Additional Custom Level of the current session.
 void setAnimationEnabled(java.lang.Boolean pAnimationEnabled)
          Set the user preference attribute - AnimationEnabled
 void setApplicationLanguage(java.lang.String pApplicationLanguage)
          Set the user preference attribute - ApplicationLanguage
 void setClientEncoding(java.lang.String pClientEncoding)
          Set the client encoding.
 void setColorContrast(java.lang.String pColorContrast)
          Set the user preference attribute - ColorContrast
 void setCurrency(java.lang.String pCurrency)
          Set the currency.
 void setDateFormat(java.lang.String pDateFormat)
          Set the value of the date format.
 void setDecimalSeparator(char pDecimalSeparator)
          Set the value of the DECIMAL_SEPARATOR.
 void setDisplayNameLanguage(java.lang.String pLanguage)
          Set the value of the language to display the current username.
 void setEmbeddedHelpEnabled(java.lang.Boolean pEmbeddedHelpEnabled)
          Set the user preference attribute - EmbeddedHelpEnabled
 void setFontSize(java.lang.String pFontSize)
          Set the user preference attribute - FontSize
 void setFUSEUserFlag(java.lang.String flag)
          Sets the FUSE user flag for the current session
 void setGroupingSeparator(char pGroupingSeparator)
          Set the value of the GROUPING_SEPARATOR.
 void setHistoryOverrideUserName(java.lang.String pOverrideUserName)
          Set the history override user name, indicating that the current session is being run on behalf of another user.
 void setIndustry(java.lang.String pIndustry)
          Update the Industry of the current session.
 void setIndustryInTerritory(java.lang.String pIndustryInTerritory)
          Update the Industry In Territory of the current session.
 void setLanguage(java.lang.String pLanguage)
          Set the session's language, and also update the session language in the database.
 void setLogoutURL(java.lang.String pLogoutURL)
          Set the logout URL for the current session.
 void setModule(java.lang.String pModule)
          Set the current module (used for tracing)
 java.lang.String setNamespaceAttribute(java.lang.String namespaceName, java.lang.String attrName, java.lang.String attrValue)
          Set the value on the specified namespace.
 void setNLSSort(java.lang.String pNLSSort)
          Set the sorting value.
 void setNumberFormat(java.lang.String pNumberFormat)
          Set the user preference attribute - NumberFormat
 void setProduct(java.lang.String pProduct)
          Update the Product of the current session
 void setProductFamily(java.lang.String pProductFamily)
          Update the Product Family of the current session
 void setSandboxID(java.lang.String pSandboxID)
          Set the sandbox ID
 java.lang.String setSessionAttribute(java.lang.String attrName, java.lang.String attrValue)
          Set the specified attribute on the lightweight session's FND_SESSION_NAMESPACE.
 void setTerritory(java.lang.String pTerritory)
          Update the current territory.
 void setTimeFormat(java.lang.String pTimeFormat)
          Set the value of the time format.
 void setTimeZone(java.lang.String pTimeZone)
          Set the value of the current timezone.
 void setTraceInfo(int pTraceLevel, java.lang.String pModule, java.lang.String pAction)
          For convenience (and in the future performance), this allows you to set all three tracing attributes in one call.
 void setTraceLevel(int pTraceLevel)
          Enable the tracing level.
 void setUserDisplayName(java.lang.String pUserDisplayName)
          Set the value of the current user display name
 void synchronize()
          This is called to cause any changes made to session attributes to get written to the database.
 void synchronize(java.sql.Connection conn)
          Version of synchronize that takes in a connection.
 void synchronizeSessionInfo(java.sql.Connection conn)
          Synchronizes the session information.
 void synchronizeWithDB()
          Synchronizes both the namespaces as well as the session information.
 void synchronizeWithDB(java.sql.Connection conn)
          Synchronizes both the namespaces as well as the session information.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

APPLICATION_DB

public static final java.lang.String APPLICATION_DB
See Also:
Constant Field Values

APPLICATION_ENV_DB_DS

public static final java.lang.String APPLICATION_ENV_DB_DS
See Also:
Constant Field Values

APPLICATION_DB_DS

public static final java.lang.String APPLICATION_DB_DS
See Also:
Constant Field Values

s_debugConn

public static boolean s_debugConn

s_debugNS

public static boolean s_debugNS

s_debugSess

public static boolean s_debugSess
Constructor Detail

ApplSession

public ApplSession(java.lang.String sessionID,
                   java.lang.String sessionCookie)
ApplSession Constructor that takes in a session cookie as well. This is public so it can be invoked by OAApplicationModuleImpl, but this api is for internal use ONLY.


ApplSession

public ApplSession(java.lang.String sessionID,
                   java.lang.String sessionCookie,
                   ApplUser user,
                   java.util.List<ApplRole> roles)
ApplSession constructor that takes an ApplUser object and ApplRoles for performance reasons, so they won't need to be refetched later on. This is public so it can be invoked by OAApplicationModuleImpl, but this api is for internal use ONLY.

Method Detail

getConnection

public java.sql.Connection getConnection()
Return a new connection, which has been initialized to reference the current ApplSession. The calling application MUST call ApplSession.releaseConnection() to free up this connection when finished.

Specified by:
getConnection in interface LwsSession
Returns:
a newly obtained connection initialized to the current apps context
See Also:
detachSession(java.sql.Connection)

releaseConnection

public void releaseConnection(java.sql.Connection conn)
Release the connection obtained from getConnection, and clear out any pointers to the current session.

Parameters:
conn - the connection obtained by getConnection() to release

getSessionID

public java.lang.String getSessionID()
Return the ID of the current lightweight session.

Specified by:
getSessionID in interface LwsSession
Returns:
the current session ID as a String

getSessionCookie

public java.lang.String getSessionCookie()
Return the session cookie associated with this lightweight session

Specified by:
getSessionCookie in interface LwsSession
Returns:
the lightweight session's cookie

getUser

public ApplUser getUser()
Returns the current ApplUser object.

Specified by:
getUser in interface LwsSession

getRoles

public java.util.List<ApplRole> getRoles()
Returns a List representing the user's active roles.

Specified by:
getRoles in interface LwsSession

getRoles

public java.util.List<ApplRole> getRoles(java.lang.String appID,
                                         java.sql.Connection conn)
Takes in an application ID and a connection. If the app ID has already been loaded, then returns an empty list. If not, it returns the list of the current session roles, for use in merging to the new application stripe's roles later.


loadAppRoles

public void loadAppRoles(java.sql.Connection conn)
Loads the application roles for crm, fscm, and hcm into the current session's roles.

Parameters:
conn - the connection to use when updating the session

getUserGuid

public java.lang.String getUserGuid()
This returns the current applications user ID.

Returns:
the current user GUID as a String

getUserName

public java.lang.String getUserName()
This returns the current application user name.

Returns:
the current user name as a String

getEnterpriseID

public java.lang.String getEnterpriseID()
Return the current Enterprise ID

Returns:
the current Enterprise ID as a String

getEnterpriseName

public java.lang.String getEnterpriseName()
Return the current Enterprise Name

Returns:
the current Enterprise Name as a String

getProductFamily

public java.lang.String getProductFamily()
Return the current ProductFamily

Returns:
the current Product Family as a String

getProduct

public java.lang.String getProduct()
Return the current Product

Returns:
the current Product as a String

getIndustry

public java.lang.String getIndustry()
Return the current Industry

Returns:
the current Industry as a String

getTerritory

public java.lang.String getTerritory()
Fetch the current territory setting. This is not the same as the database NLS_TERRITORY property.

Returns:
the TERRITORY as a String

getAddtlCustomLevel

public java.lang.String getAddtlCustomLevel()
Return the current Additional Custom Level

Returns:
the current Additional Custom Level as a String

getSite

public java.lang.String getSite()
Return the current Site

Returns:
the current Site as a String

getIndustryInTerritory

public java.lang.String getIndustryInTerritory()
Return the current Industry In Territory

Returns:
the current Industry In Territory as a String

getGlobal

public java.lang.String getGlobal()
Return the constant "GLOBAL"

Returns:
"GLOBAL"

getHistoryOverrideUserName

public java.lang.String getHistoryOverrideUserName()
If the current session is being run by an administrator on behalf of another user, this returns the guid associated with the user originating the request.

Returns:
the GUID of the user originating the session

getApplicationID

public java.lang.Integer getApplicationID()
Return the current application ID. Derived from the Product, this is listed as a separate property for backwards compatibility.

Returns:
the current application ID as an Integer

getApplicationShortName

public java.lang.String getApplicationShortName()
Return the current application short name. Derived from the Product, this is listed as a separate property for backwards compatibility.

Returns:
the current application short name as a String

getLanguage

public java.lang.String getLanguage()
Fetch the user's current language - this does not return the the database language, instead it returns the middle-tier language 'tag' representation. For example, 'en', 'fr', 'es-US'.

Returns:
the LANGUAGE tag as a String

getNLSLang

public java.lang.String getNLSLang()
Fetch the NLS_LANG value. This returns the language code associated with the current language tag in the database. Generally speaking, it is expected that the in the java layer we will not be dealing with database values, and instead be dealing with the java language (see the getLanguage() api). The NLS_LANG can also be retrieved by calling: import oracle.apps.fnd.applcore.i18n.util.LanguageMapper String OraLangCode = LanguageMapper.getOracleLanguageCode(LanguageMapper.APPS, ApplSessionUtil.getLanguage()) This eventually may be deprecated in favor of the LanguageMapper api.

Returns:
the NLS_LANG as a String

getNLSLanguage

public java.lang.String getNLSLanguage()
Fetch the NLS_LANGUAGE value. This returns the language associated with the current language tag in the database. Generally speaking, it is expected that the in the java layer we will not be dealing with database values, and instead be dealing with the java language (see the getLanguage() api).

Returns:
the NLS_LANGUAGE as a String

getNLSSort

public java.lang.String getNLSSort()
Fetch the sorting behavior. This value corresponds to the NLS_SORT setting in the database.

Returns:
the sorting behavior as a String

getDateFormat

public java.lang.String getDateFormat()
Fetch the formatting string for date values. This returns the java format, not the NLS_DATE_FORMAT value from the database.

Returns:
the date format as a String

getTimeFormat

public java.lang.String getTimeFormat()
Fetch the formatting string for date values. This returns the java format, not the NLS_TIME_FORMAT value from the database.

Returns:
the time format as a String

getGroupingSeparator

public char getGroupingSeparator()
Fetch the character used as the grouping separator.

Returns:
the grouping separator character

getDecimalSeparator

public char getDecimalSeparator()
Fetch the character used as the decimal separator.

Returns:
the decimal separator character

getClientEncoding

public java.lang.String getClientEncoding()
Fetch the current client encoding. This does not correspond to a database property.

Returns:
the CLIENT_ENCODING as a String

getCurrency

public java.lang.String getCurrency()
Fetch the current currency. This does not correspond to a database property.

Returns:
the CURRENCY as a String

getTimeZone

public java.lang.String getTimeZone()
Fetch the value of the current timezone. This does not correspond to a database property.

Returns:
the TIMEZONE as a String

getDisplayNameLanguage

public java.lang.String getDisplayNameLanguage()
Fetch the value of the language for displaying the user name.

Returns:
the DISPLAY_NAME_LANGUAGE as a String

getUserDisplayName

public java.lang.String getUserDisplayName()
Fetch the display name for the user, based on the DISPLAY_NAME_LANGUAGE

Returns:
the USER_DISPLAY_NAME as a String

getLogoutURL

public java.lang.String getLogoutURL()
Fetch the logout URL for the current session, if defined.

Returns:
the LOGOUT_URL as a String

getFUSEUserFlag

public java.lang.String getFUSEUserFlag()
Fetch the FUSE user flag for the current session, if defined.

Returns:
the FUSE user flag as a String

getTraceLevel

public java.lang.Integer getTraceLevel()
Tracing attributes - return the current TRACE_LEVEL.

Returns:
the current TRACE_LEVEL

getModule

public java.lang.String getModule()
Tracing attributes - return the current MODULE.

Returns:
the current MODULE

getAction

public java.lang.String getAction()
Tracing attributes - return the current ACTION.

Returns:
the current ACTION

getAccessibilityMode

public java.lang.String getAccessibilityMode()
Get the current accessibility mode

Returns:
the current ACCESSIBILITY_MODE

getAppStripes

public java.lang.String getAppStripes()
Return the internal code indicating which applications stripes we have loaded roles for. Internal method, can be removed at any time. Please do not use it. You risk regressions.


isProxy

public boolean isProxy()
Get the whether it's a proxy session

Returns:

getImpersonatorUserName

public java.lang.String getImpersonatorUserName()
Returns the impersonator user name if it's a proxy session

Returns:

getSandboxID

public java.lang.String getSandboxID()
Get the current sandbox ID

Returns:
the current USER_SANDBOX_ID

setProductFamily

public void setProductFamily(java.lang.String pProductFamily)
Update the Product Family of the current session


setProduct

public void setProduct(java.lang.String pProduct)
Update the Product of the current session


setIndustry

public void setIndustry(java.lang.String pIndustry)
Update the Industry of the current session.


setTerritory

public void setTerritory(java.lang.String pTerritory)
Update the current territory. This will only change the session level property, it will not affect the database session's NLS_TERRITORY setting.

Parameters:
pTerritory -

setAddtlCustomLevel

public void setAddtlCustomLevel(java.lang.String pAdditionalCustomLevel)
Update the Additional Custom Level of the current session.


setIndustryInTerritory

public void setIndustryInTerritory(java.lang.String pIndustryInTerritory)
Update the Industry In Territory of the current session.


setHistoryOverrideUserName

public void setHistoryOverrideUserName(java.lang.String pOverrideUserName)
Set the history override user name, indicating that the current session is being run on behalf of another user.


setLanguage

public void setLanguage(java.lang.String pLanguage)
Set the session's language, and also update the session language in the database. This results in an immediate round trip to the database.

Parameters:
pLanguage - the language tag to set the session's language to

setNLSSort

public void setNLSSort(java.lang.String pNLSSort)
Set the sorting value. This is will cause the NLS_SORT to be altered in the database as a result.

Parameters:
pNLSSort -

setDateFormat

public void setDateFormat(java.lang.String pDateFormat)
Set the value of the date format. This will only change the session level property, it will not affect the database session's NLS_DATE_FORMAT setting.

Parameters:
pDateFormat -

setTimeFormat

public void setTimeFormat(java.lang.String pTimeFormat)
Set the value of the time format. This will only change the session level property, it will not affect the database session's NLS_TIME_FORMAT setting.

Parameters:
pTimeFormat -

setGroupingSeparator

public void setGroupingSeparator(char pGroupingSeparator)
Set the value of the GROUPING_SEPARATOR. This will only change the session level property, it will not affect the database session's NLS_NUMERIC_CHARACTERS setting.

Parameters:
pGroupingSeparator -

setDecimalSeparator

public void setDecimalSeparator(char pDecimalSeparator)
Set the value of the DECIMAL_SEPARATOR. This will only change the session level property, it will not affect the database session's NLS_NUMERIC_CHARACTERS setting.

Parameters:
pDecimalSeparator -

setClientEncoding

public void setClientEncoding(java.lang.String pClientEncoding)
Set the client encoding. There is no corresponding database property.

Parameters:
pClientEncoding -

setCurrency

public void setCurrency(java.lang.String pCurrency)
Set the currency. There is no corresponding database property.

Parameters:
pCurrency -

setTimeZone

public void setTimeZone(java.lang.String pTimeZone)
Set the value of the current timezone. This does not correspond to a database property.

Parameters:
pTimeZone -

setUserDisplayName

public void setUserDisplayName(java.lang.String pUserDisplayName)
Set the value of the current user display name

Parameters:
pUserDisplayName -

setDisplayNameLanguage

public void setDisplayNameLanguage(java.lang.String pLanguage)
Set the value of the language to display the current username.

Parameters:
pLanguage -

setLogoutURL

public void setLogoutURL(java.lang.String pLogoutURL)
Set the logout URL for the current session. If this is invoked multiple times, whatever it is set to last will end up being used for the logout.

Parameters:
pLogoutURL -

setFUSEUserFlag

public void setFUSEUserFlag(java.lang.String flag)
Sets the FUSE user flag for the current session

Parameters:
flag - - typically, it should be 'Y' or 'N'.

setTraceLevel

public void setTraceLevel(int pTraceLevel)
Enable the tracing level. Valid values are defined in the FND_TRACE package: 1 - DB trace 5 - DB trace with bind 9 - DB trace with wait 13 - DB trace with bind and wait 16 - PL/SQL profile 17 - DB trace + PL/SQL profile 21 - DB trace with bind + PL/SQL profile 25 - DB trace with wait + PL/SQL profile 29 - DB trace with bind and wait + PL/SQL profile

Parameters:
pTraceLevel -

setModule

public void setModule(java.lang.String pModule)
Set the current module (used for tracing)

Parameters:
pModule -

setAction

public void setAction(java.lang.String pAction)
Set the current action (used for tracing)

Parameters:
pAction -

setTraceInfo

public void setTraceInfo(int pTraceLevel,
                         java.lang.String pModule,
                         java.lang.String pAction)
For convenience (and in the future performance), this allows you to set all three tracing attributes in one call.

Parameters:
pTraceLevel -
pModule -
pAction -
See Also:
setTraceLevel(int), setModule(String), setAction(String)

setAccessibilityMode

public void setAccessibilityMode(java.lang.String pAccessibilityMode)
Set the current accessibility mode

Parameters:
pAccessibilityMode -

setSandboxID

public void setSandboxID(java.lang.String pSandboxID)
Set the sandbox ID

Parameters:
pSandboxID -

loadNamespace

public void loadNamespace(java.lang.String nameSpace,
                          java.sql.Connection conn)
Internal API, created initially for BI usage. This should only be called with a connection that has been initialized (ie attached).


namespaceLoaded

public boolean namespaceLoaded(java.lang.String namespace)
Returns true if the namespace has ever been loaded


getSessionNamespace

public ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName,
                                                java.sql.Connection conn,
                                                boolean refetch)
Returns the specified namespace. This used to return a newly created namespace object each and every time, but now returns a pointer directly to the session's current namespace. Most times applications will be expected to just use the getNamespaceAttribute and getSessionAttribute calls directly.

Parameters:
namespaceName - the name of the namespace
conn - ou can pass a connection to avoid having to obtain a new one
refetch - true if you want to force this namespace to be retrieved from the database instead of the cache
Returns:
the ApplSessionNamespace object

getSessionNamespace

public ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName,
                                                boolean refetch)
Returns the specified namespace. The refetch can be passed to force the namespace to be refetched from the database. Most times applications will be expected to just use the getNamespaceAttribute and getSessionAttribute calls directly.


getNamespaceNames

public java.util.List<java.lang.String> getNamespaceNames(java.sql.Connection conn)
Return a list of the names of namespaces associated with this session. If null is passed, then this call will get (and release) a db connection unless the namespace names have already been fetched.


getSessionNamespace

public ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName)
Returns the specified namespace. This used to return a newly created namespace object each and every time, but now returns a pointer directly to the session's current namespace. Most times applications will be expected to just use the getNamespaceAttribute and getSessionAttribute calls directly.

Specified by:
getSessionNamespace in interface LwsSession
Parameters:
namespaceName - the name of the namespace
Returns:
the ApplSessionNamespace object
See Also:
getSessionNamespace(String, boolean)

getNamespaceAttribute

public java.lang.String getNamespaceAttribute(java.lang.String namespaceName,
                                              java.lang.String attrName)
Return the value from the specified namespace. Throws an exception if the session or the namespace do not exist. Currently returns null if the attribute passed in does not exist. ### do we want to return some constant indicating the parameter ### was undefined? or just provide a separate 'isdefined' method?

Parameters:
namespaceName - then namespace name
attrName - the attribute name
Returns:
the value of the attribute as a String

getNamespaceAttributeNum

public java.lang.Integer getNamespaceAttributeNum(java.lang.String namespaceName,
                                                  java.lang.String attrName)
Return the value from the specified namespace as an Integer. Throws an exception if the session or the namespace do not exist. Currently returns null if the attribute passed in does not exist. ### do we want to return some constant indicating the parameter ### was undefined? or just provide a separate 'isdefined' method?

Parameters:
namespaceName - then namespace name
attrName - the attribute name
Returns:
the value of the attribute as an Integer

setNamespaceAttribute

public java.lang.String setNamespaceAttribute(java.lang.String namespaceName,
                                              java.lang.String attrName,
                                              java.lang.String attrValue)
Set the value on the specified namespace. Throws an exception if the session or the namespace do not exist. We also may disallow using this to set sessions on the namespaces owned by FND.

Parameters:
namespaceName - then namespace name
attrName - the attribute name
attrValue - the attribute value
Returns:
the attrValue, if properly set

getSessionAttribute

public java.lang.String getSessionAttribute(java.lang.String attrName)
Return the specified attribute from the FND_SESSION_NAMESPACE.

Parameters:
attrName - the name of the attribute to fetch
Returns:
the associated session attribute as a String

setSessionAttribute

public java.lang.String setSessionAttribute(java.lang.String attrName,
                                            java.lang.String attrValue)
Set the specified attribute on the lightweight session's FND_SESSION_NAMESPACE.

Parameters:
attrName - the name of the attribute to set
attrValue - the value to set the attribute to
Returns:
the attribute value, if properly set

initializeNamespace

public ApplSessionNamespace initializeNamespace(java.lang.String namespaceName)
Initialize a namespace for this session. The FND_SECURITY and FND_SESSION namespaces will be initialized by default.

Parameters:
namespaceName - the name of the namespace to initialize
Returns:
a handle to the newly initialized namespace

checkSession

public boolean checkSession()
Check that the current session ID of this ApplSession object exists in the database and is valid. All session management API's, including this one, are expected to be called by applcore code only. Implementation of LwsSession interface.

Specified by:
checkSession in interface LwsSession
Returns:
a boolean indicating if the current session is valid

checkSession

public boolean checkSession(java.sql.Connection conn)
Check that the current session ID of this ApplSession object exists in the database and is valid. All session management API's, including this one, are expected to be called by applcore code only. Implementation of LwsSession interface.

Specified by:
checkSession in interface LwsSession
Parameters:
conn - the database connection to perform this check in
Returns:
a boolean indicating if the current session is valid

checkSessionIDExists

public boolean checkSessionIDExists(java.sql.Connection conn)
Check if the Session ID Exists in DB to avoid clashes. Bug: 9527297: In context interceptor the Session ID needs to be propagated if passed. But if the Session ID exists then to avoid Key clashes a new Session ID needs to be generated.

Parameters:
conn -
Returns:

attachSession

public void attachSession(java.sql.Connection conn)
Initializes the specified connection with the current session info.

Specified by:
attachSession in interface LwsSession
Parameters:
conn - the database connection to attach to

attachSession

public void attachSession(java.sql.Connection conn,
                          LwsUser lwsUser,
                          java.util.List<? extends LwsRole> roles,
                          java.util.HashMap attrs)
Initializes the specified connection with the current session info. If the user or role list are null, they are ignored. If passed then the session will be updated accordingly. If session conversion is required, then the roles must be passed in. All session management API's, including this one, are expected to be called by applcore code only.

Parameters:
conn - the database connection to attach to
lwsUser - an instance of ApplUser
roles - a List of ApplRole objects to attach to. Ignored if null.
attrs - a HashMap of session attributes to set

attachSession

public void attachSession(java.sql.Connection conn,
                          java.util.List<? extends LwsRole> roles)

attachSession

public void attachSession(java.sql.Connection conn,
                          LwsUser lwsUser,
                          java.util.List<? extends LwsRole> roles)
Description copied from interface: LwsSession
Attaches the LWS session of this context to a db connection using the specified user and roles.

Specified by:
attachSession in interface LwsSession

detachSession

public void detachSession()
Deprecated. 

The no argument detachSession used to detach from the session's current connection, but since we no longer have a current connection this is a no-op.

Specified by:
detachSession in interface LwsSession
See Also:
detachSession(java.sql.Connection)

detachSession

public void detachSession(java.sql.Connection conn)
Detach from the currently attached session, which will cause any changes made to session attributes to be made visible to any other session. If the session is already detached, this does nothing. ### should we commit on the detach? yes All session management API's, including this one, are expected to be called by applcore code only.


clearConnectionState

public static void clearConnectionState(java.sql.Connection conn)
This will clear out any leftover session state from a given connection. Normally, it is expected a session detach should have occurred (which will write any pending changes to the session as well), but this can be used in cases where the detach may not have occurred due to an error.


synchronize

public void synchronize()
This is called to cause any changes made to session attributes to get written to the database. Should be named synchronizeNamespace(), but leaving as is for backwards compatibility.


synchronize

public void synchronize(java.sql.Connection conn)
Version of synchronize that takes in a connection.


synchronizeSessionInfo

public void synchronizeSessionInfo(java.sql.Connection conn)
Synchronizes the session information. If this detects that any session attribute has changed since the last time the session was cached, it clears out all the cached info.


synchronizeWithDB

public void synchronizeWithDB()
Synchronizes both the namespaces as well as the session information.


synchronizeWithDB

public void synchronizeWithDB(java.sql.Connection conn)
Synchronizes both the namespaces as well as the session information.

Parameters:
conn - a database connection, does not need to be initialized

isAttached

public boolean isAttached()
Since we now decouple the session from its connection, this is meaningless. Hardcode to returning true.

Specified by:
isAttached in interface LwsSession
Returns:
TRUE

getSessionContext

public static oracle.j2ee.ws.common.context.ContextProvider getSessionContext()
For use by code from the BPEL layer only. This provides a representation of all the relevant apps state (from an applcore perspective) in the current session.

Returns:
An implementation of the ContextProvider interface

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAnimationEnabled

public java.lang.Boolean getAnimationEnabled()
Fetch the user preference attribute - AnimationEnabled.

Returns:
the current user's AnimationEnabled flag as Boolean

setAnimationEnabled

public void setAnimationEnabled(java.lang.Boolean pAnimationEnabled)
Set the user preference attribute - AnimationEnabled

Parameters:
pAnimationEnabled - - As Boolean

getEmbeddedHelpEnabled

public java.lang.Boolean getEmbeddedHelpEnabled()
Fetch the user preference attribute - EmbeddedHelpEnabled.

Returns:
the current user's EmbeddedHelpEnabled flag as Boolean

setEmbeddedHelpEnabled

public void setEmbeddedHelpEnabled(java.lang.Boolean pEmbeddedHelpEnabled)
Set the user preference attribute - EmbeddedHelpEnabled

Parameters:
pEmbeddedHelpEnabled - - As Boolean

setColorContrast

public void setColorContrast(java.lang.String pColorContrast)
Set the user preference attribute - ColorContrast

Parameters:
pColorContrast - - As String

getColorContrast

public java.lang.String getColorContrast()
Fetch the user preference attribute - ColorContrast.

Returns:
the current user's ColorContrast flag as String

setFontSize

public void setFontSize(java.lang.String pFontSize)
Set the user preference attribute - FontSize

Parameters:
pFontSize - - As String

getFontSize

public java.lang.String getFontSize()
Fetch the user preference attribute - FontSize.

Returns:
the current user's FontSize flag as String

setApplicationLanguage

public void setApplicationLanguage(java.lang.String pApplicationLanguage)
Set the user preference attribute - ApplicationLanguage

Parameters:
pApplicationLanguage - - the language tag as String

getApplicationLanguage

public java.lang.String getApplicationLanguage()
Fetch the user preference attribute - ApplicationLanguage.

Returns:
the current user's language tag as String

setNumberFormat

public void setNumberFormat(java.lang.String pNumberFormat)
Set the user preference attribute - NumberFormat

Parameters:
pNumberFormat - - the Number Format as String

getNumberFormat

public java.lang.String getNumberFormat()
Fetch the user preference attribute - NumberFormat.

Returns:
the current user's Number Format as String

getIntegerFormat

public java.lang.String getIntegerFormat()
Fetch the user preference attribute - IntegerFormat. This is derived from the NumberFormat - it cannot be set as a separate property. If the number format does not contain a decimal separator, or a decimal separator is not specified, this just returns the number format.

Returns:
the current user's Integer Format as String

isLogEnabled

public static boolean isLogEnabled(java.util.logging.Level logLevel)
For internal use - check if session logging is enabled.


log

public static void log(java.util.logging.Level logLevel,
                       java.lang.String logMessage)
For internal use only - log to the session logger

Parameters:
logLevel - the level to log at
logMessage - the message to log

log

public static void log(java.util.logging.Level logLevel,
                       java.lang.String logMessage,
                       java.lang.Throwable logException)
For internal use only - log to the session logger

Parameters:
logLevel - the level to log at
logMessage - the message to log
logException - the exception to log

logStackTrace

public static void logStackTrace(java.util.logging.Level logLevel,
                                 java.lang.String logMessage)
For internal use only - log to the session logger and generate a debug exception to print out the current stack trace.

Parameters:
logLevel - the level to log at
logMessage - the message to log

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

E22562-07

Copyright © 2013 Oracle. All Rights Reserved.