Package com.verisign.epp.codec.gen
Class EPPLoginCmd
- java.lang.Object
-
- com.verisign.epp.codec.gen.EPPCommand
-
- com.verisign.epp.codec.gen.EPPLoginCmd
-
- All Implemented Interfaces:
EPPCodecComponent,EPPMessage,java.io.Serializable,java.lang.Cloneable
public class EPPLoginCmd extends EPPCommand
The EPP <login> command is used to establish a session with an EPP server in response to a greeting issued by the server. A <login> command MUST be sent to a server before any other EPP command to establish an ongoing session. A server operator MAY limit the number of failed login attempts N, 1 <= N <= infinity, after which a login failure results in the connection to the server (if a connection exists) being closed.
A client identifier and initial password MUST be created on the server before a client can successfully complete a <login> command. The client identifier and initial password MUST be delivered to the client using an out-of-band method that protects the identifier and password from inadvertent disclosure.
In addition to the standard EPP command elements, the <login> command contains the following child elements:
- A <clID> element that contains the client identifier assigned to the client by the server.
- A <pw> element that contains the client's plain text password. The value of this element is case sensitive.
- An OPTIONAL <newPW> element that contains a new plain text password to be assigned to the client for use with subsequent <login> commands. The value of this element is case sensitive.
- An <options> element that contains the following child elements:
- A <version> element that contains the protocol version to be used for the command or ongoing server session.
- A <lang> element that contains the text response language to be used for the command or ongoing server session commands.
The values of the <version> and <lang> elements MUST exactly match one of the values presented in the EPP greeting.
- A <svcs> element that contains one or more <objURI> elements that contain namespace URIs representing the objects to be managed during the session. The <svcs> element MAY contain an OPTIONAL <svcExtension> element that contains one or more <extURI> elements that identify object extensions to be used during the session.
The PLAIN SASL mechanism presented in [RFC2595] describes a format for providing a user identifier, an authorization identifier, and a password as part of a single plain text string. The EPP authentication mechanism is similar, though EPP does not require a session-level authorization identifier and the user identifier and password are separated into distinct XML elements. Additional identification and authorization schemes MUST be provided at other protocol layers to provide more robust security services.- See Also:
EPPFactory, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.verisign.epp.codec.gen.EPPCommand
extensions, OP_APPROVE, OP_CANCEL, OP_QUERY, OP_REJECT, OP_REQUEST, transId, TYPE_CHECK, TYPE_CREATE, TYPE_DELETE, TYPE_INFO, TYPE_LOGIN, TYPE_LOGOUT, TYPE_POLL, TYPE_RENEW, TYPE_TRANSFER, TYPE_UPDATE
-
-
Constructor Summary
Constructors Constructor Description EPPLoginCmd()Allocates a newEPPLoginCmdwith default attribute values.EPPLoginCmd(java.lang.String aTransId, java.lang.String aClientId, java.lang.String aPassword)Allocates a newEPPLoginCmdwith the required attributes.EPPLoginCmd(java.lang.String aTransId, java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword)Allocates a newEPPLoginCmdwith the required attributes and the optional new password attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()CloneEPPLoginCmd.protected voiddoGenDecode(org.w3c.dom.Element aElement)decodeEPPLoginCmdfrom a DOM element tree.protected org.w3c.dom.ElementdoGenEncode(org.w3c.dom.Document aDocument)encodeEPPLoginCmdinto a DOM element tree.booleanequals(java.lang.Object aObject)implements a deepEPPLoginCmdcompare.java.lang.StringgetClientId()Gets the client login identifier.java.util.VectorgetExtensionServices()Gets the list of supported/desired extension services.java.lang.StringgetLang()Gets the desired EPP language.java.lang.StringgetNamespace()Gets the EPP command Namespace associated withEPPLoginCmd.java.lang.StringgetNewPassword()Gets the new client password.java.lang.StringgetPassword()Gets the client password.java.util.VectorgetServices()Gets the login services.java.lang.StringgetType()Gets the EPP command type associated withEPPLoginCmd.java.lang.StringgetVersion()Gets the desired EPP version.booleanhasExtensionService(java.lang.String aNamespaceURI)Does the login extension service include a specified extension service based on the Namespace URI?booleanhasNewPassword()Is a new password defined?booleanhasService(java.lang.String aNamespaceURI)Does the login service include a specified service based on the Namespace URI?booleanisValidServices(EPPGreeting aGreeting)Is theEPPLoginCmdservices settings valid as compared with the services specified in theEPPGreeting? The services attributes defined inEPPLoginCmdmust be a subset of the available services specified in theEPPGreeting.voidmergeServicesAndExtensionServices(EPPGreeting aGreeting)Merge the services defined automatically in the EPP SDK configuration with services and extension services defined in the EPP Greeting, so that the login services are sent to only be a subset of the services defined in the EPP Greeting.voidsetClientId(java.lang.String aClientId)Sets the client login identifier.voidsetExtensionServices(java.util.Vector someExtServices)Sets the list of supported/desired extension services.voidsetLang(java.lang.String aLang)Sets the desired EPP language.voidsetNewPassword(java.lang.String aNewPassword)Sets the new client password.voidsetPassword(java.lang.String aPassword)Sets the client password.voidsetServices(java.util.Vector someServices)Sets the login services.voidsetVersion(java.lang.String aVersion)Sets the desired EPP version.java.lang.StringtoString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.-
Methods inherited from class com.verisign.epp.codec.gen.EPPCommand
addExtension, decode, encode, findDuplicateExtNamespaces, findExtNamespaces, findExtNamespaceSuffixes, findUnsupportedExtNamespaces, findUnsupportedExtNamespaceSuffixes, getExtension, getExtension, getExtensions, getOp, getTransId, hasExtension, hasExtensions, hasTransId, setExtension, setExtensions, setTransId
-
-
-
-
Constructor Detail
-
EPPLoginCmd
public EPPLoginCmd()
Allocates a newEPPLoginCmdwith default attribute values. the defaults include the following:
- transaction id is set to
null. - client id is set to
null - password is set to
null - new password is set to
null - services is initialized based on the
EPPFactoryconfiguration.
The client id, password, and transaction id must be set before invokingencode. - transaction id is set to
-
EPPLoginCmd
public EPPLoginCmd(java.lang.String aTransId, java.lang.String aClientId, java.lang.String aPassword)Allocates a newEPPLoginCmdwith the required attributes. The other attributes are initialized as follows:
- new password is set to
null - services is initialized based on the
EPPFactoryconfiguration.
- Parameters:
aTransId- transaction id of the command.aClientId- Client login idaPassword- Client password
- new password is set to
-
EPPLoginCmd
public EPPLoginCmd(java.lang.String aTransId, java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword)Allocates a newEPPLoginCmdwith the required attributes and the optional new password attribute. The services is initialized based on theEPPFactoryconfiguration.- Parameters:
aTransId- transaction id of the command.aClientId- Client login idaPassword- Client passwordaNewPassword- New client password
-
-
Method Detail
-
getNamespace
public java.lang.String getNamespace()
Gets the EPP command Namespace associated withEPPLoginCmd.- Specified by:
getNamespacein interfaceEPPCodecComponent- Specified by:
getNamespacein interfaceEPPMessage- Specified by:
getNamespacein classEPPCommand- Returns:
- EPPCodec.NS
-
getType
public java.lang.String getType()
Gets the EPP command type associated withEPPLoginCmd.- Specified by:
getTypein classEPPCommand- Returns:
EPPCommand.TYPE_LOGIN
-
getClientId
public java.lang.String getClientId()
Gets the client login identifier.- Returns:
- Client login identifier if defined;
nullotherwise.
-
setClientId
public void setClientId(java.lang.String aClientId)
Sets the client login identifier.- Parameters:
aClientId- Client login identifier.
-
getPassword
public java.lang.String getPassword()
Gets the client password.- Returns:
- Client password if defined;
nullotherwise.
-
setPassword
public void setPassword(java.lang.String aPassword)
Sets the client password.- Parameters:
aPassword- Client password.
-
getNewPassword
public java.lang.String getNewPassword()
Gets the new client password.- Returns:
- New client password if defined;
nullotherwise.
-
setNewPassword
public void setNewPassword(java.lang.String aNewPassword)
Sets the new client password.- Parameters:
aNewPassword- New client password.
-
hasNewPassword
public boolean hasNewPassword()
Is a new password defined?- Returns:
trueif the new password is defined;falseotherwise.
-
getVersion
public java.lang.String getVersion()
Gets the desired EPP version. The default version is set toEPPCodec.VERSION.- Returns:
- EPP version identifier if defined;
nullotherwise.
-
setVersion
public void setVersion(java.lang.String aVersion)
Sets the desired EPP version. The default version is set toEPPCodec.VERSION.- Parameters:
aVersion- EPP version identifier
-
getLang
public java.lang.String getLang()
Gets the desired EPP language. The EPP language determines the language of the error description strings and should be one of the supported languages of theEPPGreeting. The default language is "en".- Returns:
- The desired EPP language if defined;
nullotherwise.
-
setLang
public void setLang(java.lang.String aLang)
Sets the desired EPP language. The EPP language determines the language of the error description strings and should be one of the supported languages of theEPPGreeting. The default language is "en".- Parameters:
aLang- The desired EPP language
-
getServices
public java.util.Vector getServices()
Gets the login services.- Returns:
VectorofEPPServiceinstances
-
setServices
public void setServices(java.util.Vector someServices)
Sets the login services. The default services are retrieved fromEPPFactory.getServices.- Parameters:
someServices-Vectorof desiredEPPServiceinstances
-
hasService
public boolean hasService(java.lang.String aNamespaceURI)
Does the login service include a specified service based on the Namespace URI?- Parameters:
aNamespaceURI- Service Namespace URI to search for- Returns:
trueif the login services include the service Namespace URI;falseotherwise.
-
hasExtensionService
public boolean hasExtensionService(java.lang.String aNamespaceURI)
Does the login extension service include a specified extension service based on the Namespace URI?- Parameters:
aNamespaceURI- Extension service Namespace URI to search for- Returns:
trueif the login extension services include the extension service Namespace URI;falseotherwise.
-
getExtensionServices
public java.util.Vector getExtensionServices()
Gets the list of supported/desired extension services. An EPP Client will retrieve the list of extension services supported by the EPP Server. An EPP Server will retrieve the list of extension services desired by the EPP Client.- Returns:
- Vector of
EPPServiceinstances.
-
setExtensionServices
public void setExtensionServices(java.util.Vector someExtServices)
Sets the list of supported/desired extension services. An EPP Client will set the list of extension services desired. An EPP Server will set the list of supported extension services.- Parameters:
someExtServices- Vector ofEPPServiceinstances.
-
doGenEncode
protected org.w3c.dom.Element doGenEncode(org.w3c.dom.Document aDocument) throws EPPEncodeExceptionencodeEPPLoginCmdinto a DOM element tree. The <login> element is created and the attribute nodes are appended as children. This method is part of the Template Design Pattern, whereEPPCommandprovides the publicencodeand calls the abstractdoGenEncode.- Specified by:
doGenEncodein classEPPCommand- Parameters:
aDocument- DOM Document to create elements from- Returns:
- <login> root element tree.
- Throws:
EPPEncodeException- Error encoding the DOM element tree.
-
doGenDecode
protected void doGenDecode(org.w3c.dom.Element aElement) throws EPPDecodeExceptiondecodeEPPLoginCmdfrom a DOM element tree. The "login" element needs to be the value of theaElementargument. This method is part of the Template Design Pattern, whereEPPCommandprovides the publicdecodeand calls the abstractdoGenDecode.- Specified by:
doGenDecodein classEPPCommand- Parameters:
aElement- <login> root element tree.- Throws:
EPPDecodeException- Error decoding the DOM element tree.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPLoginCmdcompare.- Overrides:
equalsin classEPPCommand- Parameters:
aObject-EPPLoginCmdinstance to compare with- Returns:
trueif equal;falseotherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionCloneEPPLoginCmd.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classEPPCommand- Returns:
- clone of
EPPLoginCmd - Throws:
java.lang.CloneNotSupportedException- standard Object.clone exception
-
toString
public java.lang.String toString()
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.- Overrides:
toStringin classEPPCommand- Returns:
- Indented XML
Stringif successful;ERRORotherwise.
-
isValidServices
public boolean isValidServices(EPPGreeting aGreeting)
Is theEPPLoginCmdservices settings valid as compared with the services specified in theEPPGreeting? The services attributes defined inEPPLoginCmdmust be a subset of the available services specified in theEPPGreeting.- Parameters:
aGreeting- Greeting to compare services with- Returns:
trueif the service settings are valid;falseotherwise.
-
mergeServicesAndExtensionServices
public void mergeServicesAndExtensionServices(EPPGreeting aGreeting)
Merge the services defined automatically in the EPP SDK configuration with services and extension services defined in the EPP Greeting, so that the login services are sent to only be a subset of the services defined in the EPP Greeting.- Parameters:
aGreeting- EPP Greeting to merge the services in the EPP Login.
-
-