com.evermind.security
Interface User

All Superinterfaces:
java.security.Principal

public interface User
extends java.security.Principal

Author:
Magnus Stenman

Method Summary
 void addToGroup(Group group)
          Adds the user to the specified group (if possible), throws UnsupportedOperationException if not possible.
 boolean authenticate(java.lang.String password)
          Verify this user.
 java.lang.String getCertificateIssuerDN()
          Retrieves the certificate issuer DN for this user, null if certificates are not supported or this user is not associated with a certificate.
 java.math.BigInteger getCertificateSerial()
          Retrieves the certificate serial ID for this user, null if certificates are not supported or this user is not associated with a certificate.
 java.lang.String getDescription()
          Returns a short description of this user or null if no description is present.
 java.util.Set getGroups()
          Returns the groups that this user belongs to, if known/supported.
 java.util.Locale getLocale()
          Return this users Locale or null if none specified.
 java.lang.String getName()
          Returns the username of this user
 java.lang.String getPassword()
          Gets the user password, may result in an exception if it's not supported by the current UserManager (for security or other reasons).
 boolean hasPermission(java.security.Permission permission)
          Check if this user has the named permission.
 boolean isMemberOf(Group group)
          See if this user is a member of the specified group.
 void removeFromGroup(Group group)
          Removes the user from the specified group, throws UnsupportedOperationException if not supported in this manager.
 void setCertificate(java.lang.String issuerDN, java.math.BigInteger serial)
          Sets the certificate associated with this user, may throw UnsupportedOperationException if certificates are not supported by this UserManager.
 void setCertificate(java.security.cert.X509Certificate cert)
          Sets the certificate associated with this user, may throw UnsupportedOperationException if certificates are not supported by this UserManager.
 void setDescription(java.lang.String description)
          Sets the description of this user, throws UnsupportedOperationException if not possible.
 void setLocale(java.util.Locale locale)
          Sets the locale of this user, throws UnsupportedOperationException if locale specification is not supported by the UserManager used.
 void setPassword(java.lang.String password)
          Sets the user password, may result in an exception if it's not supported by the current UserManager.
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Method Detail

getName

java.lang.String getName()
Returns the username of this user

Specified by:
getName in interface java.security.Principal

getDescription

java.lang.String getDescription()
Returns a short description of this user or null if no description is present.


setDescription

void setDescription(java.lang.String description)
Sets the description of this user, throws UnsupportedOperationException if not possible.


authenticate

boolean authenticate(java.lang.String password)
Verify this user.


getLocale

java.util.Locale getLocale()
Return this users Locale or null if none specified.


setLocale

void setLocale(java.util.Locale locale)
               throws java.lang.UnsupportedOperationException
Sets the locale of this user, throws UnsupportedOperationException if locale specification is not supported by the UserManager used.

Throws:
java.lang.UnsupportedOperationException

hasPermission

boolean hasPermission(java.security.Permission permission)
Check if this user has the named permission.


isMemberOf

boolean isMemberOf(Group group)
See if this user is a member of the specified group.


setPassword

void setPassword(java.lang.String password)
Sets the user password, may result in an exception if it's not supported by the current UserManager.


getPassword

java.lang.String getPassword()
Gets the user password, may result in an exception if it's not supported by the current UserManager (for security or other reasons).


getCertificateSerial

java.math.BigInteger getCertificateSerial()
Retrieves the certificate serial ID for this user, null if certificates are not supported or this user is not associated with a certificate.


getCertificateIssuerDN

java.lang.String getCertificateIssuerDN()
Retrieves the certificate issuer DN for this user, null if certificates are not supported or this user is not associated with a certificate.


setCertificate

void setCertificate(java.lang.String issuerDN,
                    java.math.BigInteger serial)
                    throws java.lang.UnsupportedOperationException
Sets the certificate associated with this user, may throw UnsupportedOperationException if certificates are not supported by this UserManager.

Throws:
java.lang.UnsupportedOperationException

setCertificate

void setCertificate(java.security.cert.X509Certificate cert)
Sets the certificate associated with this user, may throw UnsupportedOperationException if certificates are not supported by this UserManager.


addToGroup

void addToGroup(Group group)
                throws java.lang.UnsupportedOperationException
Adds the user to the specified group (if possible), throws UnsupportedOperationException if not possible.

Throws:
java.lang.UnsupportedOperationException

removeFromGroup

void removeFromGroup(Group group)
                     throws java.lang.UnsupportedOperationException
Removes the user from the specified group, throws UnsupportedOperationException if not supported in this manager.

Throws:
java.lang.UnsupportedOperationException

getGroups

java.util.Set getGroups()
                        throws java.lang.UnsupportedOperationException
Returns the groups that this user belongs to, if known/supported.

Throws:
java.lang.UnsupportedOperationException