es.iac.ing.codeso.publisher.client
Class ConnectionPolicy

java.lang.Object
  extended by es.iac.ing.codeso.publisher.client.ConnectionPolicy

public class ConnectionPolicy
extends java.lang.Object

Specifies the connection policy to be used for a PublisherProxy.

This class is thread-safe.


Nested Class Summary
static class ConnectionPolicy.ConnectionType
          Specifies the possible types of connection to the remote publisher.
 
Field Summary
 ConnectionPolicy.ConnectionType connectionType
          Specifies the type of connection to be made to the remote publisher.
static ConnectionPolicy.ConnectionType DEFAULT_CONNECTION_TYPE
          Specifies the default value for the connectionType.
static int DEFAULT_LINK_VERIFICATION_INTERVAL
          Specifies the default value in milliseconds for the linkVerificationInterval.
static int DEFAULT_POLLING_INTERVAL
          Specifies the default value in milliseconds for the pollingInterval.
 int linkVerificationInterval
          For proxies of connection type ConnectionType.SUBSCRIBER this variable specifies the interval in milliseconds between successive checks of the link to the remote publisher.
 int pollingInterval
          For proxies of connection type ConnectionType.PERIODIC_POLLER this variable specifies the interval in milliseconds between successive polls of the remote publisher.
 
Constructor Summary
ConnectionPolicy()
          Constructs a new instance whose fields will be initially set to the default values.
ConnectionPolicy(ConnectionPolicy basePolicy)
          Constructs a new instance whose fields will be initially set to the values specified in the base policy.
 
Method Summary
static ConnectionPolicy getAutoPollingInstance()
          Returns a connection policy suitable for a poller.
static ConnectionPolicy getAutoPollingInstance(int pollingInterval)
          Returns a connection policy suitable for a poller.
 ConnectionPolicy.ConnectionType getConnectionType()
          Returns the connection type
 int getLinkVerificationInterval()
          Returns a connection policy suitable for a poller.
 int getPollingInterval()
          Returns a connection policy suitable for a poller.
static ConnectionPolicy getPollOnDemandInstance()
          Returns a connection policy suitable for a poller.
static ConnectionPolicy getSubscribingInstance()
          Returns a connection policy suitable for subscriber.
static ConnectionPolicy getSubscribingInstance(int linkVerificationInterval)
          Returns a connection policy suitable for subscriber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONNECTION_TYPE

public static final ConnectionPolicy.ConnectionType DEFAULT_CONNECTION_TYPE
Specifies the default value for the connectionType. Currently set to: ConnectionType.SUBSCRIBER.


DEFAULT_LINK_VERIFICATION_INTERVAL

public static final int DEFAULT_LINK_VERIFICATION_INTERVAL
Specifies the default value in milliseconds for the linkVerificationInterval. Currently set to: 15000.

See Also:
Constant Field Values

DEFAULT_POLLING_INTERVAL

public static final int DEFAULT_POLLING_INTERVAL
Specifies the default value in milliseconds for the pollingInterval. Currently set to: 15000.

See Also:
Constant Field Values

connectionType

public ConnectionPolicy.ConnectionType connectionType
Specifies the type of connection to be made to the remote publisher.


linkVerificationInterval

public int linkVerificationInterval
For proxies of connection type ConnectionType.SUBSCRIBER this variable specifies the interval in milliseconds between successive checks of the link to the remote publisher.


pollingInterval

public int pollingInterval
For proxies of connection type ConnectionType.PERIODIC_POLLER this variable specifies the interval in milliseconds between successive polls of the remote publisher.

Constructor Detail

ConnectionPolicy

public ConnectionPolicy()
Constructs a new instance whose fields will be initially set to the default values.


ConnectionPolicy

public ConnectionPolicy(ConnectionPolicy basePolicy)
Constructs a new instance whose fields will be initially set to the values specified in the base policy.

Parameters:
basePolicy - the connection policy on which the new policy is to be initially based.
Method Detail

getSubscribingInstance

public static ConnectionPolicy getSubscribingInstance()
Returns a connection policy suitable for subscriber.

Returns:
the new policy

getSubscribingInstance

public static ConnectionPolicy getSubscribingInstance(int linkVerificationInterval)
Returns a connection policy suitable for subscriber.

Parameters:
linkVerificationInterval - the interval in milliseconds between each attempt to verify the link to the publisher.
Returns:
the new policy

getAutoPollingInstance

public static ConnectionPolicy getAutoPollingInstance()
Returns a connection policy suitable for a poller.

Returns:
the new policy

getAutoPollingInstance

public static ConnectionPolicy getAutoPollingInstance(int pollingInterval)
Returns a connection policy suitable for a poller.

Parameters:
pollingInterval - the interval in milliseconds between each successive poll operation.
Returns:
the new policy

getPollOnDemandInstance

public static ConnectionPolicy getPollOnDemandInstance()
Returns a connection policy suitable for a poller.

Returns:
the new policy

getConnectionType

public ConnectionPolicy.ConnectionType getConnectionType()
Returns the connection type

Returns:
the new policy

getLinkVerificationInterval

public int getLinkVerificationInterval()
Returns a connection policy suitable for a poller.

Returns:
the new policy

getPollingInterval

public int getPollingInterval()
Returns a connection policy suitable for a poller.

Returns:
the new policy