uk.co.real_logic.artio.messages.SessionState Maven / Gradle / Ivy
/* Generated SBE (Simple Binary Encoding) message codec. */
package uk.co.real_logic.artio.messages;
@SuppressWarnings("all")
public enum SessionState
{
/**
* The session is connecting or reconnecting.
*/
CONNECTING((short)0),
/**
* A machine has connected to the gateway, but hasn't logged in yet. Initial state of a session.
*/
CONNECTED((short)1),
/**
* Initiator only state - sent logon message but it hasn't received the reply yet.
*/
SENT_LOGON((short)2),
/**
* Session is fully authenticated and ready to execute.
*/
ACTIVE((short)3),
/**
* Session is trying to send logout, will retry sending until not backpressured
*/
LOGGING_OUT((short)5),
/**
* Session is trying to send logout and the disconnect, will retry sending until not backpressured
*/
LOGGING_OUT_AND_DISCONNECTING((short)6),
/**
* Linger between logout request and a logout acknowledgement. You can do resend processing at this point, but no other messages.
*/
AWAITING_LOGOUT((short)7),
/**
* Session is trying to disconnect, will retry disconnecting until not backpressured
*/
DISCONNECTING((short)8),
/**
* Session has been disconnected.
*/
DISCONNECTED((short)9),
/**
* DISCONNECTED and unable to reconnect.
*/
DISABLED((short)10),
/**
* Logout has been sent on an async SessionProxy, the session is waiting for it to be written via a SessionWriter.
*/
AWAITING_ASYNC_PROXY_LOGOUT((short)11),
/**
* To be used to represent not present or null.
*/
NULL_VAL((short)255);
private final short value;
SessionState(final short value)
{
this.value = value;
}
/**
* The raw encoded value in the Java type representation.
*
* @return the raw value encoded.
*/
public short value()
{
return value;
}
/**
* Lookup the enum value representing the value.
*
* @param value encoded to be looked up.
* @return the enum value representing the value.
*/
public static SessionState get(final short value)
{
switch (value)
{
case 0: return CONNECTING;
case 1: return CONNECTED;
case 2: return SENT_LOGON;
case 3: return ACTIVE;
case 5: return LOGGING_OUT;
case 6: return LOGGING_OUT_AND_DISCONNECTING;
case 7: return AWAITING_LOGOUT;
case 8: return DISCONNECTING;
case 9: return DISCONNECTED;
case 10: return DISABLED;
case 11: return AWAITING_ASYNC_PROXY_LOGOUT;
case 255: return NULL_VAL;
}
throw new IllegalArgumentException("Unknown value: " + value);
}
}