public interface ConnectorConfig extends Config
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 accept different types of connection and can be used to configure different requirements for different client needs.
Connectors are server side only configuration items and can not be changed once the Diffusion server has started.
Modifier and Type | Interface and Description |
---|---|
static class |
ConnectorConfig.ClientApiType
Deprecated.
since 5.9
Classic clients are deprecated so this will be removed in a future release |
static class |
ConnectorConfig.ProxyProtocol
The protocols allowed to connect to the connector.
|
static class |
ConnectorConfig.Type
Indicates the types of connection supported by a connector.
|
Modifier and Type | Method and Description |
---|---|
ConnectionValidationPolicyConfig |
addConnectionValidationPolicy(String name)
Add a new connection validation policy for the connector.
|
void |
addIgnoreErrorsFrom(String ipAddress)
Add an IP address to ignore errors from.
|
int |
getAcceptors()
Deprecated.
this value is ignored by the system.
|
int |
getBacklog()
Gets the backlog value.
|
ConnectorConfig.ClientApiType |
getClientType()
Deprecated.
since 5.9
|
long |
getConnectionTimeout()
Gets the connection timeout for inbound connections.
|
List<ConnectionValidationPolicyConfig> |
getConnectionValidationPolicies()
Get the connection validation policies defined for the connector.
|
ConnectionValidationPolicyConfig |
getConnectionValidationPolicy(String name)
Get a named connection validation policy that belongs to the connector.
|
FetchPolicyConfig |
getFetchPolicy()
Returns the fetch policy configuration for the connector.
|
String |
getHost()
Gets the host.
|
List<String> |
getIgnoreErrorsFrom()
Gets the list of IP addresses to ignore errors from.
|
KeyStoreConfig |
getKeyStore()
Gets the KeyStore configuration.
|
String |
getName()
Gets the connector name.
|
String |
getPolicyFile()
Gets the policy file.
|
int |
getPort()
Gets the port.
|
ConnectorConfig.ProxyProtocol |
getProxyProtocol()
Indicates the proxy protocol required for connection.
|
String |
getQueueDefinition()
Gets the queue definition.
|
ReconnectConfig |
getReconnect()
Gets the Reconnect Configuration.
|
String |
getSelectorThreadPoolDefinition()
Gets the selector thread pool definition.
|
SocketConditioningConfig |
getSocketConditioning()
Gets the Socket Conditioning Configuration.
|
long |
getSystemPingFrequency()
Gets the system ping frequency.
|
String |
getThreadPoolDefinition()
Gets the thread pool definition.
|
ConnectorConfig.Type |
getType()
Gets the connector type.
|
String |
getValidationPolicyFile()
Gets the validation policy file.
|
String |
getWebServer()
Gets the Web Server name.
|
boolean |
isRequired()
Gets the boolean value specifying if the connector is required.
|
ConnectionValidationPolicyConfig |
removeConnectionValidationPolicy(String name)
Remove a named connection validation policy.
|
void |
setAcceptors(int numberOfAcceptors)
Deprecated.
the value set will be ignored by the system.
|
void |
setApiType(ConnectorConfig.ClientApiType clientType)
Deprecated.
since 5.9
Since classic client APIs have been deprecated then this will be removed in a future release |
void |
setBacklog(int backlog)
Sets the backlog.
|
void |
setConnectionTimeout(long timeout)
Sets the connection timeout for inbound connections.
|
void |
setHost(String host)
Sets the host address to bind to.
|
void |
setPolicyFile(String policyFile)
Sets the policy file.
|
void |
setPort(int port)
Sets the port that the connector binds to.
|
void |
setProxyProtocol(ConnectorConfig.ProxyProtocol protocol)
Sets the proxy protocol required for connection.
|
void |
setQueueDefinition(String queueDefinition)
Sets the queue definition.
|
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 |
setSystemPingFrequency(long frequency)
Sets the system ping frequency.
|
void |
setThreadPoolDefinition(String definitionName)
Sets the thread pool definition.
|
void |
setType(ConnectorConfig.Type type)
Sets the connector type.
|
void |
setValidationPolicyFile(String validationPolicyFile)
Sets a validation policy file.
|
void |
setWebServer(String webServerName)
Sets the Web Server.
|
String getName()
void setRequired(boolean required) throws ConfigException
required
- is the connector required?ConfigException
- if unable to set the propertyboolean isRequired()
void setType(ConnectorConfig.Type type) throws ConfigException
By default all
types of connection are accepted.
type
- the connector typeConfigException
- if unable to set the propertyConnectorConfig.Type getType()
@Deprecated void setApiType(ConnectorConfig.ClientApiType clientType) throws ConfigException
Since classic client APIs have been deprecated then this will be removed in a future release
clientType
- The client typeConfigException
- if unable to set the property@Deprecated ConnectorConfig.ClientApiType getClientType()
void setHost(String host) throws ConfigException
The name or the IP Address that the connector will bind to. If this is not specified then a simple local bind will be performed.
host
- name or ip addressConfigException
- if unable to set the propertyString getHost()
void setPort(int port) throws ConfigException
If not explicitly set then the default is 8080. If you do not change this and there is more than one connector then they would clash at runtime and one would fail to start.
port
- The port on which the connector will accept connectionsConfigException
- if unable to set the propertyint getPort()
@Deprecated void setAcceptors(int numberOfAcceptors) throws ConfigException
If this is not explicitly set then 2 is assumed.
This call won't have any effect on the system, please use selector-thread-pool-definition.
numberOfAcceptors
- the number of acceptorsConfigException
- if unable to set the property@Deprecated int getAcceptors()
void setBacklog(int backlog) throws ConfigException
The maximum queue length for incoming clients. If a connection indication arrives when the queue is full, the connection is refused.
backlog
- queue length. If the value passed if equal or less than 0,
then the default value for a socket connection will be assumed.ConfigException
- if unable to set the propertyint getBacklog()
SocketConditioningConfig getSocketConditioning()
void setWebServer(String webServerName) throws ConfigException
If this connector is required to serve HTTP requests then a corresponding Web Server configuration must be specified.
webServerName
- the name of a configured (@link WebServerConfig Web
Server}ConfigException
- if unable to set the propertyString getWebServer()
void setPolicyFile(String policyFile) throws ConfigException
The location / name of the policy file. If this connector is required to
act as a policy file server (ConnectorConfig.Type.ALL
or ConnectorConfig.Type.POLICY
)
then this would need to be specified.
policyFile
- policy file pathConfigException
- if unable to set the propertyString getPolicyFile()
void setValidationPolicyFile(String validationPolicyFile) throws ConfigException
The location / name of a validation policy file for this connector.
Applies only to ConnectorConfig.Type.ALL
or ConnectorConfig.Type.CLIENT
.
If specified then this the connector will load
ConnectionValidationPolicyConfig
configuration from the specified
XML property file when starting,
validationPolicyFile
- file nameConfigException
- if unable to set the propertyString getValidationPolicyFile()
KeyStoreConfig getKeyStore()
The KeyStore configuration only applies to connectors that are to support SSL connections.
void setQueueDefinition(String queueDefinition) throws ConfigException
Optional queue definition for this connector. This only applies to
connectors of type ConnectorConfig.Type.ALL
or ConnectorConfig.Type.CLIENT
. The
definition must have been defined in the QueuesConfig
for the
owning ServerConfig
. If not specified then the default for the
server will be used.
queueDefinition
- name of configured queue definition.ConfigException
- if unable to set the propertyString getQueueDefinition()
ReconnectConfig getReconnect()
This specifies optional client reconnection properties. This only applies
to client connections (type ConnectorConfig.Type.ALL
or ConnectorConfig.Type.CLIENT
).
List<String> getIgnoreErrorsFrom()
void addIgnoreErrorsFrom(String ipAddress) throws ConfigException
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.
ipAddress
- an ip address to ignore connection errors fromConfigException
- if unable to add a new valuevoid setThreadPoolDefinition(String definitionName) throws ConfigException
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 then the
default
for the server will be
used.
definitionName
- thread pool definition nameConfigException
- if unable to set the propertyString getThreadPoolDefinition()
void setSelectorThreadPoolDefinition(String definitionName) throws ConfigException
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 then the
SelectorThreadPoolsConfig.getDefaultPool()
for the server will be
used.
definitionName
- selector thread pool definition nameConfigException
- if unable to set the propertyString getSelectorThreadPoolDefinition()
void setSystemPingFrequency(long frequency) throws ConfigException
This is the idle time (no inbound messages) before a client will be pinged by the server. A response must be received by Diffusion before the next interval, else the client is considered to be disconnected.
If this is not explicitly set then no system pings will be performed.
frequency
- a time in milliseconds between connection activity and a
client being pinged. If this is 0 then no system pings will be
performed.ConfigException
- if unable to set the propertylong getSystemPingFrequency()
List<ConnectionValidationPolicyConfig> getConnectionValidationPolicies()
ConnectionValidationPolicyConfig getConnectionValidationPolicy(String name)
name
- the policy nameConnectionValidationPolicyConfig addConnectionValidationPolicy(String name) throws ConfigException
This can be done even when configuration is locked.
name
- the policy nameConfigException
- if unable to add policy with given nameConnectionValidationPolicyConfig removeConnectionValidationPolicy(String name)
name
- the policy name.FetchPolicyConfig getFetchPolicy()
ConnectorConfig.ProxyProtocol getProxyProtocol()
void setProxyProtocol(ConnectorConfig.ProxyProtocol protocol) throws ConfigException
protocol
- the proxy protocol required for connectionConfigException
- if the configuration has been locked or the value
provided is nulllong getConnectionTimeout()
void setConnectionTimeout(long timeout) throws ConfigException
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.
timeout
- time in milliseconds. If this exceeds one hour (3600000ms)
a warning will be logged and the timeout will be set to one hour.ConfigException
- if unable to set the propertyCopyright © 2016 Push Technology Ltd. All Rights Reserved.