org.glite.authz.common.config
Class AbstractIniServiceConfigurationParser<ConfigurationType extends AbstractServiceConfiguration>

java.lang.Object
  extended by org.glite.authz.common.config.AbstractIniConfigurationParser<ConfigurationType>
      extended by org.glite.authz.common.config.AbstractIniServiceConfigurationParser<ConfigurationType>
Type Parameters:
ConfigurationType - the type of configuration produced by this parser
All Implemented Interfaces:
ConfigurationParser<ConfigurationType>

public abstract class AbstractIniServiceConfigurationParser<ConfigurationType extends AbstractServiceConfiguration>
extends AbstractIniConfigurationParser<ConfigurationType>

Base class for configuration parsers that employ an INI file.


Field Summary
static java.lang.String ADMIN_HOST_PROP
          The name of the "adminHost" property which indicates the host the service will listen on for admin commands.
static java.lang.String ADMIN_PASSWORD_PROP
          The name of the "adminPassword" property which indicates the password required for admin commands.
static java.lang.String ADMIN_PORT_PROP
          The name of the "adminPort" property which indicates the port the service will listen on for admin commands.
static java.lang.String CLIENT_CERT_AUTHN_PROP
          The name of the "requireClientCertAuthentication" property which indicates that client certificate authentication is required.
static java.lang.String DEFAULT_ADMIN_HOST
          Default value of the "adminHost" property: "localhost" .
static boolean DEFAULT_CLIENT_CERT_AUTH
          Default value of the "requireClientCertAuthentication" property, false .
static int DEFAULT_REQUEST_QUEUE
          Default value of the "requestQueueSize" property, 500 .
static boolean DEFAULT_SSL_ON_PROP
          Default value of the "enableSSL" property, false .
static java.lang.String ENTITY_ID_PROP
          The name of the "entityId" property which indicates the unique identity of the service.
static java.lang.String HOST_PROP
          The name of the "hostname" property which indicates the service hostname.
static java.lang.String PORT_PROP
          The name of the "port" property which indicates the port to which the service will bind.
static java.lang.String REQUEST_QUEUE_PROP
          The name of the "requestQueueSize" property which indicates the maximum number of requests that will be queued up.
static java.lang.String SERVICE_SECTION_HEADER
          The name of the "SERVICE" INI header which contains the property for configuring the service.
static java.lang.String SSL_ON_PORT_PROP
          The name of the "enableSSL" property which indicates that the service port should use SSL instead of plain HTTP.
 
Fields inherited from class org.glite.authz.common.config.AbstractIniConfigurationParser
CONN_TIMEOUT_PROP, DEFAULT_CONN_TIMEOUT, DEFAULT_MAX_REQS, DEFAULT_REC_BUFF_SIZE, DEFAULT_SEND_BUFF_SIZE, DEFAULT_TRUST_INFO_REFRESH, MAX_REQUESTS_PROP, REC_BUFF_SIZE_PROP, SECURITY_SECTION_HEADER, SEND_BUFF_SIZE_PROP, SERVICE_CERT_PROP, SERVICE_KEY_PROP, TRUST_INFO_DIR_PROP, TRUST_INFO_REFRSH_PROP
 
Constructor Summary
AbstractIniServiceConfigurationParser()
           
 
Method Summary
protected  org.opensaml.ws.soap.client.http.HttpClientBuilder buildSOAPClientBuilder(org.ini4j.Profile.Section configSection, javax.net.ssl.X509KeyManager keyManager, javax.net.ssl.X509TrustManager trustManager)
          Builds a SOAP client builder from the information contained in the configuration section.
protected  java.lang.String getAdminHost(org.ini4j.Profile.Section configSection)
          Gets the value of the "adminHost" property from the configuration section.
protected  java.lang.String getAdminPassword(org.ini4j.Profile.Section configSection)
          Gets the value of the "adminPassword" property from the configuration section.
protected  int getAdminPort(org.ini4j.Profile.Section configSection)
          Gets the value of the "adminPort" property from the configuration section.
