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()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
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
-