Class StorageDriverBase<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 abstract class StorageDriverBase<I extends Item,​O extends Operation<I>>
    extends DaemonBase
    implements StorageDriver<I,​O>
    Created by kurila on 11.07.16.
    • 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 
      Modifier Constructor Description
      protected StorageDriverBase​(java.lang.String stepId, DataInput itemDataInput, com.github.akurilov.confuse.Config storageConfig, boolean verifyFlag)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int concurrencyLimit()  
      protected void doClose()  
      com.github.akurilov.commons.io.Input<O> getInput()  
      protected boolean handleCompleted​(O op)  
      void operationResultOutput​(com.github.akurilov.commons.io.Output<O> opResultOut)  
      protected boolean prepare​(O op)  
      protected abstract java.lang.String requestNewAuthToken​(Credential credential)  
      protected abstract java.lang.String requestNewPath​(java.lang.String path)  
      java.lang.String toString()  
      • Methods inherited from class com.github.akurilov.commons.concurrent.AsyncRunnableBase

        await, await, doShutdown, doStart, doStop, 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, 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
    • Field Detail

      • stepId

        protected final java.lang.String stepId
      • concurrencyLimit

        protected final int concurrencyLimit
      • ioWorkerCount

        protected final int ioWorkerCount
      • namespace

        protected final java.lang.String namespace
      • credential

        protected final Credential credential
      • verifyFlag

        protected final boolean verifyFlag
      • pathToCredMap

        protected final java.util.concurrent.ConcurrentMap<java.lang.String,​Credential> pathToCredMap
      • requestNewPathFunc

        protected java.util.function.Function<java.lang.String,​java.lang.String> requestNewPathFunc
      • authTokens

        protected final java.util.concurrent.ConcurrentMap<Credential,​java.lang.String> authTokens
      • requestAuthTokenFunc

        protected java.util.function.Function<Credential,​java.lang.String> requestAuthTokenFunc
    • Method Detail

      • requestNewPath

        protected abstract java.lang.String requestNewPath​(java.lang.String path)
      • requestNewAuthToken

        protected abstract java.lang.String requestNewAuthToken​(Credential credential)
      • prepare

        protected boolean prepare​(O op)
      • handleCompleted

        protected boolean handleCompleted​(O op)
      • getInput

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

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

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