Package com.hazelcast.wan
Enum Class WanPublisherState
- All Implemented Interfaces:
Serializable
,Comparable<WanPublisherState>
,Constable
Defines the state in which a WAN publisher can be in if it is not shutting
down.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionState where new events are enqueued, but they are not dequeued.State where both enqueuing new events is allowed, enqueued events are replicated to the target cluster and WAN sync is enabled.State where neither new events are enqueued nor dequeued. -
Method Summary
Modifier and TypeMethodDescriptionstatic WanPublisherState
getByType
(byte id) Returns the WanPublisherState as an enum.byte
getId()
Returns the ID of the WAN publisher state.boolean
Returnstrue
if this state allows enqueueing new events,false
otherwise.boolean
Returnstrue
if this state allows dequeueing and replicating events,false
otherwise.static WanPublisherState
Returns the enum constant of this class with the specified name.static WanPublisherState[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REPLICATING
State where both enqueuing new events is allowed, enqueued events are replicated to the target cluster and WAN sync is enabled. The publisher is most often in REPLICATING state when the target cluster is operational. -
PAUSED
State where new events are enqueued, but they are not dequeued. Some events which have been dequeued before the state was switched may still be replicated to the target cluster but further events will not be replicated. WAN sync is enabled. For instance, this state may be useful if you know that the target cluster is temporarily unavailable (is under maintenance) and that the WAN queues can hold as many events as is necessary to reconcile the state between two clusters once the target cluster becomes available. -
STOPPED
State where neither new events are enqueued nor dequeued. As with thePAUSED
state, some events might still be replicated after the publisher has switched to this state. WAN sync is enabled. For instance, this state may be useful if you know that the target cluster is being shut down, decommissioned and being put out of use and that it will never come back. In such cases, you may additionally clear the WAN queues to release the consumed heap after the publisher has been switched into this state. Another example would be starting a publisher in STOPPED state. This may be the case where you know that the target cluster is not initially available and will be unavailable for a definite period but at some point it will become available. Once it becomes available, you can then switch the publisher state to REPLICATING to begin replicating to that cluster.- See Also:
-
WanReplicationService.removeWanEvents(String, String)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getByType
Returns the WanPublisherState as an enum. -
isEnqueueNewEvents
public boolean isEnqueueNewEvents()Returnstrue
if this state allows enqueueing new events,false
otherwise. -
isReplicateEnqueuedEvents
public boolean isReplicateEnqueuedEvents()Returnstrue
if this state allows dequeueing and replicating events,false
otherwise. -
getId
public byte getId()Returns the ID of the WAN publisher state.
-