Interface ConnectorConfig

All Superinterfaces:
Config, SessionConfig

public interface ConnectorConfig extends SessionConfig, Config
Connector Configuration.

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
  • Field Details

    • CLUSTER_CONFIGURATION_RESTORED_CONDITION

      static final ConnectorConfig.StartCondition 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

      static final ConnectorConfig.StartCondition 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

      static final ConnectorConfig.StartCondition 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

      void setRequired(boolean required) throws ConfigException
      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 any start 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

      void setHost(String host) throws ConfigException
      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

      void setPort(int port) throws ConfigException
      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

      void setBacklog(int backlog) throws ConfigException
      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

      void setWebServer(String webServerName) throws ConfigException
      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

      void setValidationPolicyFile(String validationPolicyFile) throws ConfigException
      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

      List<String> getIgnoreErrorsFrom()
      Gets the list of IP addresses to ignore errors from.
      Returns:
      list of IP addresses to ignore errors from
    • addIgnoreErrorsFrom

      void addIgnoreErrorsFrom(String ipAddress) throws ConfigException
      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

      void setThreadPoolDefinition(String definitionName) throws ConfigException
      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, the default for 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
    • 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

      void setSelectorThreadPoolDefinition(String definitionName) throws ConfigException
      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

      ConnectionValidationPolicyConfig getConnectionValidationPolicy(String name)
      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

      ConnectionValidationPolicyConfig addConnectionValidationPolicy(String name) throws ConfigException
      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

      ConnectionValidationPolicyConfig removeConnectionValidationPolicy(String name)
      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

      void setProxyProtocol(ConnectorConfig.ProxyProtocol protocol) throws ConfigException
      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

      void setConnectionTimeout(long timeout) throws ConfigException
      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

      void setProtocols(Set<ConnectorConfig.Protocol> protocols) throws ConfigException
      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: