Class AbstractCrossNodesEvent<R,T extends io.grpc.stub.AbstractAsyncStub<T>>

java.lang.Object
com.atlassian.bamboo.cluster.event.AbstractCrossNodesEvent<R,T>
Type Parameters:
R - The type of request message associated with the event.
T - The type of gRPC stub used for communication, extending AbstractAsyncStub.
All Implemented Interfaces:
CrossNodesEvent, Serializable
Direct Known Subclasses:
AtlassianCacheCrossNodesEvent, BambooCrossNodesEvent, PluginCrossNodesEvent

public abstract class AbstractCrossNodesEvent<R,T extends io.grpc.stub.AbstractAsyncStub<T>> extends Object implements CrossNodesEvent
Abstract base class defining common interface for cross-nodes events in a gRPC-based system. Subclasses must define specific behaviors for sending requests, converting metadata to gRPC messages, and providing the class object of the gRPC stub used for communication.
See Also:
  • Constructor Details

    • AbstractCrossNodesEvent

      public AbstractCrossNodesEvent()
  • Method Details

    • send

      public abstract void send(@NotNull T stub, @NotNull @NotNull MetadataInfo metadataInfo, @NotNull @NotNull io.grpc.stub.StreamObserver<CrossNodesCommunication.CommonResponse> responseObserver)
      Sends a gRPC request using the event specific data, provided stub and metadata information, and observes the response.
      Parameters:
      stub - The gRPC stub instance used to send the request.
      metadataInfo - Metadata information associated with the request.
      responseObserver - Observer for handling responses from the server.
    • toGrpcRequestMessage

      @NotNull protected abstract R toGrpcRequestMessage(@NotNull @NotNull MetadataInfo metadataInfo)
      Converts event specific data and provided metadata information into the corresponding gRPC request message.
      Parameters:
      metadataInfo - Metadata information to be used.
      Returns:
      The gRPC request message
    • getStubClass

      @NotNull public abstract @NotNull Class<T> getStubClass()
      Retrieves the class object representing the gRPC stub used for communication.
      Returns:
      The class object of the gRPC stub T.