Record Class ClusterEvent
java.lang.Object
java.lang.Record
org.openspaces.core.multicluster.event.ClusterEvent
- Record Components:
type- what happenedclusterName- the cluster the event is about; forClusterEventType.ACTIVE_CLUSTER_CHANGEDandClusterEventType.READ_ACTIVE_CLUSTER_CHANGEDthis is the cluster that now holds the roleclusterProxy- that cluster's proxy, ornullif it has been unregisteredpreviousActive- the cluster that held the role before, set only for the two role-change eventscause- the failure behind the event, ornullwhen it was deliberateinReadRotation- whether the cluster is in the read rotation after this eventpromotable- whether the cluster may be promoted to active after this event
-
Constructor Summary
ConstructorsConstructorDescriptionClusterEvent(ClusterEventType type, String clusterName, GigaSpace clusterProxy, String previousActive, Throwable cause, boolean inReadRotation, boolean promotable) Creates an instance of aClusterEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterEventactiveChanged(String previousActive, String newActive, GigaSpace newProxy, Throwable cause) static ClusterEventcause()Returns the value of thecauserecord component.Returns the value of theclusterNamerecord component.Returns the value of theclusterProxyrecord component.final booleanIndicates whether some other object is "equal to" this one.static ClusterEventA cluster left the rotation and the priority list because it failed.static ClusterEventfailed(String clusterName, GigaSpace proxy, Throwable cause, boolean inReadRotation, boolean promotable) A cluster failed, reporting where that leaves it.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinReadRotationrecord component.Returns the value of thepreviousActiverecord component.booleanReturns the value of thepromotablerecord component.static ClusterEventreadActiveChanged(String previous, String current, GigaSpace currentProxy, Throwable cause) The cluster servingREAD_ACTIVEreads changed fromprevioustocurrent.static ClusterEventtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ClusterEvent
public ClusterEvent(ClusterEventType type, String clusterName, GigaSpace clusterProxy, String previousActive, Throwable cause, boolean inReadRotation, boolean promotable) Creates an instance of aClusterEventrecord class.- Parameters:
type- the value for thetyperecord componentclusterName- the value for theclusterNamerecord componentclusterProxy- the value for theclusterProxyrecord componentpreviousActive- the value for thepreviousActiverecord componentcause- the value for thecauserecord componentinReadRotation- the value for theinReadRotationrecord componentpromotable- the value for thepromotablerecord component
-
-
Method Details
-
added
-
removed
-
failed
A cluster left the rotation and the priority list because it failed. -
failed
public static ClusterEvent failed(String clusterName, GigaSpace proxy, Throwable cause, boolean inReadRotation, boolean promotable) A cluster failed, reporting where that leaves it.Most modes no longer detach a cluster that could not be reached - they say so and leave the decision to the application - so the membership flags have to describe the cluster as it actually is. Reporting a cluster still serving reads as out of the rotation would tell the listener the opposite of the truth, and the listener is the one deciding whether to remove it.
-
activeChanged
public static ClusterEvent activeChanged(String previousActive, String newActive, GigaSpace newProxy, Throwable cause) -
readActiveChanged
public static ClusterEvent readActiveChanged(String previous, String current, GigaSpace currentProxy, Throwable cause) The cluster servingREAD_ACTIVEreads changed fromprevioustocurrent. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
-
clusterName
Returns the value of theclusterNamerecord component.- Returns:
- the value of the
clusterNamerecord component
-
clusterProxy
Returns the value of theclusterProxyrecord component.- Returns:
- the value of the
clusterProxyrecord component
-
previousActive
Returns the value of thepreviousActiverecord component.- Returns:
- the value of the
previousActiverecord component
-
cause
-
inReadRotation
public boolean inReadRotation()Returns the value of theinReadRotationrecord component.- Returns:
- the value of the
inReadRotationrecord component
-
promotable
public boolean promotable()Returns the value of thepromotablerecord component.- Returns:
- the value of the
promotablerecord component
-