Class AnySession

java.lang.Object
eu.c6.gibraltar.api.session.AnySession
All Implemented Interfaces:
IAnySession

public class AnySession extends Object implements IAnySession
The Class AnySession.
 Example :
 
 IAnySession mySession= AnySession.getInstance("http://localhost/any","myRestUser","myPassword");
 mySession.setAssumeUser("groupsmanager");
 mySession.setApplication("demo");
 List<String> members= mySession.getGroupsManager().getMembers("my_group");
 
 
  • Method Details

    • getInstance

      public static IAnySession getInstance(String restApiUrl, String login, String password)
      Gets a single instance of Any session.
      Parameters:
      restApiUrl - the REST API URL location to access to web server where Any REST API are installed.
      login - the user login.

      User must exist into Any database and must have a role of "REST APIs user".

      password - the password of the user.

      When you call an action, the REST API server will connect with the login and password provided. It is not verified when the instance is created.

      Returns:
      single instance of Any session
    • setLocale

      public IAnySession setLocale(Locale locale)
      Description copied from interface: IAnySession
      Sets the user session locale to use.
      Specified by:
      setLocale in interface IAnySession
      Parameters:
      locale - the locale
      Returns:
      the Any user session
    • getLocale

      public Locale getLocale()
      Description copied from interface: IAnySession
      Gets the locale used by the session.
      Specified by:
      getLocale in interface IAnySession
      Returns:
      the locale
    • isAssumed

      public boolean isAssumed()
      Checks if is assumed.
      Returns:
      true, if is assumed
    • setAssumeUser

      public IAnySession setAssumeUser(String assumeUser)
      Description copied from interface: IAnySession
      Sets the assume user.

      To assume a user you must have a role of "REST APIs user". It allows you to execute actions as another user. In this case permissions and roles are verified on assumed user. If you do not have the role "REST APIs user" any action will trigger an exception.

      Specified by:
      setAssumeUser in interface IAnySession
      Parameters:
      assumeUser - the assumed user
      Returns:
      the Any session
    • getAssumeUser

      public String getAssumeUser()
      Gets the assume user.
      Returns:
      the assume user
    • setApplication

      public IAnySession setApplication(String application)
      Description copied from interface: IAnySession
      Sets the application used for this session to determine the context of the action.

      If you do not set the application you will have by default the "Default" application.

      Specified by:
      setApplication in interface IAnySession
      Parameters:
      application - the application available in Any
      Returns:
      the Any session
    • getApplication

      public String getApplication()
      Description copied from interface: IAnySession
      Gets the application used by the session.
      Specified by:
      getApplication in interface IAnySession
      Returns:
      the application
    • getRestApiUriBuilder

      public javax.ws.rs.core.UriBuilder getRestApiUriBuilder()
      Gets the rest api uri builder.
      Returns:
      the rest api uri builder
    • getAuthorization

      public String getAuthorization()
      Gets the authorization string used by Any REST API.
      Returns:
      the encoded authorization string
    • getSessionCookie

      public javax.ws.rs.core.Cookie getSessionCookie()
      Gets the cookie for session.
      Returns:
      the cookie session
    • setSessionCookie

      public void setSessionCookie(javax.ws.rs.core.Cookie sessionCookie)
      Set the cookie for session from Any REST server.
    • getAuthManager

      public AnyAuthManager getAuthManager()
      Specified by:
      getAuthManager in interface IAnySession
    • getUsersManager

      public AnyUsersManager getUsersManager()
      Description copied from interface: IAnySession
      Gets the users manager instantiated from this user session.
      Specified by:
      getUsersManager in interface IAnySession
      Returns:
      the users manager
    • getTasksManager

      public AnyTasksManager getTasksManager()
      Description copied from interface: IAnySession
      Gets the tasks manager instantiated from this user session.
      Specified by:
      getTasksManager in interface IAnySession
      Returns:
      the tasks manager
    • getReportingManager

      public AnyReportingManager getReportingManager()
      Description copied from interface: IAnySession
      Gets the any reporting manager instantiated from this user session.
      Specified by:
      getReportingManager in interface IAnySession
      Returns:
      the any reporting manager
    • getUsersDataManager

      public AnyUsersDataManager getUsersDataManager()
      Description copied from interface: IAnySession
      Gets the users data manager instantiated from this user session.
      Specified by:
      getUsersDataManager in interface IAnySession
      Returns:
      the users data manager
    • getGroupsManager

      public AnyGroupsManager getGroupsManager()
      Description copied from interface: IAnySession
      Gets the groups manager instantiated from this user session.
      Specified by:
      getGroupsManager in interface IAnySession
      Returns:
      the groups manager
    • getRoomsManager

      public AnyRoomsManager getRoomsManager()
      Description copied from interface: IAnySession
      Gets the rooms manager instantiated from this user session.
      Specified by:
      getRoomsManager in interface IAnySession
      Returns:
      the rooms manager
    • getFoldersManager

      public AnyFoldersManager getFoldersManager()
      Specified by:
      getFoldersManager in interface IAnySession
    • getMethodEventManager

      public AnyMethodEventManager getMethodEventManager()
      Description copied from interface: IAnySession
      Gets the any method event manager instantiated from this user session.
      Specified by:
      getMethodEventManager in interface IAnySession
      Returns:
      the any method event manager
    • getJobManager

      public AnyJobManager getJobManager()
      Specified by:
      getJobManager in interface IAnySession
    • getDataListManager

      public AnyDataListManager getDataListManager()
      Specified by:
      getDataListManager in interface IAnySession
    • getContentsManager

      public AnyContentsManager getContentsManager()
      Specified by:
      getContentsManager in interface IAnySession
    • getPackagesManager

      public AnyPackagesManager getPackagesManager()
      Specified by:
      getPackagesManager in interface IAnySession
    • getCasesManager

      public AnyCasesManager getCasesManager()
      Specified by:
      getCasesManager in interface IAnySession
    • getConfigArchiveManager

      public AnyConfigArchiveManager getConfigArchiveManager()
      Specified by:
      getConfigArchiveManager in interface IAnySession
    • getSessionCookieName

      public String getSessionCookieName()
    • setSessionCookieName

      public void setSessionCookieName(String cookieName)
      Description copied from interface: IAnySession
      Set Any's session cookie name if different from default value.
      Specified by:
      setSessionCookieName in interface IAnySession
      Parameters:
      cookieName - the session cookie name