Class AtomixAtomicCounter

  • All Implemented Interfaces:
    org.onosproject.store.service.AsyncAtomicCounter, org.onosproject.store.service.DistributedPrimitive

    public class AtomixAtomicCounter
    extends java.lang.Object
    implements org.onosproject.store.service.AsyncAtomicCounter
    Atomix atomic counter.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.onosproject.store.service.DistributedPrimitive

        org.onosproject.store.service.DistributedPrimitive.Status, org.onosproject.store.service.DistributedPrimitive.Type
    • Field Summary

      • Fields inherited from interface org.onosproject.store.service.DistributedPrimitive

        DEFAULT_OPERATION_TIMEOUT_MILLIS
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomixAtomicCounter​(io.atomix.core.counter.AsyncAtomicCounter atomixCounter)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Long> addAndGet​(long delta)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> compareAndSet​(long expectedValue, long updateValue)  
      java.util.concurrent.CompletableFuture<java.lang.Long> get()  
      java.util.concurrent.CompletableFuture<java.lang.Long> getAndAdd​(long delta)  
      java.util.concurrent.CompletableFuture<java.lang.Long> getAndIncrement()  
      java.util.concurrent.CompletableFuture<java.lang.Long> incrementAndGet()  
      java.lang.String name()  
      java.util.concurrent.CompletableFuture<java.lang.Void> set​(long value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.service.AsyncAtomicCounter

        asAtomicCounter, asAtomicCounter, primitiveType
      • Methods inherited from interface org.onosproject.store.service.DistributedPrimitive

        addStatusChangeListener, applicationId, destroy, removeStatusChangeListener, statusChangeListeners
    • Constructor Detail

      • AtomixAtomicCounter

        public AtomixAtomicCounter​(io.atomix.core.counter.AsyncAtomicCounter atomixCounter)
    • Method Detail

      • name

        public java.lang.String name()
        Specified by:
        name in interface org.onosproject.store.service.DistributedPrimitive
      • incrementAndGet

        public java.util.concurrent.CompletableFuture<java.lang.Long> incrementAndGet()
        Specified by:
        incrementAndGet in interface org.onosproject.store.service.AsyncAtomicCounter
      • getAndIncrement

        public java.util.concurrent.CompletableFuture<java.lang.Long> getAndIncrement()
        Specified by:
        getAndIncrement in interface org.onosproject.store.service.AsyncAtomicCounter
      • getAndAdd

        public java.util.concurrent.CompletableFuture<java.lang.Long> getAndAdd​(long delta)
        Specified by:
        getAndAdd in interface org.onosproject.store.service.AsyncAtomicCounter
      • addAndGet

        public java.util.concurrent.CompletableFuture<java.lang.Long> addAndGet​(long delta)
        Specified by:
        addAndGet in interface org.onosproject.store.service.AsyncAtomicCounter
      • get

        public java.util.concurrent.CompletableFuture<java.lang.Long> get()
        Specified by:
        get in interface org.onosproject.store.service.AsyncAtomicCounter
      • set

        public java.util.concurrent.CompletableFuture<java.lang.Void> set​(long value)
        Specified by:
        set in interface org.onosproject.store.service.AsyncAtomicCounter
      • compareAndSet

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> compareAndSet​(long expectedValue,
                                                                                       long updateValue)
        Specified by:
        compareAndSet in interface org.onosproject.store.service.AsyncAtomicCounter