org.ogf.saga.stream
Enum StreamState

java.lang.Object
  extended by java.lang.Enum<StreamState>
      extended by org.ogf.saga.stream.StreamState
All Implemented Interfaces:
Serializable, Comparable<StreamState>

public enum StreamState
extends Enum<StreamState>

SAGA Stream states. Newly created streams start in the NEW state. A Stream.connect() call brings it either in state OPEN or ERROR. From the OPEN state, when an error occurs it goes to state ERROR. When the remote party closes the connection it goes into state DROPPED, and after a Stream.close() call it goes into state CLOSED. CLOSED, DROPPED, and ERROR are final states: I/O is no longer possible.


Enum Constant Summary
CLOSED
          State of a stream on which Stream.close() was called.
DROPPED
          Remote party closed the connection.
ERROR
          An error occured on the stream.
NEW
          Initial state of a newly constructed stream.
OPEN
          State of a connected stream.
 
Method Summary
 int getValue()
          Returns the integer value of this enumeration literal.
static StreamState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StreamState[] 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

NEW

public static final StreamState NEW
Initial state of a newly constructed stream.


OPEN

public static final StreamState OPEN
State of a connected stream.


CLOSED

public static final StreamState CLOSED
State of a stream on which Stream.close() was called. This is a final state.


DROPPED

public static final StreamState DROPPED
Remote party closed the connection. This is a final state.


ERROR

public static final StreamState ERROR
An error occured on the stream. This is a final state.

Method Detail

values

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

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

valueOf

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

getValue

public int getValue()
Returns the integer value of this enumeration literal.

Returns:
the integer value.


Copyright © 2014 Open Grid Forum. All rights reserved.