com.hazelcast.config

## Enum WanPublisherState

- java.lang.Object
- - java.lang.Enum<WanPublisherState>
  - - com.hazelcast.config.WanPublisherState

- All Implemented Interfaces:
    Serializable, Comparable<WanPublisherState>

      public enum WanPublisherState
      extends 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 and 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 and Description
    --- | ---
    `static WanPublisherState` | `getByType(byte id)` Returns the WanPublisherState as an enum.
    `byte` | `getId()` Returns the ID of the WAN publisher state.
    `boolean` | `isEnqueueNewEvents()` Returns `true` if this state allows enqueueing new events, `false` otherwise.
    `boolean` | `isReplicateEnqueuedEvents()` Returns `true` if this state allows dequeueing and replicating events, `false` otherwise.
    `static WanPublisherState` | `valueOf(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.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### 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 the `PAUSED` 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.clearQueues(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(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:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### getByType

          public static WanPublisherState getByType(byte id)

      Returns the WanPublisherState as an enum.

    - #### isEnqueueNewEvents

          public boolean isEnqueueNewEvents()

      Returns `true` if this state allows enqueueing new events, `false` otherwise.

    - #### isReplicateEnqueuedEvents

          public boolean isReplicateEnqueuedEvents()

      Returns `true` if this state allows dequeueing and replicating events, `false` otherwise.

    - #### getId

          public byte getId()

      Returns the ID of the WAN publisher state.

Copyright © 2019. All rights reserved.