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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.cluster.event.CrossNodesEvent
CrossNodesEvent.Type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the class object representing the gRPC stub used for communication.abstract void
send
(T stub, @NotNull MetadataInfo metadataInfo, @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.protected abstract R
toGrpcRequestMessage
(@NotNull MetadataInfo metadataInfo) Converts event specific data and provided metadata information into the corresponding gRPC request message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.cluster.event.CrossNodesEvent
equals, getType, hashCode, isEmpty, isNotEmpty, toString
-
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
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
Retrieves the class object representing the gRPC stub used for communication.- Returns:
- The class object of the gRPC stub T.
-