|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.net.httpserver.HttpPrincipal
public class HttpPrincipal
Represents a user authenticated by HTTP Basic or Digest authentication.
| Constructor Summary | |
|---|---|
HttpPrincipal(java.lang.String username,
java.lang.String realm)
creates a HttpPrincipal from the given username and realm |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object another)
Compares two HttpPrincipal. |
java.lang.String |
getName()
returns the contents of this principal in the form realm:username |
java.lang.String |
getRealm()
returns the realm this object was created with. |
java.lang.String |
getUsername()
returns the username this object was created with. |
int |
hashCode()
returns a hashcode for this HttpPrincipal. |
java.lang.String |
toString()
returns the same string as getName() |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HttpPrincipal(java.lang.String username,
java.lang.String realm)
username - The name of the user within the realmrealm - The realm.
java.lang.NullPointerException - if either username or realm are null| Method Detail |
|---|
public boolean equals(java.lang.Object another)
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.
equals in interface java.security.Principalequals in class java.lang.Objectpublic java.lang.String getName()
getName in interface java.security.Principalpublic java.lang.String getUsername()
public java.lang.String getRealm()
public int hashCode()
(getUsername()+getRealm().hashCode()
hashCode in interface java.security.PrincipalhashCode in class java.lang.Objectpublic java.lang.String toString()
toString in interface java.security.PrincipaltoString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||