public final class LiveViewConnectionFactory extends Object
LiveViewConnection
based on ConnectionConfig
A connection can also be retrieved by provide a simple String based URI.
The URI must have the following syntax:
lv://<host>[:<port>]
The default port, when not provided, is specified by LiveViewConnectionFactory.DEFAULT_SERVER_PORT
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOST
The default server host
|
static int |
DEFAULT_SERVER_PORT
The factory uses this as the default port when not specified in the connect URI: value 10080.
|
static int |
DEFAULT_SERVER_SSL_PORT |
static String |
DEFAULT_URI
The default server uri
|
Modifier and Type | Method and Description |
---|---|
static LiveViewConnection |
getConnection(ConnectionConfig config)
Retrieves a
LiveViewConnection based on the ConnectionConfig |
static LiveViewMultiConnection |
getConnection(MultiConnectionConfig config,
boolean waitForConnection)
Retrieves a
LiveViewMultiConnection based on the given MultiConnectionConfig . |
static LiveViewConnection |
getConnection(String uri)
Retrieves a
LiveViewConnection based on a valid URI. |
public static final int DEFAULT_SERVER_PORT
public static final int DEFAULT_SERVER_SSL_PORT
public static final String DEFAULT_HOST
public static final String DEFAULT_URI
public static LiveViewConnection getConnection(String uri) throws LiveViewException
LiveViewConnection
based on a valid URI.uri
- valid URI supported by LiveViewLiveViewException
- if connection cannot be establishedNullPointerException
- if URI is nullpublic static LiveViewConnection getConnection(ConnectionConfig config) throws LiveViewException, LiveViewConnectionCanceledException
LiveViewConnection
based on the ConnectionConfig
config
- Connection configurationLiveViewException
- if a server exception occurs on connectLiveViewConnectionCanceledException
- if user cancels the connection via a ProgressMonitor
NullPointerException
- if the configuration URI is nullpublic static LiveViewMultiConnection getConnection(MultiConnectionConfig config, boolean waitForConnection) throws LiveViewException
LiveViewMultiConnection
based on the given MultiConnectionConfig
. Note that
this call has no declared exceptions, as errors connecting to individual servers are handled internally and
available as statuses for each underlying LiveViewConnectionControl
.
Important: see the Javadoc for LiveViewMultiConnection
for limitations to expect when connect
to servers this way.
config
- configuration, identifying the servers you want to connect to, plus some flags that control how you connectwaitForConnection
- true if you want to wait until at least one connection is made before this call returns.
If false, this method returns immediately although many operations will throw an exception until a connection
is later established.LiveViewMultiConnection
the connection objectLiveViewException
- may be thrown on errors. Note that most errors will be reported using the listeners
attached to the configuration instead.