org.abstracthorizon.danube.auth.jaas.memory
Class PropertiesModuleService

java.lang.Object
  extended by org.abstracthorizon.danube.auth.jaas.memory.PropertiesModuleService

public class PropertiesModuleService
extends Object

This is keystore login module service. This class sets up keystore login module

Author:
Daniel Sendula

Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
PropertiesModuleService()
          Default constructor
 
Method Summary
 void addUser(String user, String passwd)
          Adds new user to the store
 void changePassword(String user, String oldPassword, String newPassword)
          Changes the password of the user
static String generateHash(String algorithm, String password)
           
static String generateMD5Hash(String password)
           
 Configuration getConfiguration()
          Returns configuration
 String getControlFlag()
          Returns control flag
 String getLoginContext()
          Returns login context name
 Properties getProperties()
           
 String getPropertiesURI()
          Returns properties uri
 Set<String> getUserRoles(String user)
           
 String[] getUserRolesAsArray(String user)
           
 List<String> listUsers()
          Returns a list of all users in the keystore
 String listUsersString()
          Lists certificates (users) from the keystore
 void loadProperties()
           
 void removeUser(String user)
          Removes certificate - user
 void setConfiguration(Configuration configuration)
          Sets configuration
 void setControlFlag(String controlFlag)
          Sets control flag
 void setLoginContext(String loginContext)
          Sets login context name
 void setPropertesURI(String uri)
          Sets properties URI
 void setProperties(Properties properties)
           
 void start()
          Starts the service - adding keystore login module to system application configuration entry
 void stop()
           
 void storeProperties()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger
Constructor Detail

PropertiesModuleService

public PropertiesModuleService()
Default constructor

Method Detail

start

public void start()
           throws Exception
Starts the service - adding keystore login module to system application configuration entry

Throws:
Exception

stop

public void stop()
          throws Exception
Throws:
Exception

listUsersString

public String listUsersString()
                       throws Exception
Lists certificates (users) from the keystore

Returns:
users as a string
Throws:
Exception

listUsers

public List<String> listUsers()
                       throws Exception
Returns a list of all users in the keystore

Returns:
list of all users in the keystore
Throws:
Exception

changePassword

public void changePassword(String user,
                           String oldPassword,
                           String newPassword)
                    throws Exception
Changes the password of the user

Parameters:
user - user
oldPassword - old password
newPassword - new password
Throws:
Exception

addUser

public void addUser(String user,
                    String passwd)
             throws Exception
Adds new user to the store

Parameters:
user - user
passwd - password
Throws:
Exception

removeUser

public void removeUser(String user)
                throws Exception
Removes certificate - user

Parameters:
user - username
Throws:
Exception

getUserRoles

public Set<String> getUserRoles(String user)

getUserRolesAsArray

public String[] getUserRolesAsArray(String user)

loadProperties

public void loadProperties()
                    throws CertificateException,
                           IOException,
                           URISyntaxException
Throws:
CertificateException
IOException
URISyntaxException

storeProperties

public void storeProperties()
                     throws IOException,
                            URISyntaxException
Throws:
IOException
URISyntaxException

getPropertiesURI

public String getPropertiesURI()
Returns properties uri

Returns:
properties uri

setPropertesURI

public void setPropertesURI(String uri)
Sets properties URI

Parameters:
uri - properties URI

setLoginContext

public void setLoginContext(String loginContext)
Sets login context name

Parameters:
loginContext - login context name

getLoginContext

public String getLoginContext()
Returns login context name

Returns:
login context name

setControlFlag

public void setControlFlag(String controlFlag)
Sets control flag

Parameters:
controlFlag - control flag

getControlFlag

public String getControlFlag()
Returns control flag

Returns:
control flag

getConfiguration

public Configuration getConfiguration()
Returns configuration

Returns:
configuration

setConfiguration

public void setConfiguration(Configuration configuration)
Sets configuration

Parameters:
configuration - configuration

getProperties

public Properties getProperties()

setProperties

public void setProperties(Properties properties)

generateMD5Hash

public static String generateMD5Hash(String password)
                              throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

generateHash

public static String generateHash(String algorithm,
                                  String password)
                           throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.