com.hazelcast.spi

## Enum CallStatus

- java.lang.Object
- - java.lang.Enum<CallStatus>
  - - com.hazelcast.spi.CallStatus

- All Implemented Interfaces:
    Serializable, Comparable<CallStatus>

      public enum CallStatus
      extends Enum<CallStatus>

  The result of an `Operation.call()`. Using the CallStatus the operation can control how the system will deal with the operation after it is executed. For example when the CallStatus is `DONE_RESPONSE`, a response can be send to the caller. But it also allows for different behavior where no response is available yet e.g. when an operation gets offloaded.

  # CallStatus doesn't need ot be enum

  CallStatus is currently an enumeration. But if for whatever reason state needs to be returned, we can easily convert this enumeration to a regular object like e.g. java https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html. So you can have a call status class and if e.g. an operation that requires interleaving, a new Interleaving (subclass of CallStatus) can be returned containing all the state for that interleaving. The same can be done for Blocking operations. Currently we just return WAIT, but this can easily be modified by creating a new Wait (subclass of CallStatus) containing the wait key or whatever else is needed. It is very likely that the CallStatus is going to be converted to regular classes/object with the introduction of the 'Offloaded' which is part of phase 2 for the Operation continuations.

  # Future additions

  In the future we can add more values to this enumeration, for example 'YIELD' for batching operations that wants to release the operation thread so that other operations can be interleaved.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `DONE_RESPONSE` Signals that the Operation is done running and that a response is ready to be returned.
    `DONE_VOID` Signals that the Operation is done running, but no response will be returned.
    `OFFLOADED` Signals that the Operation has been offloaded e.g.
    `WAIT` Indicates that the call could not complete because waiting is required.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CallStatus` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static CallStatus[]` | `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

    - #### DONE_RESPONSE

          public static final CallStatus DONE_RESPONSE

      Signals that the Operation is done running and that a response is ready to be returned. Most of the normal operations like IAtomicLong.get will fall in this category.

    - #### DONE_VOID

          public static final CallStatus DONE_VOID

      Signals that the Operation is done running, but no response will be returned. Most of the regular operations like map.get will return a response, but there are also fire and forget operations (lot of cluster operations) that don't return a response.

    - #### WAIT

          public static final CallStatus WAIT

      Indicates that the call could not complete because waiting is required. E.g. a queue.take on an empty queue. This can only be returned by BlockingOperations.

    - #### OFFLOADED

          public static final CallStatus OFFLOADED

      Signals that the Operation has been offloaded e.g. an EntryProcessor. And therefor no response is available when the operation is executed. Only at a later time a response is ready and it is up to the offload functionality to determine how to deal with that. It could be that a response is send using the original operation handler, but it could also be that the operation will be rescheduled on an operation thread (a real continuation).

  - ### Method Detail

    - #### values

          public static CallStatus[] 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 (CallStatus c : CallStatus.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static CallStatus 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

Copyright © 2018. All rights reserved.