Package com.verisign.epp.codec.gen
Class EPPFactory
- java.lang.Object
-
- com.verisign.epp.codec.gen.EPPFactory
-
public class EPPFactory extends java.lang.ObjectEPPFactoryis a Singleton class that will createEPPCommandorEPPResponseinstances for any of the supported EPP Command Mappings (e.g. domain, host, contact). When a create method is called,EPPFactorywill use the XML namespace of the element to call the appropriate concreteEPPMapFactory, which will create the correct concreteEPPCommandorEPPResponse.createCommand(String, String)is provided to instantiateEPPCommandobjects associated with the general EPP Specification, which includesEPPLoginCmdandEPPLogout.
EPPFactoryis initialized with the set of available EPP Command Mappings. A method is provided to retrieve the listEPPServicedescriptions of available EPP Command Mappings. The list of available EPP Command Mappings can be used inEPPGreetingand inEPPLoginCmd.- See Also:
EPPMapFactory,EPPGreeting,EPPLoginCmd
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEPPFactory()Protected constructor following the Singleton Design Pattern.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtFactory(java.lang.String aExtFactory)Add a concreteEPPExtFactoryif it does not already exist inEPPFactory.voidaddMapFactory(java.lang.String aMapFactory)Add a concreteEPPMapFactoryif it does not already exist inEPPFactory.EPPCommandcreateCommand(java.lang.String aCommandType, java.lang.String aOp)creates a concreteEPPCommandgiven a command type and a command operation.EPPCommandcreateCommand(org.w3c.dom.Element aMapElement)creates a concreteEPPCommandgiven a DOM Command Mapping Element.EPPCodecComponentcreateExtension(org.w3c.dom.Element aExtensionElm)creates a concreteEPPCommandgiven a DOM Command Mapping Element.EPPProtocolExtensioncreateProtocolExtension(org.w3c.dom.Element aExtensionElm)creates a concreteEPPProtocolExtensiongiven a DOM protocol extension Element.EPPResponsecreateResponse(org.w3c.dom.Element aMapElement)creates a concreteEPPResponsegiven a DOM Command Mapping Element.java.util.Vector<EPPService>getExtensions()Gets a Vector of EPPService objects that represent the supported EPP Extensions.static EPPFactorygetInstance()Singleton Design Pattern method to retrieve the singleEPPFactoryinstance.java.util.Vector<EPPService>getServices()Gets aVectorofEPPServiceobjects that represent the supported EPP Command Mappings.java.util.SetgetXmlSchemas()Gets the list of XML schemas that need to be pre-loaded into the XML Parser.booleanhasExtension(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".booleanhasService(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".voidinit(java.util.Vector<java.lang.String> aMapFactories)Initialize the Singleton EPP instance with the list of available concrete EPPMapFactory's.voidinit(java.util.Vector<java.lang.String> aMapFactories, java.util.Vector<java.lang.String> aExtFactories)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 singleEPPFactoryinstance.- Returns:
- Single
EPPFactoryinstance.
-
createCommand
public EPPCommand createCommand(java.lang.String aCommandType, java.lang.String aOp) throws EPPCodecException
creates a concreteEPPCommandgiven 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_LOGINandEPPCommand.EPP_LOGOUT.- Parameters:
aCommandType-Command.TYPE_constant associated with theEPPCommand.aOp-Command.OP_constant associated withEPPCommand. This should benullif 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 concreteEPPCommandgiven a DOM Command Mapping Element. The DOM Command Mapping Element must have an XML namespace URI, which is used to determine the concreteEPPMapFactoryto use to create theEPPCommand.- Parameters:
aMapElement- The DOM Element associated with the command mapping.- Returns:
- EPPCommand Concrete
EPPCommandassociated withaMapElementparameter. - Throws:
EPPCodecException- Unable to create concreteEPPCommand.
-
createResponse
public EPPResponse createResponse(org.w3c.dom.Element aMapElement) throws EPPCodecException
creates a concreteEPPResponsegiven a DOM Command Mapping Element. The DOM Command Mapping Element must have an XML Namespace URI, which is used to determine the concreteEPPMapFactoryto use to create theEPPResponse.- Parameters:
aMapElement- The DOM Element associated with the command mapping.- Returns:
- EPPCommand Concrete
EPPResponseassociated withaMapElementparameter. - Throws:
EPPCodecException- Unable to create concreteEPPCommand.
-
createExtension
public EPPCodecComponent createExtension(org.w3c.dom.Element aExtensionElm) throws EPPCodecException
creates a concreteEPPCommandgiven a DOM Command Mapping Element. The DOM Command Mapping Element must have an XML namespace URI, which is used to determine the concreteEPPMapFactoryto use to create theEPPCommand.- Parameters:
aExtensionElm- The DOM Element associated with the command mapping.- Returns:
- EPPCommand Concrete
EPPCommandassociated withaMapElementparameter. - Throws:
EPPCodecException- Unable to create concreteEPPCommand.
-
createProtocolExtension
public EPPProtocolExtension createProtocolExtension(org.w3c.dom.Element aExtensionElm) throws EPPCodecException
creates a concreteEPPProtocolExtensiongiven a DOM protocol extension Element. The extension element must have an XML namespace URI, which is used to determine the concreteEPPExtFactoryto use to create theEPPProtocolExtension.- Parameters:
aExtensionElm- The Protocol extension Element .- Returns:
- EPPProtocolExtension.
- Throws:
EPPCodecException- Unable to create concreteEPPCommand.
-
getServices
public java.util.Vector<EPPService> getServices()
Gets aVectorofEPPServiceobjects that represent the supported EPP Command Mappings. EPP can support a dynamic set of command mappings, and each command mapping will have anEPPServiceobject that contains information about the command mapping.- Returns:
VectorofEPPServiceobjects, each representing an EPP Command Mapping.
-
getExtensions
public java.util.Vector<EPPService> 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:
VectorofEPPServiceobjects, 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:
trueif EPP supports the service;falseotherwise.
-
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:
trueif EPP supports the extension;falseotherwise.
-
init
public void init(java.util.Vector<java.lang.String> aMapFactories) throws EPPCodecExceptionInitialize 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 inEPPFactorywith the following calls:
Vector theFactories = new Vector(); theFactories.addElement("com.verisign.epp.codec.domain.EPPDomainMapFactory"); EPPFactory.getInstance().init(theFactories);- Parameters:
aMapFactories- a Vector of concreteEPPMapFactoryfully qualified class names.- Throws:
EPPCodecException- Error initializingEPPFactory
-
init
public void init(java.util.Vector<java.lang.String> aMapFactories, java.util.Vector<java.lang.String> aExtFactories) throws EPPCodecExceptionInitialize 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 inEPPFactorywith 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:
aMapFactories- aVectorof concreteEPPMapFactoryfully qualified class names.aExtFactories- aVectorof concreteEPPExtFactoryfully qualified class names.- Throws:
EPPCodecException- Error initializingEPPFactory
-
addMapFactory
public void addMapFactory(java.lang.String aMapFactory) throws EPPCodecExceptionAdd a concreteEPPMapFactoryif it does not already exist inEPPFactory.- Parameters:
aMapFactory- a concreteEPPMapFactoryfully qualified class names.- Throws:
EPPCodecException- Error addEPPMapFactorytoEPPFactory.
-
addExtFactory
public void addExtFactory(java.lang.String aExtFactory) throws EPPCodecExceptionAdd a concreteEPPExtFactoryif it does not already exist inEPPFactory.- Parameters:
aExtFactory- a concreteEPPExtFactoryfully qualified class names.- Throws:
EPPCodecException- Error addEPPExtFactorytoEPPFactory.
-
getXmlSchemas
public java.util.Set getXmlSchemas()
Gets the list of XML schemas that need to be pre-loaded into the XML Parser. EachEPPMapFactoryandEPPExtFactoryinclude 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:
SetofStringXML 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.xsdepp-1.0.xsd
-
-