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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceContextgetServiceContext(javax.servlet.http.HttpServletRequest q_) static ServiceContextgetServiceContext(javax.servlet.http.HttpServletRequest q_, com.appiancorp.services.ASLIdentity id_) Gets theServiceContextfor the request andASLIdentity.static ServiceContextgetServiceContext(javax.servlet.http.HttpServletRequest q_, String username_, String grantorUsername) Get theServiceContextfor the request and username.static ServiceContextgetServiceContext(javax.servlet.http.HttpSession session_) Gets theASLIdentityfrom the session and gets a service context for it.static ServiceContextgetServiceContext(javax.servlet.http.HttpSession session_, com.appiancorp.services.ASLIdentity id, String grantorUsername) Gets theServiceContextfor 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 theServiceContextassociated with the user data in theHttpServletRequest'sHttpSession. If there is noServiceContextassociated with the user data, it creates a newWebServiceContextfor 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 theServiceContextfor 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 theServiceContextfor 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 theASLIdentityargument, 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 theASLIdentityfrom the session and gets a service context for it. If there is noASLIdentityin 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 theServiceContextfor 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 theASLIdentityargument, returns the context. If the context's username is different or no context exists, return a newWebServiceContext.- Parameters:
session_- the sessionid- theASLIdentitygrantorUsername-- Returns:
- the context
-