EPP 0.4.9

com.neulevel.epp.core.command
Class EppCommand

java.lang.Object
  extended by com.neulevel.epp.core.EppEntity
      extended by com.neulevel.epp.core.command.EppCommand
Direct Known Subclasses:
EppCommandCheck, EppCommandCreate, EppCommandDelete, EppCommandInfo, EppCommandLogin, EppCommandLogout, EppCommandPoll, EppCommandRenew, EppCommandTransfer, EppCommandUpdate

public abstract class EppCommand
extends EppEntity

This EppCommand class implements EPP Command entity.

Version:
$Revision: 1.3 $ $Date: 2006/03/01 01:35:38 $
Author:
Ning Zhang ning.zhang@neustar.com

Field Summary
protected  java.lang.String clTRID
          The client transaction id associated with the EPP Command
protected  EppCreds creds
          The EPP Credentials associated with the EPP Command (optional) - for backward compatibility, not used any more in EPP-1.0
protected  java.util.Vector extension
          Any extension data associated with the EPP Command (optional)
 
Constructor Summary
EppCommand()
           
 
Method Summary
 void addExtension(org.w3c.dom.Element ext)
          Adds an optional extension object
 void addExtension(EppExtension ext)
          Adds an optional extension object
static EppCommandCheck check(int objectType, java.lang.String xid)
          Creates an EppCommandCheck object based on the object type.
static EppCommandCreate create(EppObject object, java.lang.String xid)
          Creates an EppCommandCreate object.
static EppCommandDelete delete(int objectType, java.lang.String objectId, java.lang.String xid)
          Creates an EppCommandDelete object based on the object type.
static EppEntity fromXML(org.w3c.dom.Node root)
          Converts an XML element into an EppCommand object.
 java.lang.String getClientTransactionId()
          Gets transaction id from the registrar client
 EppCreds getCreds()
          Gets command credentials - for backward compatibility, not used any more in EPP-1.0
 java.util.Vector getExtension()
          Gets the list of extension objects, either EppUnspec, or DOM Element
 EppUnspec getUnspec()
          Gets optional unspecified object - for backward compatibility
static EppCommandInfo info(int objectType, java.lang.String objectId, java.lang.String xid)
          Creates an EppCommandInfo object based on the object type.
static EppCommandRenew renew(int objectType, java.lang.String objectId, java.lang.String xid)
          Creates an EppCommandRenew object based on the object type.
 void setClientTransactionId(java.lang.String xid)
          Sets transaction id from the registrar client
 void setCreds(EppCreds creds)
          Sets command credentials - for backward compatibility, not used any more in EPP-1.0
 void setUnspec(EppUnspec unspec)
          Sets optional unspecified object - for backward compatibility
protected  org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc, java.lang.String command, org.w3c.dom.Element element)
          Converts the shared EppCommand components into an XML element.
protected  org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc, java.lang.String command, org.w3c.dom.Element element, java.util.Vector attrList)
          Converts the shared EppCommand components into an XML element.
protected  org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc, java.lang.String command, EppEntity object)
          Converts the shared EppCommand components into an XML element.
protected  org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc, java.lang.String command, java.lang.Object object, java.lang.String tag, java.util.Vector attrList)
          Converts the shared EppCommand components into an XML element
static EppCommandTransfer transfer(int objectType, java.lang.String objectId, java.lang.String xid)
          Creates an EppCommandTransfer object based on the object type.
static EppCommandUpdate update(int objectType, java.lang.String objectId, java.lang.String xid)
          Creates an EppCommandUpdate object based on the object type.
 
Methods inherited from class com.neulevel.epp.core.EppEntity
toString, toString, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

creds

protected EppCreds creds
The EPP Credentials associated with the EPP Command (optional) - for backward compatibility, not used any more in EPP-1.0


extension

protected java.util.Vector extension
Any extension data associated with the EPP Command (optional)


clTRID

protected java.lang.String clTRID
The client transaction id associated with the EPP Command

Constructor Detail

EppCommand

public EppCommand()
Method Detail

getCreds

public EppCreds getCreds()
Gets command credentials - for backward compatibility, not used any more in EPP-1.0


setCreds

