|
Oracle Fusion Middleware extensions for Applications Core API Reference 11g Release 1 (11.1.1.5) E22562-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.apps.fnd.applcore.common.ApplSession
public final class ApplSession
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.
The JAZN layer is still responsible for authenticating and authorizing the user. But once authorized, the ApplSession code takes care of 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.
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. |
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 |
getFontSize()
Fetch the user preference attribute - FontSize. |
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 |
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 |
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. |
boolean |
isProxy()
Get the whether it's a proxy session |
void |
loadNamespace(java.lang.String nameSpace,
java.sql.Connection conn)
Internal API, created initially for BI usage. |
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 |
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 |
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 |
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 |
---|
public static final java.lang.String APPLICATION_DB
public static final java.lang.String APPLICATION_ENV_DB_DS
public static final java.lang.String APPLICATION_DB_DS
public static boolean s_debugConn
public static boolean s_debugNS
public static boolean s_debugSess
Constructor Detail |
---|
public ApplSession(java.lang.String sessionID, java.lang.String sessionCookie)
public ApplSession(java.lang.String sessionID, java.lang.String sessionCookie, ApplUser user, java.util.List<ApplRole> roles)
Method Detail |
---|
public java.sql.Connection getConnection()
getConnection
in interface LwsSession
detachSession(java.sql.Connection)
public void releaseConnection(java.sql.Connection conn)
conn
- the connection obtained by getConnection() to releasepublic java.lang.String getSessionID()
getSessionID
in interface LwsSession
public java.lang.String getSessionCookie()
getSessionCookie
in interface LwsSession
public ApplUser getUser()
getUser
in interface LwsSession
public java.util.List<ApplRole> getRoles()
getRoles
in interface LwsSession
public java.util.List<ApplRole> getRoles(java.lang.String appID, java.sql.Connection conn)
public java.lang.String getUserGuid()
public java.lang.String getUserName()
public java.lang.String getEnterpriseID()
public java.lang.String getProductFamily()
public java.lang.String getProduct()
public java.lang.String getIndustry()
public java.lang.String getTerritory()
public java.lang.String getAddtlCustomLevel()
public java.lang.String getSite()
public java.lang.String getIndustryInTerritory()
public java.lang.String getGlobal()
public java.lang.String getHistoryOverrideUserName()
public java.lang.Integer getApplicationID()
public java.lang.String getApplicationShortName()
public java.lang.String getLanguage()
public java.lang.String getNLSLang()
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.
public java.lang.String getNLSLanguage()
public java.lang.String getNLSSort()
public java.lang.String getDateFormat()
public java.lang.String getTimeFormat()
public char getGroupingSeparator()
public char getDecimalSeparator()
public java.lang.String getClientEncoding()
public java.lang.String getCurrency()
public java.lang.String getTimeZone()
public java.lang.String getDisplayNameLanguage()
public java.lang.Integer getTraceLevel()
public java.lang.String getModule()
public java.lang.String getAction()
public java.lang.String getAccessibilityMode()
public java.lang.String getAppStripes()
public boolean isProxy()
public java.lang.String getImpersonatorUserName()
public java.lang.String getSandboxID()
public void setProductFamily(java.lang.String pProductFamily)
public void setProduct(java.lang.String pProduct)
public void setIndustry(java.lang.String pIndustry)
public void setTerritory(java.lang.String pTerritory)
pTerritory
- public void setAddtlCustomLevel(java.lang.String pAdditionalCustomLevel)
public void setIndustryInTerritory(java.lang.String pIndustryInTerritory)
public void setHistoryOverrideUserName(java.lang.String pOverrideUserName)
public void setLanguage(java.lang.String pLanguage)
pLanguage
- the language tag to set the session's language topublic void setNLSSort(java.lang.String pNLSSort)
pNLSSort
- public void setDateFormat(java.lang.String pDateFormat)
pDateFormat
- public void setTimeFormat(java.lang.String pTimeFormat)
pTimeFormat
- public void setGroupingSeparator(char pGroupingSeparator)
pGroupingSeparator
- public void setDecimalSeparator(char pDecimalSeparator)
pDecimalSeparator
- public void setClientEncoding(java.lang.String pClientEncoding)
pClientEncoding
- public void setCurrency(java.lang.String pCurrency)
pCurrency
- public void setTimeZone(java.lang.String pTimeZone)
pTimeZone
- public void setDisplayNameLanguage(java.lang.String pLanguage)
pLanguage
- public void setTraceLevel(int pTraceLevel)
pTraceLevel
- public void setModule(java.lang.String pModule)
pModule
- public void setAction(java.lang.String pAction)
pAction
- public void setTraceInfo(int pTraceLevel, java.lang.String pModule, java.lang.String pAction)
pTraceLevel
- pModule
- pAction
- setTraceLevel(int)
,
setModule(String)
,
setAction(String)
public void setAccessibilityMode(java.lang.String pAccessibilityMode)
pAccessibilityMode
- public void setSandboxID(java.lang.String pSandboxID)
pSandboxID
- public void loadNamespace(java.lang.String nameSpace, java.sql.Connection conn)
public boolean namespaceLoaded(java.lang.String namespace)
public ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName, java.sql.Connection conn, boolean refetch)
namespaceName
- the name of the namespaceconn
- ou can pass a connection to avoid having to obtain a new onerefetch
- true if you want to force this namespace to be
retrieved from the database instead of the cache
public ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName, boolean refetch)
public java.util.List<java.lang.String> getNamespaceNames(java.sql.Connection conn)
public ApplSessionNamespace getSessionNamespace(java.lang.String namespaceName)
getSessionNamespace
in interface LwsSession
namespaceName
- the name of the namespace
getSessionNamespace(String, boolean)
public java.lang.String getNamespaceAttribute(java.lang.String namespaceName, java.lang.String attrName)
namespaceName
- then namespace nameattrName
- the attribute name
public java.lang.Integer getNamespaceAttributeNum(java.lang.String namespaceName, java.lang.String attrName)
namespaceName
- then namespace nameattrName
- the attribute name
public java.lang.String setNamespaceAttribute(java.lang.String namespaceName, java.lang.String attrName, java.lang.String attrValue)
namespaceName
- then namespace nameattrName
- the attribute nameattrValue
- the attribute value
public java.lang.String getSessionAttribute(java.lang.String attrName)
attrName
- the name of the attribute to fetch
public java.lang.String setSessionAttribute(java.lang.String attrName, java.lang.String attrValue)
attrName
- the name of the attribute to setattrValue
- the value to set the attribute to
public ApplSessionNamespace initializeNamespace(java.lang.String namespaceName)
namespaceName
- the name of the namespace to initialize
public boolean checkSession()
checkSession
in interface LwsSession
public boolean checkSession(java.sql.Connection conn)
checkSession
in interface LwsSession
conn
- the database connection to perform this check in
public boolean checkSessionIDExists(java.sql.Connection conn)
conn
-
public void attachSession(java.sql.Connection conn)
attachSession
in interface LwsSession
conn
- the database connection to attach topublic void attachSession(java.sql.Connection conn, LwsUser lwsUser, java.util.List<? extends LwsRole> roles, java.util.HashMap attrs)
conn
- the database connection to attach tolwsUser
- an instance of ApplUserroles
- a List of ApplRole objects to attach to. Ignored if null.attrs
- a HashMap of session attributes to setpublic void attachSession(java.sql.Connection conn, java.util.List<? extends LwsRole> roles)
public void attachSession(java.sql.Connection conn, LwsUser lwsUser, java.util.List<? extends LwsRole> roles)
LwsSession
attachSession
in interface LwsSession
public void detachSession()
detachSession
in interface LwsSession
detachSession(java.sql.Connection)
public void detachSession(java.sql.Connection conn)
public void synchronize()
public void synchronize(java.sql.Connection conn)
public void synchronizeSessionInfo(java.sql.Connection conn)
public void synchronizeWithDB()
public void synchronizeWithDB(java.sql.Connection conn)
conn
- a database connection, does not need to be initializedpublic boolean isAttached()
isAttached
in interface LwsSession
public static oracle.j2ee.ws.common.context.ContextProvider getSessionContext()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Boolean getAnimationEnabled()
public void setAnimationEnabled(java.lang.Boolean pAnimationEnabled)
pAnimationEnabled
- - As Booleanpublic java.lang.Boolean getEmbeddedHelpEnabled()
public void setEmbeddedHelpEnabled(java.lang.Boolean pEmbeddedHelpEnabled)
pEmbeddedHelpEnabled
- - As Booleanpublic void setColorContrast(java.lang.String pColorContrast)
pColorContrast
- - As Stringpublic java.lang.String getColorContrast()
public void setFontSize(java.lang.String pFontSize)
pFontSize
- - As Stringpublic java.lang.String getFontSize()
public void setApplicationLanguage(java.lang.String pApplicationLanguage)
pApplicationLanguage
- - the language tag as Stringpublic java.lang.String getApplicationLanguage()
public void setNumberFormat(java.lang.String pNumberFormat)
pNumberFormat
- - the Number Format as Stringpublic java.lang.String getNumberFormat()
public java.lang.String getIntegerFormat()
|
Oracle Fusion Middleware extensions for Applications Core API Reference 11g Release 1 (11.1.1.5) E22562-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |