Class CyclicUserSessionRepositoryImpl
- java.lang.Object
-
- io.ryos.rhino.sdk.users.repositories.CyclicUserSessionRepositoryImpl
-
- All Implemented Interfaces:
CyclicUserSessionRepository<UserSession>
public class CyclicUserSessionRepositoryImpl extends java.lang.Object implements CyclicUserSessionRepository<UserSession>
User define repository provides the user sessions limited by maxNumberOfUsers. The take() method returns the next user define in the backing collection. Once all elements in the collection are returned, the cyclic iterator starts from the beginning.- Since:
- 1.1.0
- Author:
- Erhan Bagdemir
-
-
Constructor Summary
Constructors Constructor Description CyclicUserSessionRepositoryImpl(UserRepository<UserSession> userRepository, java.lang.String region)
CyclicUserSessionRepositoryImpl(UserRepository<UserSession> userRepository, java.lang.String region, int maxNumberOfUsers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<UserSession>
getUserList()
UserSession
take()
Takes a single user from the repository.
-
-
-
Constructor Detail
-
CyclicUserSessionRepositoryImpl
public CyclicUserSessionRepositoryImpl(UserRepository<UserSession> userRepository, java.lang.String region)
-
CyclicUserSessionRepositoryImpl
public CyclicUserSessionRepositoryImpl(UserRepository<UserSession> userRepository, java.lang.String region, int maxNumberOfUsers)
-
-
Method Detail
-
take
public UserSession take()
Description copied from interface:CyclicUserSessionRepository
Takes a single user from the repository.- Specified by:
take
in interfaceCyclicUserSessionRepository<UserSession>
- Returns:
- A
UserSession
instance, at the top of the list.
-
getUserList
public java.util.List<UserSession> getUserList()
-
-