java.lang.Object
com.pushtechnology.diffusion.client.callbacks.ErrorReason

public final class ErrorReason extends Object
Reason codes used to report error conditions.

An application can check whether an ErrorReason is equal to some expected value using Object.equals(Object). Equality is derived from the reasonCode, with instances with equal codes considered equal.

Some common ErrorReason values are defined as constants in this class. More specific reasons may be defined by individual features.

Since:
5.1
Author:
DiffusionData Limited
See Also:
  • Field Details

    • COMMUNICATION_FAILURE

      public static final ErrorReason COMMUNICATION_FAILURE
      Communication with the server failed.
    • SESSION_CLOSED

      public static final ErrorReason SESSION_CLOSED
      Communication with the server failed because the session is closed.
    • REQUEST_TIME_OUT

      public static final ErrorReason REQUEST_TIME_OUT
      Communication with the server failed because a service request timed out.
    • ACCESS_DENIED

      public static final ErrorReason ACCESS_DENIED
      The request was rejected because the caller has insufficient permissions.
    • UNSUPPORTED

      public static final ErrorReason UNSUPPORTED
      The request was rejected because the requested service is unsupported for this caller.
      Since:
      5.9
    • CALLBACK_EXCEPTION

      public static final ErrorReason CALLBACK_EXCEPTION
      An application callback threw an exception. Check logs for more information.
      Since:
      5.9
    • INVALID_DATA

      public static final ErrorReason INVALID_DATA
      An operation failed because invalid data was received.
      Since:
      6.0
    • NO_SUCH_SESSION

      public static final ErrorReason NO_SUCH_SESSION
      The session does not exist on the server.
      Since:
      6.0
    • INCOMPATIBLE_DATATYPE

      public static final ErrorReason INCOMPATIBLE_DATATYPE
      A datatype operation has failed due to incompatibility.
      Since:
      6.0
    • UNHANDLED_MESSAGE

      public static final ErrorReason UNHANDLED_MESSAGE
      A message was not handled by the server.
      Since:
      6.0
    • CLUSTER_REPARTITION

      public static final ErrorReason CLUSTER_REPARTITION
      A cluster operation failed because partition ownership changed during processing.

      This is a transient error that occurs while the cluster is recovering from failure. The session can retry the operation.

      Since:
      6.0
      See Also:
    • INCOMPATIBLE_STATE

      public static final ErrorReason INCOMPATIBLE_STATE
      A topic update could not be performed because the topic is managed by a component (for example, fan-out) which prohibits external updates.
      Since:
      6.0
    • CLUSTER_ROUTING

      public static final ErrorReason CLUSTER_ROUTING
      A cluster operation failed to be routed to a server within the cluster due to a communication failure, or the server that owns a partition is not currently known.

      This is a transient error that occurs while the cluster is recovering from failure. The session can retry the operation.

      Since:
      6.5
      See Also:
    • TOPIC_TREE_REGISTRATION_CONFLICT

      public static final ErrorReason TOPIC_TREE_REGISTRATION_CONFLICT
      A conflicting registration exists on the same branch of the topic tree.
    • HANDLER_CONFLICT

      public static final ErrorReason HANDLER_CONFLICT
      A conflicting registration exists.
    • INVALID_PATH

      public static final ErrorReason INVALID_PATH
      An invalid path was supplied.
  • Constructor Details

    • ErrorReason

      public ErrorReason(int reasonCode, String description)
      Constructor.

      Application code should prefer pre-defined constants such as COMMUNICATION_FAILURE, rather than calling this.

      Parameters:
      reasonCode - a unique code
      description - a description of the reason, may be context-specific
  • Method Details

    • getReasonCode

      public int getReasonCode()
      A code that uniquely identifies this reason.

      Applications should rarely need to call this method and prefer equals(Object) to compare instances for equality.

      Reasons defined by DiffusionData have reason codes in the range 0 to 65535 inclusive.

      Returns:
      the code
    • getDescription

      public String getDescription()
      Description of the error reason, may be context-specific.
      Returns:
      the description
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object