de.knipp.rritoolkit
Class DomainData

java.lang.Object
  extended by de.knipp.rritoolkit.DomainData
All Implemented Interfaces:
java.io.Serializable

public class DomainData
extends java.lang.Object
implements java.io.Serializable

class that holds domain data, both for requests and responses

Version:
$Revision: 14987 $
Author:
Klaus Malorny
See Also:
Serialized Form

Nested Class Summary
static class DomainData.DomainState
          enumeration for the different states of the domain
static class DomainData.Ref
          class that represents a reference to a contact.
static class DomainData.Role
          enumeration for the different contact roles within the domain
 
Field Summary
private  java.util.Date authInfo1ExpireDate
          the date AuthInfo 1 expires (null if not set or unknown)
private  java.util.Date authInfo2ExpireDate
          the date AuthInfo 2 expires (null if not set or unknown)
private  boolean authInfosSet
          flag whether either AuthInfo 1 or AuthInfo 2 is set
private  java.util.Date changeDate
          the last change date
private  java.lang.String changeProvAuthInfo
          the AuthInfo text for the change provider operation
private  java.util.List<DomainData.Ref> contacts
          the list of contacts
private static boolean[] contactSectionFromDescr
          the "from description" flags for the sections, order must be synchronized with contactSectionNames
private static java.lang.String[] contactSectionNames
          the names of the contact sections
private static DomainData.Role[] contactSectionRoles
          the types of the contact sections; order must be synchronized with contactSectionNames
private  java.util.List<DnsEntry> dns
          the DNS related data
private  java.lang.String domainName
          the domain name
private  DomainData.DomainState domainState
          the domain state
private  java.lang.String encodedDomainName
          the encoded domain name
private  java.util.Date expireDate
          expire date
private  boolean inDispute
          flag whether domain is in dispute
private  java.lang.String provider
          the provider
 
Constructor Summary
DomainData()
          constructor
DomainData(DomainData other, boolean deepCopy)
          copy constructor
 
Method Summary
 void addContact(DomainData.Ref ref)
          add a single contact
 void addContact(DomainData.Role role, ContactData contact)
          add a single contact
 void addContacts(java.util.Collection<DomainData.Ref> refs)
          add all given contacts
 void addContacts(DomainData.Ref... refs)
          add all given contacts
 void addContacts(DomainData.Role role, ContactData... theContacts)
          add all given contacts
 void addDnsEntries(java.util.Collection<? extends DnsEntry> entries)
          add all entries to the DNS configuration
 void addDnsEntries(DnsEntry... entries)
          add all entries to the DNS configuration
 void addDnsEntry(DnsEntry entry)
          add an entry to the DNS configuration
 void clearContacts()
          clear all contact references
 void clearContacts(DomainData.Role role)
          clear all contact references with the given role
 void clearDnsEntries()
          clear all DNS entries
 void fromList(KVMultiList list)
          parse the given key-value list.
 void fromXml(org.w3c.dom.Element node)
          parse the given XML subtree
 java.util.Date getAuthInfo1ExpireDate()
          return the expire date for the AuthInfo 1
 java.util.Date getAuthInfo2ExpireDate()
          return the expire date for the AuthInfo 2
 java.util.Date getChangeDate()
          return the change date
 java.lang.String getChangeProvAuthInfo()
          return the AuthInfo that shall be used for the change provider operation
 java.util.List<DomainData.Ref> getContactRefs()
          returns the list of contact references
 java.util.List<ContactData> getContacts(DomainData.Role role)
          return a list of contacts with the given role
 java.util.List<DnsEntry> getDnsEntries()
          return the DNS entries
 java.lang.String getDomainName()
          return the domain name
 DomainData.DomainState getDomainState()
          return the domain state
 java.lang.String getEncodedDomainName()
          return the encoded domain name
 java.util.Date getExpireDate()
          return the expiration date
 ContactData getFirstContact(DomainData.Role role)
          return the first contact of the given role
 java.lang.String getProvider()
          return the provider
 boolean hasAnyAuthInfos()
          return whether any of the two AutInfos are valid; if the extended info response (own domain or "with provider" flag) is retrieved, which does not contain the flag, the value is set to true if at least one of the two expire dates is given.
 void setChangeProvAuthInfo(java.lang.String authInfo)
          set the AuthInfo that shall be used for the change provider operation
 void setDomainName(java.lang.String theDomainName)
          set the domain name.
 void setDomainName(java.lang.String theDomainName, java.lang.String theEncodedDomainName)
          set the domain name
 void toList(KVList list, boolean addDns)
          convert the object to a KV list as part of a domain request (create, update, chholder, chprov, delete)
 java.lang.String toString()
          convert the object to a string (for debugging purposes)
 void toXml(org.w3c.dom.Node node, boolean addDns)
          convert the object to XML as part of a domain request (create, update, chholder, chprov, delete)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

