org.apache.sling.discovery.impl
Class Config

java.lang.Object
  extended by org.apache.sling.discovery.impl.Config

@Service(value=Config.class)
public class Config
extends Object

Configuration object used as a central config point for the discovery service implementation

The properties are described below under.


Field Summary
static String CONNECTION_TIMEOUT_KEY
           
static int DEFAULT_CONNECTION_TIMEOUT
          Configure the socket connect timeout for topology connectors.
static long DEFAULT_HEARTBEAT_INTERVAL
          Configure the interval (in seconds) according to which the heartbeats are exchanged in the topology.
static long DEFAULT_HEARTBEAT_TIMEOUT
          Configure the timeout (in seconds) after which an instance is considered dead/crashed.
static int DEFAULT_MIN_EVENT_DELAY
          Configure the time (in seconds) which must be passed at minimum between sending TOPOLOGY_CHANGING/_CHANGED (avoid flooding).
static int DEFAULT_SO_TIMEOUT
          Configure the socket read timeout (SO_TIMEOUT) for topology connectors.
static String DISCOVERY_RESOURCE_PATH_KEY
           
static String HEARTBEAT_INTERVAL_KEY
           
static String HEARTBEAT_TIMEOUT_KEY
           
static String LEADER_ELECTION_REPOSITORY_DESCRIPTOR_NAME_KEY
          Name of the repository descriptor to be taken into account for leader election: those instances have preference to become leader which have the corresponding descriptor value of 'false'
static String MIN_EVENT_DELAY_KEY
           
static String SO_TIMEOUT_KEY
           
static String TOPOLOGY_CONNECTOR_URLS_KEY
          URLs where to join a topology, eg http://localhost:4502/libs/sling/topology/connector
static String TOPOLOGY_CONNECTOR_WHITELIST_KEY
           
 
Constructor Summary
Config()
           
 
Method Summary
protected  void activate(Map<String,Object> properties)
           
protected  void configure(Map<String,Object> properties)
           
 int getBackoffStableFactor()
          Returns the (maximum) backoff factor to be used for stable connectors
 int getBackoffStandbyFactor()
          Returns the backoff factor to be used for standby (loop) connectors
 long getBackoffStandbyInterval()
          Returns the backoff interval for standby (loop) connectors in seconds
 String getClusterInstancesPath()
          Returns the resource path where cluster instance informations are stored.
 int getConnectionTimeout()
          Returns the socket connect() timeout used by the topology connector, 0 disables the timeout
 String getEstablishedViewPath()
          Returns the resource path where the established view is stored.
 long getHeartbeatInterval()
          Returns the interval (in seconds) in which heartbeats are sent
 long getHeartbeatTimeout()
          Returns the timeout (in seconds) after which an instance or voting is considered invalid/timed out
 long getHeartbeatTimeoutMillis()
          Returns the timeout (in milliseconds) after which an instance or voting is considered invalid/timed out
 long getKeyInterval()
           
 String getLeaderElectionRepositoryDescriptor()
          Returns the repository descriptor key which is to be included in the cluster leader election - or null.
 int getMinEventDelay()
          Returns the minimum time (in seconds) between sending TOPOLOGY_CHANGING/_CHANGED events - to avoid flooding
 String getOngoingVotingsPath()
          Returns the resource path where ongoing votings are stored.
 String getPreviousViewPath()
          Returns the resource path where the previous view is stored.
 String getSharedKey()
           
 int getSoTimeout()
          Returns the socket read timeout (SO_TIMEOUT) used by the topology connector, 0 disables the timeout
 URL[] getTopologyConnectorURLs()
          Returns the URLs to which to open a topology connector - or null/empty if no topology connector is configured (default is null)
 String[] getTopologyConnectorWhitelist()
          Returns a comma separated list of hostnames and/or ip addresses which are allowed as remote hosts to open connections to the topology connector servlet
 boolean isAutoStopLocalLoopEnabled()
           
 boolean isEncryptionEnabled()
           
 boolean isGzipConnectorRequestsEnabled()
           
 boolean isHmacEnabled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HEARTBEAT_TIMEOUT

