- java.lang.Object
-
- java.lang.Enum<ConnectState>
-
- com.gluonhq.connect.ConnectState
-
- All Implemented Interfaces:
Serializable
,Comparable<ConnectState>
public enum ConnectState extends Enum<ConnectState>
The possible states aGluonObservable
can be in while aDataProvider
operation is in progress. All observables begin in theREADY
state. When the operation is started, the observable will enter theRUNNING
state. Finally, depending on the operation outcome, the observable will always enter one of the following states:SUCCEEDED
,FAILED
,REMOVED
orCANCELLED
. When an exception was thrown during the operation, it will enter theFAILED
state. When the observable is aGluonObservableObject
and it is passed in as a parameter to theremove method
, then the object will enter theREMOVED
state when the remove operation succeeded successfully. When the operation was cancelled, the state of the observable will be changed toCANCELLED
. Signaling the cancellation of an operation is done by throwing aCancellationException
. In all other cases, the state will becomeSUCCEEDED
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CANCELLED
A GluonObservable object in theCANCELLED
state signals that the last executed synchronization operation was cancelled.FAILED
A GluonObservable object in theFAILED
state signals that the last executed synchronization operation failed.READY
This is the initial state of a new GluonObservable object.REMOVED
A GluonObservable object in theREMOVED
state signals that it is successfully removed after executing theDataProvider.removeObject(GluonObservableObject, ObjectDataRemover)
remove operation}.RUNNING
A GluonObservable object in theRUNNING
state means that a synchronization operation is currently in progress.SUCCEEDED
A GluonObservable object in theSUCCEEDED
state signals that the last executed synchronization operation completed successfully.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConnectState
valueOf(String name)
Returns the enum constant of this type with the specified name.static ConnectState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
READY
public static final ConnectState READY
This is the initial state of a new GluonObservable object. It will remain in theREADY
state until the first synchronization operation is started.
-
RUNNING
public static final ConnectState RUNNING
A GluonObservable object in theRUNNING
state means that a synchronization operation is currently in progress.
-
FAILED
public static final ConnectState FAILED
A GluonObservable object in theFAILED
state signals that the last executed synchronization operation failed. You can check theexception
to find out more about the reason of the failure.
-
SUCCEEDED
public static final ConnectState SUCCEEDED
A GluonObservable object in theSUCCEEDED
state signals that the last executed synchronization operation completed successfully.
-
CANCELLED
public static final ConnectState CANCELLED
A GluonObservable object in theCANCELLED
state signals that the last executed synchronization operation was cancelled. Cancellation is most likely caused by a user that cancels an action that is required to proceed with the operation. For example, when an operation requires an authenticated user, that operation is cancelled when the user aborts the authentication process.
-
REMOVED
public static final ConnectState REMOVED
A GluonObservable object in theREMOVED
state signals that it is successfully removed after executing theDataProvider.removeObject(GluonObservableObject, ObjectDataRemover)
remove operation}. TheREMOVED
state is only applicable toGluonObservableObject
because aGluonObservableList
can not be removed.
-
-
Method Detail
-
values
public static ConnectState[] 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 (ConnectState c : ConnectState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConnectState 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 nameNullPointerException
- if the argument is null
-
-