EPP RTK
for Java v 0.7.2

com.tucows.oxrs.epp0705.rtk
Class RTKBase

java.lang.Object
  |
  +--org.omg.CORBA.portable.ObjectImpl
        |
        +--com.tucows.oxrs.epp0705.rtk.RTKBase
All Implemented Interfaces:
org.omg.CORBA.Object
Direct Known Subclasses:
EPPClient, EPPTransportBase, EPPXMLBase

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.

Version:
$Revision: 1.6 $ $Date: 2003/04/25 20:39:38 $
Author:
Daniel Manley

Field Summary
protected static java.lang.String CRLF
          Defined as "\r\n".
static java.text.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 java.lang.String RTK_VERSION
          RTK Version number.
static java.text.DateFormat UTC_FMT
          DateFormat for "yyyy-MM-dd'T'hh:mm:ss.S'Z'".
 
Constructor Summary
RTKBase()
           
 
Method Summary
 java.lang.String[] _ids()
          Method required by ObjectImpl and the CORBA Object interface.
 void debug(int level, java.lang.String method_name, java.lang.Exception xcp)
          Prints an exception to System.err, including its stack trace.
 void debug(int level, java.lang.String method_name, java.lang.String message)
          Prints a debug message to System.err.
static int getDebugLevel()
          Accessor method for the debug level
static java.io.PrintStream getDebugPrintStream()
          Accessor method for the debug output stream
static java.util.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(java.io.PrintStream stream)
          Accessor method for the debug output stream.
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RTK_VERSION

public static final java.lang.String RTK_VERSION
RTK Version number.

See Also:
Constant Field Values

CRLF

protected static final java.lang.String CRLF
Defined as "\r\n". Used to complete a request to the EPP Server.

See Also:
Constant Field Values

DEBUG_NONE

public static final int DEBUG_NONE
Debug level for no debug output.

See Also:
Constant Field Values

DEBUG_LEVEL_ONE

public static final int DEBUG_LEVEL_ONE
Debug level for sending exceptions to System.err.

See Also:
Constant Field Values

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

See Also:
Constant Field Values

DEBUG_LEVEL_THREE

public static final int DEBUG_LEVEL_THREE
Debug level for showing all debugging output, which include entry and exit of methods.

See Also:
Constant Field Values

UTC_FMT

public static final java.text.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); 


DATE_FMT

public static final java.text.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); 

Constructor Detail

RTKBase

public RTKBase()
Method Detail

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.

Parameters:
value - The debug level

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.


getDebugLevel

public static int getDebugLevel()
Accessor method for the debug level

Returns:
The current debug level

setDebugPrintStream

public static void setDebugPrintStream(java.io.PrintStream stream)
Accessor method for the debug output stream. The default is System.err

Parameters:
stream - The debug's new output stream

getDebugPrintStream

public static java.io.PrintStream getDebugPrintStream()
Accessor method for the debug output stream

Returns:
The current debug output stream

debug

public void debug(int level,
                  java.lang.String method_name,
                  java.lang.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.

Parameters:
level - the debug level of this message
method_name - the method name String
message - the message String

debug

public void debug(int level,
                  java.lang.String method_name,
                  java.lang.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.

Parameters:
level - the debug level of this message
method_name - the method name String
xcp - the exception to be reported

_ids

public java.lang.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.

Specified by:
_ids in class org.omg.CORBA.portable.ObjectImpl

getRTKProperties

public static java.util.Properties getRTKProperties()
                                             throws java.io.FileNotFoundException,
                                                    java.io.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.

Returns:
The RTK Properties contained in the rtk.properties file.
Throws:
java.io.FileNotFoundException - If rtk.props.file System property doesn't point to the rtk.properties file
java.io.IOException - If there are problems reading the rtk.properties file

EPP RTK
for Java v 0.7.2

Copyright ? 2001-2002 - Tucows, Inc., 2003 - LibertyRMS