Such connections are a form of classic client connection which
will be removed along with the classic client API in a future
release. The only practical use was for manual fan-out
implementations that use
topic notify
topics. It is now recommended that automatic
fan-out is used instead.
@Deprecated public interface PublisherServerConnection extends ServerConnection
Publisher
and a Diffusion
Server.
Such a connection allows a Publisher to connect to another Publisher as if it were a client of that Publisher. This makes it possible to configure a Publisher to distribute messages to many (client) Publishers or for many Publishers to have messages they broadcast aggregated into a single Publisher.
A Publisher may register a connection to another server using
addServerConnection
and then use the connect
method to make a connection. When connected the Publisher will be
notified on the serverConnected
method and the Publisher would then be able to subscribe to
topics at the server as required. The Publisher would receive messages from
the server on its messageFromServer
method. The Publisher would be notified of a lost connection on its
serverDisconnected
method.
Alternatively, it may be more convenient to configure the servers that the
Publisher should automatically connect to in its properties file. In this
case any servers that are declared are connected to before
initialLoad
is called and all connections
that have not been explicitly connected to will be automatically connected
after initialLoad. The connection policy may be configured so that if a
connection fails it will either stop the Publisher or attempt to periodically
retry the connection. The default policy would be to just ignore a failed
connection, thus allowing the Publisher to deal with it.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_RETRY_INTERVAL
Deprecated.
The default retry interval.
|
Modifier and Type | Method and Description |
---|---|
PublisherServerConnectionFailPolicy |
getFailPolicy()
Deprecated.
Returns the connection failure policy.
|
String |
getOutboundMessageQueueDefinition()
Deprecated.
Return the outbound queue definition name.
|
long |
getRetryInterval()
Deprecated.
Returns the retry interval.
|
void |
setFailPolicy(PublisherServerConnectionFailPolicy policy)
Deprecated.
Set the failure policy for a connection.
|
void |
setOutboundMessageQueueDefinition(String definitionName)
Deprecated.
Sets the name of the outbound queue definition to use when creating an an
outbound message queue on connection.
|
void |
setRetryInterval(long interval)
Deprecated.
Sets the retry interval.
|
acknowledge, addTopicListener, addTopicListener, close, connect, connect, connect, createDeltaMessage, createDeltaMessage, createLoadMessage, createLoadMessage, createPagedTopicHandler, createServiceTopicHandler, createTopicNotifyTopicHandler, createTopicNotifyTopicHandler, fetch, fetch, getAckTimeout, getClientID, getLastInteraction, getName, getServerDetails, getServerProtocolVersion, getState, isConnected, isReconnected, ping, removeTopicListener, send, sendCredentials, setAckListener, setAckTimeout, setListener, setPingResponseListener, subscribe, subscribe, unsubscribe, unsubscribe
getMessageSourceType
static final long DEFAULT_RETRY_INTERVAL
The retry interval is the interval in milliseconds between retries of a
failed connection when a failure policy of
PublisherServerConnectionFailPolicy.RETRY
is in use.
PublisherServerConnectionFailPolicy getFailPolicy()
void setFailPolicy(PublisherServerConnectionFailPolicy policy)
The failure policy determines what action should be taken if a connection can not be established or is lost.
policy
- the policy.long getRetryInterval()
The retry interval is the interval in milliseconds between retries of a
failed connection when a failure policy of
PublisherServerConnectionFailPolicy.RETRY
is in use.
If this has not been specifically set using
setRetryInterval(long)
then the value of
DEFAULT_RETRY_INTERVAL
will be returned.
void setRetryInterval(long interval) throws APIException
The retry interval is the interval in milliseconds between retries of a
failed connection when a failure policy of
PublisherServerConnectionFailPolicy.RETRY
is in use.
interval
- in milliseconds.APIException
- if an invalid value is specified.void setOutboundMessageQueueDefinition(String definitionName) throws APIException
This must be the name of a queue definition in the Server.xml properties.
If no queue definition name is explicitly specified then the default queue definition will be used.
The definition will be used for the outbound queue used for queueing outbound messages.
definitionName
- the name of a queue definition in Server.xml.APIException
- if the named definition does not exist or attempt to
call when connected.String getOutboundMessageQueueDefinition()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.