Class HttpPrincipal
java.lang.Object
com.sun.net.httpserver.HttpPrincipal
- All Implemented Interfaces:
Principal
-
Constructor Summary
ConstructorsConstructorDescriptionHttpPrincipal
(String username, String realm) Creates aHttpPrincipal
from the givenusername
andrealm
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare two instances ofHttpPrincipal
.getName()
Returns the contents of this principal in the form realm:username.getRealm()
Returns therealm
this object was created with.Returns theusername
this object was created with.int
hashCode()
Returns a hashcode for thisHttpPrincipal
.toString()
Returns the same string asgetName()
.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
HttpPrincipal
Creates aHttpPrincipal
from the givenusername
andrealm
.- Parameters:
username
- the name of the user within the realmrealm
- the realm for this user- Throws:
NullPointerException
- if either username or realm arenull
-
-
Method Details
-
equals
Compare two instances ofHttpPrincipal
. Returnstrue
if another is an instance ofHttpPrincipal
, and its username and realm are equal to this object's username and realm. Returnsfalse
otherwise. -
getName
-
getUsername
Returns theusername
this object was created with.- Returns:
- the name of the user associated with this object
-
getRealm
Returns therealm
this object was created with.- Returns:
- the realm associated with this object
-
hashCode
-
toString
-