com.tucows.oxrs.epprtk.rtk
Class RTKBase
org.omg.CORBA.portable.ObjectImpl
com.tucows.oxrs.epprtk.rtk.RTKBase
public abstract class RTKBase
extends org.omg.CORBA.portable.ObjectImpl
RTK Base -- Base of the registrar tool kit. All RTK classes inherit from this one.
Defines: debug method and constants; date formats.
Note that despite this class extending a CORBA Object class, it does not make
any promises of CORBA functionality. Extension of the CORBA ObjectImpl was required
because of the methods required by the RTK IDL interfaces.
$Revision: 1.1 $ $Date: 2004/12/07 15:53:26 $protected static String | CRLF - Defined as "\r\n".
|
static DateFormat | DATE_FMT - DateFormat for "yyyy-MM-dd".
|
static int | DEBUG_LEVEL_ONE - Debug level for sending exceptions to System.err.
|
static int | DEBUG_LEVEL_THREE - Debug level for showing all debugging output, which
include entry and exit of methods.
|
static int | DEBUG_LEVEL_TWO - Debug level for debugging points on interest throughout the RTK code,
including display of XML messages to and from the EPP Server
|
static int | DEBUG_NONE - Debug level for no debug output.
|
static String | RTK_VERSION - RTK Version number.
|
static DateFormat | UTC_FMT - DateFormat for "yyyy-MM-dd'T'HH:mm:ss.S'Z'".
|
String[] | _ids() - Method required by ObjectImpl and the CORBA Object interface.
|
void | debug(int level, String method_name, Exception xcp) - Prints an exception to System.err, including its stack trace.
|
void | debug(int level, String method_name, String message) - Prints a debug message to System.err.
|
static int | getDebugLevel() - Accessor method for the debug level
|
static PrintStream | getDebugPrintStream() - Accessor method for the debug output stream
|
static String | getEasyProperty(String propName, String defaultValue) - This method gets a specific RTK property.
|
static Properties | getRTKProperties() - Returns the global properties for the RTK.
|
static void | setDebugLevel() - Accessor method for the debug level.
|
static void | setDebugLevel(int value) - Accessor method for the debug level.
|
static void | setDebugPrintStream(PrintStream stream) - Accessor method for the debug output stream.
|
CRLF
protected static final String CRLF
Defined as "\r\n". Used to complete a request to the EPP Server.
DATE_FMT
public static final DateFormat DATE_FMT
DateFormat for "yyyy-MM-dd".
It can be used to convert String dates into Date objects
and vice versa. eg:
String date_string = DATE_FMT.format(date_object);
DEBUG_LEVEL_ONE
public static final int DEBUG_LEVEL_ONE
Debug level for sending exceptions to System.err.
DEBUG_LEVEL_THREE
public static final int DEBUG_LEVEL_THREE
Debug level for showing all debugging output, which
include entry and exit of methods.
DEBUG_LEVEL_TWO
public static final int DEBUG_LEVEL_TWO
Debug level for debugging points on interest throughout the RTK code,
including display of XML messages to and from the EPP Server
DEBUG_NONE
public static final int DEBUG_NONE
Debug level for no debug output.
RTK_VERSION
public static final String RTK_VERSION
RTK Version number.
UTC_FMT
public static final DateFormat UTC_FMT
DateFormat for "yyyy-MM-dd'T'HH:mm:ss.S'Z'".
This is the format returned by the EPP Server in timestamps
(eg. expiration date, last modified date, etc...). It can be used
to convert String dates into Date objects. eg:
java.util.Date date_object = UTC_FMT.parse(date_string);
_ids
public String[] _ids()
Method required by ObjectImpl and the CORBA Object interface.
Always returns null. It's only here to satisfy the CORBA requirements
of the IDL usage.
debug
public void debug(int level,
String method_name,
Exception xcp)
Prints an exception to System.err, including its stack trace.
If the set debug level is greater than or equal to the given level,
then the exception is reported is reported.
The print out includes the class name, the given
method name, the current date and time, the given debug level
of this exception, the exception class name and the exception's message.
This is followed by the stack trace.
level
- the debug level of this messagemethod_name
- the method name Stringxcp
- the exception to be reported
debug
public void debug(int level,
String method_name,
String message)
Prints a debug message to System.err. If the set debug level
is greater than or equal to the given level, then the message
is printed. The print out includes the class name, the given
method name, the current date and time, the given debug level
of this message, and the message itself.
level
- the debug level of this messagemethod_name
- the method name Stringmessage
- the message String
getDebugLevel
public static int getDebugLevel()
Accessor method for the debug level
getDebugPrintStream
public static PrintStream getDebugPrintStream()
Accessor method for the debug output stream
- The current debug output stream
getEasyProperty
public static String getEasyProperty(String propName,
String defaultValue)
This method gets a specific RTK property.
It calls getRTKProperties() but shields the caller from the
exception which can be generated by catching it and returning
the default value.
getRTKProperties
public static Properties getRTKProperties()
throws FileNotFoundException,
IOException
Returns the global properties for the RTK.
By default the properties are empty. If the RTK user specifies
the system property "rtk.props.file", then that file will be loaded.
If there is a problem loading that file, then an exception will
be thrown.
- The RTK Properties contained in the rtk.properties file.
setDebugLevel
public static void setDebugLevel()
Accessor method for the debug level.
Sets the debug level using the setting found in the RTK properties.
Uses a default of DEBUG_LEVEL_ONE if the setting is not found
in the properties or if the setting is invalid.
setDebugLevel
public static void setDebugLevel(int value)
Accessor method for the debug level. Use DEBUG_LEVEL_NONE,
DEBUG_LEVEL_ONE, DEBUG_LEVEL_TWO, or DEBUG_LEVEL_THREE.
setDebugPrintStream
public static void setDebugPrintStream(PrintStream stream)
Accessor method for the debug output stream.
The default is System.err
stream
- The debug's new output stream
Copyright © 2001-2002 - Tucows, Inc., 2003 - LibertyRMS