Package com.verisign.epp.codec.gen
Class EPPFactory
- java.lang.Object
-
- com.verisign.epp.codec.gen.EPPFactory
-
public class EPPFactory extends java.lang.Object
EPPFactory
is a Singleton class that will createEPPCommand
orEPPResponse
instances for any of the supported EPP Command Mappings (e.g. domain, host, contact). When a create method is called,EPPFactory
will use the XML namespace of the element to call the appropriate concreteEPPMapFactory
, which will create the correct concreteEPPCommand
orEPPResponse
.createCommand(String, String)
is provided to instantiateEPPCommand
objects associated with the general EPP Specification, which includesEPPLoginCmd
andEPPLogout
.
EPPFactory
is initialized with the set of available EPP Command Mappings. A method is provided to retrieve the listEPPService
descriptions of available EPP Command Mappings. The list of available EPP Command Mappings can be used inEPPGreeting
and inEPPLoginCmd
.
- See Also:
EPPMapFactory
,EPPGreeting
,EPPLoginCmd
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EPPFactory()
Protected constructor following the Singleton Design Pattern.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtFactory(java.lang.String aExtFactory)
Add a concreteEPPExtFactory
if it does not already exist inEPPFactory
.void
addMapFactory(java.lang.String aMapFactory)
Add a concreteEPPMapFactory
if it does not already exist inEPPFactory
.EPPCommand
createCommand(java.lang.String aCommandType, java.lang.String aOp)
creates a concreteEPPCommand
given a command type and a command operation.EPPCommand
createCommand(org.w3c.dom.Element aMapElement)
creates a concreteEPPCommand
given a DOM Command Mapping Element.EPPCodecComponent
createExtension(org.w3c.dom.Element aExtensionElm)
creates a concreteEPPCommand
given a DOM Command Mapping Element.EPPProtocolExtension
createProtocolExtension(org.w3c.dom.Element aExtensionElm)
creates a concreteEPPProtocolExtension
given a DOM protocol extension Element.EPPResponse
createResponse(org.w3c.dom.Element aMapElement)
creates a concreteEPPResponse
given a DOM Command Mapping Element.java.util.Vector
getExtensions()
Gets a Vector of EPPService objects that represent the supported EPP Extensions.static EPPFactory
getInstance()
Singleton Design Pattern method to retrieve the singleEPPFactory
instance.java.util.Vector
getServices()
Gets a Vector of EPPService objects that represent the supported EPP Command Mappings.java.util.Set
getXmlSchemas()
Gets the list of XML schemas that need to be pre-loaded into the XML Parser.boolean
hasExtension(java.lang.String aNamespace)
Does the EPP support an extension specified by the namespace URI? For example, the service namespace URI for the Domain Command Mapping is "urn:verisign:xmlns:pricing".boolean
hasService(java.lang.String aNamespace)
Does the EPP support a service specified by the service namespace URI? For example, the service namespace URI for the Domain Command Mapping is "urn:iana:xmlns:domain".void
init(java.util.Vector someFactories)
Initialize the Singleton EPP instance with the list of available concrete EPPMapFactory's.void
init(java.util.Vector someFactories, java.util.Vector someExtFactories)
Initialize the Singleton EPP instance with the list of available concreteEPPMapFactory
's and concreteEPPExtFactory
's.
-
-
-
Method Detail
-
getInstance
public static EPPFactory getInstance()
Singleton Design Pattern method to retrieve the singleEPPFactory
instance.- Returns:
- Single
EPPFactory
instance.
-
createCommand
public EPPCommand createCommand(java.lang.String aCommandType, java.lang.String aOp) throws EPPCodecException
creates a concreteEPPCommand
given a command type and a command operation. This method should only be used for commands that don't have an EPP Namespace extension. The only commands currently supported includeEPPCommand.TYPE_LOGIN
andEPPCommand.EPP_LOGOUT
.- Parameters:
aCommandType
-Command.TYPE_
constant associated with theEPPCommand
.aOp
-Command.OP_
constant associated withEPPCommand
. This should benull
if there is no operation value associated with the command.- Returns:
- Concrete command associated with the command tag and optional operation tag
- Throws:
EPPCodecException
- Unable to create command map.
-
createCommand
public EPPCommand createCommand(org.w3c.dom.Element aMapElement) throws EPPCodecException
creates a concreteEPPCommand
given a DOM Command Mapping Element. The DOM Command Mapping Element must have an XML namespace URI, which is used to determine the concreteEPPMapFactory
to use to create theEPPCommand
.- Parameters:
aMapElement
- The DOM Element associated with the command mapping.- Returns:
- EPPCommand Concrete
EPPCommand
associated withaMapElement
parameter. - Throws:
EPPCodecException
- Unable to create concreteEPPCommand
.
-
createResponse
public EPPResponse createResponse(org.w3c.dom.Element aMapElement) throws EPPCodecException
creates a concreteEPPResponse
given a DOM Command Mapping Element. The DOM Command Mapping Element must have an XML Namespace URI, which is used to determine the concreteEPPMapFactory
to use to create theEPPResponse
.- Parameters:
aMapElement
- The DOM Element associated with the command mapping.- Returns:
- EPPCommand Concrete
EPPResponse
associated withaMapElement
parameter. - Throws:
EPPCodecException
- Unable to create concreteEPPCommand
.
-
createExtension
public EPPCodecComponent createExtension(org.w3c.dom.Element aExtensionElm) throws EPPCodecException
creates a concreteEPPCommand
given a DOM Command Mapping Element. The DOM Command Mapping Element must have an XML namespace URI, which is used to determine the concreteEPPMapFactory
to use to create theEPPCommand
.- Parameters:
aExtensionElm
- The DOM Element associated with the command mapping.- Returns:
- EPPCommand Concrete
EPPCommand
associated withaMapElement
parameter. - Throws:
EPPCodecException
- Unable to create concreteEPPCommand
.
-
createProtocolExtension
public EPPProtocolExtension createProtocolExtension(org.w3c.dom.Element aExtensionElm) throws EPPCodecException
creates a concreteEPPProtocolExtension
given a DOM protocol extension Element. The extension element must have an XML namespace URI, which is used to determine the concreteEPPExtFactory
to use to create theEPPProtocolExtension
.- Parameters:
aExtensionElm
- The Protocol extension Element .- Returns:
- EPPProtocolExtension.
- Throws:
EPPCodecException
- Unable to create concreteEPPCommand
.
-
getServices
public java.util.Vector getServices()
Gets a Vector of EPPService objects that represent the supported EPP Command Mappings. EPP can support a dynamic set of command mappings, and each command mapping will have an EPPService object that contains information about the command mapping.- Returns:
- Vector of EPPService objects, each representing an EPP Command Mapping.
-
getExtensions
public java.util.Vector getExtensions()
Gets a Vector of EPPService objects that represent the supported EPP Extensions. EPP can support a dynamic set of command and response extensions. anEPPService
. object that contains information about the extension.- Returns:
Vector
ofEPPService
objects, each representing an EPP Extension.
-
hasService
public boolean hasService(java.lang.String aNamespace)
Does the EPP support a service specified by the service namespace URI? For example, the service namespace URI for the Domain Command Mapping is "urn:iana:xmlns:domain".- Parameters:
aNamespace
- XML Namespace URI associated with service. For example "urn:iana:xmlns:domain" for the Domain Command Mapping.- Returns:
true
if EPP supports the service;false
otherwise.
-
hasExtension
public boolean hasExtension(java.lang.String aNamespace)
Does the EPP support an extension specified by the namespace URI? For example, the service namespace URI for the Domain Command Mapping is "urn:verisign:xmlns:pricing".- Parameters:
aNamespace
- XML Namespace URI associated with extension. For example "urn:verisign:xmlns:pricing" for the Domain Command Mapping.- Returns:
true
if EPP supports the extension;false
otherwise.
-
init
public void init(java.util.Vector someFactories) throws EPPCodecException
Initialize the Singleton EPP instance with the list of available concrete EPPMapFactory's. The concrete EPPMapFactory's are specified by their fully qualified class names. For example, the EPPDomainMapFactory can be initialized inEPPFactory
with the following calls:
Vector theFactories = new Vector(); theFactories.addElement("com.verisign.epp.codec.domain.EPPDomainMapFactory"); EPPFactory.getInstance().init(theFactories);
- Parameters:
someFactories
- a Vector of concreteEPPMapFactory
fully qualified class names.- Throws:
EPPCodecException
- Error initializingEPPFactory
-
init
public void init(java.util.Vector someFactories, java.util.Vector someExtFactories) throws EPPCodecException
Initialize the Singleton EPP instance with the list of available concreteEPPMapFactory
's and concreteEPPExtFactory
's. The concreteEPPMapFactory
's andEPPExtFactory
's are specified by their fully qualified class names. For example, the EPPDomainMapFactory and EPPPricingExtFactory can be initialized inEPPFactory
with the following calls:
Vector theMapFactories = new Vector(); theMapFactories.addElement("com.verisign.epp.codec.domain.EPPDomainMapFactory"); theExtFactories = new Vector(); theExtFactories.addElement("com.verisign.epp.codec.pricing.EPPPricingExtFactory"); EPPFactory.getInstance().init(theMapFactories, theExtFactories);
- Parameters:
someFactories
- aVector
of concreteEPPMapFactory
fully qualified class names.someExtFactories
- aVector
of concreteEPPExtFactory
fully qualified class names.- Throws:
EPPCodecException
- Error initializingEPPFactory
-
addMapFactory
public void addMapFactory(java.lang.String aMapFactory) throws EPPCodecException
Add a concreteEPPMapFactory
if it does not already exist inEPPFactory
.- Parameters:
aMapFactory
- a concreteEPPMapFactory
fully qualified class names.- Throws:
EPPCodecException
- Error addEPPMapFactory
toEPPFactory
.
-
addExtFactory
public void addExtFactory(java.lang.String aExtFactory) throws EPPCodecException
Add a concreteEPPExtFactory
if it does not already exist inEPPFactory
.- Parameters:
aExtFactory
- a concreteEPPExtFactory
fully qualified class names.- Throws:
EPPCodecException
- Error addEPPExtFactory
toEPPFactory
.
-
getXmlSchemas
public java.util.Set getXmlSchemas()
Gets the list of XML schemas that need to be pre-loaded into the XML Parser. EachEPPMapFactory
andEPPExtFactory
include a list of XML schemas that need to be loaded into the XML Parser, sogetXmlSchemas()
will aggregate them into a singleList
. Each XML schemas should not include the path, since the schema will be loaded as a resource from schemas folder of the classpath.- Returns:
Set
ofString
XML Schema names that should be pre-loaded in the XML Parser. For example, at a minimum, the following two XML schemas will be returned:
eppcom-1.0.xsd
epp-1.0.xsd
-
-