protected  java.lang.String getEntityId(org.ini4j.Profile.Section configSection)
          Gets the value of the "entityId" property from the configuration section.
protected  java.lang.String getHostname(org.ini4j.Profile.Section configSection)
          Gets the value of the "hostname" property from the configuration section.
protected  int getMaxRequestQueueSize(org.ini4j.Profile.Section configSection)
          Gets the value of the "requestQueueSize" property from the configuration section.
protected  int getPort(org.ini4j.Profile.Section configSection)
          Gets the value of the "port" property from the configuration section.
protected  boolean isClientCertAuthRequired(org.ini4j.Profile.Section configSection)
          Gets the value of the "requireClientCertAuthentication" property from the configuration section.
protected  boolean isSSLEnabled(org.ini4j.Profile.Section configSection)
          Gets the value of the "enableSSL" property from the configuration section.
protected  void processSecuritySection(org.ini4j.Ini iniFile, AbstractServiceConfigurationBuilder<?> configBuilder)
          Process the information contained in the configuration section.
protected  void processServiceSection(org.ini4j.Ini iniFile, AbstractServiceConfigurationBuilder<?> configBuilder)
          Process the information contained in the "SERVICE" configuration section.
 
Methods inherited from class org.glite.authz.common.config.AbstractIniConfigurationParser
getConnectionTimeout, getMaximumRequests, getReceiveBufferSize, getSendBufferSize, getTrustMaterialRefreshInterval, getX509KeyManager, getX509TrustMaterialStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.glite.authz.common.config.ConfigurationParser
parse, parse
 

Field Detail

SERVICE_SECTION_HEADER

public static final java.lang.String SERVICE_SECTION_HEADER
The name of the "SERVICE" INI header which contains the property for configuring the service.

See Also:
Constant Field Values

ENTITY_ID_PROP

public static final java.lang.String ENTITY_ID_PROP
The name of the "entityId" property which indicates the unique identity of the service.

See Also:
Constant Field Values

HOST_PROP

public static final java.lang.String HOST_PROP
The name of the "hostname" property which indicates the service hostname.

See Also:
Constant Field Values

PORT_PROP

public static final java.lang.String PORT_PROP
The name of the "port" property which indicates the port to which the service will bind.

See Also:
Constant Field Values

SSL_ON_PORT_PROP

public static final java.lang.String SSL_ON_PORT_PROP
The name of the "enableSSL" property which indicates that the service port should use SSL instead of plain HTTP.

See Also:
Constant Field Values

CLIENT_CERT_AUTHN_PROP

public static final java.lang.String CLIENT_CERT_AUTHN_PROP
The name of the "requireClientCertAuthentication" property which indicates that client certificate authentication is required.

See Also:
Constant Field Values

ADMIN_HOST_PROP

public static final java.lang.String ADMIN_HOST_PROP
The name of the "adminHost" property which indicates the host the service will listen on for admin commands.

See Also:
Constant Field Values

DEFAULT_ADMIN_HOST

public static final java.lang.String DEFAULT_ADMIN_HOST
Default value of the "adminHost" property: "localhost" .

See Also:
Constant Field Values

ADMIN_PORT_PROP

public static final java.lang.String ADMIN_PORT_PROP
The name of the "adminPort" property which indicates the port the service will listen on for admin commands.

See Also:
Constant Field Values

ADMIN_PASSWORD_PROP

public static final java.lang.String ADMIN_PASSWORD_PROP
The name of the "adminPassword" property which indicates the password required for admin commands.

See Also:
Constant Field Values

REQUEST_QUEUE_PROP

public static final java.lang.String REQUEST_QUEUE_PROP
The name of the "requestQueueSize" property which indicates the maximum number of requests that will be queued up.

See Also:
Constant Field Values

DEFAULT_SSL_ON_PROP

public static final boolean DEFAULT_SSL_ON_PROP
Default value of the "enableSSL" property, false .

See Also:
Constant Field Values

