PAJES 2.3.9

org.pajes.security
Class DefaultPrincipal

java.lang.Object
  extended byorg.pajes.security.DefaultPrincipal
All Implemented Interfaces:
java.security.Principal

public class DefaultPrincipal
extends java.lang.Object
implements java.security.Principal

Represents an unknown user when using an AuthenticatedPajeServlet but no authentication method has been provided in the deployment descriptor.


Constructor Summary
DefaultPrincipal(javax.servlet.http.HttpServletRequest request)
          Creates a default Principal obbject.
 
Method Summary
 boolean equals(java.lang.Object another)
          Compares this principal to the specified object.
 java.lang.String getName()
          Returns the name of this principal.
 int hashCode()
          Returns a hashcode for this principal.
 java.lang.String toString()
          Returns a string representation of this principal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultPrincipal

public DefaultPrincipal(javax.servlet.http.HttpServletRequest request)
Creates a default Principal obbject.

If a Principal exists on the HttpServletRequest (i.e. if it has been authenticated by the servlet container), then getName() will return the same as request.getUserPrincipal().getName(). Otherwise, it will return request.getRemoteAddr().

Parameters:
request - the HttpServletRequest object.
Method Detail

getName

public java.lang.String getName()
Returns the name of this principal.

Specified by:
getName in interface java.security.Principal
Returns:
the name of this principal.

equals

public boolean equals(java.lang.Object another)
Compares this principal to the specified object. Returns true if the object passed in matches the principal represented by the implementation of this interface.

Specified by:
equals in interface java.security.Principal
Parameters:
another - principal to compare with.
Returns:
true if the principal passed in is the same as that encapsulated by this principal, and false otherwise.

hashCode

public int hashCode()
Returns a hashcode for this principal.

Specified by:
hashCode in interface java.security.Principal
Returns:
a hashcode for this principal.

toString

public java.lang.String toString()
Returns a string representation of this principal.

Specified by:
toString in interface java.security.Principal
Returns:
a string representation of this principal.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.