Class PluginCrossNodesEvent<R>
java.lang.Object
com.atlassian.bamboo.cluster.event.AbstractCrossNodesEvent<R,PluginCrossNodesEventsServiceGrpc.PluginCrossNodesEventsServiceStub>
com.atlassian.bamboo.cluster.event.plugin.PluginCrossNodesEvent<R>
- Type Parameters:
R
- the correspondent CrossNodesCommunication event type
- All Implemented Interfaces:
CrossNodesEvent
,Serializable
- Direct Known Subclasses:
DisablePluginEvent
,EnablePluginEvent
,InstallPluginEvent
,UninstallPluginEvent
,UpgradePluginEvent
public abstract class PluginCrossNodesEvent<R>
extends AbstractCrossNodesEvent<R,PluginCrossNodesEventsServiceGrpc.PluginCrossNodesEventsServiceStub>
implements CrossNodesEvent, Serializable
Abstract class with commonalities for plugin events in a multi-node environment.
Child classes need to expose their own static method to create a Builder. For instance, take
a look at InstallPluginEvent.newBuilder()
.
- Since:
- 9.5
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
PluginCrossNodesEvent.AbstractPluginEventBuilder<T extends PluginCrossNodesEvent<?>,
B extends PluginCrossNodesEvent.AbstractPluginEventBuilder<T, B>> Nested classes/interfaces inherited from interface com.atlassian.bamboo.cluster.event.CrossNodesEvent
CrossNodesEvent.Type
-
Constructor Summary
ModifierConstructorDescriptionprotected
PluginCrossNodesEvent
(CrossNodesEvent.Type eventType, @Nullable String pluginKey, int pluginsVersion, @Nullable String pluginName, @NotNull TestModeEnum testMode) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.Retrieves the class object representing the gRPC stub used for communication with the Atlassian Cache service.@NotNull CrossNodesEvent.Type
getType()
Returns the type of the event.int
hashCode()
Returns a hash code value for the object.boolean
isEmpty()
Returns whether the event is empty.toGrpcRequestMessage
(@NotNull MetadataInfo metadataInfo) Converts event specific data and provided metadata information into the corresponding gRPC request message.protected abstract R
toGrpcRequestMessage
(@NotNull MetadataInfo metadataInfo, String pluginKey, int pluginsVersion, String pluginName) @NotNull String
toString()
Returns a string representation of the object.Methods inherited from class com.atlassian.bamboo.cluster.event.AbstractCrossNodesEvent
send
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.cluster.event.CrossNodesEvent
isNotEmpty
-
Constructor Details
-
PluginCrossNodesEvent
protected PluginCrossNodesEvent(@NotNull CrossNodesEvent.Type eventType, @Nullable @Nullable String pluginKey, int pluginsVersion, @Nullable @Nullable String pluginName, @NotNull @NotNull TestModeEnum testMode)
-
-
Method Details
-
getType
Description copied from interface:CrossNodesEvent
Returns the type of the event.- Specified by:
getType
in interfaceCrossNodesEvent
- Returns:
- the type of the event
-
isEmpty
public boolean isEmpty()Description copied from interface:CrossNodesEvent
Returns whether the event is empty. May be needed to avoid sending empty events.- Specified by:
isEmpty
in interfaceCrossNodesEvent
- Returns:
- true if the event is empty, false otherwise.
-
getStubClass
@NotNull public @NotNull Class<PluginCrossNodesEventsServiceGrpc.PluginCrossNodesEventsServiceStub> getStubClass()Retrieves the class object representing the gRPC stub used for communication with the Atlassian Cache service.- Specified by:
getStubClass
in classAbstractCrossNodesEvent<R,
PluginCrossNodesEventsServiceGrpc.PluginCrossNodesEventsServiceStub> - Returns:
- The class object of PluginCrossNodesEventsServiceStub.
-
toString
Description copied from interface:CrossNodesEvent
Returns a string representation of the object.- Specified by:
toString
in interfaceCrossNodesEvent
- Overrides:
toString
in classObject
- Returns:
- a string representation of the object
-
equals
Description copied from interface:CrossNodesEvent
Indicates whether some other object is "equal to" this one.- Specified by:
equals
in interfaceCrossNodesEvent
- Overrides:
equals
in classObject
- Parameters:
o
- the reference object with which to compare- Returns:
true
if this object is the same as the obj argument;false
otherwise
-
hashCode
public int hashCode()Description copied from interface:CrossNodesEvent
Returns a hash code value for the object.- Specified by:
hashCode
in interfaceCrossNodesEvent
- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this object
-
toGrpcRequestMessage
@NotNull protected abstract R toGrpcRequestMessage(@NotNull @NotNull MetadataInfo metadataInfo, String pluginKey, int pluginsVersion, String pluginName) -
toGrpcRequestMessage
Description copied from class:AbstractCrossNodesEvent
Converts event specific data and provided metadata information into the corresponding gRPC request message.- Specified by:
toGrpcRequestMessage
in classAbstractCrossNodesEvent<R,
PluginCrossNodesEventsServiceGrpc.PluginCrossNodesEventsServiceStub> - Parameters:
metadataInfo
- Metadata information to be used.- Returns:
- The gRPC request message
-