Package com.verisign.epp.codec.gen
Class EPPCredentials
- java.lang.Object
-
- com.verisign.epp.codec.gen.EPPCredentials
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
public class EPPCredentials extends java.lang.Object implements EPPCodecComponent
Represents the optional <creds> element in an EPP Command. A "cred" element SHALL contain the following child elements:- A "clID" element that contains the client identifier assigned to the
client by the server. The value of this element is case insensitive. Use
getClientId
andsetClientId
to get and set the element. - A "pw" element that contains the client's plain text password. Use
getPassword
andsetPassword
to get and set the element. - 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. Use
getNewPassword
andsetNewPassword
to get and set the element. - An "options" element that contains the "version" and "lang" elements. Use
getVersion
andsetVersion
to get and set the version. UsegetLang
andsetLang
to get and set the language.
- See Also:
EPPCommand
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_PASSWORD_LEN
Maximum length of a password.static int
MIN_PASSWORD_LEN
Minimum length of a password.
-
Constructor Summary
Constructors Constructor Description EPPCredentials()
Allocates a newEPPCredentials
with the following default attribute values:
client id - Default ofnull
.EPPCredentials(java.lang.String aClientId, java.lang.String aPassword)
Allocates a newEPPCredentials
with the required attributes.EPPCredentials(java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword)
Allocates a newEPPCredentials
with client id, password, and new password.EPPCredentials(java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword, java.lang.String aVersion, java.lang.String aLang)
Allocates a newEPPCredentials
with all attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CloneEPPCredentials
.void
decode(org.w3c.dom.Element aElement)
decodeEPPCredentials
from a DOM element tree.org.w3c.dom.Element
encode(org.w3c.dom.Document aDocument)
encodeEPPCredentials
into a DOM element tree.boolean
equals(java.lang.Object aObject)
implements a deepEPPCredentials
compare.java.lang.String
getClientId()
Gets the client login identifier.java.lang.String
getLang()
Gets the desired EPP language.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getNewPassword()
Gets the new client password.java.lang.String
getPassword()
Gets the client password.java.lang.String
getVersion()
Gets the desired EPP version.boolean
hasNewPassword()
Is a new password defined?void
setClientId(java.lang.String aClientId)
Sets the client login identifier.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
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
.
-
-
-
Field Detail
-
MIN_PASSWORD_LEN
public static final int MIN_PASSWORD_LEN
Minimum length of a password.- See Also:
- Constant Field Values
-
MAX_PASSWORD_LEN
public static final int MAX_PASSWORD_LEN
Maximum length of a password.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPCredentials
public EPPCredentials()
Allocates a newEPPCredentials
with the following default attribute values:
- client id - Default of
null
. Set withsetClientId
- password - Default of
null
. Set withsetPassword
- new password - Default of
null
. Set withsetNewPassword
- version - Default of
EPPCodec.VERSION
. Set withsetVersion
- language - Default of "en". Set with
setLang
- client id - Default of
-
EPPCredentials
public EPPCredentials(java.lang.String aClientId, java.lang.String aPassword)
Allocates a newEPPCredentials
with the required attributes. The other attributes are initialized as follows:
- new password - Default of
null
. Set withsetNewPassword
- version - Default of
EPPCodec.VERSION
. Set withsetVersion
- language - Default of "en". Set with
setLang
- Parameters:
aClientId
- Client login idaPassword
- Client password
- new password - Default of
-
EPPCredentials
public EPPCredentials(java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword)
Allocates a newEPPCredentials
with client id, password, and new password. The other attributes are initialized as follows:
- version - Default of
EPPCodec.VERSION
. Set withsetVersion
- language - Default of "en". Set with
setLang
- Parameters:
aClientId
- Client login idaPassword
- Client passwordaNewPassword
- Client new password
- version - Default of
-
EPPCredentials
public EPPCredentials(java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword, java.lang.String aVersion, java.lang.String aLang)
Allocates a newEPPCredentials
with all attributes.- Parameters:
aClientId
- Client login idaPassword
- Client passwordaNewPassword
- Client new passwordaVersion
- EPP protocol version desired by ClientaLang
- Desired language for result messages
-
-
Method Detail
-
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
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
encodeEPPCredentials
into a DOM element tree.- Specified by:
encode
in interfaceEPPCodecComponent
- Parameters:
aDocument
- DOM document used as a factory of DOM objects.- Returns:
- Encoded DOM element.
- Throws:
EPPEncodeException
- Error encoding the DOM element tree.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
decodeEPPCredentials
from a DOM element tree. TheaElement
argument needs to be the "trans-id" element, or an element that conforms to the XML structure of "trans-id".- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- The "trans-id" XML element.- Throws:
EPPDecodeException
- Error decoding the DOM element tree.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPCredentials
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPCredentials
instance to compare with
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPCredentials
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- Deep copy clone of
EPPCredentials
- 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 classjava.lang.Object
- Returns:
- Indented XML
String
if successful;ERROR
otherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.- Specified by:
getNamespace
in interfaceEPPCodecComponent
- Returns:
- XML namespace for the
EPPCodecComponent
.
-
-