util
Class SyslogAdmin

java.lang.Object
  extended by util.CommandLineParser
      extended by util.SyslogAdmin

public class SyslogAdmin
extends CommandLineParser

A basic command-line interface to allow some client-access to the running loggers. Note that any running PropertySyslog bound to the registry may serve as the aim for this admin facility. Changing a logger's properties will change this logger system-wide, i.e. for the entire VM the PropertySyslog runs in.
This class provides only basic functionality for dealing with the system loggers. The following command line switches are recognized:


Nested Class Summary
 
Nested classes/interfaces inherited from class util.CommandLineParser
CommandLineParser.Test
 
Field Summary
protected static String FOOT
          A footer message.
static String NULLSWITCHES
          The no-argument switches.
static String ONESWITCHES
          The one-argument switches.
static String TWOSWITCHES
          The two-argument switches.
protected static Map<String,String> USE
          A look-up table for detailed usage messages.
 
Constructor Summary
SyslogAdmin()
          Constructs a new syslog admin utility.
 
Method Summary
static void main(String[] arg)
          Provides access to the syslog properties.
 boolean process(String[] arg)
          Process the command line arguments.
protected  boolean processSwitches(SyslogAdjusting sys)
          Parses through the command line switches known and performs the desired action on the SyslogAdjusting instance handed over.
 
Methods inherited from class util.CommandLineParser
getArguments, getCommandLine, getCommands, getRegisteredSwitches, hasAnySwitch, hasSwitch, hasSwitch, haveAllSwitches, parse, printCommandLine, registerLine, registerSwitches, setCommands, staticUsage, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULLSWITCHES

public static final String NULLSWITCHES
The no-argument switches.

See Also:
Constant Field Values

ONESWITCHES

public static final String ONESWITCHES
The one-argument switches.

See Also:
Constant Field Values

TWOSWITCHES

public static final String TWOSWITCHES
The two-argument switches.

See Also:
Constant Field Values

USE

protected static final Map<String,String> USE
A look-up table for detailed usage messages.


FOOT

protected static final String FOOT
A footer message.

See Also:
Constant Field Values
Constructor Detail

SyslogAdmin

public SyslogAdmin()
Constructs a new syslog admin utility. During construction, all switches are registered to the underlying parser. Use the process(java.lang.String[]) method to process the arguments.

Method Detail

process

public boolean process(String[] arg)
                throws ParseException
Process the command line arguments. After parsing the switches, the single command is converted into a instance. If this is successful, the instance is further passed on to the processSwitches method.

Returns:
True on success.
Throws:
ParseException

processSwitches

protected boolean processSwitches(SyslogAdjusting sys)
Parses through the command line switches known and performs the desired action on the SyslogAdjusting instance handed over.


main

public static void main(String[] arg)
                 throws ParseException
Provides access to the syslog properties. Call the main method without any parameters to get a short usage message.

Throws:
ParseException