public abstract class AbstractSessionData extends java.lang.Object implements SessionData
| Modifier and Type | Field and Description |
|---|---|
protected RequestData |
requestData |
| Constructor and Description |
|---|
AbstractSessionData(RequestData requestData) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
bean(java.lang.Class<T> beanClass) |
void |
checkConsistency()
Checks for consistency.
|
protected ConfigurationAccessor |
doGetConfigurationAccessor() |
protected abstract java.lang.Long |
doGetConfigurationId() |
protected java.util.List<java.lang.String> |
doGetPreferredLocales() |
protected abstract org.cyclos.impl.users.ProductsAccessor |
doGetProducts()
Must be implemented to return a a valid
ProductsAccessor |
protected org.springframework.context.ApplicationContext |
getApplicationContext() |
Channel |
getChannel()
Returns the channel this session is using
|
ConfigurationAccessor |
getConfiguration()
Returns the configuration accessor
|
protected Configuration |
getConfigurationEntity() |
User |
getLoggedUser()
Returns the authenticated user, or null if none
|
Network |
getNetwork()
Returns the network this session is using, or null if as global system or administrator
|
java.lang.String |
getPrincipal()
Returns the principal used to access this session, if any
|
PrincipalType |
getPrincipalType()
Returns the principal type used for the current session.
|
org.cyclos.impl.users.ProductsAccessor |
getProducts()
Returns the products accessor
|
protected RawEntityManagerHandler |
getRawEntityManagerHandler() |
java.lang.String |
getRemoteAddress()
Returns the remote address, of the client accessing the application
|
RequestData |
getRequestData()
Returns data about the calling request.
|
Session |
getSession()
Returns the session in case this session data performed a login
|
boolean |
isAdmin()
Returns whether the
Role.ADMIN is granted |
boolean |
isAdminOf(BasicUser user)
Returns whether the current user is an administrator of the given user
|
boolean |
isAliasOperator()
Returns whether the
Role.ALIAS_OPERATOR is granted |
boolean |
isBroker()
Returns whether the
Role.BROKER is granted |
boolean |
isBrokerOf(BasicUser user)
Returns whether the current user is a broker of the given user
|
boolean |
isGlobalAdmin()
Returns whether the
Role.GLOBAL_ADMIN is granted |
boolean |
isGlobalAdminInNetwork()
Returns whether a global admin OR a global restricted has switched to a network.
|
boolean |
isGuest()
Returns whether the current session represents a guest
|
boolean |
isLoggedIn()
Returns whether the current session represents an user
|
boolean |
isManagerOf(BasicUser user)
Returns whether the current user is a manager of the given user and is not the given user.
|
boolean |
isMember()
Returns whether the
Role.MEMBER is granted |
boolean |
isMemberOnly()
Returns true if the logged user has only
Role member. |
boolean |
isNetworkAdmin()
Returns whether the
Role.NETWORK_ADMIN is granted |
boolean |
isOperator()
Returns whether the
Role.OPERATOR is granted |
boolean |
isRestrictedOperator()
Returns whether the
Role.RESTRICTED_OPERATOR is granted |
boolean |
isScript()
Returns whether this session is running under a script
|
boolean |
isSystem()
Returns whether the current session represents a system task
|
boolean |
isUserManager()
Returns whether the
Role.ADMIN or Role.BROKER roles are granted |
protected java.lang.Long |
resolveNetworkId() |
protected <T> T |
runAsSystem(java.util.concurrent.Callable<T> callable)
Runs the given callable as system, with the same request data and channel as this session data
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessClient, getAccessibleBasicGroups, getAuthenticatedUser, getChannelConfiguration, getChannelName, getGroup, getLoggedBasicUser, getToken, hasPermission, hasRequiredValue, isVisible, manages, relatesToprotected final RequestData requestData
public AbstractSessionData(RequestData requestData)
public void checkConsistency()
throws InvalidSessionDataException
SessionDatacheckConsistency in interface SessionDataInvalidSessionDataExceptionpublic final Channel getChannel()
SessionDatagetChannel in interface SessionDatapublic final ConfigurationAccessor getConfiguration()
SessionDatagetConfiguration in interface SessionDatapublic final User getLoggedUser()
SessionDatagetLoggedUser in interface SessionDatapublic final Network getNetwork()
SessionDatagetNetwork in interface SessionDatapublic java.lang.String getPrincipal()
SessionDatagetPrincipal in interface SessionDatapublic PrincipalType getPrincipalType()
SessionDatagetPrincipalType in interface SessionDatapublic final org.cyclos.impl.users.ProductsAccessor getProducts()
SessionDatagetProducts in interface SessionDatapublic java.lang.String getRemoteAddress()
SessionDatagetRemoteAddress in interface SessionDatapublic final RequestData getRequestData()
SessionDatagetRequestData in interface SessionDatapublic Session getSession()
SessionDatagetSession in interface SessionDatapublic boolean isAdmin()
RoleContainerRole.ADMIN is grantedisAdmin in interface RoleContainerpublic boolean isAdminOf(BasicUser user)
SessionDataisAdminOf in interface SessionDatapublic boolean isAliasOperator()
RoleContainerRole.ALIAS_OPERATOR is grantedisAliasOperator in interface RoleContainerpublic boolean isBroker()
RoleContainerRole.BROKER is grantedisBroker in interface RoleContainerpublic boolean isBrokerOf(BasicUser user)
SessionDataisBrokerOf in interface SessionDatapublic boolean isGlobalAdmin()
RoleContainerRole.GLOBAL_ADMIN is grantedisGlobalAdmin in interface RoleContainerpublic boolean isGlobalAdminInNetwork()
isGlobalAdminInNetwork in interface SessionDatapublic boolean isGuest()
SessionDataisGuest in interface SessionDatapublic boolean isLoggedIn()
SessionDataisLoggedIn in interface SessionDatapublic boolean isManagerOf(BasicUser user)
SessionDataisManagerOf in interface SessionDatapublic boolean isMember()
RoleContainerRole.MEMBER is grantedisMember in interface RoleContainerpublic boolean isMemberOnly()
SessionDataRole member.isMemberOnly in interface SessionDatapublic boolean isNetworkAdmin()
RoleContainerRole.NETWORK_ADMIN is grantedisNetworkAdmin in interface RoleContainerpublic boolean isOperator()
RoleContainerRole.OPERATOR is grantedisOperator in interface RoleContainerpublic boolean isRestrictedOperator()
RoleContainerRole.RESTRICTED_OPERATOR is grantedisRestrictedOperator in interface RoleContainerpublic boolean isScript()
SessionDataisScript in interface SessionDatapublic boolean isSystem()
SessionDataisSystem in interface SessionDatapublic boolean isUserManager()
RoleContainerRole.ADMIN or Role.BROKER roles are grantedisUserManager in interface RoleContainerprotected <T> T bean(java.lang.Class<T> beanClass)
protected ConfigurationAccessor doGetConfigurationAccessor()
protected abstract java.lang.Long doGetConfigurationId()
protected java.util.List<java.lang.String> doGetPreferredLocales()
protected abstract org.cyclos.impl.users.ProductsAccessor doGetProducts()
ProductsAccessorprotected org.springframework.context.ApplicationContext getApplicationContext()
protected final Configuration getConfigurationEntity()
protected RawEntityManagerHandler getRawEntityManagerHandler()
protected java.lang.Long resolveNetworkId()
protected <T> T runAsSystem(java.util.concurrent.Callable<T> callable)