infoservice
Class Configuration

java.lang.Object
  extended by infoservice.Configuration

public final class Configuration
extends java.lang.Object


Field Summary
private static Configuration configurationInstance
          Stores the instance of Configuration (Singleton).
private  boolean m_bRootOfUpdateInformation
          Stores, whether we are the "root" of the JAP update information (JNLP-Files + JAPMinVersion).
private  boolean m_bStatusStatisticsEnabled
          This stores, whether status statistics are enabled (true) or not (false).
private  java.util.Vector m_hardwareListenerList
          Stores the ListenerInterfaces of all interfaces our infoservice is bound to.
private  boolean m_holdForwarderList
          Stores whether this infoservice should hold a list with JAP forwarders (true) or not (false).
private  int m_iMaxPostContentLength
          Maximum size in bytes of HTTP POST data.
private  java.util.Vector m_initialNeighbourInfoServices
          Stores the ListenerInterfaces of all neighbour infoservices declared in the config file.
private  long m_lStatusStatisticsInterval
          Stores the interval (in ms, see System.currentTimeMillis()) between two status statistics.
private  java.io.File m_messageFile
           
private  int m_NrOfThreads
          Stores how many concurrent connections the InfoService can handle
private  java.util.Date m_startupTime
          Stores the startup time of the infoservice (time when the configuration instance was created).
private  java.lang.String m_strID
          The InfoService ID.
private  java.lang.String m_strJapDevelopmentJnlpFile
          Stores where the japDevelopment.jnlp is located in the local file system (path + filename).
private  java.lang.String m_strJapMinVersionFile
          Stores where the japMinVersion.xml is located in the local file system (path + filename).
private  java.lang.String m_strJapReleaseJnlpFile
          Stores where the japRelease.jnlp is located in the local file system (path + filename).
private  java.io.File m_strJavaLatestVersionFile
          Stores where the information about latest Java versions is located in the local file system (path + filename).
private  java.lang.String m_strOwnName
          Stores the name of our infoservice.
private  java.lang.String m_strProxyAddresses
          Stores the addresses of the proxy servers at the end of the cascades.
private  java.lang.String m_strStatusStatisticsLogDir
          Stores the directory, where to write the status statistics files.
private  java.util.Vector m_virtualListenerList
          Stores the ListenerInterfaces of all interfaces our infoservice propagates to others.
private static java.text.SimpleDateFormat ms_httpDateFormat
          Stores the date format information for HTTP headers.
 
Constructor Summary
Configuration(java.util.Properties a_properties)
           
 
Method Summary
 java.util.Vector getHardwareListeners()
          Returns the ListenerInterfaces of all Interfaces our infoservice is locally bound to.
static java.text.SimpleDateFormat getHttpDateFormat()
          Returns the HTTP-header date format information.
 java.lang.String getID()
           
 java.util.Vector getInitialNeighbourInfoServices()
          Returns the list with ListenerInterfaces of all neighbour infoservices from the config file.
static Configuration getInstance()
          Returns the instance of Configuration (Singleton).
 java.lang.String getJapDevelopmentJnlpFile()
          Returns where the japDevelopment.jnlp is located in the local file system (path + filename).
 java.lang.String getJapMinVersionFile()
          Returns where the file with JAP minimal version number is located in the local file system (path + filename).
 java.lang.String getJapReleaseJnlpFile()
          Returns where the japRelease.jnlp is located in the local file system (path + filename).
 java.io.File getJavaLatestVersionFile()
          Returns where the file with Java latest version information is located in the local file system (path + filename).
 int getMaxPostContentLength()
          Returns the maximum HTTP POST data size which will be accepted.
 java.io.File getMessageFile()
           
 int getNrOfConcurrentConnections()
          Returns how many concurrent connections this IS should handle
 java.lang.String getOwnName()
          Returns the name of our infoservice.
 java.lang.String getProxyAddresses()
          Returns the addresses of the proxy servers at the end of the cascades.
 java.util.Date getStartupTime()
          Returns the startup time of this infoservice.
 long getStatusStatisticsInterval()
          Returns the interval (in ms, see System.currentTimeMillis()) between two status statistics.
 java.lang.String getStatusStatisticsLogDir()
          Returns the directory where to log the status statistics.
 java.util.Vector getVirtualListeners()
          Returns the ListenerInterfaces of all Interfaces our infoservice propagates to others.
 boolean holdForwarderList()
          Returns whether this infoservice holds a JAP forwarder list or not.
 boolean isRootOfUpdateInformation()
          Returns, whether we are the root of the JAP update information (JNLP-Files + JAPMinVersion).
 boolean isStatusStatisticsEnabled()
          This returns, whether status statistics are enabled (true) or not (false).
