Class CachingNumericIdSequences
- java.lang.Object
-
- jetbrains.buildServer.serverSide.db.CachingNumericIdSequences
-
- All Implemented Interfaces:
IdSequences<Number>,NumericIdSequences
public class CachingNumericIdSequences extends Object implements NumericIdSequences
- Author:
- Leonid Bushuev from JetBrains
-
-
Constructor Summary
Constructors Constructor Description CachingNumericIdSequences(SchemaDef schema, SQLRunnerEx DB)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear(String domainName)Clears sequence cache for given domainvoidclearCache()This method is not thread safe.static intgetReservedIdsCount(DomainDef domain)NumericIdSequence<? extends Number>getSequence(String domainName)Provides with the sequence for the specified domain.NumericIdSequence<? extends Number>getSequence(DomainDef domain)voidinitIntegerIdSequence(DomainDef domain, int initialValue)voidinitLongIdSequence(DomainDef domain, long initialValue)NumbernextOne(String domainName)Produces and returns one next identifier of the specified domain.
-
-
-
Constructor Detail
-
CachingNumericIdSequences
public CachingNumericIdSequences(@NotNull SchemaDef schema, @NotNull SQLRunnerEx DB)
-
-
Method Detail
-
getSequence
@NotNull public NumericIdSequence<? extends Number> getSequence(@NotNull String domainName) throws UnknownDomainException
Description copied from interface:NumericIdSequencesProvides with the sequence for the specified domain.- Specified by:
getSequencein interfaceIdSequences<Number>- Specified by:
getSequencein interfaceNumericIdSequences- Parameters:
domainName- domain.- Returns:
- the sequence for this domain.
- Throws:
UnknownDomainException
-
getSequence
public NumericIdSequence<? extends Number> getSequence(@NotNull DomainDef domain) throws UnknownDomainException
- Throws:
UnknownDomainException
-
getReservedIdsCount
public static int getReservedIdsCount(@NotNull DomainDef domain)
-
initIntegerIdSequence
public void initIntegerIdSequence(@NotNull DomainDef domain, int initialValue)
-
initLongIdSequence
public void initLongIdSequence(@NotNull DomainDef domain, long initialValue)
-
nextOne
@NotNull public Number nextOne(@NotNull String domainName) throws UnknownDomainException
Description copied from interface:NumericIdSequencesProduces and returns one next identifier of the specified domain.- Specified by:
nextOnein interfaceIdSequences<Number>- Specified by:
nextOnein interfaceNumericIdSequences- Parameters:
domainName- domain.- Returns:
- the new identifier.
- Throws:
UnknownDomainException
-
clearCache
public void clearCache()
This method is not thread safe. It's only for testing purposes. Please never call it from Production code.
-
clear
public void clear(@NotNull String domainName)Clears sequence cache for given domain- Parameters:
domainName- domain name- Since:
- 2019.1
-
-