The classic client API will be removed in a future release.
@Deprecated public interface ConnectionDetails
Such an object may identify one or more possible servers to connect to as a
list of ServerDetails
objects. More than one would be required if
cascading
, auto
failover
or load balancing
is specified.
Values for connection timeout
,
credentials
,
initial Topics
or
auto acknowledging
may be specified
for use with all possible servers although these may be overridden by
explicitly specifying values to the ServerDetails
.
Connection Details are created using one of the ConnectionFactory
methods.
Modifier and Type | Method and Description |
---|---|
long |
getConnectionTimeout()
Deprecated.
Returns the default connection timeout.
|
Credentials |
getCredentials()
Deprecated.
Returns the default credentials.
|
ConnectionDetailsListener |
getListener()
Deprecated.
Get the listener.
|
List<ServerDetails> |
getServerDetails()
Deprecated.
Returns the list of servers to be considered when connecting.
|
TopicSet |
getTopics()
Deprecated.
Returns the default list of Topics to subscribe to on connection.
|
boolean |
isAutoAcknowledging()
Deprecated.
Indicates whether connections should automatically
acknowledge inbound Messages that require acknowledgement.
|
boolean |
isAutoFailover()
Deprecated.
Indicates whether the 'Auto Failover' option is set.
|
boolean |
isCascading()
Deprecated.
Indicates whether the 'Cascading' option is set.
|
boolean |
isLoadbalancing()
Deprecated.
Indicates whether 'Load Balancing' is set.
|
void |
setAutoAcknowledging(boolean auto)
Deprecated.
Sets the default auto acknowledge flag for connections.
|
void |
setAutoFailover(boolean autoFailover)
Deprecated.
Sets the 'Auto Failover' option.
|
void |
setCascading(boolean cascading)
Deprecated.
Sets the 'Cascading' option.
|
void |
setConnectionTimeout(long timeout)
Deprecated.
Sets the default connection timeout.
|
void |
setCredentials(Credentials credentials)
Deprecated.
Sets default credentials.
|
void |
setListener(ConnectionDetailsListener listener)
Deprecated.
Sets a listener for Connection Details events.
|
void |
setLoadBalancing(boolean loadBalancing)
Deprecated.
Sets the 'Load Balancing' option.
|
void |
setServerDetails(Collection<ServerDetails> servers)
Deprecated.
Sets the list of
ServerDetails objects representing the servers
to be connected to. |
void |
setTopics(String... topics)
Deprecated.
Sets the default Topic(s) to be subscribed to on connection.
|
void |
setTopics(TopicSet topics)
Deprecated.
Sets the default Topic(s) to be subscribed to on connection.
|
void setConnectionTimeout(long timeout)
This only constrains the time taken to establish a TCP connection to a
server. The write timeout
constrains the time taken to send the connection request. The server is
responsible for limiting the overall time taken to establish a connection
once it has received the request.
This value is used for connections where the timeout value is not
explicitly specified in the ServerDetails
. If no value is set in
this ConnectionDetails
or the ServerDetails
, the default
value will be taken from the
client
configuration
.
timeout
- the default connection timeout in milliseconds. If this is
not a positive value then it will be ignored. If this exceeds one
hour (3600000ms) a warning will be logged and the time-out will be
set to one hour.long getConnectionTimeout()
setConnectionTimeout(long)
void setCredentials(Credentials credentials)
This value is used for connections where credentials have not been
explicitly specified in the ServerDetails
.
If not explicitly set then no credentials are provided by default on connection.
credentials
- the credentials to use by default or null to indicate
that no credentials are passed (the default).Credentials getCredentials()
setCredentials(Credentials)
void setTopics(TopicSet topics)
This value is used for connections where initial Topics have not been
explicitly specified in the ServerDetails
.
If not explicitly set then no Topics are subscribed to by default on connection.
topics
- the Topics to use by default or null to indicate that no
Topics are to be subscribed to on connection (the default).void setTopics(String... topics)
This is a convenience method equivalent to calling
setTopics(TopicSet)
with a TopicSet
constructed
with one or more Topic
names and/or patterns).
topics
- one or more Topic names or selection patterns.TopicSet getTopics()
setTopics(TopicSet)
void setAutoAcknowledging(boolean auto)
By default, when a Message is received on the
listener
that is pending
acknowledgement
then it must be acknowledged using the
ServerConnection.acknowledge(TopicMessage)
method. However, by
setting auto acknowledging on then all such inbound messages will be
automatically acknowledged on arrival.
auto
- true to automatically auto acknowledge messages.boolean isAutoAcknowledging()
setAutoAcknowledging(boolean)
void setCascading(boolean cascading)
By default, when attempting to connect using a ServerDetails
, if
the connection fails then the connection will be aborted. However, if
the 'Cascading' option is set and more than one ServerDetails
has been supplied then if a connection attempt fails then it will move
on to try the next in the list.
cascading
- true to turn the 'Cascading' option on. This would
only make sense if more than one server has been specified.boolean isCascading()
setCascading(boolean)
void setAutoFailover(boolean autoFailover)
By default when a connection is lost then the listener is notified and
the connection simply closed. However, if 'Auto Failover' is specified
then if a connection is lost then an automatic attempt will be made to
connect using the next Server Details
(assuming
more than one was provided).
By default this is false.
autoFailover
- true to request the 'Auto Failover' option. This
would only make sense if more than one ServerDetails
has been
supplied.boolean isAutoFailover()
setAutoFailover(boolean)
void setLoadBalancing(boolean loadBalancing)
By default the list of ServerDetails
specified will be selected
in the order that they have been supplied. However, if the 'Load
Balancing' option is set then the order of the list is randomised
whenever a connect is requested.
loadBalancing
- true indicates that 'Load Balancing' is required.
This would only make sense if more than one server had been specified.boolean isLoadbalancing()
setLoadBalancing(boolean)
void setServerDetails(Collection<ServerDetails> servers)
ServerDetails
objects representing the servers
to be connected to.
This would be used to supply the details if they were not supplied on construction or to totally replace the list of servers.
servers
- a list of one or more server details.List<ServerDetails> getServerDetails()
If no servers have been specified then this will return an empty list.
void setListener(ConnectionDetailsListener listener)
listener
- the listener or null to remove the listener.ConnectionDetailsListener getListener()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.