Class HotRodOperation<T>

java.lang.Object
java.util.concurrent.CompletableFuture<T>
org.infinispan.hotrod.impl.operations.HotRodOperation<T>
All Implemented Interfaces:
Runnable, CompletionStage<T>, Future<T>, HotRodConstants
Direct Known Subclasses:
AuthMechListOperation, AuthOperation, IterationEndOperation, IterationNextOperation, PingOperation, RemoveClientListenerOperation, RetryOnFailureOperation, StatsAffectingHotRodOperation, UpdateBloomFilterOperation

public abstract class HotRodOperation<T> extends CompletableFuture<T> implements HotRodConstants, Runnable
Generic Hot Rod operation. It is aware of HotRodFlags and it is targeted against a cache name. This base class encapsulates the knowledge of writing and reading a header, as described in the Hot Rod protocol specification
Since:
14.0
  • Field Details

    • operationContext

      protected final OperationContext operationContext
    • options

      protected final org.infinispan.api.common.CacheOptions.Impl options
    • timeoutFuture

      protected volatile ScheduledFuture<?> timeoutFuture
  • Constructor Details

    • HotRodOperation

      protected HotRodOperation(OperationContext operationContext, short requestCode, short responseCode, org.infinispan.api.common.CacheOptions options, DataFormat dataFormat)
    • HotRodOperation

      protected HotRodOperation(OperationContext operationContext, short requestCode, short responseCode, org.infinispan.api.common.CacheOptions options)
  • Method Details

    • execute

      public abstract CompletionStage<T> execute()
    • header

      public HeaderParams header()
    • flags

      protected int flags()
    • sendHeaderAndRead

      protected void sendHeaderAndRead(io.netty.channel.Channel channel)
    • sendHeader

      protected void sendHeader(io.netty.channel.Channel channel)
    • scheduleRead

      protected void scheduleRead(io.netty.channel.Channel channel)
    • releaseChannel

      public void releaseChannel(io.netty.channel.Channel channel)
    • channelInactive

      public void channelInactive(io.netty.channel.Channel channel)
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.Channel channel, Throwable cause)
    • sendArrayOperation

      protected void sendArrayOperation(io.netty.channel.Channel channel, byte[] array)
    • acceptResponse

      public abstract void acceptResponse(io.netty.buffer.ByteBuf buf, short status, HeaderDecoder decoder)
    • toString

      public String toString()
      Overrides:
      toString in class CompletableFuture<T>
    • addParams

      protected void addParams(StringBuilder sb)
    • complete

      public boolean complete(T value)
      Overrides:
      complete in class CompletableFuture<T>
    • completeExceptionally

      public boolean completeExceptionally(Throwable ex)
      Overrides:
      completeExceptionally in class CompletableFuture<T>
    • scheduleTimeout

      public void scheduleTimeout(io.netty.channel.Channel channel)
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • dataFormat

      public final DataFormat dataFormat()
    • cacheName

      protected final byte[] cacheName()