Interface ReplicableCommand

All Superinterfaces:
TracedCommand, VersionAware
All Known Subinterfaces:
org.infinispan.commands.remote.CacheRpcCommand, DataCommand, FlagAffectedCommand, GlobalRpcCommand, RemoteLockCommand, TopologyAffectedCommand, TransactionalRemoteLockCommand, VisitableCommand
All Known Implementing Classes:
org.infinispan.commands.read.AbstractDataCommand, AbstractFlagAffectedCommand, AbstractTopologyAffectedCommand, org.infinispan.commands.remote.BaseRpcCommand, ForwardCommitCommand, ForwardRollbackCommand, HeartBeatCommand, MultiClusterEventCommand, ReplicableManagerFunctionCommand, ReplicableRunnableCommand, TouchCommand, XSiteAmendOfflineStatusCommand, XSiteAutoTransferStatusCommand, XSiteLocalEventCommand, XSiteSetStateTransferModeCommand, XSiteStatePushCommand, XSiteStateTransferCancelSendCommand, XSiteStateTransferClearStatusCommand, XSiteStateTransferFinishReceiveCommand, XSiteStateTransferFinishSendCommand, XSiteStateTransferRestartSendingCommand, XSiteStateTransferStartReceiveCommand, XSiteStateTransferStartSendCommand, XSiteStateTransferStatusRequestCommand

public interface ReplicableCommand extends TracedCommand, VersionAware
The core of the command-based cache framework. Commands correspond to specific areas of functionality in the cache, and can be replicated using the RpcManager
Since:
4.0
Author:
Mircea.Markus@jboss.com, Manik Surtani
  • Method Summary

    Modifier and Type
    Method
    Description
    default byte
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 16.0 as this is no longer required by the Protostream based marshaller.
    boolean
    If true, a return value will be provided when performed remotely.
    default boolean
    If true, a return value will be marshalled as a SuccessfulResponse, otherwise it will be marshalled as a UnsuccessfulResponse.
    default boolean
     
    default void
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 16.0 command objects should be marshalled directly by ProtoStream
    default void
    Sets the sender's Address.
    Returns a NodeVersion representing the Infinispan version in which this command was added.
    default void
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 16.0 command objects should be marshalled directly by ProtoStream

    Methods inherited from interface org.infinispan.commands.TracedCommand

    getOperationName, getSpanAttributes, setSpanAttributes
  • Method Details

    • getCommandId

      @Deprecated(since="16.0", forRemoval=true) default byte getCommandId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 16.0 as this is no longer required by the Protostream based marshaller. Implementations of this method are always ignored.
      Used by marshallers to convert this command into an id for streaming.
      Returns:
      the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
    • isReturnValueExpected

      boolean isReturnValueExpected()
      If true, a return value will be provided when performed remotely. Otherwise, a remote ResponseGenerator may choose to simply return null to save on marshalling costs.
      Returns:
      true or false
    • isSuccessful

      default boolean isSuccessful()
      If true, a return value will be marshalled as a SuccessfulResponse, otherwise it will be marshalled as a UnsuccessfulResponse.
    • logThrowable

      default boolean logThrowable(Throwable t)
    • writeTo

      @Deprecated(forRemoval=true, since="16.0") default void writeTo(ObjectOutput output) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 16.0 command objects should be marshalled directly by ProtoStream
      Writes this instance to the ObjectOutput.
      Parameters:
      output - the stream.
      Throws:
      IOException - if an error occurred during the I/O.
    • readFrom

      @Deprecated(forRemoval=true, since="16.0") default void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 16.0 command objects should be marshalled directly by ProtoStream
      Reads this instance from the stream written by writeTo(ObjectOutput).
      Parameters:
      input - the stream to read.
      Throws:
      IOException - if an error occurred during the I/O.
      ClassNotFoundException - if it tries to load an undefined class.
    • setOrigin

      default void setOrigin(Address origin)
      Sets the sender's Address.

      By default, it doesn't set anything. Implement this method if the sender's Address is needed.

      Parameters:
      origin - the sender's Address
    • supportedSince

      NodeVersion supportedSince()
      Returns a NodeVersion representing the Infinispan version in which this command was added. This value is used to ensure that when the cluster contains different Infinispan versions, only commands compatible with the oldest version are transmitted.

      Abstract classes should not implement this method as the version should be specific to an individual implementation. Similarly, implementations which extend another ReplicableCommand should always override this method.

      Specified by:
      supportedSince in interface VersionAware
      Returns:
      a NodeVersion corresponding to the Infinispan version this command was added.