Package eu.c6.gibraltar.api.session
Class AnySession
java.lang.Object
eu.c6.gibraltar.api.session.AnySession
- All Implemented Interfaces:
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");
-
Field Summary
Fields inherited from interface eu.c6.gibraltar.api.session.IAnySession
DEFAULT_SESSION_COOKIE_NAME -
Method Summary
Modifier and TypeMethodDescriptionGets the application used by the session.Gets the assume user.Gets the authorization string used by Any REST API.Gets the groups manager instantiated from this user session.static IAnySessiongetInstance(String restApiUrl, String login, String password) Gets a single instance of Any session.Gets the locale used by the session.Gets the any method event manager instantiated from this user session.Gets the any reporting manager instantiated from this user session.javax.ws.rs.core.UriBuilderGets the rest api uri builder.Gets the rooms manager instantiated from this user session.javax.ws.rs.core.CookieGets the cookie for session.Gets the tasks manager instantiated from this user session.Gets the users data manager instantiated from this user session.Gets the users manager instantiated from this user session.booleanChecks if is assumed.setApplication(String application) Sets the application used for this session to determine the context of the action.setAssumeUser(String assumeUser) Sets the assume user.Sets the user session locale to use.voidsetSessionCookie(javax.ws.rs.core.Cookie sessionCookie) Set the cookie for session from Any REST server.voidsetSessionCookieName(String cookieName) Set Any's session cookie name if different from default value.
-
Method Details
-
getInstance
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
Description copied from interface:IAnySessionSets the user session locale to use.- Specified by:
setLocalein interfaceIAnySession- Parameters:
locale- the locale- Returns:
- the Any user session
-
getLocale
Description copied from interface:IAnySessionGets the locale used by the session.- Specified by:
getLocalein interfaceIAnySession- Returns:
- the locale
-
isAssumed
public boolean isAssumed()Checks if is assumed.- Returns:
- true, if is assumed
-
setAssumeUser
Description copied from interface:IAnySessionSets 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:
setAssumeUserin interfaceIAnySession- Parameters:
assumeUser- the assumed user- Returns:
- the Any session
-
getAssumeUser
Gets the assume user.- Returns:
- the assume user
-
setApplication
Description copied from interface:IAnySessionSets 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:
setApplicationin interfaceIAnySession- Parameters:
application- the application available in Any- Returns:
- the Any session
-
getApplication
Description copied from interface:IAnySessionGets the application used by the session.- Specified by:
getApplicationin interfaceIAnySession- Returns:
- the application
-
getRestApiUriBuilder
public javax.ws.rs.core.UriBuilder getRestApiUriBuilder()Gets the rest api uri builder.- Returns:
- the rest api uri builder
-
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
- Specified by:
getAuthManagerin interfaceIAnySession
-
getUsersManager
Description copied from interface:IAnySessionGets the users manager instantiated from this user session.- Specified by:
getUsersManagerin interfaceIAnySession- Returns:
- the users manager
-
getTasksManager
Description copied from interface:IAnySessionGets the tasks manager instantiated from this user session.- Specified by:
getTasksManagerin interfaceIAnySession- Returns:
- the tasks manager
-
getReportingManager
Description copied from interface:IAnySessionGets the any reporting manager instantiated from this user session.- Specified by:
getReportingManagerin interfaceIAnySession- Returns:
- the any reporting manager
-
getUsersDataManager
Description copied from interface:IAnySessionGets the users data manager instantiated from this user session.- Specified by:
getUsersDataManagerin interfaceIAnySession- Returns:
- the users data manager
-
getGroupsManager
Description copied from interface:IAnySessionGets the groups manager instantiated from this user session.- Specified by:
getGroupsManagerin interfaceIAnySession- Returns:
- the groups manager
-
getRoomsManager
Description copied from interface:IAnySessionGets the rooms manager instantiated from this user session.- Specified by:
getRoomsManagerin interfaceIAnySession- Returns:
- the rooms manager
-
getFoldersManager
- Specified by:
getFoldersManagerin interfaceIAnySession
-
getMethodEventManager
Description copied from interface:IAnySessionGets the any method event manager instantiated from this user session.- Specified by:
getMethodEventManagerin interfaceIAnySession- Returns:
- the any method event manager
-
getJobManager
- Specified by:
getJobManagerin interfaceIAnySession
-
getDataListManager
- Specified by:
getDataListManagerin interfaceIAnySession
-
getContentsManager
- Specified by:
getContentsManagerin interfaceIAnySession
-
getPackagesManager
- Specified by:
getPackagesManagerin interfaceIAnySession
-
getCasesManager
- Specified by:
getCasesManagerin interfaceIAnySession
-
getConfigArchiveManager
- Specified by:
getConfigArchiveManagerin interfaceIAnySession
-
getSessionCookieName
-
setSessionCookieName
Description copied from interface:IAnySessionSet Any's session cookie name if different from default value.- Specified by:
setSessionCookieNamein interfaceIAnySession- Parameters:
cookieName- the session cookie name
-