Interface ConnectorConfig
- All Superinterfaces:
Config
,SessionConfig
This is used to specify the configuration of a single connector. A connector is a connection point to a Diffusion server. There must be at least one connector per Diffusion server. Each connector can be used to configure different requirements for different client needs.
Connectors can not be changed once the Diffusion server has started.
From release 6.2, the attributes that set the policy for the behavior of a
class of sessions are now grouped under the SessionConfig
super
interface. The remaining attributes of ConnectorConfig
relate to the
acceptance and establishment of inbound network connections.
- Since:
- 4.4
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Start condition representing a fanout link being ready.static enum
The protocol allowed to connect to the connector.static enum
The protocols allowed to connect to the connector.static final class
Start condition representing a remote topic view being ready.static interface
Marker interface for start conditions.Nested classes/interfaces inherited from interface com.pushtechnology.diffusion.api.config.SessionConfig
SessionConfig.CompressionScheme
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConnectorConfig.StartCondition
Singleton start condition that is satisfied when the server is configured as part of a cluster, has joined the cluster, and has completed restoration of shared configuration.static final ConnectorConfig.StartCondition
Singleton start condition that is satisfied when the server has completed its restore of persisted topics.static final ConnectorConfig.StartCondition
Singleton start condition that is satisfied when the server is configured as part of a cluster, has joined the cluster, and has completed restoration of replicated topics. -
Method Summary
Modifier and TypeMethodDescriptionAdd a new connection validation policy for the connector.void
addIgnoreErrorsFrom
(String ipAddress) Add an IP address to ignore errors from.int
Gets the backlog value.long
Gets the connection timeout for inbound connections.Get the connection validation policies defined for the connector.Get a named connection validation policy that belongs to the connector.getHost()
Gets the host.Gets the list of IP addresses to ignore errors from.Gets the KeyStore configuration.getName()
Gets the connector name.int
getPort()
Gets the port.Gets the client protocols supported by this connector.Indicates the proxy protocol required for connection.Gets the selector thread pool definition.Gets the Socket Conditioning Configuration.Gets the conditions that must be satisfied before the connector is automatically started.Gets the thread pool definition.Gets the validation policy file.Gets the Web Server name.boolean
Gets the boolean value specifying if the connector is required.Remove a named connection validation policy.void
setBacklog
(int backlog) Sets the backlog.void
setConnectionTimeout
(long timeout) Sets the connection timeout for inbound connections.void
Sets the host address to bind to.void
setPort
(int port) Sets the port that the connector binds to.void
setProtocols
(Set<ConnectorConfig.Protocol> protocols) Sets the client protocols supported by this connector.void
Sets the proxy protocol required for connection.void
setRequired
(boolean required) Sets a boolean value to specify if the connector is required on startup.void
setSelectorThreadPoolDefinition
(String definitionName) Sets the thread pool definition.void
setStartConditions
(List<? extends ConnectorConfig.StartCondition> conditions) Sets the conditions that must be satisfied before the connector is automatically started.void
setThreadPoolDefinition
(String definitionName) Sets the thread pool definition.void
setValidationPolicyFile
(String validationPolicyFile) Sets a validation policy file.void
setWebServer
(String webServerName) Sets the Web Server.Methods inherited from interface com.pushtechnology.diffusion.api.config.SessionConfig
getCompressionSchemes, getMaximumMessageSize, getMaximumQueuedBytes, getQueueDefinition, getReconnect, getSystemPingFrequency, setCompressionSchemes, setMaximumQueuedBytes, setQueueDefinition, setSystemPingFrequency
-
Field Details
-
CLUSTER_CONFIGURATION_RESTORED_CONDITION
Singleton start condition that is satisfied when the server is configured as part of a cluster, has joined the cluster, and has completed restoration of shared configuration.- Since:
- 6.5
-
REPLICATED_TOPICS_RESTORED_CONDITION
Singleton start condition that is satisfied when the server is configured as part of a cluster, has joined the cluster, and has completed restoration of replicated topics.- Since:
- 6.5
-
PERSISTED_TOPICS_RESTORED_CONDITION
Singleton start condition that is satisfied when the server has completed its restore of persisted topics.- Since:
- 6.9
-
-
Method Details
-
getName
String getName()Gets the connector name.- Returns:
- connector name
-
setRequired
Sets a boolean value to specify if the connector is required on startup. If the connector is required (set to true) and the server can not start it during start-up (after waiting for anystart conditions
that are configured), the server is stopped. By default, this is set to true.- Parameters:
required
- is the connector required?- Throws:
ConfigException
- if unable to set the property
-
isRequired
boolean isRequired()Gets the boolean value specifying if the connector is required.- Returns:
- boolean
-
setHost
Sets the host address to bind to.The name or the IP Address that the connector will bind to. If this is not specified, a simple local bind will be performed.
- Parameters:
host
- name or ip address- Throws:
ConfigException
- if unable to set the property
-
getHost
String getHost()Gets the host.- Returns:
- host or null if local bind required.
-
setPort
Sets the port that the connector binds to.If not explicitly set, the default is 8080. If you do not change this and there is more than one connector, they would clash at runtime and one would fail to start.
- Parameters:
port
- The port on which the connector will accept connections- Throws:
ConfigException
- if unable to set the property
-
getPort
int getPort()Gets the port.- Returns:
- port the port that the connector listens on
-
setBacklog
Sets the backlog.The requested maximum queue length for incoming connection requests. It is rarely necessary to tune this value. Operating System settings must be adjusted in tandem. On Linux, the appropriate setting is net.core.somaxconn. If a value is not specified, a default of 1000 is used.
- Parameters:
backlog
- queue length. If the value passed if equal or less than 0, the default value for a socket connection will be used.- Throws:
ConfigException
- if unable to set the property
-
getBacklog
int getBacklog()Gets the backlog value.- Returns:
- backlog value
-
getSocketConditioning
SocketConditioningConfig getSocketConditioning()Gets the Socket Conditioning Configuration.- Returns:
- socket conditioning configuration
-
setWebServer
Sets the Web Server.If this connector is required to serve HTTP requests, a corresponding Web Server configuration must be specified.
- Parameters:
webServerName
- the name of a configured (@link WebServerConfig Web Server}- Throws:
ConfigException
- if unable to set the property
-
getWebServer
String getWebServer()Gets the Web Server name.- Returns:
- web server name or null if no web server configured
-
setValidationPolicyFile
Sets a validation policy file.The location / name of a validation policy file for this connector.
If specified, this the connector will load
ConnectionValidationPolicyConfig
configuration from the specified XML property file when starting,- Parameters:
validationPolicyFile
- file name- Throws:
ConfigException
- if unable to set the property
-
getValidationPolicyFile
String getValidationPolicyFile()Gets the validation policy file.- Returns:
- validation policy file name or null if none specified
-
getKeyStore
KeyStoreConfig getKeyStore()Gets the KeyStore configuration.The KeyStore configuration only applies to connectors that are to support SSL connections.
- Returns:
- KeyStore configuration
-
getIgnoreErrorsFrom
Gets the list of IP addresses to ignore errors from.- Returns:
- list of IP addresses to ignore errors from
-
addIgnoreErrorsFrom
Add an IP address to ignore errors from.Sometimes external entities may legitimately poll ports and by adding the IP addresses of such entities here, error messages that might otherwise be logged for invalid connections can be suppressed.
- Parameters:
ipAddress
- an ip address to ignore connection errors from- Throws:
ConfigException
- if unable to add a new value
-
setThreadPoolDefinition
Sets the thread pool definition.Defines an optional thread pool to use to execute inbound requests for this connector. The named definition (see
ThreadPoolConfig
) must have been configured for the owning server. If not specified, thedefault
for the server will be used.- Parameters:
definitionName
- thread pool definition name- Throws:
ConfigException
- if unable to set the propertyConfigException
- if unable to set the property
-
getThreadPoolDefinition
String getThreadPoolDefinition()Gets the thread pool definition.- Returns:
- thread pool definition name or null if none specified and the default is to be used
-
setSelectorThreadPoolDefinition
Sets the thread pool definition.Defines an optional selector thread pool to use to deal with nio operations. The named definition must have been configured for the owning server. If not specified, the
SelectorThreadPoolsConfig.getDefaultPool()
for the server will be used.- Parameters:
definitionName
- selector thread pool definition name- Throws:
ConfigException
- if unable to set the property- Since:
- 5.3
-
getSelectorThreadPoolDefinition
String getSelectorThreadPoolDefinition()Gets the selector thread pool definition.- Returns:
- selector thread pool definition name or null if none specified and the default is to be used
- Since:
- 5.3
-
getConnectionValidationPolicies
List<ConnectionValidationPolicyConfig> getConnectionValidationPolicies()Get the connection validation policies defined for the connector.- Returns:
- list of policies (which may be empty)
-
getConnectionValidationPolicy
Get a named connection validation policy that belongs to the connector.- Parameters:
name
- the policy name- Returns:
- the policy or null if no such policy found for connector
-
addConnectionValidationPolicy
Add a new connection validation policy for the connector.This can be done even when configuration is locked.
- Parameters:
name
- the policy name- Returns:
- the new policy
- Throws:
ConfigException
- if unable to add policy with given name
-
removeConnectionValidationPolicy
Remove a named connection validation policy.- Parameters:
name
- the policy name.- Returns:
- the policy that was removed or null if no policy with the given name existed
-
getProxyProtocol
ConnectorConfig.ProxyProtocol getProxyProtocol()Indicates the proxy protocol required for connection.- Returns:
- the proxy protocol required for connection
- Since:
- 5.2
-
setProxyProtocol
Sets the proxy protocol required for connection.- Parameters:
protocol
- the proxy protocol required for connection- Throws:
ConfigException
- if the configuration has been locked or the value provided is null- Since:
- 5.2
-
getConnectionTimeout
long getConnectionTimeout()Gets the connection timeout for inbound connections.- Returns:
- the connection timeout in milliseconds
- Since:
- 5.8
-
setConnectionTimeout
Sets the connection timeout for inbound connections.The value constrains the time taken to process the connection request and send the response. This includes the time taken to call any configured authentication handlers and look up location details.
If this is not specified, a value
TimeoutsConfig.getConnectionTimeout()
is used.- Parameters:
timeout
- time in milliseconds. If this exceeds one hour (3600000ms) a warning will be logged and the timeout will be set to one hour.- Throws:
ConfigException
- if unable to set the property- Since:
- 5.8
-
getStartConditions
List<ConnectorConfig.StartCondition> getStartConditions()Gets the conditions that must be satisfied before the connector is automatically started.- Returns:
- the conditions that must be satisfied for the connector to be start automatically. May be empty.
- Since:
- 6.4
-
setStartConditions
void setStartConditions(List<? extends ConnectorConfig.StartCondition> conditions) throws ConfigException Sets the conditions that must be satisfied before the connector is automatically started.- Parameters:
conditions
- the conditions that must be satisfied for the connector to be start automatically, which may be empty- Throws:
ConfigException
- if unable to set the property- Since:
- 6.4
-
setProtocols
Sets the client protocols supported by this connector.If empty, no protocols are supported.
- Parameters:
protocols
- the supported protocols- Throws:
ConfigException
- if unable to set the property- Since:
- 6.6
-
getProtocols
Set<ConnectorConfig.Protocol> getProtocols()Gets the client protocols supported by this connector.- Returns:
- the supported protocols
- Since:
- 6.6
- See Also:
-