Package org.onosproject.store.service
Interface AsyncAtomicIdGenerator
-
- All Superinterfaces:
DistributedPrimitive
public interface AsyncAtomicIdGenerator extends DistributedPrimitive
An async ID generator for generating globally unique numbers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.store.service.DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.Type
-
-
Field Summary
-
Fields inherited from interface org.onosproject.store.service.DistributedPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default AtomicIdGenerator
asAtomicIdGenerator()
Returns a newAtomicIdGenerator
that is backed by this instance and with a default operation timeout.default AtomicIdGenerator
asAtomicIdGenerator(long timeoutMillis)
Returns a newAtomicIdGenerator
that is backed by this instance.java.util.concurrent.CompletableFuture<java.lang.Long>
nextId()
Returns the next globally unique numeric ID.default DistributedPrimitive.Type
primitiveType()
Returns the type of primitive.-
Methods inherited from interface org.onosproject.store.service.DistributedPrimitive
addStatusChangeListener, applicationId, destroy, name, removeStatusChangeListener, statusChangeListeners
-
-
-
-
Method Detail
-
primitiveType
default DistributedPrimitive.Type primitiveType()
Description copied from interface:DistributedPrimitive
Returns the type of primitive.- Specified by:
primitiveType
in interfaceDistributedPrimitive
- Returns:
- primitive type
-
nextId
java.util.concurrent.CompletableFuture<java.lang.Long> nextId()
Returns the next globally unique numeric ID.- Returns:
- a future to be completed with the next globally unique identifier
-
asAtomicIdGenerator
default AtomicIdGenerator asAtomicIdGenerator(long timeoutMillis)
Returns a newAtomicIdGenerator
that is backed by this instance.- Parameters:
timeoutMillis
- timeout duration for the returned ConsistentMap operations- Returns:
- new
AtomicIdGenerator
instance
-
asAtomicIdGenerator
default AtomicIdGenerator asAtomicIdGenerator()
Returns a newAtomicIdGenerator
that is backed by this instance and with a default operation timeout.- Returns:
- new
AtomicIdGenerator
instance
-
-