Package com.appiancorp.services
Class WebServiceContextFactory
java.lang.Object
com.appiancorp.services.ServiceContextFactory
com.appiancorp.services.WebServiceContextFactory
Used to manufacture the
ServiceContext
used within the product
and in other web applications.-
Field Summary
Fields inherited from class com.appiancorp.services.ServiceContextFactory
ADMIN_USERNAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceContext
getServiceContext
(javax.servlet.http.HttpServletRequest q_) static ServiceContext
getServiceContext
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.services.ASLIdentity id_) Gets theServiceContext
for the request andASLIdentity
.static ServiceContext
getServiceContext
(javax.servlet.http.HttpServletRequest q_, String username_, String grantorUsername) Get theServiceContext
for the request and username.static ServiceContext
getServiceContext
(javax.servlet.http.HttpSession session_) Gets theASLIdentity
from the session and gets a service context for it.static ServiceContext
getServiceContext
(javax.servlet.http.HttpSession session_, com.appiancorp.services.ASLIdentity id, String grantorUsername) Gets theServiceContext
for the session andASLIdentity
.Methods inherited from class com.appiancorp.services.ServiceContextFactory
areI18nSettingsPopulated, createEscalatedServiceContext, createEscalatedServiceContext, getAdministratorServiceContext, getAdministratorServiceContextForMigration, getAdministratorUser, getServiceContext, getServiceContext, getUser, populateServiceContextI18nSettings, populateServiceContextI18nSettings, populateServiceContextI18nSettings
-
Constructor Details
-
WebServiceContextFactory
public WebServiceContextFactory()
-
-
Method Details
-
getServiceContext
Gets theServiceContext
associated with the user data in theHttpServletRequest
'sHttpSession
. If there is noServiceContext
associated with the user data, it creates a newWebServiceContext
for the web session. If there is no user data in theHttpSession
, it returnsnull
.- Parameters:
q_
- the request- Returns:
- the service context
-
getServiceContext
public static ServiceContext getServiceContext(javax.servlet.http.HttpServletRequest q_, String username_, String grantorUsername) Get theServiceContext
for the request and username. If the request has a context associated with it and the context's username is the same as the username passed in, returns the context. If the context's username is different or no context exists, return a newWebServiceContext
.- Parameters:
q_
- the requestusername_
- the web user's usernamegrantorUsername
- the name of the user granting privilege escalation- Returns:
- the context
-
getServiceContext
public static ServiceContext getServiceContext(javax.servlet.http.HttpServletRequest q_, com.appiancorp.services.ASLIdentity id_) Gets theServiceContext
for the request andASLIdentity
. If the request has a context associated with it and the context's username is the same as the username associated with theASLIdentity
argument, returns the context. If the context's username is different or no context exists, return a newWebServiceContext
.- Parameters:
q_
- the requestid_
- theASLIdentity
- Returns:
- the context
-
getServiceContext
Gets theASLIdentity
from the session and gets a service context for it. If there is noASLIdentity
in the session, returnsnull
.- Parameters:
session_
- the session- Returns:
- the context
-
getServiceContext
public static ServiceContext getServiceContext(javax.servlet.http.HttpSession session_, com.appiancorp.services.ASLIdentity id, String grantorUsername) Gets theServiceContext
for the session andASLIdentity
. If the session has a context associated with it and the context's username is the same as the username associated with theASLIdentity
argument, returns the context. If the context's username is different or no context exists, return a newWebServiceContext
.- Parameters:
session_
- the sessionid
- theASLIdentity
grantorUsername
-- Returns:
- the context
-