FileDocCategorySizeDatePackage
WebPrincipal.javaAPI DocGlassfish v2 API3998Fri May 04 22:36:20 BST 2007com.sun.web.security

WebPrincipal

public class WebPrincipal extends com.sun.enterprise.deployment.PrincipalImpl

Fields Summary
private String
password
private X509Certificate[]
certs
private boolean
useCertificate
private com.sun.enterprise.security.SecurityContext
secCtx
private Principal
customPrincipal
Constructors Summary
public WebPrincipal(Principal p, com.sun.enterprise.security.SecurityContext context)

	super(p.getName());
	if (!(p instanceof PrincipalImpl)) {
	    customPrincipal = p;
	}
        this.useCertificate = false;
        this.secCtx = context;
    
public WebPrincipal(String user, String password, com.sun.enterprise.security.SecurityContext context)

        super(user);
        this.password = password;
        this.useCertificate = false;
        this.secCtx = context;
    
public WebPrincipal(X509Certificate[] certs, com.sun.enterprise.security.SecurityContext context)

        super(certs[0].getSubjectDN().getName());
        this.certs = certs;
        this.useCertificate = true;
        this.secCtx = context;
    
Methods Summary
public booleanequals(java.lang.Object another)


	if (customPrincipal == null) {
	    return super.equals(another);
	} 
	return customPrincipal.equals(another);
    
public java.security.cert.X509Certificate[]getCertificates()

        return certs;
    
public java.lang.StringgetName()

	if (customPrincipal == null) {
	    return super.getName();
	} else {
	    return customPrincipal.getName();
	}
    
public java.lang.StringgetPassword()

        return password;
    
public com.sun.enterprise.security.SecurityContextgetSecurityContext()

        return secCtx;
    
public inthashCode()

	if (customPrincipal == null) {
	    return super.hashCode();
	} 
	return customPrincipal.hashCode();
    
public booleanisUsingCertificate()

        return useCertificate;
    
public java.lang.StringtoString()

	if (customPrincipal == null) {
	    return super.toString();
	} 
	return customPrincipal.toString();