private  PKCS12 loadPkcs12PrivateKey(java.lang.String a_pkcs12FileName, java.lang.String a_password)
          Loads a PKCS12 certificate from a file.
private  JAPCertificate loadX509Certificate(java.lang.String a_x509FileName)
          Loads a X509 certificate from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configurationInstance

private static Configuration configurationInstance
Stores the instance of Configuration (Singleton).


m_initialNeighbourInfoServices

private java.util.Vector m_initialNeighbourInfoServices
Stores the ListenerInterfaces of all neighbour infoservices declared in the config file.


m_hardwareListenerList

private java.util.Vector m_hardwareListenerList
Stores the ListenerInterfaces of all interfaces our infoservice is bound to.


m_virtualListenerList

private java.util.Vector m_virtualListenerList
Stores the ListenerInterfaces of all interfaces our infoservice propagates to others.


m_strOwnName

private java.lang.String m_strOwnName
Stores the name of our infoservice. The name is just for comfort reasons and has no importance.


m_strID

private java.lang.String m_strID
The InfoService ID. It is the SubjectPublicKeyIdentifier of the certificate.


m_iMaxPostContentLength

private int m_iMaxPostContentLength
Maximum size in bytes of HTTP POST data. We will not accept the post of longer messages. Longer messages will be thrown away.


m_bStatusStatisticsEnabled

private boolean m_bStatusStatisticsEnabled
This stores, whether status statistics are enabled (true) or not (false).


m_lStatusStatisticsInterval

private long m_lStatusStatisticsInterval
Stores the interval (in ms, see System.currentTimeMillis()) between two status statistics.


m_strStatusStatisticsLogDir

private java.lang.String m_strStatusStatisticsLogDir
Stores the directory, where to write the status statistics files. The name must end with a slash or backslash (WINDOWS).


m_strProxyAddresses

private java.lang.String m_strProxyAddresses
Stores the addresses of the proxy servers at the end of the cascades. This is only for compatibility and will be removed soon.


ms_httpDateFormat

private static java.text.SimpleDateFormat ms_httpDateFormat
Stores the date format information for HTTP headers.


m_bRootOfUpdateInformation

private boolean m_bRootOfUpdateInformation
Stores, whether we are the "root" of the JAP update information (JNLP-Files + JAPMinVersion).


m_strJapReleaseJnlpFile

private java.lang.String m_strJapReleaseJnlpFile
Stores where the japRelease.jnlp is located in the local file system (path + filename).


m_strJapDevelopmentJnlpFile

private java.lang.String m_strJapDevelopmentJnlpFile
Stores where the japDevelopment.jnlp is located in the local file system (path + filename).


m_strJavaLatestVersionFile

private java.io.File m_strJavaLatestVersionFile
Stores where the information about latest Java versions is located in the local file system (path + filename).


m_messageFile

private java.io.File m_messageFile

m_strJapMinVersionFile

private java.lang.String m_strJapMinVersionFile
Stores where the japMinVersion.xml is located in the local file system (path + filename).


m_startupTime

private java.util.Date m_startupTime
Stores the startup time of the infoservice (time when the configuration instance was created).


m_holdForwarderList

private boolean m_holdForwarderList
Stores whether this infoservice should hold a list with JAP forwarders (true) or not (false).


m_NrOfThreads

private int m_NrOfThreads
Stores how many concurrent connections the InfoService can handle

Constructor Detail

Configuration

public Configuration(java.util.Properties a_properties)
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getInstance

public static Configuration getInstance()
Returns the instance of Configuration (Singleton).

Returns:
The Configuration instance.

getInitialNeighbourInfoServices

public java.util.Vector getInitialNeighbourInfoServices()
Returns the list with ListenerInterfaces of all neighbour infoservices from the config file.

Returns:
Vector with ListenerInterfaces of initial neighbours.

getHardwareListeners

public java.util.Vector getHardwareListeners()
Returns the ListenerInterfaces of all Interfaces our infoservice is locally bound to.

Returns:
the ListenerInterfaces of bound interfaces.

getNrOfConcurrentConnections

public int getNrOfConcurrentConnections()
Returns how many concurrent connections this IS should handle


