Class StatusIndexPoolService
- java.lang.Object
-
- io.jans.as.server.service.cluster.StatusIndexPoolService
-
@ApplicationScoped public class StatusIndexPoolService extends Object
- Version:
- 1.0, 06/03/2024
- Author:
- Yuriy Movchan
-
-
Field Summary
Fields Modifier and Type Field Description static intATTEMPT_LIMITstatic longDELAY_AFTER_EXPIRATIONstatic longDELAY_IF_LOCKEDstatic longLOCK_WAIT_BEFORE_UPDATE
-
Constructor Summary
Constructors Constructor Description StatusIndexPoolService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.jans.model.token.StatusIndexPoolallocate(int nodeId)StringbaseDn()StringcreateDn(int id)List<io.jans.model.token.StatusIndexPool>getAllPools()Returns a list of all poolsList<io.jans.model.token.StatusIndexPool>getNodePools(Integer nodeId)Returns a list of all StatusIndexPools associated with ClusterNodeio.jans.model.token.StatusIndexPoolgetPoolByDn(String dn)Returns pool by dnio.jans.model.token.StatusIndexPoolgetPoolById(int id)Returns pool by Idio.jans.model.token.StatusIndexPoolgetPoolByIndex(int index)Gets pool by global status list indexio.jans.model.token.StatusIndexPoolgetPoolLast()Returns last (max) pool or null if noneList<io.jans.model.token.StatusIndexPool>getPoolsExpired()Returns a list of expired poolsvoidinit()protected voidpersist(io.jans.model.token.StatusIndexPool pool)static io.jans.model.token.StatusIndexPoolsetIndexes(io.jans.model.token.StatusIndexPool pool, int indexAllocationBlockSize)voidupdate(io.jans.model.token.StatusIndexPool pool)io.jans.model.token.StatusIndexPoolupdateWithLock(String poolDn, List<Integer> indexes, io.jans.model.tokenstatus.TokenStatus status)
-
-
-
Field Detail
-
ATTEMPT_LIMIT
public static final int ATTEMPT_LIMIT
- See Also:
- Constant Field Values
-
DELAY_AFTER_EXPIRATION
public static long DELAY_AFTER_EXPIRATION
-
LOCK_WAIT_BEFORE_UPDATE
public static long LOCK_WAIT_BEFORE_UPDATE
-
DELAY_IF_LOCKED
public static long DELAY_IF_LOCKED
-
-
Method Detail
-
setIndexes
public static io.jans.model.token.StatusIndexPool setIndexes(io.jans.model.token.StatusIndexPool pool, int indexAllocationBlockSize)
-
init
@PostConstruct public void init()
-
getPoolByDn
public io.jans.model.token.StatusIndexPool getPoolByDn(String dn)
Returns pool by dn- Returns:
- pool
-
getPoolById
public io.jans.model.token.StatusIndexPool getPoolById(int id)
Returns pool by Id- Returns:
- pool
-
getAllPools
public List<io.jans.model.token.StatusIndexPool> getAllPools()
Returns a list of all pools- Returns:
- list of pools
-
getPoolLast
public io.jans.model.token.StatusIndexPool getPoolLast()
Returns last (max) pool or null if none- Returns:
- pool
-
getPoolByIndex
public io.jans.model.token.StatusIndexPool getPoolByIndex(int index)
Gets pool by global status list index- Parameters:
index- status list index- Returns:
- pool
-
getNodePools
public List<io.jans.model.token.StatusIndexPool> getNodePools(Integer nodeId)
Returns a list of all StatusIndexPools associated with ClusterNode- Returns:
- list of pools
-
getPoolsExpired
public List<io.jans.model.token.StatusIndexPool> getPoolsExpired()
Returns a list of expired pools- Returns:
- list of pools
-
persist
protected void persist(io.jans.model.token.StatusIndexPool pool)
-
update
public void update(io.jans.model.token.StatusIndexPool pool)
-
updateWithLock
public io.jans.model.token.StatusIndexPool updateWithLock(String poolDn, List<Integer> indexes, io.jans.model.tokenstatus.TokenStatus status) throws IOException
- Throws:
IOException
-
allocate
public io.jans.model.token.StatusIndexPool allocate(int nodeId)
-
baseDn
public String baseDn()
-
createDn
public String createDn(int id)
-
-