Class HttpPrincipal
java.lang.Object
com.sun.net.httpserver.HttpPrincipal
- All Implemented Interfaces:
Principal
-
Constructor Summary
ConstructorsConstructorDescriptionHttpPrincipal(String username, String realm) Creates aHttpPrincipalfrom the givenusernameandrealm. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompare two instances ofHttpPrincipal.getName()Returns the contents of this principal in the form realm:username.getRealm()Returns therealmthis object was created with.Returns theusernamethis object was created with.inthashCode()Returns a hashcode for thisHttpPrincipal.toString()Returns the same string asgetName().Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.protected voidfinalize()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 voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(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 voidwait(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 aHttpPrincipalfrom the givenusernameandrealm.- 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. Returnstrueif another is an instance ofHttpPrincipal, and its username and realm are equal to this object's username and realm. Returnsfalseotherwise. -
getName
-
getUsername
Returns theusernamethis object was created with.- Returns:
- the name of the user associated with this object
-
getRealm
Returns therealmthis object was created with.- Returns:
- the realm associated with this object
-
hashCode
-
toString
-