Class Overview
Represents a user authenticated by HTTP Basic or Digest
authentication.
Summary
Public Methods |
boolean
|
equals(Object another)
Compares two HttpPrincipal.
|
String
|
getName()
returns the contents of this principal in the form
realm:username
|
String
|
getRealm()
returns the realm this object was created with.
|
String
|
getUsername()
returns the username this object was created with.
|
int
|
hashCode()
returns a hashcode for this HttpPrincipal.
|
String
|
toString()
returns the same string as getName()
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.security.Principal
abstract
boolean
|
equals(Object another)
Compares this principal to the specified object.
|
abstract
String
|
getName()
Returns the name of this principal.
|
abstract
int
|
hashCode()
Returns a hashcode for this principal.
|
abstract
String
|
toString()
Returns a string representation of this principal.
|
|
Public Constructors
public
HttpPrincipal
(String username, String realm)
creates a HttpPrincipal from the given username and realm
Parameters
username
| The name of the user within the realm |
realm
| The realm. |
Public Methods
public
boolean
equals
(Object another)
Compares two HttpPrincipal. Returns true
if another is an instance of HttpPrincipal, and its
username and realm are equal to this object's username
and realm. Returns false
otherwise.
Parameters
another
| the reference object with which to compare. |
Returns
true
if this object is the same as the obj
argument; false
otherwise.
public
String
getName
()
returns the contents of this principal in the form
realm:username
Returns
- the name of this principal.
public
String
getRealm
()
returns the realm this object was created with.
public
String
getUsername
()
returns the username this object was created with.
public
int
hashCode
()
returns a hashcode for this HttpPrincipal. This is calculated
as (getUsername()+getRealm().hashCode()
Returns
- a hash code value for this object.
public
String
toString
()
returns the same string as getName()
Returns
- a string representation of the object.