Package org.apache.sling.discovery.oak
Class Config
- java.lang.Object
-
- org.apache.sling.discovery.oak.Config
-
- All Implemented Interfaces:
org.apache.sling.discovery.base.connectors.BaseConfig
,org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig
public class Config extends Object implements org.apache.sling.discovery.base.connectors.BaseConfig, org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig
Configuration object used as a central config point for the discovery service implementationThe properties are described below under.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
clusterSyncServiceInterval
protected long
clusterSyncServiceTimeout
protected long
connectorPingInterval
protected long
connectorPingTimeout
protected long
discoveryLiteCheckInterval
protected String
discoveryResourcePath
protected boolean
invertLeaderElectionPrefixOrder
protected long
joinerDelaySeconds
protected long
leaderElectionPrefix
protected int
minEventDelay
protected long
suppressionTimeoutSeconds
protected boolean
suppressPartiallyStartedInstance
protected String[]
topologyConnectorWhitelist
-
Constructor Summary
Constructors Constructor Description Config()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
activate(org.osgi.framework.BundleContext context, DiscoveryServiceCentralConfig config)
protected void
configure(DiscoveryServiceCentralConfig config)
int
getBackoffStableFactor()
Returns the (maximum) backoff factor to be used for stable connectorsint
getBackoffStandbyFactor()
Returns the backoff factor to be used for standby (loop) connectorslong
getBackoffStandbyInterval()
Returns the backoff interval for standby (loop) connectors in secondsString
getClusterInstancesPath()
Returns the resource path where cluster instance informations are stored.long
getClusterSyncServiceIntervalMillis()
long
getClusterSyncServiceTimeoutMillis()
long
getConnectorPingInterval()
long
getConnectorPingTimeout()
long
getDiscoveryLiteCheckInterval()
protected String
getDiscoveryResourcePath()
String
getIdMapPath()
long
getJoinerDelayMillis()
long
getKeyInterval()
long
getLeaderElectionPrefix()
int
getMinEventDelay()
Returns the minimum time (in seconds) between sending TOPOLOGY_CHANGING/_CHANGED events - to avoid floodingString
getSharedKey()
int
getSocketConnectTimeout()
Returns the socket connect() timeout used by the topology connector, 0 disables the timeoutint
getSoTimeout()
Returns the socket read timeout (SO_TIMEOUT) used by the topology connector, 0 disables the timeoutlong
getSuppressionTimeoutSeconds()
boolean
getSuppressPartiallyStartedInstances()
boolean
getSyncTokenEnabled()
String
getSyncTokenPath()
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 servletboolean
isAutoStopLocalLoopEnabled()
boolean
isEncryptionEnabled()
boolean
isGzipConnectorRequestsEnabled()
boolean
isHmacEnabled()
boolean
isInvertLeaderElectionPrefixOrder()
-
-
-
Field Detail
-
connectorPingTimeout
protected long connectorPingTimeout
-
connectorPingInterval
protected long connectorPingInterval
-
discoveryLiteCheckInterval
protected long discoveryLiteCheckInterval
-
clusterSyncServiceTimeout
protected long clusterSyncServiceTimeout
-
clusterSyncServiceInterval
protected long clusterSyncServiceInterval
-
minEventDelay
protected int minEventDelay
-
topologyConnectorWhitelist
protected String[] topologyConnectorWhitelist
-
discoveryResourcePath
protected String discoveryResourcePath
-
leaderElectionPrefix
protected long leaderElectionPrefix
-
invertLeaderElectionPrefixOrder
protected boolean invertLeaderElectionPrefixOrder
-
suppressPartiallyStartedInstance
protected boolean suppressPartiallyStartedInstance
-
suppressionTimeoutSeconds
protected long suppressionTimeoutSeconds
-
joinerDelaySeconds
protected long joinerDelaySeconds
-
-
Method Detail
-
activate
protected void activate(org.osgi.framework.BundleContext context, DiscoveryServiceCentralConfig config)
-
configure
protected void configure(DiscoveryServiceCentralConfig config)
-
getSocketConnectTimeout
public int getSocketConnectTimeout()
Returns the socket connect() timeout used by the topology connector, 0 disables the timeout- Specified by:
getSocketConnectTimeout
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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- Specified by:
getSoTimeout
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- the socket read timeout (SO_TIMEOUT) used by the topology connector, 0 disables the timeout
-
getMinEventDelay
public int getMinEventDelay()
Returns the minimum time (in seconds) between sending TOPOLOGY_CHANGING/_CHANGED events - to avoid flooding- Specified by:
getMinEventDelay
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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)- Specified by:
getTopologyConnectorURLs
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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- Specified by:
getTopologyConnectorWhitelist
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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
-
getDiscoveryResourcePath
protected String getDiscoveryResourcePath()
-
getClusterInstancesPath
public String getClusterInstancesPath()
Returns the resource path where cluster instance informations are stored.- Specified by:
getClusterInstancesPath
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- the resource path where cluster instance informations are stored
-
getSyncTokenPath
public String getSyncTokenPath()
- Specified by:
getSyncTokenPath
in interfaceorg.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig
-
getIdMapPath
public String getIdMapPath()
- Specified by:
getIdMapPath
in interfaceorg.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig
-
isHmacEnabled
public boolean isHmacEnabled()
- Specified by:
isHmacEnabled
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- true if hmac is enabled.
-
getSharedKey
public String getSharedKey()
- Specified by:
getSharedKey
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- the shared key
-
getKeyInterval
public long getKeyInterval()
- Specified by:
getKeyInterval
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- the interval of the shared key for hmac.
-
isEncryptionEnabled
public boolean isEncryptionEnabled()
- Specified by:
isEncryptionEnabled
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- true if encryption is enabled.
-
isGzipConnectorRequestsEnabled
public boolean isGzipConnectorRequestsEnabled()
- Specified by:
isGzipConnectorRequestsEnabled
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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()
- Specified by:
isAutoStopLocalLoopEnabled
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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- Specified by:
getBackoffStandbyFactor
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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- Specified by:
getBackoffStableFactor
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- 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- Specified by:
getBackoffStandbyInterval
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
- Returns:
- the backoff interval for standby (loop) connectors in seconds
-
getConnectorPingInterval
public long getConnectorPingInterval()
- Specified by:
getConnectorPingInterval
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
-
getConnectorPingTimeout
public long getConnectorPingTimeout()
- Specified by:
getConnectorPingTimeout
in interfaceorg.apache.sling.discovery.base.connectors.BaseConfig
-
getDiscoveryLiteCheckInterval
public long getDiscoveryLiteCheckInterval()
-
getClusterSyncServiceTimeoutMillis
public long getClusterSyncServiceTimeoutMillis()
- Specified by:
getClusterSyncServiceTimeoutMillis
in interfaceorg.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig
-
getClusterSyncServiceIntervalMillis
public long getClusterSyncServiceIntervalMillis()
- Specified by:
getClusterSyncServiceIntervalMillis
in interfaceorg.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig
-
getSyncTokenEnabled
public boolean getSyncTokenEnabled()
-
isInvertLeaderElectionPrefixOrder
public boolean isInvertLeaderElectionPrefixOrder()
-
getLeaderElectionPrefix
public long getLeaderElectionPrefix()
-
getSuppressPartiallyStartedInstances
public boolean getSuppressPartiallyStartedInstances()
-
getSuppressionTimeoutSeconds
public long getSuppressionTimeoutSeconds()
-
getJoinerDelayMillis
public long getJoinerDelayMillis()
-
-