hr.fer.tel.nims.dsa.client
Class ConfigurationHandler

java.lang.Object
  extended by hr.fer.tel.nims.dsa.client.ConfigurationHandler

public class ConfigurationHandler
extends java.lang.Object

ConfigurationHandler class parses SIP user agent's configuration from a properties file. (based on the hr.fer.teletk.sipas.proxy.ConfigurationHandler)

Author:
Ognjen Dobrijevic

Field Summary
 java.lang.String ADDRESS_PROPERTY
           
 java.lang.String DEBUG_LOG_PROPERTY
           
 java.lang.String DOMAIN_PROPERTY
           
 java.lang.String NAME_PROPERTY
           
 java.lang.String OUTBOUND_PROXY_PROPERTY
           
 java.lang.String PORT_PROPERTY
           
 java.lang.String RETRANSMISSION_FILTER_PROPERTY
           
 java.lang.String SERVER_LOG_PROPERTY
           
 java.lang.String TRACE_LEVEL_PROPERTY
           
 java.lang.String TRANSPORT_PROPERTY
           
 
Constructor Summary
ConfigurationHandler(java.lang.String configurationFile)
          Creates a configuration handler for initializing SIP user agent.
 
Method Summary
 java.util.Properties getConfigurationProperties()
           
 java.lang.String getDebugLog()
           
 java.lang.String getDomain()
           
 java.lang.String getIpAddress()
           
 java.lang.String getName()
          Gets the name of the user agent that is configured.
 boolean getRetransmissionFilter()
           
 java.lang.String getServerLog()
           
 java.lang.String getTraceLevel()
          Gets the trace level value that is configured.
 int getTransportPort()
          Gets the transport protocol port number that is configured.
 java.lang.String getTransportProtocol()
          Gets the configured transport protocol.
 void init()
          Initializes the configuration properties by reading the configuration file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_PROPERTY

public final java.lang.String NAME_PROPERTY
See Also:
Constant Field Values

ADDRESS_PROPERTY

public final java.lang.String ADDRESS_PROPERTY
See Also:
Constant Field Values

OUTBOUND_PROXY_PROPERTY

public final java.lang.String OUTBOUND_PROXY_PROPERTY
See Also:
Constant Field Values

PORT_PROPERTY

public final java.lang.String PORT_PROPERTY
See Also:
Constant Field Values

TRANSPORT_PROPERTY

public final java.lang.String TRANSPORT_PROPERTY
See Also:
Constant Field Values

RETRANSMISSION_FILTER_PROPERTY

public final java.lang.String RETRANSMISSION_FILTER_PROPERTY
See Also:
Constant Field Values

DOMAIN_PROPERTY

public final java.lang.String DOMAIN_PROPERTY
See Also:
Constant Field Values

SERVER_LOG_PROPERTY

public final java.lang.String SERVER_LOG_PROPERTY
See Also:
Constant Field Values

DEBUG_LOG_PROPERTY

public final java.lang.String DEBUG_LOG_PROPERTY
See Also:
Constant Field Values

TRACE_LEVEL_PROPERTY

public final java.lang.String TRACE_LEVEL_PROPERTY
See Also:
Constant Field Values
Constructor Detail

ConfigurationHandler

public ConfigurationHandler(java.lang.String configurationFile)
Creates a configuration handler for initializing SIP user agent.

Parameters:
configurationFile - the name of the file containing the configuration.
Method Detail

init

public void init()
          throws java.io.IOException,
                 java.lang.IllegalArgumentException
Initializes the configuration properties by reading the configuration file.

Throws:
java.io.IOException - if the file could not be found or there was an error reading from it.
java.lang.IllegalArgumentException - if some of the values in the configuration file are invalid.

getIpAddress

public java.lang.String getIpAddress()

getName

public java.lang.String getName()
Gets the name of the user agent that is configured.

Returns:
the name of the user agent that is configured.

getTransportPort

public int getTransportPort()
Gets the transport protocol port number that is configured. If the port number is not specified, returns 5060.

Returns:
the number of the port that is configured or 5060 if it is not configured.

getTransportProtocol

public java.lang.String getTransportProtocol()
Gets the configured transport protocol. If transport protocol isn't configured, assumes "UDP".

Returns:
the name of transport protocol configured, or "UDP" if it is not configured

getRetransmissionFilter

public boolean getRetransmissionFilter()

getServerLog

public java.lang.String getServerLog()

getDebugLog

public java.lang.String getDebugLog()

getTraceLevel

public java.lang.String getTraceLevel()
Gets the trace level value that is configured. If the value isn't configured, assumes value of 16.

Returns:
the value of trace level configured, or value of "16" if it is not configured

getConfigurationProperties

public java.util.Properties getConfigurationProperties()

getDomain

public java.lang.String getDomain()