domainName

private java.lang.String domainName
the domain name


encodedDomainName

private java.lang.String encodedDomainName
the encoded domain name


domainState

private DomainData.DomainState domainState
the domain state


provider

private java.lang.String provider
the provider


contacts

private java.util.List<DomainData.Ref> contacts
the list of contacts


dns

private java.util.List<DnsEntry> dns
the DNS related data


changeDate

private java.util.Date changeDate
the last change date


expireDate

private java.util.Date expireDate
expire date


inDispute

private boolean inDispute
flag whether domain is in dispute


changeProvAuthInfo

private java.lang.String changeProvAuthInfo
the AuthInfo text for the change provider operation


authInfo1ExpireDate

private java.util.Date authInfo1ExpireDate
the date AuthInfo 1 expires (null if not set or unknown)


authInfo2ExpireDate

private java.util.Date authInfo2ExpireDate
the date AuthInfo 2 expires (null if not set or unknown)


authInfosSet

private boolean authInfosSet
flag whether either AuthInfo 1 or AuthInfo 2 is set


contactSectionNames

private static final java.lang.String[] contactSectionNames
the names of the contact sections


contactSectionRoles

private static final DomainData.Role[] contactSectionRoles
the types of the contact sections; order must be synchronized with contactSectionNames


contactSectionFromDescr

private static final boolean[] contactSectionFromDescr
the "from description" flags for the sections, order must be synchronized with contactSectionNames

Constructor Detail

DomainData

public DomainData()
constructor


DomainData

public DomainData(DomainData other,
                  boolean deepCopy)
copy constructor

Parameters:
other - the instance to copy from
deepCopy - if true, a deep copy is performed, i.e. copies from referenced mutable objects are also created
Method Detail

toList

public void toList(KVList list,
                   boolean addDns)
            throws EncodeException
convert the object to a KV list as part of a domain request (create, update, chholder, chprov, delete)

Parameters:
list - the list
addDns - if true, DNS data is added
Throws:
EncodeException - on encoding exceptions

fromList

public void fromList(KVMultiList list)
              throws ResponseParseException
parse the given key-value list.

Parameters:
list - the list to parse
Throws:
ResponseParseException - if the parsing failed

toXml

public void toXml(org.w3c.dom.Node node,
                  boolean addDns)
           throws org.w3c.dom.DOMException,
                  EncodeException
convert the object to XML as part of a domain request (create, update, chholder, chprov, delete)

Parameters:
node - the node to add the contents to
addDns - if true, DNS data is added
Throws:
org.w3c.dom.DOMException - on DOM exceptions
EncodeException - on encode exceptions

fromXml

public void fromXml(org.w3c.dom.Element node)
             throws org.w3c.dom.DOMException,
                    ResponseParseException
parse the given XML subtree

Parameters:
node - the node containing the contact data (infoDataType)
Throws:
org.w3c.dom.DOMException - on DOM exceptions
ResponseParseException - if the parsing failed

toString

public java.lang.String toString()
convert the object to a string (for debugging purposes)

Overrides:
toString in class java.lang.Object
Returns:
the string representation

getDomainName

public java.lang.String getDomainName()
return the domain name

Returns:
the domain name

getEncodedDomainName

public java.lang.String getEncodedDomainName()
return the encoded domain name

