Class DummyStorageDriverMock<I extends Item,​O extends Operation<I>>

  • All Implemented Interfaces:
    Daemon, StorageDriver<I,​O>, com.github.akurilov.commons.concurrent.AsyncRunnable, com.github.akurilov.commons.io.Output<O>, java.lang.AutoCloseable, java.rmi.Remote, java.util.function.Consumer<O>

    public final class DummyStorageDriverMock<I extends Item,​O extends Operation<I>>
    extends com.github.akurilov.commons.concurrent.AsyncRunnableBase
    implements StorageDriver<I,​O>
    Created by andrey on 11.05.17.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.github.akurilov.commons.concurrent.AsyncRunnable

        com.github.akurilov.commons.concurrent.AsyncRunnable.State
    • Constructor Summary

      Constructors 
      Constructor Description
      DummyStorageDriverMock​(com.github.akurilov.confuse.Config storageConfig)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int activeOpCount()  
      void adjustIoBuffers​(long avgTransferSize, OpType opType)  
      boolean await​(long timeout, java.util.concurrent.TimeUnit timeUnit)  
      long completedOpCount()  
      int concurrencyLimit()  
      protected void doClose()  
      protected void doShutdown()  
      protected void doStart()  
      protected void doStop()  
      com.github.akurilov.commons.io.Input<O> getInput()  
      boolean isIdle()  
      java.util.List<I> list​(ItemFactory<I> itemFactory, java.lang.String path, java.lang.String prefix, int idRadix, I lastPrevItem, int count)  
      void operationResultOutput​(com.github.akurilov.commons.io.Output<O> opResultOut)  
      int put​(java.util.List<O> tasks)  
      int put​(java.util.List<O> tasks, int from, int to)  
      boolean put​(O task)  
      long scheduledOpCount()  
      java.lang.String toString()  
      • Methods inherited from class com.github.akurilov.commons.concurrent.AsyncRunnableBase

        await, close, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state, stop
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.github.akurilov.commons.concurrent.AsyncRunnable

        await, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state
      • Methods inherited from interface java.util.function.Consumer

        andThen
      • Methods inherited from interface com.github.akurilov.commons.io.Output

        accept
    • Constructor Detail

      • DummyStorageDriverMock

        public DummyStorageDriverMock​(com.github.akurilov.confuse.Config storageConfig)
    • Method Detail

      • put

        public final boolean put​(O task)
        Specified by:
        put in interface com.github.akurilov.commons.io.Output<I extends Item>
        Specified by:
        put in interface StorageDriver<I extends Item,​O extends Operation<I>>
      • put

        public final int put​(java.util.List<O> tasks,
                             int from,
                             int to)
        Specified by:
        put in interface com.github.akurilov.commons.io.Output<I extends Item>
        Specified by:
        put in interface StorageDriver<I extends Item,​O extends Operation<I>>
      • put

        public final int put​(java.util.List<O> tasks)
        Specified by:
        put in interface com.github.akurilov.commons.io.Output<I extends Item>
        Specified by:
        put in interface StorageDriver<I extends Item,​O extends Operation<I>>
      • getInput

        public final com.github.akurilov.commons.io.Input<O> getInput()
        Specified by:
        getInput in interface com.github.akurilov.commons.io.Output<I extends Item>
      • list

        public final java.util.List<I> list​(ItemFactory<I> itemFactory,
                                            java.lang.String path,
                                            java.lang.String prefix,
                                            int idRadix,
                                            I lastPrevItem,
                                            int count)
                                     throws java.io.IOException
        Specified by:
        list in interface StorageDriver<I extends Item,​O extends Operation<I>>
        Throws:
        java.io.IOException
      • doStart

        protected void doStart()
                        throws java.lang.IllegalStateException
        Overrides:
        doStart in class com.github.akurilov.commons.concurrent.AsyncRunnableBase
        Throws:
        java.lang.IllegalStateException
      • doShutdown

        protected final void doShutdown()
                                 throws java.lang.IllegalStateException
        Overrides:
        doShutdown in class com.github.akurilov.commons.concurrent.AsyncRunnableBase
        Throws:
        java.lang.IllegalStateException
      • await

        public final boolean await​(long timeout,
                                   java.util.concurrent.TimeUnit timeUnit)
                            throws java.lang.InterruptedException
        Specified by:
        await in interface com.github.akurilov.commons.concurrent.AsyncRunnable
        Overrides:
        await in class com.github.akurilov.commons.concurrent.AsyncRunnableBase
        Throws:
        java.lang.InterruptedException
      • doStop

        protected final void doStop()
                             throws java.lang.IllegalStateException
        Overrides:
        doStop in class com.github.akurilov.commons.concurrent.AsyncRunnableBase
        Throws:
        java.lang.IllegalStateException
      • doClose

        protected final void doClose()
                              throws java.io.IOException
        Overrides:
        doClose in class com.github.akurilov.commons.concurrent.AsyncRunnableBase
        Throws:
        java.io.IOException
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object