public abstract class AbstractSessionData extends java.lang.Object implements SessionData
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractSessionData.SessionDataChannelAccessAccessor |
| 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 abstract org.cyclos.impl.access.SessionDataSubjectId |
doGetSubjectId() |
protected abstract boolean |
doHasPermission(Permission permission) |
Channel |
getAccessChannel()
Returns the original channel (i.e the channel used to access Cyclos) this session is using
|
AccessClient |
getAccessClient() |
OidcAccessToken |
getAccessToken()
Returns the OpenID Connect / OAuth2 access token for this session
|
UserAccount |
getAccount() |
protected org.springframework.context.ApplicationContext |
getApplicationContext() |
BasicUser |
getBasicUser() |
Channel |
getChannel()
Returns the current channel this session is using
|
org.cyclos.impl.system.ChannelAccessAccessor |
getChannelAccessAccessor()
Returns the accessor for the access channel (i.e the original channel used to access Cyclos) access settings.
|
ChannelConfiguration |
getChannelConfiguration()
This method is here, but not in the interface.
|
org.cyclos.impl.system.ChannelSettingsAccessor |
getChannelSettingsAccessor()
Returns the accessor for the current channel (i.e the channel used to run the service method) general settings.
|
ConfigurationAccessor |
getConfiguration()
Returns the configuration accessor
|
protected Configuration |
getConfigurationEntity() |
UserCustomFieldValue |
getCustomFieldValue() |
IdentityProvider |
getIdentityProvider()
Returns the
IdentityProvider used for this session only if the user was authenticated using such
mechanism. |
Operator |
getLoggedOperator()
Returns the authenticated operator, or null if none or the logged is not an operator
|
User |
getLoggedUser()
Returns the authenticated user, or null if none
|
MobilePhone |
getMobilePhone() |
Network |
getNetwork()
Returns the network this session is using, or null if as global system or administrator
|
Pin |
getPin()
Returns the
Pin used for this session only if the user was authenticated using such mechanism. |
java.lang.String |
getPrincipal() |
PrincipalType |
getPrincipalType() |
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
|
org.cyclos.impl.access.SessionDataSubjectId |
getSubjectId()
Returns the subject id
|
Token |
getToken() |
TrustedDevice |
getTrustedDevice() |
boolean |
hasPermission(Permission permission)
Returns whether the current user has the given permission
|
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 a 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 |
isMultiNetworkAdminInGlobalMode()
Returns whether a global restricted has not switched to a network.
|
boolean |
isNetworkAdmin()
Returns whether the
Role.NETWORK_ADMIN is granted |
boolean |
isOperator()
Returns whether the
Role.OPERATOR is granted |
boolean |
isOwnerOf(BasicUser operator)
Returns whether current user is either the owner member of a given operator or as another alias operator
|
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 |
isTrusted()
Returns whether this session should be considered trusted
|
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
|
protected <T> T |
runAsSystem(java.util.concurrent.Callable<T> callable,
boolean useCurrentChannelName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessChannelName, getAccessibleBasicGroups, getAuthenticatedUser, getChannelName, getGroup, getLoggedBasicUser, hasPermission, hasRequiredValue, isRest, isVisible, manages, relatesToprotected final RequestData requestData
public AbstractSessionData(RequestData requestData)
public void checkConsistency()
throws InvalidSessionDataException
SessionDatacheckConsistency in interface SessionDataInvalidSessionDataExceptionpublic final Channel getAccessChannel()
SessionDatagetAccessChannel in interface SessionDatapublic AccessClient getAccessClient()
getAccessClient in interface org.cyclos.impl.access.UserPrincipalpublic OidcAccessToken getAccessToken()
SessionDatagetAccessToken in interface SessionDatapublic UserAccount getAccount()
getAccount in interface org.cyclos.impl.access.UserPrincipalpublic BasicUser getBasicUser()
getBasicUser in interface org.cyclos.impl.access.UserPrincipalpublic final Channel getChannel()
SessionDatagetChannel in interface SessionDatapublic org.cyclos.impl.system.ChannelAccessAccessor getChannelAccessAccessor()
SessionDatagetChannelAccessAccessor in interface SessionDatapublic ChannelConfiguration getChannelConfiguration()
public org.cyclos.impl.system.ChannelSettingsAccessor getChannelSettingsAccessor()
SessionDatagetChannelSettingsAccessor in interface SessionDatapublic final ConfigurationAccessor getConfiguration()
SessionDatagetConfiguration in interface SessionDatapublic UserCustomFieldValue getCustomFieldValue()
getCustomFieldValue in interface org.cyclos.impl.access.UserPrincipalpublic IdentityProvider getIdentityProvider()
SessionDataIdentityProvider used for this session only if the user was authenticated using such
mechanism.getIdentityProvider in interface SessionDatapublic final Operator getLoggedOperator()
SessionDatagetLoggedOperator in interface SessionDatapublic final User getLoggedUser()
SessionDatagetLoggedUser in interface SessionDatapublic MobilePhone getMobilePhone()
getMobilePhone in interface org.cyclos.impl.access.UserPrincipalpublic final Network getNetwork()
SessionDatagetNetwork in interface SessionDatapublic Pin getPin()
SessionDataPin used for this session only if the user was authenticated using such mechanism.getPin in interface SessionDatapublic java.lang.String getPrincipal()
getPrincipal in interface org.cyclos.impl.access.DelegatingUserPrincipalgetPrincipal in interface org.cyclos.impl.access.UserPrincipalpublic PrincipalType getPrincipalType()
getPrincipalType in interface org.cyclos.impl.access.UserPrincipalpublic 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 org.cyclos.impl.access.SessionDataSubjectId getSubjectId()
SessionDatagetSubjectId in interface SessionDatapublic Token getToken()
getToken in interface org.cyclos.impl.access.UserPrincipalpublic TrustedDevice getTrustedDevice()
getTrustedDevice in interface org.cyclos.impl.access.UserPrincipalpublic final boolean hasPermission(Permission permission)
SessionDatahasPermission 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 isMultiNetworkAdminInGlobalMode()
isMultiNetworkAdminInGlobalMode in interface SessionDatapublic boolean isNetworkAdmin()
RoleContainerRole.NETWORK_ADMIN is grantedisNetworkAdmin in interface RoleContainerpublic boolean isOperator()
RoleContainerRole.OPERATOR is grantedisOperator in interface RoleContainerpublic boolean isOwnerOf(BasicUser operator)
SessionDataisOwnerOf in interface SessionDatapublic boolean isRestrictedOperator()
RoleContainerRole.RESTRICTED_OPERATOR is grantedisRestrictedOperator in interface RoleContainerpublic boolean isScript()
SessionDataisScript in interface SessionDatapublic boolean isSystem()
SessionDataisSystem in interface SessionDatapublic boolean isTrusted()
SessionDataisTrusted 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 abstract org.cyclos.impl.access.SessionDataSubjectId doGetSubjectId()
protected abstract boolean doHasPermission(Permission permission)
protected 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)
protected <T> T runAsSystem(java.util.concurrent.Callable<T> callable,
boolean useCurrentChannelName)