public void setCreds(EppCreds creds)
Sets command credentials - for backward compatibility, not used any more in EPP-1.0


getUnspec

public EppUnspec getUnspec()
Gets optional unspecified object - for backward compatibility


setUnspec

public void setUnspec(EppUnspec unspec)
Sets optional unspecified object - for backward compatibility


getExtension

public java.util.Vector getExtension()
Gets the list of extension objects, either EppUnspec, or DOM Element


addExtension

public void addExtension(EppExtension ext)
Adds an optional extension object


addExtension

public void addExtension(org.w3c.dom.Element ext)
Adds an optional extension object


getClientTransactionId

public java.lang.String getClientTransactionId()
Gets transaction id from the registrar client


setClientTransactionId

public void setClientTransactionId(java.lang.String xid)
Sets transaction id from the registrar client


toXMLCommon

protected org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc,
                                          java.lang.String command,
                                          org.w3c.dom.Element element)
Converts the shared EppCommand components into an XML element. The command must be object specific commands such as create/delete/query, etc.

Parameters:
doc - the XML Document object
command - the tag/element name for the EppCommand object
element - the Element associated with the command
Returns:
an Element object

toXMLCommon

protected org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc,
                                          java.lang.String command,
                                          org.w3c.dom.Element element,
                                          java.util.Vector attrList)
Converts the shared EppCommand components into an XML element. The command must be object specific commands such as create/delete/query, etc.

Parameters:
doc - the XML Document object
command - the tag/element name for the EppCommand object
element - the Element associated with the command
attrList - the Attr list associated with the command
Returns:
an Element object

toXMLCommon

protected org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc,
                                          java.lang.String command,
                                          EppEntity object)
Converts the shared EppCommand components into an XML element. The command must be object specific commands such as create/delete/query, etc.

Parameters:
doc - the XML Document object
command - the tag/element name for the EppCommand object
object - the EppObject associated with the command. the type of the object should be either EppEntity or Element
Returns:
an Element object

toXMLCommon

protected org.w3c.dom.Element toXMLCommon(org.w3c.dom.Document doc,
                                          java.lang.String command,
                                          java.lang.Object object,
                                          java.lang.String tag,
                                          java.util.Vector attrList)
Converts the shared EppCommand components into an XML element

Parameters:
doc - the XML Document object
command - the tag/element name for the EppCommand object
object - the Object associated with the command. the type of the object should be either EppEntity or Element
tag - the tag indicating if the command is generic, such as login/logout
attrList - the Attr list associated with the command
Returns:
an Element object

fromXML

public static EppEntity fromXML(org.w3c.dom.Node root)
Converts an XML element into an EppCommand object. The caller of this method must make sure that the root node is of an EPP Command entity.

Parameters:
root - root node for an EppCommand object in XML format
Returns:
an EppEntity object, or null if the node is invalid

create

public static EppCommandCreate create(EppObject object,
                                      java.lang.String xid)
Creates an EppCommandCreate object. This is a convience method for creating an EPP Object in the registry.

Parameters:
object - object to be created in the registry
xid - client transaction id associated with the operation
Returns:
an EppCommandCreate object, which could be one of the subclass of EppCommandCreate

check

public static EppCommandCheck check(int objectType,
                                    java.lang.String xid)
Creates an EppCommandCheck object based on the object type.

Parameters:
objectType - the type of objects to be checked. The value must be defined in EppObject, as one of the followings:
  • EppObject.CONTACT
  • EppObject.DOMAIN
  • EppObject.HOST
  • EppObject.SVCSUB
  • EppObject.XRI_AUTHORITY
  • EppObject.XRI_INUMBER
  • EppObject.XRI_INAME
  • EppObject.XRI_ISERVICE
xid - client transaction id associated with the operation
Returns:
an EppCommandCheck object, which could be one of the subclass of EppCommandCheck; or null if the object type is invalid.

delete

public static EppCommandDelete delete(int objectType,
                                      java.lang.String objectId,
                                      java.lang.String xid)
Creates an EppCommandDelete object based on the object type.