getVirtualListeners

public java.util.Vector getVirtualListeners()
Returns the ListenerInterfaces of all Interfaces our infoservice propagates to others.

Returns:
the ListenerInterfaces of propagated interfaces.

getID

public java.lang.String getID()

getOwnName

public java.lang.String getOwnName()
Returns the name of our infoservice. The name is just for comfort reasons and has no importance.

Returns:
The name of our infoservice from config file.

getMaxPostContentLength

public int getMaxPostContentLength()
Returns the maximum HTTP POST data size which will be accepted. We throw away longer POST messages.

Returns:
The maximum HTTP POST data size we accept.

isStatusStatisticsEnabled

public boolean isStatusStatisticsEnabled()
This returns, whether status statistics are enabled (true) or not (false).

Returns:
True, if status statistics are enabled or false, if they are disabled.

getStatusStatisticsInterval

public long getStatusStatisticsInterval()
Returns the interval (in ms, see System.currentTimeMillis()) between two status statistics. The value is only meaningful, if isStatusStatisticsEnabled() returns true.

Returns:
The status statistics interval.

getStatusStatisticsLogDir

public java.lang.String getStatusStatisticsLogDir()
Returns the directory where to log the status statistics. The directory name must end with a slash or backslash (WINDOWS). The value is only meaningful, if isStatusStatisticsEnabled() returns true.

Returns:
The directory, where to write the status statistics files.

getProxyAddresses

public java.lang.String getProxyAddresses()
Returns the addresses of the proxy servers at the end of the cascades. The info is from the proxyAddresses line of the properties file. This method is only for compatibility and will be removed soon.

Returns:
The addresses of the proxy servers.

getHttpDateFormat

public static java.text.SimpleDateFormat getHttpDateFormat()
Returns the HTTP-header date format information.

Returns:
The HTTP-header date format.

isRootOfUpdateInformation

public boolean isRootOfUpdateInformation()
Returns, whether we are the root of the JAP update information (JNLP-Files + JAPMinVersion).


getJapReleaseJnlpFile

public java.lang.String getJapReleaseJnlpFile()
Returns where the japRelease.jnlp is located in the local file system (path + filename).

Returns:
The filename (maybe with path) of japRelease.jnlp.

getJapDevelopmentJnlpFile

public java.lang.String getJapDevelopmentJnlpFile()
Returns where the japDevelopment.jnlp is located in the local file system (path + filename).

Returns:
The filename (maybe with path) of japDevelopment.jnlp.

getJavaLatestVersionFile

public java.io.File getJavaLatestVersionFile()
Returns where the file with Java latest version information is located in the local file system (path + filename).

Returns:
The filename (maybe with path) of java latest versions

getMessageFile

public java.io.File getMessageFile()

getJapMinVersionFile

public java.lang.String getJapMinVersionFile()
Returns where the file with JAP minimal version number is located in the local file system (path + filename).

Returns:
The filename (maybe with path) of japMinVersion.xml.

getStartupTime

public java.util.Date getStartupTime()
Returns the startup time of this infoservice.

Returns:
The time when this infoservices was started.

holdForwarderList

public boolean holdForwarderList()
Returns whether this infoservice holds a JAP forwarder list or not.

Returns:
True, if this infoservice has a primary forwarder list or false, if this infoservice doesn't have a primary forwarder list and redirects all requests from blockees to an infoservice with such a list (if we know one in the InfoserviceDatabase).

loadPkcs12PrivateKey

private PKCS12 loadPkcs12PrivateKey(java.lang.String a_pkcs12FileName,
                                    java.lang.String a_password)
                             throws java.io.FileNotFoundException
Loads a PKCS12 certificate from a file.

Parameters:
a_pkcs12FileName - The filename (with path) of the PKCS12 file.
a_password - The password for the PKCS12 file, if necessary. If no password is necessary, you can supply null or an empty string.
Returns:
The PKCS12 certificate structure including the private key or null, if the certificate could not be loaded (invalid password or invalid data within the file).
Throws:
java.io.FileNotFoundException - If the file cannot be found in the filesystem.

loadX509Certificate

private JAPCertificate loadX509Certificate(java.lang.String a_x509FileName)
Loads a X509 certificate from a file.

Parameters:
a_x509FileName - The filename (with path) of the X509 file.
Returns:
The X509 certificate or null, if there was an error while loading the certificate from the specified file.