dk.netarkivet.harvester.datamodel
Class Password

java.lang.Object
  extended by dk.netarkivet.harvester.datamodel.Password
All Implemented Interfaces:
Named

public final class Password
extends java.lang.Object
implements Named

Immutable password class. Represents a http credentials password. See RFC 2617: HTTP Authentication: Basic and Digest Access Authentication


Constructor Summary
Password(java.lang.String name, java.lang.String comments, java.lang.String passwordDomain, java.lang.String realm, java.lang.String username, java.lang.String password)
          Create a new password object with the given information.
 
Method Summary
 boolean equals(java.lang.Object o)
          equals method overriding Object#equals.
 java.lang.String getComments()
          Get the comment of this object.
(package private)  long getID()
          Get the ID of this password.
 java.lang.String getName()
          Get the name of this object.
 java.lang.String getPassword()
           
 java.lang.String getPasswordDomain()
           
 java.lang.String getRealm()
           
 java.lang.String getUsername()
           
 int hashCode()
          hashCode method overriding Object#hashCode.
(package private)  boolean hasID()
          Check if this password has an ID set yet (doesn't happen until the DBDAO persists it).
(package private)  void setID(long id)
          Set the ID of this password.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Password

public Password(java.lang.String name,
                java.lang.String comments,
                java.lang.String passwordDomain,
                java.lang.String realm,
                java.lang.String username,
                java.lang.String password)
Create a new password object with the given information.

Parameters:
name - The name of the Password
comments - Any comments
passwordDomain - the domain where this Password is used
realm - the realm of the Password
username - the username
password - the password
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Named
Get the name of this object.

Specified by:
getName in interface Named
Returns:
the name of the Password

getComments

public java.lang.String getComments()
Description copied from interface: Named
Get the comment of this object.

Specified by:
getComments in interface Named
Returns:
the comments for the Password

getPasswordDomain

public java.lang.String getPasswordDomain()
Returns:
the domain for the Password

getRealm

public java.lang.String getRealm()
Returns:
the Realm for the Password

getUsername

public java.lang.String getUsername()
Returns:
the username.

getPassword

public java.lang.String getPassword()
Returns:
the password.

getID

long getID()
Get the ID of this password. Only for use by DBDAO

Returns:
the ID of this password

setID

void setID(long id)
Set the ID of this password. Only for use by DBDAO.

Parameters:
id - the new ID of this password

hasID

boolean hasID()
Check if this password has an ID set yet (doesn't happen until the DBDAO persists it).

Returns:
true if this password has an ID set yet

equals

public boolean equals(java.lang.Object o)
equals method overriding Object#equals. Autogenerated code.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare with
Returns:
Whether they are equal

hashCode

public int hashCode()
hashCode method overriding Object#hashCode. Autogenerated code.

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode