com.metamatrix.platform.security.membership.spi.file
Class FileMembershipDomain

java.lang.Object
  extended by com.metamatrix.platform.security.membership.spi.file.FileMembershipDomain
All Implemented Interfaces:
MembershipDomain

public class FileMembershipDomain
extends java.lang.Object
implements MembershipDomain

A membership domain that loads user and group definitions from the file system.


Field Summary
static java.lang.String CHECK_PASSWORD
           
static java.lang.String GROUPS_FILE
           
static java.lang.String USERS_FILE
           
 
Constructor Summary
FileMembershipDomain()
           
 
Method Summary
 SuccessfulAuthenticationToken authenticateUser(java.lang.String username, Credentials credential, java.io.Serializable trustedPayload, java.lang.String applicationName)
          Authenticate a user with the specified username and credential for use with the specified application.
protected  boolean checkPasswords()
           
 java.util.Set getGroupNames()
          Returns a String set all group names known to this domain.
 java.util.Set getGroupNamesForUser(java.lang.String username)
          Returns a String set of all group names the given user is a member of.
protected  java.util.HashMap getGroups()
           
protected  java.util.HashMap getUserGroups()
           
protected  java.util.Properties getUsers()
           
 void initialize(java.util.Properties env)
          Initialize this domain with the given properties.
 void shutdown()
          Shut down this domain to further work.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USERS_FILE

public static final java.lang.String USERS_FILE
See Also:
Constant Field Values

GROUPS_FILE

public static final java.lang.String GROUPS_FILE
See Also:
Constant Field Values

CHECK_PASSWORD

public static final java.lang.String CHECK_PASSWORD
See Also:
Constant Field Values
Constructor Detail

FileMembershipDomain

public FileMembershipDomain()
Method Detail

initialize

public void initialize(java.util.Properties env)
                throws MembershipSourceException
Description copied from interface: MembershipDomain
Initialize this domain with the given properties.

Specified by:
initialize in interface MembershipDomain
Parameters:
env - contains the properties for this domain as set by the console
Throws:
MembershipSourceException
See Also:
MembershipDomain.initialize(java.util.Properties)

shutdown

public void shutdown()
Description copied from interface: MembershipDomain
Shut down this domain to further work.

Specified by:
shutdown in interface MembershipDomain
See Also:
MembershipDomain.shutdown()

authenticateUser

public SuccessfulAuthenticationToken authenticateUser(java.lang.String username,
                                                      Credentials credential,
                                                      java.io.Serializable trustedPayload,
                                                      java.lang.String applicationName)
                                               throws UnsupportedCredentialException,
                                                      InvalidUserException,
                                                      LogonException,
                                                      MembershipSourceException
Description copied from interface: MembershipDomain
Authenticate a user with the specified username and credential for use with the specified application. The application name may also be used by the Membership Domain to determine the appropriate authentication mechanism.

Specified by:
authenticateUser in interface MembershipDomain
Parameters:
username - The base username (without the domain suffix) of the individual attempting authentication. May be null if the membership domain implementation uses a mechanism other than username/credential authentication.
credential - The credentials belonging to the individual seeking authentication. May be null for anonymous authentications.
trustedPayload - The trusted payload set by the client. May be null if not set by the client.
applicationName - The name of the application to which the individual is attempting to authenticate. It's provided as a connection property when the individual connects (via URL or connection properties). This applicationName may be used by the authenticating membership domain as a basis for authentication and authorization.
Returns:
the SuccessfulAuthenticationToken containing the username and trustedPayload. The username in the SuccessfulAuthenticationToken will be used to identify this user in later calls. If the user is to be authenticated into a different domain, that domain name should be set on the SuccessfulAuthenticationToken. The return value should not be null.
Throws:
UnsupportedCredentialException - if the credential or trustedPayload cannot be used to authenticate the user
InvalidUserException - if the user does not exist in this domain
LogonException - if the user was unsuccessfully authenticated
MembershipSourceException - if there was an internal error
See Also:
MembershipDomain.authenticateUser(java.lang.String, com.metamatrix.platform.security.api.Credentials, java.io.Serializable, java.lang.String)

getGroupNames

public java.util.Set getGroupNames()
                            throws MembershipSourceException
Description copied from interface: MembershipDomain
Returns a String set all group names known to this domain. The returned values should not be fully qualified with a domain suffix.

Specified by:
getGroupNames in interface MembershipDomain
Returns:
a set of String group names
Throws:
MembershipSourceException - if there was an internal error
See Also:
MembershipDomain.getGroupNames()

getGroupNamesForUser

public java.util.Set getGroupNamesForUser(java.lang.String username)
                                   throws InvalidUserException,
                                          MembershipSourceException
Description copied from interface: MembershipDomain
Returns a String set of all group names the given user is a member of. The returned values should not be fully qualified with a domain suffix.

Specified by:
getGroupNamesForUser in interface MembershipDomain
Returns:
a set of String group names
Throws:
InvalidUserException - if the user does not exist in this domain
MembershipSourceException - if there was an internal error
See Also:
MembershipDomain.getGroupNamesForUser(java.lang.String)

checkPasswords

protected boolean checkPasswords()
Returns:
Returns the checkPasswords.

getGroups

protected java.util.HashMap getGroups()
Returns:
Returns the groups.

getUserGroups

protected java.util.HashMap getUserGroups()
Returns:
Returns the userGroups.

getUsers

protected java.util.Properties getUsers()
Returns:
Returns the users.


Copyright © 2009. All Rights Reserved.