Package com.hazelcast.wan
Enum WanPublisherState
- java.lang.Object
-
- java.lang.Enum<WanPublisherState>
-
- com.hazelcast.wan.WanPublisherState
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<WanPublisherState>
public enum WanPublisherState extends java.lang.Enum<WanPublisherState>
Defines the state in which a WAN publisher can be in if it is not shutting down.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PAUSED
State where new events are enqueued but they are not dequeued.REPLICATING
State where both enqueuing new events is allowed, enqueued events are replicated to the target cluster and WAN sync is enabled.STOPPED
State where neither new events are enqueued nor dequeued.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WanPublisherState
getByType(byte id)
Returns the WanPublisherState as an enum.byte
getId()
Returns the ID of the WAN publisher state.boolean
isEnqueueNewEvents()
Returnstrue
if this state allows enqueueing new events,false
otherwise.boolean
isReplicateEnqueuedEvents()
Returnstrue
if this state allows dequeueing and replicating events,false
otherwise.static WanPublisherState
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static WanPublisherState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
REPLICATING
public static final WanPublisherState 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
public static final WanPublisherState 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
public static final WanPublisherState 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, decomissioned 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. An 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 Detail
-
values
public static WanPublisherState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WanPublisherState c : WanPublisherState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WanPublisherState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getByType
public static WanPublisherState getByType(byte id)
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.
-
-