DEFAULT_CLIENT_CERT_AUTH

public static final boolean DEFAULT_CLIENT_CERT_AUTH
Default value of the "requireClientCertAuthentication" property, false .

See Also:
Constant Field Values

DEFAULT_REQUEST_QUEUE

public static final int DEFAULT_REQUEST_QUEUE
Default value of the "requestQueueSize" property, 500 .

See Also:
Constant Field Values
Constructor Detail

AbstractIniServiceConfigurationParser

public AbstractIniServiceConfigurationParser()
Method Detail

getEntityId

protected java.lang.String getEntityId(org.ini4j.Profile.Section configSection)
                                throws ConfigurationException
Gets the value of the "entityId" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the value
Throws:
ConfigurationException - thrown if the entity ID property is not set or has an empty value

getHostname

protected java.lang.String getHostname(org.ini4j.Profile.Section configSection)
                                throws ConfigurationException
Gets the value of the "hostname" property from the configuration section. If the property is not present or is not valid the default value of will be used.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the value
Throws:
ConfigurationException - thrown if no host name is given

getPort

protected int getPort(org.ini4j.Profile.Section configSection)
Gets the value of the "port" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the value, or 0 if it is not set

isSSLEnabled

protected boolean isSSLEnabled(org.ini4j.Profile.Section configSection)
Gets the value of the "enableSSL" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
whether SSL should be enabled on the service port, defaults to false.

isClientCertAuthRequired

protected boolean isClientCertAuthRequired(org.ini4j.Profile.Section configSection)
Gets the value of the "requireClientCertAuthentication" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
whether client certificate authentication is required when a client is connecting, defaults to false.

getAdminHost

protected java.lang.String getAdminHost(org.ini4j.Profile.Section configSection)
Gets the value of the "adminHost" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the admin host value, or the default admin host "localhost" if it is not set

getAdminPort

protected int getAdminPort(org.ini4j.Profile.Section configSection)
Gets the value of the "adminPort" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the value, or 0 if is not set

getAdminPassword

protected java.lang.String getAdminPassword(org.ini4j.Profile.Section configSection)
Gets the value of the "adminPassword" property from the configuration section.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the value or null if it is not set

getMaxRequestQueueSize

protected int getMaxRequestQueueSize(org.ini4j.Profile.Section configSection)
Gets the value of the "requestQueueSize" property from the configuration section. If the property is not present or is not valid the default value of 500 will be used.

Parameters:
configSection - configuration section from which to extract the value
Returns:
the value

processServiceSection

protected void processServiceSection(org.ini4j.Ini iniFile,
                                     AbstractServiceConfigurationBuilder<?> configBuilder)
                              throws ConfigurationException
Process the information contained in the "SERVICE" configuration section.

Parameters:
iniFile - INI file being processed
configBuilder - builder being populated with configuration information
Throws:
ConfigurationException - thrown if there is a problem reading the information contained in the "SERVICE" section

processSecuritySection

protected void processSecuritySection(org.ini4j.Ini iniFile,
                                      AbstractServiceConfigurationBuilder<?> configBuilder)
                               throws ConfigurationException
Process the information contained in the configuration section.

Parameters:
iniFile - INI file being processed
configBuilder - builder being populated with configuration information
Throws:
ConfigurationException - thrown if there is a problem reading the information contained in the section

buildSOAPClientBuilder

protected org.opensaml.ws.soap.client.http.HttpClientBuilder buildSOAPClientBuilder(org.ini4j.Profile.Section configSection,
                                                                                    javax.net.ssl.X509KeyManager keyManager,
                                                                                    javax.net.ssl.X509TrustManager trustManager)
Builds a SOAP client builder from the information contained in the configuration section.

Parameters:
configSection - client configuration
keyManager - key manager used for outbound SSL/TLS connections
trustManager - trust manager used for inbound SSL/TLS connections
Returns:
the constructed SOAP client


Copyright © 2008-2012 EMI - European Middleware Initiative. All Rights Reserved.