public static final long DEFAULT_HEARTBEAT_TIMEOUT
Configure the timeout (in seconds) after which an instance is considered dead/crashed.

See Also:
Constant Field Values

HEARTBEAT_TIMEOUT_KEY

@Property(longValue=120L)
public static final String HEARTBEAT_TIMEOUT_KEY
See Also:
Constant Field Values

DEFAULT_HEARTBEAT_INTERVAL

public static final long DEFAULT_HEARTBEAT_INTERVAL
Configure the interval (in seconds) according to which the heartbeats are exchanged in the topology.

See Also:
Constant Field Values

HEARTBEAT_INTERVAL_KEY

@Property(longValue=30L)
public static final String HEARTBEAT_INTERVAL_KEY
See Also:
Constant Field Values

DEFAULT_MIN_EVENT_DELAY

public static final int DEFAULT_MIN_EVENT_DELAY
Configure the time (in seconds) which must be passed at minimum between sending TOPOLOGY_CHANGING/_CHANGED (avoid flooding).

See Also:
Constant Field Values

MIN_EVENT_DELAY_KEY

@Property(intValue=3)
public static final String MIN_EVENT_DELAY_KEY
See Also:
Constant Field Values

DEFAULT_CONNECTION_TIMEOUT

public static final int DEFAULT_CONNECTION_TIMEOUT
Configure the socket connect timeout for topology connectors.

See Also:
Constant Field Values

CONNECTION_TIMEOUT_KEY

@Property(intValue=10)
public static final String CONNECTION_TIMEOUT_KEY
See Also:
Constant Field Values

DEFAULT_SO_TIMEOUT

public static final int DEFAULT_SO_TIMEOUT
Configure the socket read timeout (SO_TIMEOUT) for topology connectors.

See Also:
Constant Field Values

SO_TIMEOUT_KEY

@Property(intValue=10)
public static final String SO_TIMEOUT_KEY
See Also:
Constant Field Values

LEADER_ELECTION_REPOSITORY_DESCRIPTOR_NAME_KEY

@Property
public static final String LEADER_ELECTION_REPOSITORY_DESCRIPTOR_NAME_KEY
Name of the repository descriptor to be taken into account for leader election: those instances have preference to become leader which have the corresponding descriptor value of 'false'

See Also:
Constant Field Values

TOPOLOGY_CONNECTOR_URLS_KEY

@Property(cardinality=1024)
public static final String TOPOLOGY_CONNECTOR_URLS_KEY
URLs where to join a topology, eg http://localhost:4502/libs/sling/topology/connector

See Also:
Constant Field Values

TOPOLOGY_CONNECTOR_WHITELIST_KEY

@Property(value={"localhost","127.0.0.1"})
public static final String TOPOLOGY_CONNECTOR_WHITELIST_KEY
See Also:
Constant Field Values

DISCOVERY_RESOURCE_PATH_KEY

@Property(value="/var/discovery/impl/",
          propertyPrivate=true)
public static final String DISCOVERY_RESOURCE_PATH_KEY
See Also:
Constant Field Values
Constructor Detail

Config

public Config()
Method Detail

activate

@Activate
protected void activate(Map<String,Object> properties)

configure

protected void configure(Map<String,Object> properties)

getHeartbeatTimeout

public long getHeartbeatTimeout()
Returns the timeout (in seconds) after which an instance or voting is considered invalid/timed out

Returns:
the timeout (in seconds) after which an instance or voting is considered invalid/timed out

getHeartbeatTimeoutMillis

public long getHeartbeatTimeoutMillis()
Returns the timeout (in milliseconds) after which an instance or voting is considered invalid/timed out

Returns:
the timeout (in milliseconds) after which an instance or voting is considered invalid/timed out

