Class WebPrincipal
- java.lang.Object
-
- org.glassfish.security.common.PrincipalImpl
-
- com.sun.enterprise.security.web.integration.WebPrincipal
-
- All Implemented Interfaces:
SecurityContextProxy,Serializable,Principal
public class WebPrincipal extends PrincipalImpl implements SecurityContextProxy
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebPrincipal(String user, char[] pwd, SecurityContext context)WebPrincipal(String user, String password, SecurityContext context)WebPrincipal(X509Certificate[] certs, SecurityContext context)WebPrincipal(X509Certificate[] certificates, SecurityContext context, boolean nameFromContext)WebPrincipal(Principal principal, SecurityContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object another)This function returns true if the object passed matches the principal represented in this implementationX509Certificate[]getCertificates()PrincipalgetCustomPrincipal()StringgetName()Gets the name of the Principal as a java.lang.Stringchar[]getPassword()SecurityContextgetSecurityContext()inthashCode()Returns the hashcode for this Principal objectbooleanisUsingCertificate()StringtoString()Prints a stringified version of the principal.
-
-
-
Constructor Detail
-
WebPrincipal
public WebPrincipal(Principal principal, SecurityContext context)
-
WebPrincipal
public WebPrincipal(String user, String password, SecurityContext context)
-
WebPrincipal
public WebPrincipal(String user, char[] pwd, SecurityContext context)
-
WebPrincipal
public WebPrincipal(X509Certificate[] certs, SecurityContext context)
-
WebPrincipal
public WebPrincipal(X509Certificate[] certificates, SecurityContext context, boolean nameFromContext)
-
-
Method Detail
-
getPassword
public char[] getPassword()
-
getCertificates
public X509Certificate[] getCertificates()
-
isUsingCertificate
public boolean isUsingCertificate()
-
getSecurityContext
public SecurityContext getSecurityContext()
- Specified by:
getSecurityContextin interfaceSecurityContextProxy
-
getName
public String getName()
Description copied from class:PrincipalImplGets the name of the Principal as a java.lang.String- Specified by:
getNamein interfacePrincipal- Overrides:
getNamein classPrincipalImpl- Returns:
- the name of the principal.
-
equals
public boolean equals(Object another)
Description copied from class:PrincipalImplThis function returns true if the object passed matches the principal represented in this implementation- Specified by:
equalsin interfacePrincipal- Overrides:
equalsin classPrincipalImpl- Parameters:
another- the Principal to compare with.- Returns:
- true if the Principal passed is the same as that encapsulated in this object, false otherwise
-
hashCode
public int hashCode()
Description copied from class:PrincipalImplReturns the hashcode for this Principal object- Specified by:
hashCodein interfacePrincipal- Overrides:
hashCodein classPrincipalImpl- Returns:
- a hashcode for the principal.
-
toString
public String toString()
Description copied from class:PrincipalImplPrints a stringified version of the principal.- Specified by:
toStringin interfacePrincipal- Overrides:
toStringin classPrincipalImpl- Returns:
- A java.lang.String object returned by the method getName()
-
getCustomPrincipal
public Principal getCustomPrincipal()
-
-