T
- The type of the underlying connection widget.public interface IVizConnection<T>
Instead of directly implementing this interface, classes should inherit from
VizConnection
.
Instances of this class will usually be created by and acquired from a
VizConnectionManager
.
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(IVizConnectionListener<T> listener)
Adds a listener for state changes to this connection.
|
java.lang.String |
getDescription()
Gets a description of the connection.
|
java.lang.String |
getHost()
Gets the current host associated with the connection.
|
java.lang.String |
getName()
Gets the name of the connection.
|
java.lang.String |
getPath()
Gets the installation path to the executable required to run the
associated connection widget.
|
int |
getPort()
Gets the port associated with the connection.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Gets the current properties for this connection.
|
java.lang.String |
getProperty(java.lang.String name)
Gets the value of the property with the specified name.
|
ConnectionState |
getState()
Gets the current state of the connection.
|
java.lang.String |
getStatusMessage()
Gets a descriptive message for the current state of the connection.
|
T |
getWidget()
Gets the underlying connection widget managed by this viz connection
instance.
|
boolean |
removeListener(IVizConnectionListener<T> listener)
Removes a listener from state change notifications.
|
boolean addListener(IVizConnectionListener<T> listener)
listener
- The listener to add. If null
, no listener will be
added.java.lang.String getDescription()
null
, but
may be an empty string.java.lang.String getHost()
null
.java.lang.String getName()
VizConnectionManager
.java.lang.String getPath()
int getPort()
java.util.Map<java.lang.String,java.lang.String> getProperties()
null
and should always contain the name, description, host, port,
and path, as well as any other properties required by the implementing
class.java.lang.String getProperty(java.lang.String name)
name
- The name of the property to get.null
if it has not been set.ConnectionState getState()
This may change at any moment. If code needs to listen for the current
state, then a listener should be registered via
addListener(IVizConnectionListener)
.
java.lang.String getStatusMessage()
This may change at any moment. If code needs to listen for the current
state, then a listener should be registered via
addListener(IVizConnectionListener)
.
T getWidget()
null
if the
connection is currently disconnected or failed.boolean removeListener(IVizConnectionListener<T> listener)
listener
- The listener to remove.