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 SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic final classStart condition representing a fanout link being ready.static enumThe protocol allowed to connect to the connector.static enumThe protocols allowed to connect to the connector.static final classStart condition representing a remote topic view being ready.static interfaceMarker interface for start conditions.Nested classes/interfaces inherited from interface com.pushtechnology.diffusion.api.config.SessionConfigSessionConfig.CompressionScheme
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ConnectorConfig.StartConditionSingleton 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.StartConditionSingleton start condition that is satisfied when the server has completed its restore of persisted topics.static final ConnectorConfig.StartConditionSingleton 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 SummaryModifier and TypeMethodDescriptionAdd a new connection validation policy for the connector.voidaddIgnoreErrorsFrom(String ipAddress) Add an IP address to ignore errors from.intGets the backlog value.longGets 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.intgetPort()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.booleanGets the boolean value specifying if the connector is required.Remove a named connection validation policy.voidsetBacklog(int backlog) Sets the backlog.voidsetConnectionTimeout(long timeout) Sets the connection timeout for inbound connections.voidSets the host address to bind to.voidsetPort(int port) Sets the port that the connector binds to.voidsetProtocols(Set<ConnectorConfig.Protocol> protocols) Sets the client protocols supported by this connector.voidSets the proxy protocol required for connection.voidsetRequired(boolean required) Sets a boolean value to specify if the connector is required on startup.voidsetSelectorThreadPoolDefinition(String definitionName) Sets the thread pool definition.voidsetStartConditions(List<? extends ConnectorConfig.StartCondition> conditions) Sets the conditions that must be satisfied before the connector is automatically started.voidsetThreadPoolDefinition(String definitionName) Sets the thread pool definition.voidsetValidationPolicyFile(String validationPolicyFile) Sets a validation policy file.voidsetWebServer(String webServerName) Sets the Web Server.Methods inherited from interface com.pushtechnology.diffusion.api.config.SessionConfiggetCompressionSchemes, getMaximumMessageSize, getMaximumQueuedBytes, getQueueDefinition, getReconnect, getSystemPingFrequency, setCompressionSchemes, setMaximumQueuedBytes, setQueueDefinition, setSystemPingFrequency
- 
Field Details- 
CLUSTER_CONFIGURATION_RESTORED_CONDITIONSingleton 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_CONDITIONSingleton 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_CONDITIONSingleton start condition that is satisfied when the server has completed its restore of persisted topics.- Since:
- 6.9
 
 
- 
- 
Method Details- 
getNameString getName()Gets the connector name.- Returns:
- connector name
 
- 
setRequiredSets 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 conditionsthat 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
 
- 
isRequiredboolean isRequired()Gets the boolean value specifying if the connector is required.- Returns:
- boolean
 
- 
setHostSets 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
 
- 
getHostString getHost()Gets the host.- Returns:
- host or null if local bind required.
 
- 
setPortSets 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
 
- 
getPortint getPort()Gets the port.- Returns:
- port the port that the connector listens on
 
- 
setBacklogSets 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
 
- 
getBacklogint getBacklog()Gets the backlog value.- Returns:
- backlog value
 
- 
getSocketConditioningSocketConditioningConfig getSocketConditioning()Gets the Socket Conditioning Configuration.- Returns:
- socket conditioning configuration
 
- 
setWebServerSets 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
 
- 
getWebServerString getWebServer()Gets the Web Server name.- Returns:
- web server name or null if no web server configured
 
- 
setValidationPolicyFileSets a validation policy file.The location / name of a validation policy file for this connector. If specified, this the connector will load ConnectionValidationPolicyConfigconfiguration from the specified XML property file when starting,- Parameters:
- validationPolicyFile- file name
- Throws:
- ConfigException- if unable to set the property
 
- 
getValidationPolicyFileString getValidationPolicyFile()Gets the validation policy file.- Returns:
- validation policy file name or null if none specified
 
- 
getKeyStoreKeyStoreConfig getKeyStore()Gets the KeyStore configuration.The KeyStore configuration only applies to connectors that are to support SSL connections. - Returns:
- KeyStore configuration
 
- 
getIgnoreErrorsFromGets the list of IP addresses to ignore errors from.- Returns:
- list of IP addresses to ignore errors from
 
- 
addIgnoreErrorsFromAdd 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
 
- 
setThreadPoolDefinitionSets 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, thedefaultfor the server will be used.- Parameters:
- definitionName- thread pool definition name
- Throws:
- ConfigException- if unable to set the property
- ConfigException- if unable to set the property
 
- 
getThreadPoolDefinitionString getThreadPoolDefinition()Gets the thread pool definition.- Returns:
- thread pool definition name or null if none specified and the default is to be used
 
- 
setSelectorThreadPoolDefinitionSets 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
 
- 
getSelectorThreadPoolDefinitionString 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
 
- 
getConnectionValidationPoliciesList<ConnectionValidationPolicyConfig> getConnectionValidationPolicies()Get the connection validation policies defined for the connector.- Returns:
- list of policies (which may be empty)
 
- 
getConnectionValidationPolicyGet 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
 
- 
addConnectionValidationPolicyAdd 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
 
- 
removeConnectionValidationPolicyRemove 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
 
- 
getProxyProtocolConnectorConfig.ProxyProtocol getProxyProtocol()Indicates the proxy protocol required for connection.- Returns:
- the proxy protocol required for connection
- Since:
- 5.2
 
- 
setProxyProtocolSets 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
 
- 
getConnectionTimeoutlong getConnectionTimeout()Gets the connection timeout for inbound connections.- Returns:
- the connection timeout in milliseconds
- Since:
- 5.8
 
- 
setConnectionTimeoutSets 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
 
- 
getStartConditionsList<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
 
- 
setStartConditionsvoid 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
 
- 
setProtocolsSets 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
 
- 
getProtocolsSet<ConnectorConfig.Protocol> getProtocols()Gets the client protocols supported by this connector.- Returns:
- the supported protocols
- Since:
- 6.6
- See Also:
 
 
-