Parameters:
objectType - the type of object to be deleted. The value must be defined in EppObject, as one of the followings:
  • EppObject.CONTACT
  • EppObject.DOMAIN
  • EppObject.HOST
  • EppObject.SVCSUB
  • EppObject.XRI_AUTHORITY
  • EppObject.XRI_INUMBER
  • EppObject.XRI_INAME
  • EppObject.XRI_ISERVICE
objectId - the id associated with object to be deleted. The value is id for an EPP Contact object, domain name for an EPP Domain object, or host name for an EPP Host object, or service subscription id for an EPP Svcsub object
xid - client transaction id associated with the operation
Returns:
an EppCommandDelete object, which could be one of the subclass of EppCommandDelete; or null if the object type is invalid.

info

public static EppCommandInfo info(int objectType,
                                  java.lang.String objectId,
                                  java.lang.String xid)
Creates an EppCommandInfo object based on the object type.

Parameters:
objectType - the type of object to be queried. The value must be defined in EppObject, as one of the followings:
  • EppObject.CONTACT
  • EppObject.DOMAIN
  • EppObject.HOST
  • EppObject.SVCSUB
  • EppObject.XRI_AUTHORITY
  • EppObject.XRI_INUMBER
  • EppObject.XRI_INAME
  • EppObject.XRI_ISERVICE
objectId - the id associated with object to be queried. The value is id for an EPP Contact object, domain name for an EPP Domain object, or host name for an EPP Host object, or service subscription id for an EPP Svcsub object
xid - client transaction id associated with the operation
Returns:
an EppCommandInfo object, which could be one of the subclass of EppCommandInfo; or null if the object type is invalid.

update

public static EppCommandUpdate update(int objectType,
                                      java.lang.String objectId,
                                      java.lang.String xid)
Creates an EppCommandUpdate object based on the object type.

Parameters:
objectType - the type of object to be updated. The value must be defined in EppObject, as one of the followings:
  • EppObject.CONTACT
  • EppObject.DOMAIN
  • EppObject.HOST
  • EppObject.SVCSUB
  • EppObject.XRI_AUTHORITY
  • EppObject.XRI_INUMBER
  • EppObject.XRI_INAME
  • EppObject.XRI_ISERVICE
objectId - the id associated with object to be updated. The value is id for an EPP Contact object, domain name for an EPP Domain object, or host name for an EPP Host object, or service subscription id for an EPP Svcsub object
xid - client transaction id associated with the operation
Returns:
an EppCommandUpdate object, which could be one of the subclass of EppCommandUpdate; or null if the object type is invalid.

transfer

public static EppCommandTransfer transfer(int objectType,
                                          java.lang.String objectId,
                                          java.lang.String xid)
Creates an EppCommandTransfer object based on the object type.

Parameters:
objectType - the type of object to be transferred. The value must be defined in EppObject, as one of the followings:
  • EppObject.CONTACT
  • EppObject.DOMAIN
  • EppObject.SVCSUB
  • EppObject.XRI_AUTHORITY
  • EppObject.XRI_INAME
objectId - the id associated with object to be transferred. The value is id for an EPP Contact object, domain name for an EPP Domain object, or service subscription id for an EPP Svcsub object
xid - client transaction id associated with the operation
Returns:
an EppCommandTransfer object, which could be one of the subclass of EppCommandTransfer; or null if the object type is invalid.

renew

public static EppCommandRenew renew(int objectType,
                                    java.lang.String objectId,
                                    java.lang.String xid)
Creates an EppCommandRenew object based on the object type.

Parameters:
objectType - the type of object to be renewed. The value must be defined in EppObject, as one of the followings:
  • EppObject.DOMAIN
  • EppObject.SVCSUB
  • EppObject.XRI_INUMBER
  • EppObject.XRI_INAME
  • EppObject.XRI_ISERVICE
objectId - the id associated with object to be renewed. The value is the domain name for an EPP Domain object, or service subscription id for an EPP Svcsub object
xid - client transaction id associated with the operation
Returns:
an EppCommandRenew object, which could be one of the subclass of EppCommandRenew; or null if the object type is invalid.

Note: As the current expiration date of the object is default to the current date, and the default value of the new registration period is specified by the registry, the the caller to this method may have to use setCurrentExpiratin and setPeriod to change these default values.


EPP 0.4.9

Copyright © 2001-2006 NeuStar, Inc. All Rights Reserved.