Package org.intermine.web.logic.session
Class SessionMethods
- java.lang.Object
-
- org.intermine.web.logic.session.SessionMethods
-
public final class SessionMethods extends java.lang.Object
Business logic that interacts with session data. These methods are generally called by actions to perform business logic. Obviously, a lot of the business logic happens in other parts of intermine, called from here, then the users session is updated accordingly.- Author:
- Thomas Riley
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.Logger
LOG
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PagedTable
doQueryGetPagedTable(javax.servlet.http.HttpServletRequest request, InterMineBag imBag)
Execute a query and return a PagedTable to display contents of an InterMineBagstatic PagedTable
doQueryGetPagedTable(javax.servlet.http.HttpServletRequest request, InterMineObject obj, java.lang.String field, java.lang.String referencedClassName)
Execute a query and return a PagedTable to display contents of a Collection, field of a given InterMineObject.static java.util.Map<java.lang.String,Aspect>
getAspects(javax.servlet.ServletContext servletContext)
Returns the Map of aspects.static AutoCompleter
getAutoCompleter(javax.servlet.ServletContext servletContext)
Get the AutoCompleter stored on the ServletContext.static Instance
getBasicInstanceInfo(javax.servlet.http.HttpSession session)
Get the instance to usestatic java.util.Set<java.lang.String>
getCategories(javax.servlet.ServletContext servletContext)
Gets the aspect categories from the servlet context.static java.lang.String
getDefaultOperator(javax.servlet.http.HttpSession session)
Get the default operator to apply to new constraints.static java.util.List<java.lang.String>
getEditingView(javax.servlet.http.HttpSession session)
Get the view list that the user is currently editing.static java.util.Map<java.lang.String,java.lang.String>
getErrorOnInitialiser(javax.servlet.ServletContext servletContext)
Gets the blocking error codes from the servlet context.static SearchRepository
getGlobalSearchRepository(javax.servlet.ServletContext context)
Get the SearchRepository for global (public) objects.static InterMineAPI
getInterMineAPI(javax.servlet.http.HttpServletRequest request)
Get the InterMineAPI which provides the core features of an InterMine application.static InterMineAPI
getInterMineAPI(javax.servlet.http.HttpSession session)
Get the InterMineAPI which provides access to core features of an InterMine application.static InterMineAPI
getInterMineAPI(javax.servlet.ServletContext servletContext)
Get the InterMineAPI which provides access to core features of an InterMine application.static java.util.Set<java.lang.String>
getOAuth2Providers(javax.servlet.http.HttpSession session)
Get the set of accepted Open-ID providers.static java.util.Set<java.lang.String>
getOpenIdProviders(javax.servlet.http.HttpSession session)
Get the set of accepted Open-ID providers.static Profile
getProfile(javax.servlet.http.HttpSession session)
Returns user profile saved in session.static java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getPropertiesOrigins(javax.servlet.http.HttpSession session)
Gets the origins map from the servlet context.static PathQuery
getQuery(javax.servlet.http.HttpServletRequest request)
Returns the PathQuery on the session.static PathQuery
getQuery(javax.servlet.http.HttpSession session)
Returns the PathQuery on the session.static ReportObjectFactory
getReportObjects(javax.servlet.http.HttpSession session)
Return the ReportObjects Map from the session or create and return it if it doesn't exist.static PagedTable
getResultsTable(javax.servlet.http.HttpSession session, java.lang.String identifier)
Given a table identifier, return the cached PagedTable.static QueryMonitor
getRunningQueryController(java.lang.String qid, javax.servlet.http.HttpSession session)
Get the QueryMonitor object corresponding to a running query id (qid).static WebConfig
getWebConfig(javax.servlet.http.HttpServletRequest request)
static WebConfig
getWebConfig(javax.servlet.ServletContext context)
static java.util.Properties
getWebProperties(javax.servlet.http.HttpServletRequest request)
Returns the web properties.static java.util.Properties
getWebProperties(javax.servlet.ServletContext servletContext)
Returns the web properties.static WebState
getWebState(javax.servlet.http.HttpSession session)
Get WebState object that is used for saving state of webapp GUI.static void
initSession(javax.servlet.http.HttpSession session)
Initialise a new session.static void
invalidateBagTable(javax.servlet.http.HttpSession session, java.lang.String name)
Remove a cached bag table from the session.static boolean
isErrorOnInitialiser(javax.servlet.ServletContext servletContext)
Return true if exists blocking errorsstatic boolean
isSuperUser(javax.servlet.http.HttpSession session)
Return true if and only if the current user if the superuser.static void
loadQuery(PathQuery query, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response)
Load a query into the session, cloning to avoid modifying the originalstatic void
logExampleQueryUse(javax.servlet.http.HttpSession session, java.lang.String exampleName)
Log load of an example query.static void
logQuery(javax.servlet.http.HttpSession session)
Before running a query via web services, add to query history and add a trackstatic void
logTemplateQueryUse(javax.servlet.http.HttpSession session, java.lang.String templateType, java.lang.String templateName)
Log use of a template query.static void
moveToRequest(java.lang.String attributeName, javax.servlet.http.HttpServletRequest request)
Move an attribute from the session to the request, removing it from the session.static void
recordError(java.lang.String error, javax.servlet.http.HttpSession session)
Record an error.static void
recordMessage(java.lang.String message, javax.servlet.http.HttpSession session)
Record a message that will be stored in the session until it is displayed to the user.static void
removeQuery(javax.servlet.http.HttpSession session)
Removes the current query from the session.static boolean
runQuery(javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources resources, java.lang.String qid, org.intermine.web.logic.session.SessionMethods.Action action, org.intermine.web.logic.session.SessionMethods.CompletionCallBack completionCallBack)
Executes an action and call a callback when it completes successfully.static void
saveQuery(javax.servlet.http.HttpSession session, java.lang.String queryName, PathQuery query)
Save a clone of a query to the user's Profile.static SavedQuery
saveQuery(javax.servlet.http.HttpSession session, java.lang.String queryName, PathQuery query, java.util.Date created)
Save a clone of a query to the user's Profile.static void
saveQueryToHistory(javax.servlet.http.HttpSession session, java.lang.String queryName, PathQuery query)
Save a clone of a query to the user's Profile history.static void
setAspects(javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,Aspect> aspects)
Sets the Map of aspects.static void
setAutoCompleter(javax.servlet.ServletContext servletContext, AutoCompleter ac)
Set the AutoCompleter into the ServletContext.static void
setBasicInstanceInfo(javax.servlet.ServletContext ctx, Instance instance)
Set the instance to use.static void
setCategories(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.String> categories)
Sets the aspect categories into the servlet context.static void
setErrorOnInitialiser(javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.lang.String> errorKey)
Sets the blocking error codes into the servlet context.static void
setGlobalSearchRepository(javax.servlet.ServletContext context, SearchRepository repo)
Set the SearchRepository for global (public) objects in the servlet context.static void
setInterMineAPI(javax.servlet.ServletContext servletContext, InterMineAPI im)
Sets the InterMineAPI in the servlet context.static void
setOAuth2Providers(javax.servlet.ServletContext ctx, java.util.Set<java.lang.String> providers)
Set the set of supported OAuth2 providers to use.static void
setOpenIdProviders(javax.servlet.ServletContext ctx, java.util.Set<java.lang.String> providers)
Set the set of supported Open-ID providers to use.static void
setProfile(javax.servlet.http.HttpSession session, Profile profile)
Sets the user profile in the session.static void
setPropertiesOrigins(javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.util.List<java.lang.String>> origins)
Sets the origins of the web properties on the servlet context.static void
setQuery(javax.servlet.http.HttpSession session, PathQuery query)
Set the current query on the session.static void
setResultsTable(javax.servlet.http.HttpSession session, java.lang.String identifier, PagedTable table)
static void
setWebConfig(javax.servlet.ServletContext context, WebConfig webConfig)
Sets the WebConfig into the ServletContext.static void
setWebProperties(javax.servlet.ServletContext servletContext, java.util.Properties props)
Sets the web properties in the session.static java.lang.String
startPagedTableCount(PageTableQueryMonitor monitor, javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources messages)
Start a query running in the background that will return the row count of the collection.static java.lang.String
startQuery(QueryMonitor monitor, javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources messages, boolean saveQuery, PathQuery pathQuery)
Start the current query running in the background, then return.static java.lang.String
startQueryCount(QueryCountQueryMonitor monitor, javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources messages)
Start a query running in the background that will return the row count of the query argument.static java.lang.String
startQueryWithTimeout(javax.servlet.http.HttpServletRequest request, boolean saveQuery, PathQuery pathQuery)
Start the given query running in the background, then return, with a default timeout.
-
-
-
Method Detail
-
runQuery
public static boolean runQuery(javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources resources, java.lang.String qid, org.intermine.web.logic.session.SessionMethods.Action action, org.intermine.web.logic.session.SessionMethods.CompletionCallBack completionCallBack) throws java.lang.Exception
Executes an action and call a callback when it completes successfully. If the query fails for some reason, this method returns false and ActionErrors are set on the request.- Parameters:
session
- the http sessionresources
- message resourcesqid
- the query idaction
- the action/query to perform in a new threadcompletionCallBack
- sets the method to call when the action successfully completes- Returns:
- true if query ran successfully, false if an error occured
- Throws:
java.lang.Exception
- if getting results info from paged results fails
-
loadQuery
public static void loadQuery(PathQuery query, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response)
Load a query into the session, cloning to avoid modifying the original- Parameters:
query
- the querysession
- the sessionresponse
- the response
-
getEditingView
public static java.util.List<java.lang.String> getEditingView(javax.servlet.http.HttpSession session)
Get the view list that the user is currently editing.- Parameters:
session
- current session- Returns:
- view list
-
saveQuery
public static SavedQuery saveQuery(javax.servlet.http.HttpSession session, java.lang.String queryName, PathQuery query, java.util.Date created)
Save a clone of a query to the user's Profile.- Parameters:
session
- The HTTP sessionqueryName
- the name to save the query underquery
- the PathQuerycreated
- creation date- Returns:
- the SavedQuery created
-
saveQuery
public static void saveQuery(javax.servlet.http.HttpSession session, java.lang.String queryName, PathQuery query)
Save a clone of a query to the user's Profile.- Parameters:
session
- The HTTP sessionqueryName
- the name to save the query underquery
- the PathQuery
-
saveQueryToHistory
public static void saveQueryToHistory(javax.servlet.http.HttpSession session, java.lang.String queryName, PathQuery query)
Save a clone of a query to the user's Profile history.- Parameters:
session
- The HTTP sessionqueryName
- the name to save the query underquery
- the PathQuery
-
recordMessage
public static void recordMessage(java.lang.String message, javax.servlet.http.HttpSession session)
Record a message that will be stored in the session until it is displayed to the user. This allows actions that result in a redirect to display messages to the user after the redirect. Messages are stored in a Collection session attribute so you may call this method multiple times to display multiple messages.recordMessage
andrecordError
are used byInterMineRequestProcessor.processForwardConfig
to store errors and messages in the session when a redirecting forward is about to occur.- Parameters:
session
- The Session object in which to store the messagemessage
- The message to store
-
recordError
public static void recordError(java.lang.String error, javax.servlet.http.HttpSession session)
Record an error.- Parameters:
error
- The error to storesession
- The Session object in which to store the message- See Also:
recordMessage(String, HttpSession)
-
logTemplateQueryUse
public static void logTemplateQueryUse(javax.servlet.http.HttpSession session, java.lang.String templateType, java.lang.String templateName)
Log use of a template query.- Parameters:
session
- The session of the user running the template querytemplateType
- The type of template 'global' or 'user'templateName
- The name of the template
-
logExampleQueryUse
public static void logExampleQueryUse(javax.servlet.http.HttpSession session, java.lang.String exampleName)
Log load of an example query. If user is not logged in then lo- Parameters:
session
- The session of the user loading the example queryexampleName
- The name of the example query loaded
-
getReportObjects
public static ReportObjectFactory getReportObjects(javax.servlet.http.HttpSession session)
Return the ReportObjects Map from the session or create and return it if it doesn't exist.- Parameters:
session
- the HttpSession to get the ReportObjects Map from- Returns:
- the (possibly new) ReportObjects Map
-
initSession
public static void initSession(javax.servlet.http.HttpSession session)
Initialise a new session. Adds a profile to the session.- Parameters:
session
- the new session to initialise
-
startQueryWithTimeout
public static java.lang.String startQueryWithTimeout(javax.servlet.http.HttpServletRequest request, boolean saveQuery, PathQuery pathQuery)
Start the given query running in the background, then return, with a default timeout. A new query id will be created and added to the RUNNING_QUERIES session attribute.- Parameters:
request
- the Http requestsaveQuery
- whether or not to automatically save the querypathQuery
- query to start- Returns:
- the new query id created
-
startQuery
public static java.lang.String startQuery(QueryMonitor monitor, javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources messages, boolean saveQuery, PathQuery pathQuery)
Start the current query running in the background, then return. A new query id will be created and added to the RUNNING_QUERIES session attribute. That attribute is a Map from query id to QueryMonitor. A Thread will be created to update the QueryMonitor.- Parameters:
monitor
- the monitor for this query - controls cancelling and receives feedback about how the query concludedsession
- the current http sessionmessages
- messages resources (for messages and errors)saveQuery
- whether or not to automatically save the querypathQuery
- query to start- Returns:
- the new query id created
-
logQuery
public static void logQuery(javax.servlet.http.HttpSession session) throws PathException
Before running a query via web services, add to query history and add a track- Parameters:
session
- User's session- Throws:
PathException
- if the path query is borked.
-
startPagedTableCount
public static java.lang.String startPagedTableCount(PageTableQueryMonitor monitor, javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources messages)
Start a query running in the background that will return the row count of the collection. A new query id will be created and added to the RUNNING_QUERIES session attribute. That attribute is a Map from query id to QueryMonitor. A Thread will be created to update the QueryMonitor.- Parameters:
monitor
- the monitor for this query - controls cancelling and receives feedback about how the query concludedsession
- the current http sessionmessages
- messages resources (for messages and errors)- Returns:
- the new query id
-
startQueryCount
public static java.lang.String startQueryCount(QueryCountQueryMonitor monitor, javax.servlet.http.HttpSession session, org.apache.struts.util.MessageResources messages)
Start a query running in the background that will return the row count of the query argument. A new query id will be created and added to the RUNNING_QUERIES session attribute. That attribute is a Map from query id to QueryMonitor. A Thread will be created to update the QueryMonitor.- Parameters:
monitor
- the monitor for this query - controls cancelling and receives feedback about how the query concludedsession
- the current http sessionmessages
- messages resources (for messages and errors)- Returns:
- the new query id created
-
getRunningQueryController
public static QueryMonitor getRunningQueryController(java.lang.String qid, javax.servlet.http.HttpSession session)
Get the QueryMonitor object corresponding to a running query id (qid).- Parameters:
qid
- the query id returned by startQuerysession
- the users session- Returns:
- QueryMonitor registered to the query id
-
getResultsTable
public static PagedTable getResultsTable(javax.servlet.http.HttpSession session, java.lang.String identifier)
Given a table identifier, return the cached PagedTable.- Parameters:
session
- the current sessionidentifier
- table identifier- Returns:
- PagedTable identified by identifier
-
setResultsTable
public static void setResultsTable(javax.servlet.http.HttpSession session, java.lang.String identifier, PagedTable table)
- Parameters:
session
- the current sessionidentifier
- table identifiertable
- table to register
-
invalidateBagTable
public static void invalidateBagTable(javax.servlet.http.HttpSession session, java.lang.String name)
Remove a cached bag table from the session.- Parameters:
session
- the current sessionname
- the bag name
-
getDefaultOperator
public static java.lang.String getDefaultOperator(javax.servlet.http.HttpSession session)
Get the default operator to apply to new constraints.- Parameters:
session
- the session- Returns:
- operator name ("and" or "or")
-
isSuperUser
public static boolean isSuperUser(javax.servlet.http.HttpSession session)
Return true if and only if the current user if the superuser.- Parameters:
session
- the session- Returns:
- true for superuser
-
moveToRequest
public static void moveToRequest(java.lang.String attributeName, javax.servlet.http.HttpServletRequest request)
Move an attribute from the session to the request, removing it from the session.- Parameters:
attributeName
- the attribute namerequest
- the current request
-
doQueryGetPagedTable
public static PagedTable doQueryGetPagedTable(javax.servlet.http.HttpServletRequest request, InterMineBag imBag) throws ObjectStoreException
Execute a query and return a PagedTable to display contents of an InterMineBag- Parameters:
request
- the requestimBag
- the InterMineBag- Returns:
- a PagedTable
- Throws:
ObjectStoreException
- thrown exception
-
doQueryGetPagedTable
public static PagedTable doQueryGetPagedTable(javax.servlet.http.HttpServletRequest request, InterMineObject obj, java.lang.String field, java.lang.String referencedClassName) throws ObjectStoreException
Execute a query and return a PagedTable to display contents of a Collection, field of a given InterMineObject.- Parameters:
request
- the ServletRequestobj
- the InterMineObjectfield
- the name of the collection field in the InterMineObjectreferencedClassName
- the type of the collection- Returns:
- a PagedTable
- Throws:
ObjectStoreException
- exception thrown
-
getWebConfig
public static WebConfig getWebConfig(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
- a HttpServletRequest- Returns:
- WebConfig
-
getWebConfig
public static WebConfig getWebConfig(javax.servlet.ServletContext context)
- Parameters:
context
- a ServletContext- Returns:
- WebConfig
-
setWebConfig
public static void setWebConfig(javax.servlet.ServletContext context, WebConfig webConfig)
Sets the WebConfig into the ServletContext.- Parameters:
context
- a ServletContextwebConfig
- a WebConfig object
-
getWebState
public static WebState getWebState(javax.servlet.http.HttpSession session)
Get WebState object that is used for saving state of webapp GUI.- Parameters:
session
- session- Returns:
- WebState
-
getProfile
public static Profile getProfile(javax.servlet.http.HttpSession session)
Returns user profile saved in session.- Parameters:
session
- session- Returns:
- user profile
-
setProfile
public static void setProfile(javax.servlet.http.HttpSession session, Profile profile)
Sets the user profile in the session.- Parameters:
session
- the sessionprofile
- a Profile object to put in the session
-
getAspects
public static java.util.Map<java.lang.String,Aspect> getAspects(javax.servlet.ServletContext servletContext)
Returns the Map of aspects.- Parameters:
servletContext
- a ServletContext object- Returns:
- a Map
-
setAspects
public static void setAspects(javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,Aspect> aspects)
Sets the Map of aspects.- Parameters:
servletContext
- a ServletContext objectaspects
- a Map
-
getWebProperties
public static java.util.Properties getWebProperties(javax.servlet.ServletContext servletContext)
Returns the web properties.- Parameters:
servletContext
- a ServletContext object- Returns:
- a Properties object
-
getWebProperties
public static java.util.Properties getWebProperties(javax.servlet.http.HttpServletRequest request)
Returns the web properties.- Parameters:
request
- The current HTTP request.- Returns:
- a Properties object
-
setWebProperties
public static void setWebProperties(javax.servlet.ServletContext servletContext, java.util.Properties props)
Sets the web properties in the session.- Parameters:
servletContext
- a ServletContext objectprops
- a Properties object
-
setPropertiesOrigins
public static void setPropertiesOrigins(javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.util.List<java.lang.String>> origins)
Sets the origins of the web properties on the servlet context.- Parameters:
servletContext
- The context of the web application.origins
- A map tracing the origin of each property.
-
getPropertiesOrigins
public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getPropertiesOrigins(javax.servlet.http.HttpSession session)
Gets the origins map from the servlet context.- Parameters:
session
- An HTTP session for this web application.- Returns:
- A map from each property to its origins.
-
getQuery
public static PathQuery getQuery(javax.servlet.http.HttpSession session)
Returns the PathQuery on the session.- Parameters:
session
- a HttpSession object- Returns:
- a PathQuery for the current user from the session
-
getQuery
public static PathQuery getQuery(javax.servlet.http.HttpServletRequest request)
Returns the PathQuery on the session.- Parameters:
request
- The the current request.- Returns:
- a PathQuery for the current user from the session
-
setQuery
public static void setQuery(javax.servlet.http.HttpSession session, PathQuery query)
Set the current query on the session.- Parameters:
session
- a HttpSession objectquery
- a PathQuery object
-
removeQuery
public static void removeQuery(javax.servlet.http.HttpSession session)
Removes the current query from the session.- Parameters:
session
- a HttpSession object
-
getGlobalSearchRepository
public static SearchRepository getGlobalSearchRepository(javax.servlet.ServletContext context)
Get the SearchRepository for global (public) objects.- Parameters:
context
- the servlet context- Returns:
- the singleton SearchRepository object
-
setGlobalSearchRepository
public static void setGlobalSearchRepository(javax.servlet.ServletContext context, SearchRepository repo)
Set the SearchRepository for global (public) objects in the servlet context.- Parameters:
context
- the servlet contextrepo
- the SearchRepository object
-
getInterMineAPI
public static InterMineAPI getInterMineAPI(javax.servlet.http.HttpSession session)
Get the InterMineAPI which provides access to core features of an InterMine application.- Parameters:
session
- the webapp session- Returns:
- the InterMine core object
-
getInterMineAPI
public static InterMineAPI getInterMineAPI(javax.servlet.http.HttpServletRequest request)
Get the InterMineAPI which provides the core features of an InterMine application.- Parameters:
request
- A Http Request- Returns:
- The API
-
getInterMineAPI
public static InterMineAPI getInterMineAPI(javax.servlet.ServletContext servletContext)
Get the InterMineAPI which provides access to core features of an InterMine application.- Parameters:
servletContext
- the webapp servletContext- Returns:
- the InterMine core object
-
setInterMineAPI
public static void setInterMineAPI(javax.servlet.ServletContext servletContext, InterMineAPI im)
Sets the InterMineAPI in the servlet context.- Parameters:
servletContext
- the webapp servlet contextim
- the InterMineAPI object
-
getAutoCompleter
public static AutoCompleter getAutoCompleter(javax.servlet.ServletContext servletContext)
Get the AutoCompleter stored on the ServletContext.- Parameters:
servletContext
- a ServletContext object- Returns:
- the AutoCompleter
-
setAutoCompleter
public static void setAutoCompleter(javax.servlet.ServletContext servletContext, AutoCompleter ac)
Set the AutoCompleter into the ServletContext.- Parameters:
servletContext
- a ServletContext objectac
- an AutoCompleter object
-
getCategories
public static java.util.Set<java.lang.String> getCategories(javax.servlet.ServletContext servletContext)
Gets the aspect categories from the servlet context.- Parameters:
servletContext
- the ServletContext- Returns:
- a Set of aspect names
-
setCategories
public static void setCategories(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.String> categories)
Sets the aspect categories into the servlet context.- Parameters:
servletContext
- the ServletContextcategories
- the Set of aspect names
-
setErrorOnInitialiser
public static void setErrorOnInitialiser(javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.lang.String> errorKey)
Sets the blocking error codes into the servlet context.- Parameters:
servletContext
- the ServletContexterrorKey
- the Map of error codes and replacement value
-
getErrorOnInitialiser
public static java.util.Map<java.lang.String,java.lang.String> getErrorOnInitialiser(javax.servlet.ServletContext servletContext)
Gets the blocking error codes from the servlet context.- Parameters:
servletContext
- the ServletContext- Returns:
- a Map of blocking error codes and replacement value
-
isErrorOnInitialiser
public static boolean isErrorOnInitialiser(javax.servlet.ServletContext servletContext)
Return true if exists blocking errors- Parameters:
servletContext
- the ServletContext- Returns:
- Whether or not there are blocking errors.
-
setOpenIdProviders
public static void setOpenIdProviders(javax.servlet.ServletContext ctx, java.util.Set<java.lang.String> providers)
Set the set of supported Open-ID providers to use.- Parameters:
ctx
- The Servlet-Contextproviders
- The providers we accept.
-
getOpenIdProviders
public static java.util.Set<java.lang.String> getOpenIdProviders(javax.servlet.http.HttpSession session)
Get the set of accepted Open-ID providers.- Parameters:
session
- The session to use for lookups- Returns:
- The set of open-id providers.
-
setOAuth2Providers
public static void setOAuth2Providers(javax.servlet.ServletContext ctx, java.util.Set<java.lang.String> providers)
Set the set of supported OAuth2 providers to use.- Parameters:
ctx
- The Servlet-Contextproviders
- The providers we accept.
-
getOAuth2Providers
public static java.util.Set<java.lang.String> getOAuth2Providers(javax.servlet.http.HttpSession session)
Get the set of accepted Open-ID providers.- Parameters:
session
- The session to use for lookups- Returns:
- The set of open-id providers.
-
setBasicInstanceInfo
public static void setBasicInstanceInfo(javax.servlet.ServletContext ctx, Instance instance)
Set the instance to use.- Parameters:
ctx
- The Servlet-Contextinstance
- The instance
-
getBasicInstanceInfo
public static Instance getBasicInstanceInfo(javax.servlet.http.HttpSession session)
Get the instance to use- Parameters:
session
- The session to use for lookups- Returns:
- The instance.
-
-