de.knipp.rritoolkit.request
Class Request

java.lang.Object
  extended by de.knipp.rritoolkit.request.Request
Direct Known Subclasses:
ContactCheckRequest, ContactCreateRequest, ContactInfoRequest, ContactUpdateRequest, DomainDataRequest, DomainMigrateDescrRequest, DomainSimpleRequest, LoginRequest, LogoutRequest, QueueDeleteRequest, QueueReadRequest

public abstract class Request
extends java.lang.Object

base class for all DENIC requests

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Field Summary
private  java.lang.String clientTxnID
          the client transaction ID
 
Constructor Summary
Request()
           
 
Method Summary
 Response execute(Port port)
          execute the this request on the given port.
protected abstract  java.lang.String getActionCode()
          return the action string for this request
 java.lang.String getClientTxnID()
          return the client transaction ID
protected  java.lang.String getProtocolVersion()
          return the version number of the protocol.
protected abstract  void requestToKVList(KVList list)
          method that needs to be implemented by subclasses for the key-value list conversion
protected abstract  void requestToXml(org.w3c.dom.Node node)
          method that needs to be implemented by subclasses for the XML conversion
 void setClientTxnID(java.lang.String txnID)
          set the client transaction ID
 void toList(KVList list)
          convert the request to a key-value list
 java.lang.String toString()
          return a string representation for debugging purposes
 void toXml(org.w3c.dom.Document doc)
          convert the request into an XML document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clientTxnID

private java.lang.String clientTxnID
the client transaction ID

Constructor Detail

Request

public Request()
Method Detail

execute

public Response execute(Port port)
                 throws java.io.IOException
execute the this request on the given port. Subclasses should override this method if subclasses of Response are returned.

Parameters:
port - the port on which this request shall be executed
Returns:
the response
Throws:
java.io.IOException - if the execution failed

toXml

public final void toXml(org.w3c.dom.Document doc)
                 throws org.w3c.dom.DOMException,
                        EncodeException
convert the request into an XML document

Parameters:
doc - the empty document which shall be filled
Throws:
org.w3c.dom.DOMException - on DOM exceptions
EncodeException - if the encoding fails for some reason

requestToXml

protected abstract void requestToXml(org.w3c.dom.Node node)
                              throws org.w3c.dom.DOMException,
                                     EncodeException
method that needs to be implemented by subclasses for the XML conversion

Parameters:
node - the node where the request shall be added to
Throws:
org.w3c.dom.DOMException - on DOM exceptions
EncodeException - if the encoding fails for some reason

toList

public final void toList(KVList list)
                  throws EncodeException
convert the request to a key-value list

Parameters:
list - an empty list which whould be filled
Throws:
EncodeException - if the encoding fails for some reason

getProtocolVersion

protected java.lang.String getProtocolVersion()
return the version number of the protocol. The default implementation returns the DenicConstants.RRI_VERSION

Returns:
the version string

getActionCode

protected abstract java.lang.String getActionCode()
return the action string for this request

Returns:
the action string

requestToKVList

protected abstract void requestToKVList(KVList list)
                                 throws EncodeException
method that needs to be implemented by subclasses for the key-value list conversion

Parameters:
list - the list that has to be filled
Throws:
EncodeException - if the encoding fails for some reason

toString

public java.lang.String toString()
return a string representation for debugging purposes

Overrides:
toString in class java.lang.Object
Returns:
the string representation

getClientTxnID

public java.lang.String getClientTxnID()
return the client transaction ID

Returns:
the ID or null if not set

setClientTxnID

public void setClientTxnID(java.lang.String txnID)
set the client transaction ID

Parameters:
txnID - the new transaction ID, may be null


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH