Interface IContextProvider

All Superinterfaces:
IComponent, IComponentProvider, IInitializable, IURIResolver

public interface IContextProvider extends IComponentProvider
Manages
  • Method Details

    • acquireContext

      IContext acquireContext(HttpServletRequest request) throws PortalException
      Factory for obtaining a context on the httpServletRequest
      Parameters:
      request -
      Returns:
      Throws:
      PortalException
    • acquireContext

      IContext acquireContext(HttpSession httpSession) throws PortalException
      Factory for obtaining a context on the httpSession
      Parameters:
      httpSession -
      Returns:
      Throws:
      PortalException
    • acquireContext

      IContext acquireContext(Map<?,?> properties) throws PortalException
      Factory for obtaining a context from the properties
      Parameters:
      properties -
      Returns:
      Throws:
      PortalException
    • acquireContext

      IContext acquireContext(boolean shouldCreate) throws PortalException
      Factory to acquire a context from the local thread
      Parameters:
      shouldCreate - whether it should be created
      Returns:
      Throws:
      PortalException
    • acquireAdminContext

      IContext acquireAdminContext() throws PortalException
      Creates a new sysadmin context
      Throws:
      PortalException
    • acquireAdminContext

      IContext acquireAdminContext(boolean createUserFolders) throws PortalException
      Creates a new sysadmin context
      Parameters:
      createUserFolders - true to create user folders if they don't already exist
      Throws:
      PortalException
    • acquireContextByDN

      IContext acquireContextByDN(String userDN, boolean createUserFolders, boolean initialize) throws PortalException
      Creates a new context for a given user DN
      Parameters:
      userDN -
      Throws:
      PortalException
    • acquireContextByAlias

      IContext acquireContextByAlias(String userAlias, boolean createUserFolders, boolean initialize) throws PortalException
      Creates a new context for a given user alias
      Parameters:
      userAlias -
      Throws:
      PortalException
    • acquireContext

      IContext acquireContext(String userID) throws PortalException
      Creates a new context for a given userID
      Parameters:
      userID -
      Throws:
      PortalException
    • acquireContext

      IContext acquireContext(String userID, boolean createUserFolders) throws PortalException
      Creates a new context for a given userID
      Parameters:
      userID -
      Throws:
      PortalException
    • acquireContext

      IContext acquireContext(String userID, boolean createUserFolders, boolean initialize) throws PortalException
      Creates a new context for a given userID
      Parameters:
      userID -
      Throws:
      PortalException
    • releaseContext

      void releaseContext(IContext context)
      Releases previously acquired context and removes it from list of context. This is usually called when session containing context gets invalidated
      Parameters:
      context -
    • setCurrentContext

      void setCurrentContext(IContext context) throws PortalException
      Set current context for the thread. This has lower priority that context available on the request, but if there is no request then current context will be used. If there is no current context assigned, new Admin context will be created
      Parameters:
      context -
      Throws:
      PortalException
    • getCurrentContextForThread

      IContext getCurrentContextForThread() throws PortalException
      Return the context for the current thread.
      Returns:
      context for the current thread
      Throws:
      PortalException
    • lookupContext

      IContext[] lookupContext(IThingID userID) throws PortalException
      Find all the current contexts for a given user
      Parameters:
      userID -
      Returns:
      Throws:
      PortalException
    • getContexts

      List<IContext> getContexts() throws PortalException
      Get all the active contexts
      Returns:
      Throws:
      PortalException
    • postInit

      void postInit()
      Post init
    • createTraits

      ITraits createTraits(int traits) throws PortalException
      Factory to create an ITraits instance
      Parameters:
      traits - the bitset of traits to create
      Returns:
      a new traits object
      Throws:
      PortalException
    • getSingletonTraits

      ITraits getSingletonTraits(IContextProvider.SingletonTraits type)
      Get one of the shared singleton traits objects These are shared ITraits that anyone can use but not modify.
      Parameters:
      type - the type of traits to retrieve
      Returns:
      the shared singleton traits object, or null if it could not be found