Package com.streambase.liveview.client
Interface LiveViewConnectionControl
-
public interface LiveViewConnectionControl
When using a LiveViewMultiConnection, this represents one of the connections.- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LiveViewConnectionControl.ConnectionState
The status of this connection
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConnectionConfig
getConnectionConfig()
LiveViewConnectionControl.ConnectionState
getConnectionState()
long
getLastSuccessfulConnect()
If the current status is CONNECTED, this will have the time this connection was made.int
getRetryCount()
Valid only if the current state is TRYING_TO_CONNECT.String
getUri()
Convenience method that is the same as getConnectionConfig().getUri()VersionType
getVersion()
If this server has never been successfully connected to, this value will be null.boolean
isCurrent()
void
setActive(boolean active)
If a connection is set to be inactive, it will stop attempting to connect to the server.
-
-
-
Method Detail
-
getConnectionConfig
ConnectionConfig getConnectionConfig()
- Returns:
- the connectionConfig that was / will be used to create this connection.
-
getUri
String getUri()
Convenience method that is the same as getConnectionConfig().getUri()- Returns:
- The URI to the server represented by this ConnectionControl.
-
isCurrent
boolean isCurrent()
- Returns:
- true if this connection is the currently active connection
-
getConnectionState
LiveViewConnectionControl.ConnectionState getConnectionState()
- Returns:
- The state of this connection.
-
getLastSuccessfulConnect
long getLastSuccessfulConnect()
If the current status is CONNECTED, this will have the time this connection was made.- Returns:
- time of last successful connect, or Long.MIN_VALUE if never connected.
-
getVersion
VersionType getVersion()
If this server has never been successfully connected to, this value will be null.- Returns:
- The version information received from the server in the last successful connect to it, if there have been any.
-
getRetryCount
int getRetryCount()
Valid only if the current state is TRYING_TO_CONNECT. It is the number of tries since the last successful connect, or since startup if there has never been a successful connect to this server.- Returns:
- number of tries since the last successful connect
-
setActive
void setActive(boolean active)
If a connection is set to be inactive, it will stop attempting to connect to the server.- Parameters:
active
-
-
-