dk.netarkivet.harvester.datamodel
Class AliasInfo

java.lang.Object
  extended by dk.netarkivet.harvester.datamodel.AliasInfo

public class AliasInfo
extends java.lang.Object

Class encapsulating domain alias information. The information is used to prevent harvesting the domains which are aliases of other domains.


Constructor Summary
AliasInfo(java.lang.String domain, java.lang.String aliasOf, java.util.Date lastChange)
          Constructor for the AliasInfo class.
 
Method Summary
 java.lang.String getAliasOf()
           
 java.lang.String getDomain()
           
 java.util.Date getExpirationDate()
          The date when this alias will expire (or has expired).
 java.util.Date getLastChange()
           
 boolean isExpired()
          Is this alias expired? This method depends upon the Constant: dk.netarkivet.harvester.webinterface.Constants.ALIAS_TIMEOUT_IN_MILLISECONDS Note that this constant is now read from settings.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AliasInfo

public AliasInfo(java.lang.String domain,
                 java.lang.String aliasOf,
                 java.util.Date lastChange)
          throws ArgumentNotValid
Constructor for the AliasInfo class.

Parameters:
domain - a given domain
aliasOf - the given domain is an alias of this domain
lastChange - the alias was (re-)registered on this date.
Throws:
ArgumentNotValid - in the following cases: 1. domain is null or empty 2. aliasOf is null or empty 3. lastChange is null 4. domain equals aliasOf
Method Detail

getAliasOf

public java.lang.String getAliasOf()
Returns:
Returns the aliasOf.

getDomain

public java.lang.String getDomain()
Returns:
Returns the domain.

getLastChange

public java.util.Date getLastChange()
Returns:
Returns the lastChange.

isExpired

public boolean isExpired()
Is this alias expired? This method depends upon the Constant: dk.netarkivet.harvester.webinterface.Constants.ALIAS_TIMEOUT_IN_MILLISECONDS Note that this constant is now read from settings.

Returns:
true, if alias is expired

getExpirationDate

public java.util.Date getExpirationDate()
The date when this alias will expire (or has expired).

Returns:
The expiration date for this alias. May be in the past or in the future.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
String representation of this AliasInfo object.
See Also:
Object.toString()