Returns:
the encoded domain name

setDomainName

public void setDomainName(java.lang.String theDomainName)
set the domain name. The encoded domain name is cleared. This version should be used for non-IDNs only

Parameters:
theDomainName - the domain name

setDomainName

public void setDomainName(java.lang.String theDomainName,
                          java.lang.String theEncodedDomainName)
set the domain name

Parameters:
theDomainName - the domain name
theEncodedDomainName - the encoded domain name

getDomainState

public DomainData.DomainState getDomainState()
return the domain state

Returns:
the domain state

getProvider

public java.lang.String getProvider()
return the provider

Returns:
the provider (may be null)

getChangeProvAuthInfo

public java.lang.String getChangeProvAuthInfo()
return the AuthInfo that shall be used for the change provider operation

Returns:
the AuthInfo or null if none is available

setChangeProvAuthInfo

public void setChangeProvAuthInfo(java.lang.String authInfo)
set the AuthInfo that shall be used for the change provider operation

Parameters:
authInfo - the AuthInfo or null if none is available

getAuthInfo1ExpireDate

public java.util.Date getAuthInfo1ExpireDate()
return the expire date for the AuthInfo 1

Returns:
the expire date or null if it is not set or not provided by the registry, i.e. if the domain is not managed by the registrar and the "with provider" flag has not been set in the request

getAuthInfo2ExpireDate

public java.util.Date getAuthInfo2ExpireDate()
return the expire date for the AuthInfo 2

Returns:
the expire date or null if it is not set or not provided by the registry, i.e. if the domain is not managed by the registrar and the "with provider" flag has not been set in the request

hasAnyAuthInfos

public boolean hasAnyAuthInfos()
return whether any of the two AutInfos are valid; if the extended info response (own domain or "with provider" flag) is retrieved, which does not contain the flag, the value is set to true if at least one of the two expire dates is given.

Returns:
true if the domain has valid AuthInfos

getContactRefs

public java.util.List<DomainData.Ref> getContactRefs()
returns the list of contact references

Returns:
the list

getContacts

public java.util.List<ContactData> getContacts(DomainData.Role role)
return a list of contacts with the given role

Parameters:
role - the role
Returns:
the list

getFirstContact

public ContactData getFirstContact(DomainData.Role role)
return the first contact of the given role

Parameters:
role - the role
Returns:
the first contact or null if there are no contacts of that role

clearContacts

public void clearContacts()
clear all contact references


clearContacts

public void clearContacts(DomainData.Role role)
clear all contact references with the given role

Parameters:
role - the role to clear

addContact

public void addContact(DomainData.Role role,
                       ContactData contact)
add a single contact

Parameters:
role - the role
contact - the contact

addContacts

public void addContacts(DomainData.Role role,
                        ContactData... theContacts)
add all given contacts

Parameters:
role - the role
theContacts - the contacts

addContact

public void addContact(DomainData.Ref ref)
add a single contact

Parameters:
ref - the reference

addContacts

public void addContacts(DomainData.Ref... refs)
add all given contacts

Parameters:
refs - the references

addContacts

public void addContacts(java.util.Collection<DomainData.Ref> refs)
add all given contacts

Parameters:
refs - the references

getDnsEntries

public java.util.List<DnsEntry> getDnsEntries()
return the DNS entries

Returns:
the entries

clearDnsEntries

public void clearDnsEntries()
clear all DNS entries


addDnsEntry

public void addDnsEntry(DnsEntry entry)
add an entry to the DNS configuration

Parameters:
entry - the entry to add

addDnsEntries

public void addDnsEntries(DnsEntry... entries)
add all entries to the DNS configuration

Parameters:
entries - the entries to add

addDnsEntries

public void addDnsEntries(java.util.Collection<? extends DnsEntry> entries)
add all entries to the DNS configuration

Parameters:
entries - the entries

getExpireDate

public java.util.Date getExpireDate()
return the expiration date

Returns:
the expiration date (for non-delegated domains) or null if the domain does not expire

getChangeDate

public java.util.Date getChangeDate()
return the change date

Returns:
the change date, may be null


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH