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 newEPPLoginCmd
with default attribute values.EPPLoginCmd(java.lang.String aTransId, java.lang.String aClientId, java.lang.String aPassword)
Allocates a newEPPLoginCmd
with the required attributes.EPPLoginCmd(java.lang.String aTransId, java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword)
Allocates a newEPPLoginCmd
with the required attributes and the optional new password attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CloneEPPLoginCmd
.protected void
doGenDecode(org.w3c.dom.Element aElement)
decodeEPPLoginCmd
from a DOM element tree.protected org.w3c.dom.Element
doGenEncode(org.w3c.dom.Document aDocument)
encodeEPPLoginCmd
into a DOM element tree.boolean
equals(java.lang.Object aObject)
implements a deepEPPLoginCmd
compare.java.lang.String
getClientId()
Gets the client login identifier.java.util.Vector
getExtensionServices()
Gets the list of supported/desired extension services.java.lang.String
getLang()
Gets the desired EPP language.java.lang.String
getNamespace()
Gets the EPP command Namespace associated withEPPLoginCmd
.java.lang.String
getNewPassword()
Gets the new client password.java.lang.String
getPassword()
Gets the client password.java.util.Vector
getServices()
Gets the login services.java.lang.String
getType()
Gets the EPP command type associated withEPPLoginCmd
.java.lang.String
getVersion()
Gets the desired EPP version.boolean
hasExtensionService(java.lang.String aNamespaceURI)
Does the login extension service include a specified extension service based on the Namespace URI?boolean
hasNewPassword()
Is a new password defined?boolean
hasService(java.lang.String aNamespaceURI)
Does the login service include a specified service based on the Namespace URI?boolean
isValidServices(EPPGreeting aGreeting)
Is theEPPLoginCmd
services settings valid as compared with the services specified in theEPPGreeting
? The services attributes defined inEPPLoginCmd
must be a subset of the available services specified in theEPPGreeting
.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.void
setClientId(java.lang.String aClientId)
Sets the client login identifier.void
setExtensionServices(java.util.Vector someExtServices)
Sets the list of supported/desired extension services.void
setLang(java.lang.String aLang)
Sets the desired EPP language.void
setNewPassword(java.lang.String aNewPassword)
Sets the new client password.void
setPassword(java.lang.String aPassword)
Sets the client password.void
setServices(java.util.Vector someServices)
Sets the login services.void
setVersion(java.lang.String aVersion)
Sets the desired EPP version.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation 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 newEPPLoginCmd
with 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
EPPFactory
configuration.
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 newEPPLoginCmd
with the required attributes. The other attributes are initialized as follows:
- new password is set to
null
- services is initialized based on the
EPPFactory
configuration.
- 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 newEPPLoginCmd
with the required attributes and the optional new password attribute. The services is initialized based on theEPPFactory
configuration.- 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:
getNamespace
in interfaceEPPCodecComponent
- Specified by:
getNamespace
in interfaceEPPMessage
- Specified by:
getNamespace
in classEPPCommand
- Returns:
- EPPCodec.NS
-
getType
public java.lang.String getType()
Gets the EPP command type associated withEPPLoginCmd
.- Specified by:
getType
in classEPPCommand
- Returns:
EPPCommand.TYPE_LOGIN
-
getClientId
public java.lang.String getClientId()
Gets the client login identifier.- Returns:
- Client login identifier if defined;
null
otherwise.
-
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;
null
otherwise.
-
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;
null
otherwise.
-
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:
true
if the new password is defined;false
otherwise.
-
getVersion
public java.lang.String getVersion()
Gets the desired EPP version. The default version is set toEPPCodec.VERSION
.- Returns:
- EPP version identifier if defined;
null
otherwise.
-
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;
null
otherwise.
-
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:
Vector
ofEPPService
instances
-
setServices
public void setServices(java.util.Vector someServices)
Sets the login services. The default services are retrieved fromEPPFactory.getServices
.- Parameters:
someServices
-Vector
of desiredEPPService
instances
-
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:
true
if the login services include the service Namespace URI;false
otherwise.
-
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:
true
if the login extension services include the extension service Namespace URI;false
otherwise.
-
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
EPPService
instances.
-
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 ofEPPService
instances.
-
doGenEncode
protected org.w3c.dom.Element doGenEncode(org.w3c.dom.Document aDocument) throws EPPEncodeException
encodeEPPLoginCmd
into 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, whereEPPCommand
provides the publicencode
and calls the abstractdoGenEncode
.- Specified by:
doGenEncode
in 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 EPPDecodeException
decodeEPPLoginCmd
from a DOM element tree. The "login" element needs to be the value of theaElement
argument. This method is part of the Template Design Pattern, whereEPPCommand
provides the publicdecode
and calls the abstractdoGenDecode
.- Specified by:
doGenDecode
in 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 deepEPPLoginCmd
compare.- Overrides:
equals
in classEPPCommand
- Parameters:
aObject
-EPPLoginCmd
instance to compare with- Returns:
true
if equal;false
otherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPLoginCmd
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in 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 XMLString
representation of the concreteEPPCodecComponent
.- Overrides:
toString
in classEPPCommand
- Returns:
- Indented XML
String
if successful;ERROR
otherwise.
-
isValidServices
public boolean isValidServices(EPPGreeting aGreeting)
Is theEPPLoginCmd
services settings valid as compared with the services specified in theEPPGreeting
? The services attributes defined inEPPLoginCmd
must be a subset of the available services specified in theEPPGreeting
.- Parameters:
aGreeting
- Greeting to compare services with- Returns:
true
if the service settings are valid;false
otherwise.
-
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.
-
-