getConnectionTimeout

public int getConnectionTimeout()
Returns the socket connect() timeout used by the topology connector, 0 disables the timeout

Returns:
the socket connect() timeout used by the topology connector, 0 disables the timeout

getSoTimeout

public int getSoTimeout()
Returns the socket read timeout (SO_TIMEOUT) used by the topology connector, 0 disables the timeout

Returns:
the socket read timeout (SO_TIMEOUT) used by the topology connector, 0 disables the timeout

getHeartbeatInterval

public long getHeartbeatInterval()
Returns the interval (in seconds) in which heartbeats are sent

Returns:
the interval (in seconds) in which heartbeats are sent

getMinEventDelay

public int getMinEventDelay()
Returns the minimum time (in seconds) between sending TOPOLOGY_CHANGING/_CHANGED events - to avoid flooding

Returns:
the minimum time (in seconds) between sending TOPOLOGY_CHANGING/_CHANGED events - to avoid flooding

getTopologyConnectorURLs

public URL[] getTopologyConnectorURLs()
Returns the URLs to which to open a topology connector - or null/empty if no topology connector is configured (default is null)

Returns:
the URLs to which to open a topology connector - or null/empty if no topology connector is configured

getTopologyConnectorWhitelist

public String[] getTopologyConnectorWhitelist()
Returns a comma separated list of hostnames and/or ip addresses which are allowed as remote hosts to open connections to the topology connector servlet

Returns:
a comma separated list of hostnames and/or ip addresses which are allowed as remote hosts to open connections to the topology connector servlet

getClusterInstancesPath

public String getClusterInstancesPath()
Returns the resource path where cluster instance informations are stored.

Returns:
the resource path where cluster instance informations are stored

getEstablishedViewPath

public String getEstablishedViewPath()
Returns the resource path where the established view is stored.

Returns:
the resource path where the established view is stored

getOngoingVotingsPath

public String getOngoingVotingsPath()
Returns the resource path where ongoing votings are stored.

Returns:
the resource path where ongoing votings are stored

getPreviousViewPath

public String getPreviousViewPath()
Returns the resource path where the previous view is stored.

Returns:
the resource path where the previous view is stored

getLeaderElectionRepositoryDescriptor

public String getLeaderElectionRepositoryDescriptor()
Returns the repository descriptor key which is to be included in the cluster leader election - or null.

When set, the value (treated as a boolean) of the repository descriptor is prepended to the leader election id.

Returns:
the repository descriptor key which is to be included in the cluster leader election - or null

isHmacEnabled

public boolean isHmacEnabled()
Returns:
true if hmac is enabled.

getSharedKey

public String getSharedKey()
Returns:
the shared key

getKeyInterval

public long getKeyInterval()
Returns:
the interval of the shared key for hmac.

isEncryptionEnabled

public boolean isEncryptionEnabled()
Returns:
true if encryption is enabled.

isGzipConnectorRequestsEnabled

public boolean isGzipConnectorRequestsEnabled()
Returns:
true if requests on the topology connector should be gzipped (which only works if the server accepts that.. ie discovery.impl 1.0.4+)

isAutoStopLocalLoopEnabled

public boolean isAutoStopLocalLoopEnabled()
Returns:
true if the auto-stopping of local-loop topology connectors is enabled.

getBackoffStandbyFactor

public int getBackoffStandbyFactor()
Returns the backoff factor to be used for standby (loop) connectors

Returns:
the backoff factor to be used for standby (loop) connectors

getBackoffStableFactor

public int getBackoffStableFactor()
Returns the (maximum) backoff factor to be used for stable connectors

Returns:
the (maximum) backoff factor to be used for stable connectors

getBackoffStandbyInterval

public long getBackoffStandbyInterval()
Returns the backoff interval for standby (loop) connectors in seconds

Returns:
the backoff interval for standby (loop) connectors in seconds


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.