Package ch.ivyteam.ivy.security.session
Interface ISessionRepository
-
public interface ISessionRepository
Session repository to create, destroy and find sessions.
- Since:
- 9.3
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<ISession>
all()
Gets all sessions of the security context / application.ClusterSessionsSnapshot
clusterSnapshot()
CallsclusterSnapshot(long)
with the default value of maxAge=1000 (1 second)ClusterSessionsSnapshot
clusterSnapshot(long maxAge)
Returns a snapshot containing information of all sessions at the time this method was invoked.long
count()
Get count of all sessions of this local running engine.ISession
create()
Creates a new sessionISession
current()
Gets the current session.void
destroy(int sessionIdentifier)
Destroys a sessionISession
find(int sessionIdentifier)
Finds a session by its identifierList<ISession>
ofUser(IUser user)
Gets all sessions of the given user.ISession
systemUser()
Gets the session of the system user
-
-
-
Method Detail
-
all
List<ISession> all()
Gets all sessions of the security context / application. In a cluster environment returns only the sessions of the local cluster node. To get information of session on all cluster nodes useclusterSnapshot()
- Returns:
- sessions
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS SessionReadAll PERMISSION OR OWNS SessionReadAll@SYSTEM PERMISSION
-
ofUser
List<ISession> ofUser(IUser user)
Gets all sessions of the given user. In a cluster environment returns only the sessions of the user on the local cluster node.- Returns:
- sessions of the given user
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS SessionReadAll PERMISSION OR OWNS SessionReadAll@SYSTEM PERMISSION
-
count
long count()
Get count of all sessions of this local running engine.- Returns:
- count of sessions (without system user session)
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
find
ISession find(int sessionIdentifier)
Finds a session by its identifier- Parameters:
sessionIdentifier
- session identifier- Returns:
- session or null
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS SessionReadAll PERMISSION OR OWNS SessionReadAll@SYSTEM PERMISSION
-
systemUser
ISession systemUser()
Gets the session of the system user- Returns:
- system user session
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS SessionReadAll PERMISSION OR OWNS SessionReadAll@SYSTEM PERMISSION
-
current
ISession current()
Gets the current session. Gets the current session associated to the current thread- Returns:
- current session or null if current thread has no session associated
- See Also:
ISession.current()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
destroy
void destroy(int sessionIdentifier)
Destroys a session- Parameters:
sessionIdentifier
- session identifier- API:
- This public API is available in Java.
- Security:
- SESSION OWNS SessionDestroy PERMISSION OR OWNS SessionDestroy@SYSTEM PERMISSION
-
create
ISession create()
Creates a new session- Returns:
- new session
- API:
- This public API is available in Java.
-
clusterSnapshot
ClusterSessionsSnapshot clusterSnapshot()
CallsclusterSnapshot(long)
with the default value of maxAge=1000 (1 second)- Returns:
- a cluster session snapshot. Never null
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
clusterSnapshot
ClusterSessionsSnapshot clusterSnapshot(long maxAge)
Returns a snapshot containing information of all sessions at the time this method was invoked. If there is only one cluster node theClusterSessionsSnapshot
contains the same information which can be fetched withall()
. If there are multiple cluster nodes theClusterSessionsSnapshot
contains as well information about sessions on other nodes. The parametermaxAge
controls how old theClusterSessionsSnapshot
can be. For example withmaxAge=5000
theClusterSessionsSnapshot
is maximal 5 seconds old. The longer themaxAge
is the less network traffic is caused.- Parameters:
maxAge
- in milliSeconds- Returns:
- a cluster session snapshot. Never null
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
-