net.sf.jradius.server.config
Class Configuration

java.lang.Object
  extended by net.sf.jradius.server.config.Configuration

public class Configuration
extends java.lang.Object

Reads JRadius configuration options and provides methods to access them

Author:
Gert Jan Verhoog, David Bird

Constructor Summary
Configuration()
           
 
Method Summary
static DictionaryConfigurationItem dictionaryConfigurationForName(java.lang.String name)
           
static HandlerConfigurationItem eventHandlerConfigurationForName(java.lang.String name)
           
static JRCommand eventHandlerForName(java.lang.String name)
           
static org.apache.commons.chain.Command getCommand(java.lang.String commandID)
           
static java.lang.String getConfigFileDir()
           
static java.util.Collection getDictionaryConfigs()
          A collection of DictionaryConfigurationItems, corresponding to the <load-dictionaries> elements in the configuration file.
static java.util.Collection getEventHandlers()
          A collection of HandlerConfigurationItems, corresponding to the <event-handler> elements in the configuration file.
static java.util.Collection getListenerConfigs()
          A collection of ListenerConfigurationItems, corresponding to the <listener> elements in the configuration file.
static java.util.Collection getPacketHandlers()
          A collection of PacketHandlerConfigurationItems, corresponding to the <packet-handler> elements in the configuration file.
static int getTimeoutSeconds()
          The number of seconds to wait for packets, corresponding to the <timeout> option in the configuration file.
static void initialize(java.io.File file)
           
static boolean isDebug()
          Corresponds to the <debug>true/false</debug> configuration option.
static ListenerConfigurationItem listenerConfigurationForName(java.lang.String name)
           
static PacketHandlerConfigurationItem packetHandlerConfigurationForName(java.lang.String name)
           
static JRCommand packetHandlerForName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Method Detail

initialize

public static void initialize(java.io.File file)
                       throws java.io.FileNotFoundException,
                              org.apache.commons.configuration.ConfigurationException
Throws:
java.io.FileNotFoundException
org.apache.commons.configuration.ConfigurationException

isDebug

public static boolean isDebug()
Corresponds to the <debug>true/false</debug> configuration option. If set to true, generate log messages for debugging.

Returns:
true if debugging messages should be generated.

getConfigFileDir

public static java.lang.String getConfigFileDir()
Returns:
configuration file directory

getPacketHandlers

public static java.util.Collection getPacketHandlers()
A collection of PacketHandlerConfigurationItems, corresponding to the <packet-handler> elements in the configuration file.

Returns:
A collection of PacketHandlerConfigurationItems

getEventHandlers

public static java.util.Collection getEventHandlers()
A collection of HandlerConfigurationItems, corresponding to the <event-handler> elements in the configuration file.

Returns:
A collection of HandlerConfigurationItems

packetHandlerConfigurationForName

public static PacketHandlerConfigurationItem packetHandlerConfigurationForName(java.lang.String name)

eventHandlerConfigurationForName

public static HandlerConfigurationItem eventHandlerConfigurationForName(java.lang.String name)

packetHandlerForName

public static JRCommand packetHandlerForName(java.lang.String name)

eventHandlerForName

public static JRCommand eventHandlerForName(java.lang.String name)

getCommand

public static org.apache.commons.chain.Command getCommand(java.lang.String commandID)
                                                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getListenerConfigs

public static java.util.Collection getListenerConfigs()
A collection of ListenerConfigurationItems, corresponding to the <listener> elements in the configuration file.

Returns:
A collection of ListenerConfigurationItems

listenerConfigurationForName

public static ListenerConfigurationItem listenerConfigurationForName(java.lang.String name)

getDictionaryConfigs

public static java.util.Collection getDictionaryConfigs()
A collection of DictionaryConfigurationItems, corresponding to the <load-dictionaries> elements in the configuration file.

Returns:
A collection of DictionaryConfigurationItems

dictionaryConfigurationForName

public static DictionaryConfigurationItem dictionaryConfigurationForName(java.lang.String name)

getTimeoutSeconds

public static int getTimeoutSeconds()
The number of seconds to wait for packets, corresponding to the <timeout> option in the configuration file. If this is 0 (zero), wait indefinately (i.e. waiting will never time out).

Returns:
The number of seconds to wait for packets


Copyright © 2006 The JRadius Project, All Rights Reserved.