net.jetrix.config
Class ServerConfig

java.lang.Object
  extended by net.jetrix.config.ServerConfig

public class ServerConfig
extends Object

Server configuration. This objet reads and retains server parameters, channel definitions and the ban list.

Version:
$Revision: 866 $, $Date: 2010-08-23 17:02:51 +0200 (lun., 23 août 2010) $
Author:
Emmanuel Bourg

Field Summary
static String ENCODING
           
static int STATUS_LOCKED
           
static int STATUS_OPENED
           
static String VERSION
           
 
Constructor Summary
ServerConfig()
           
 
Method Summary
 void addBannedHost(String host)
           
 void addChannel(ChannelConfig cconf)
           
 void addCommand(Command command)
           
 void addDataSource(DataSourceConfig datasource)
           
 void addFilter(FilterConfig filterConfig)
           
 void addFilterAlias(String name, String classname)
           
 void addListener(Listener listener)
           
 void addService(Service service)
          Add a new service to the server.
 void addWinlist(WinlistConfig config)
           
 String getAccessLogPath()
           
 String getAdminPassword()
           
 List<ChannelConfig> getChannels()
           
 String getChannelsFile()
           
 Collection<DataSourceConfig> getDataSources()
           
 Settings getDefaultSettings()
           
 String getErrorLogPath()
           
 Iterator<FilterConfig> getGlobalFilters()
           
 InetAddress getHost()
           
 List<Listener> getListeners()
           
 Locale getLocale()
           
 MailSessionConfig getMailSessionConfig()
           
 int getMaxChannels()
           
 int getMaxConnections()
           
 int getMaxPlayers()
           
 String getMessageOfTheDay()
           
 String getName()
           
 String getOpPassword()
           
 String getProperty(String key)
           
 List<Service> getServices()
          Return the list of services currently registered on the server
 Statistics getStatistics()
          Return the server statistics.
 int getStatus()
           
 int getTimeout()
           
 boolean isRunning()
           
 void load(File file)
          Load the configuration
 void load(URL serverConfigURL)
          Load the configuration.
 void save()
          Save the configuration.
 void setAccessLogPath(String accesslogPath)
           
 void setAdminPassword(String adminPassword)
           
 void setChannelsFile(String channelsFile)
           
 void setDefaultSettings(Settings defaultSettings)
           
 void setErrorLogPath(String errorlogPath)
           
 void setHost(InetAddress host)
           
 void setHost(String hostname)
           
 void setLocale(Locale locale)
           
 void setLocale(String language)
           
 void setMailSessionConfig(MailSessionConfig mailSessionConfig)
           
 void setMaxChannels(int maxChannels)
           
 void setMaxConnections(int maxConnections)
           
 void setMaxPlayers(int maxPlayers)
           
 void setMessageOfTheDay(String motd)
           
 void setName(String name)
           
 void setOpPassword(String oppass)
           
 void setProperty(String key, String value)
           
 void setRunning(boolean running)
           
 void setStatus(int status)
           
 void setTimeout(int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final String ENCODING
See Also:
Constant Field Values

VERSION

public static final String VERSION
See Also:
Constant Field Values

STATUS_OPENED

public static final int STATUS_OPENED
See Also:
Constant Field Values

STATUS_LOCKED

public static final int STATUS_LOCKED
See Also:
Constant Field Values
Constructor Detail

ServerConfig

public ServerConfig()
Method Detail

load

public void load(File file)
Load the configuration


load

public void load(URL serverConfigURL)
Load the configuration.


save

public void save()
          throws IOException
Save the configuration.

Throws:
IOException

getName

public String getName()

setName

public void setName(String name)

getHost

public InetAddress getHost()

setHost

public void setHost(InetAddress host)

setHost

public void setHost(String hostname)

getLocale

public Locale getLocale()

setLocale

public void setLocale(Locale locale)

setLocale

public void setLocale(String language)

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)

getMaxChannels

public int getMaxChannels()

setMaxChannels

public void setMaxChannels(int maxChannels)

getMaxPlayers

public int getMaxPlayers()

setMaxPlayers

public void setMaxPlayers(int maxPlayers)

getMaxConnections

public int getMaxConnections()

setMaxConnections

public void setMaxConnections(int maxConnections)

getOpPassword

public String getOpPassword()

setOpPassword

public void setOpPassword(String oppass)

getAdminPassword

public String getAdminPassword()

setAdminPassword

public void setAdminPassword(String adminPassword)

getAccessLogPath

public String getAccessLogPath()

setAccessLogPath

public void setAccessLogPath(String accesslogPath)

getErrorLogPath

public String getErrorLogPath()

setErrorLogPath

public void setErrorLogPath(String errorlogPath)

getChannelsFile

public String getChannelsFile()

setChannelsFile

public void setChannelsFile(String channelsFile)

getMessageOfTheDay

public String getMessageOfTheDay()

setMessageOfTheDay

public void setMessageOfTheDay(String motd)

isRunning

public boolean isRunning()

setRunning

public void setRunning(boolean running)

getStatus

public int getStatus()

setStatus

public void setStatus(int status)

getDefaultSettings

public Settings getDefaultSettings()

setDefaultSettings

public void setDefaultSettings(Settings defaultSettings)

getChannels

public List<ChannelConfig> getChannels()

addChannel

public void addChannel(ChannelConfig cconf)

getGlobalFilters

public Iterator<FilterConfig> getGlobalFilters()

addFilter

public void addFilter(FilterConfig filterConfig)

addFilterAlias

public void addFilterAlias(String name,
                           String classname)

addWinlist

public void addWinlist(WinlistConfig config)

addCommand

public void addCommand(Command command)

addListener

public void addListener(Listener listener)

getListeners

public List<Listener> getListeners()

addService

public void addService(Service service)
Add a new service to the server. The service is not started automatically by calling this method.

Parameters:
service - the service to add
Since:
0.2

getServices

public List<Service> getServices()
Return the list of services currently registered on the server

Since:
0.2

addBannedHost

public void addBannedHost(String host)

getStatistics

public Statistics getStatistics()
Return the server statistics.


getDataSources

public Collection<DataSourceConfig> getDataSources()
Since:
0.3

addDataSource

public void addDataSource(DataSourceConfig datasource)
Since:
0.3

getMailSessionConfig

public MailSessionConfig getMailSessionConfig()
Since:
0.3

setMailSessionConfig

public void setMailSessionConfig(MailSessionConfig mailSessionConfig)
Since:
0.3

getProperty

public String getProperty(String key)
Since:
0.3

setProperty

public void setProperty(String key,
                        String value)
Since:
0.3


Copyright © 2001-2010. All Rights Reserved.