Skip to main content
Version: 4.25.x.x LTS

Resource pools

Resource pools are used to manage a pool of resources to allow load balancing and failover behavior on resources bound to a thread, a session or the whole application. They can be configured in nevisAuth for a variety of components to be used, e.g., in AuthStates or in KeyStore configurations. The nevisAuth core allows the configuration of the following resource pool types:

  • ch.nevis.esauth.service.resourcepool.FileResourcePool
  • ch.nevis.esauth.service.resourcepool.HttpResourcePool
  • ch.nevis.esauth.service.resourcepool.LdapResourcePool
  • ch.nevis.esauth.service.resourcepool.ServiceResourcePool

Some resource pools only allow resources management (FileResourcePool); others share a connection manager to provide better performance during connection creation (HttpResourcePool).

The following table shows the format and properties of resource pools:

TopicDescription
Element (ResourcePool)name (string, -) Mandatory attribute that identifies the resource pool. This name is used to reference a resource pool.
class (class, -) Mandatory attribute that specifies the class to be used for storing resources. E.g., ch.nevis.esauth.service.resourcepool.HttpResourcePool
Element (Resource)value (string, -) Mandatory attribute that configures the path to the resource (e.g., to a file or URL).
Properties *(ResourcePool)*poolingMode (enum, FAILOVER) The pooling mode that should be used to retrieve the resource. Can be set to FAILOVER or LOAD BALANCING.
discardInterval (int, 10) The interval in seconds that a resource will be blocked if discarded.
retryDiscardedResources (boolean, false) If set to true, discarded resources will be used again if all resources have been discarded. If pooling mode is FAILOVER, the resource that was discarded for the longest time is retried. Otherwise, if pooling mode is LOAD BALANCING, the next resource in the pool is tried again.
retries (int, #resources or 1) Sets the number of retries available for the resource pool. If pooling mode is FAILOVER, the number of resources in the pool is set as a default value. Otherwise, if pooling mode if LOAD BALANCING, the default value is 1.
Properties (LdapResourcePool)searchSizeLimit (int, 256) This property limits the number of results returned by an LDAP search. This way, you can control resources such as memory and network bandwidth.
Properties (HttpResourcePool)pool.size (int, 200) The pool size for the HttpConnectionManager used in the HttpResourcePool.
pool.wait.timeout (int, 10000) The connection time-out in milliseconds until a connection is established. 0 is interpreted as an infinite time-out.
read.timeout (int, 30000) The socket time-out in milliseconds, which is the time-out for waiting for data. 0 is interpreted as an infinite time-out.

Resources in resource pools can contain properties specific to the resource pool implementation class. The following table lists the properties for the different types of resources:

TopicDescription
Properties (HttpResource)See settings in Utilities, table "Common HTTP/S client-side settings".
Properties (LdapConnection)user (string, -) Optional property that configures the user to authenticate the LDAP connection.
passwd (string, -) Optional property that configures the password to authenticate the LDAP connection.
Properties (ServiceResource)service (class, -) The class for the Web service that was generated with JAX-WS. This is a mandatory property.
maintainSession (boolean, false) Optional property to maintain a session over calls to the Web service. Set this to true if you want to avoid reauthentication on the server side.
proxy.proxyHost (string, -) Optional property for configuring the host of an outbound proxy.
proxy.proxyPort (int, 8080) Optional property for configuring the port of an outbound proxy.
proxy.proxyType (string, http) Optional property for configuring the type of an outbound proxy.

Example

<ResourcePool name="myHttpResourcePool"
class="ch.nevis.esauth.service.resourcepool.HttpResourcePool">
<Resource value="https://firstDomain.ch/certs/?ca_cert.pem">
<property name="username" value="admin" />
<property name="password" value="secretPassword" />
</Resource>
<Resource value="https://secondDomain.ch/certs/?node1_signedByCA.der">
<property name="username" value="certOwner" />
<property name="password" value="qwerty" />
</Resource>
<property name="proxyHost" value="proxy.mydomain.ch">
<property name="proxyPort" value="90">
</ResourcePool>