org.wso2.registry.users.hybrid.ldap
Class LDAPUserStoreReader

java.lang.Object
  extended by org.wso2.registry.users.hybrid.ldap.LDAPUserStoreReader
All Implemented Interfaces:
UserStoreReader
Direct Known Subclasses:
LDAPUserStoreAdmin

public class LDAPUserStoreReader
extends java.lang.Object
implements UserStoreReader


Field Summary
protected  javax.sql.DataSource dataSource
           
 
Constructor Summary
LDAPUserStoreReader(LDAPRealmConfig config, javax.sql.DataSource dataSource, javax.naming.directory.DirContext context)
           
 
Method Summary
 java.lang.String[] getAllRoleNames()
          Retrieves all role names
 java.lang.String[] getAllUserNames()
          Retrieves all user names
protected  javax.naming.directory.Attributes getGenericUserByPattern(java.lang.String userName, java.lang.String[] attrIds)
           
static int getRoleId(java.sql.Connection dbConnection, java.lang.String roleName)
           
 java.util.Map getRoleProperties(java.lang.String roleName)
          Retrieves role properties given the role name
 java.lang.String[] getUserNamesWithPropertyValue(java.lang.String propertyName, java.lang.String propetyValue)
          Retrieves user names with the given property values
 java.util.Map getUserProperties(java.lang.String userName)
          Retrieves user properties given the user name
 java.lang.String[] getUserPropertyNames()
          Retrieves user properties given the user name
protected static java.lang.String[] getUserRoles(java.sql.Connection dbConnection, java.lang.String userName)
           
 java.lang.String[] getUserRoles(java.lang.String userName)
          Gets all user roles
 java.lang.String[] getUsersInRole(java.lang.String roleName)
          Retrieves users in a role
 boolean isExistingRole(java.lang.String roleName)
          Checks whether a role exist in the user store
 boolean isExistingUser(java.lang.String userName)
          Checks whether an user exist in the user store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected javax.sql.DataSource dataSource
Constructor Detail

LDAPUserStoreReader

public LDAPUserStoreReader(LDAPRealmConfig config,
                           javax.sql.DataSource dataSource,
                           javax.naming.directory.DirContext context)
Method Detail

getAllUserNames

public java.lang.String[] getAllUserNames()
                                   throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves all user names

Specified by:
getAllUserNames in interface UserStoreReader
Throws:
UserStoreException

getUserProperties

public java.util.Map getUserProperties(java.lang.String userName)
                                throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves user properties given the user name

Specified by:
getUserProperties in interface UserStoreReader
Throws:
UserStoreException

getUserPropertyNames

public java.lang.String[] getUserPropertyNames()
                                        throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves user properties given the user name

Specified by:
getUserPropertyNames in interface UserStoreReader
Throws:
UserStoreException

isExistingUser

public boolean isExistingUser(java.lang.String userName)
                       throws UserStoreException
Description copied from interface: UserStoreReader
Checks whether an user exist in the user store

Specified by:
isExistingUser in interface UserStoreReader
Parameters:
userName - TODO
Throws:
UserStoreException

getUserNamesWithPropertyValue

public java.lang.String[] getUserNamesWithPropertyValue(java.lang.String propertyName,
                                                        java.lang.String propetyValue)
                                                 throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves user names with the given property values

Specified by:
getUserNamesWithPropertyValue in interface UserStoreReader
Throws:
UserStoreException

getAllRoleNames

public java.lang.String[] getAllRoleNames()
                                   throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves all role names

Specified by:
getAllRoleNames in interface UserStoreReader
Throws:
UserStoreException

getRoleProperties

public java.util.Map getRoleProperties(java.lang.String roleName)
                                throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves role properties given the role name

Specified by:
getRoleProperties in interface UserStoreReader
Throws:
UserStoreException

getUserRoles

public java.lang.String[] getUserRoles(java.lang.String userName)
                                throws UserStoreException
Description copied from interface: UserStoreReader
Gets all user roles

Specified by:
getUserRoles in interface UserStoreReader
Throws:
UserStoreException

getUsersInRole

public java.lang.String[] getUsersInRole(java.lang.String roleName)
                                  throws UserStoreException
Description copied from interface: UserStoreReader
Retrieves users in a role

Specified by:
getUsersInRole in interface UserStoreReader
Throws:
UserStoreException

isExistingRole

public boolean isExistingRole(java.lang.String roleName)
                       throws UserStoreException
Description copied from interface: UserStoreReader
Checks whether a role exist in the user store

Specified by:
isExistingRole in interface UserStoreReader
Parameters:
roleName - RoleName
Throws:
UserStoreException

getGenericUserByPattern

protected javax.naming.directory.Attributes getGenericUserByPattern(java.lang.String userName,
                                                                    java.lang.String[] attrIds)
                                                             throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getUserRoles

protected static java.lang.String[] getUserRoles(java.sql.Connection dbConnection,
                                                 java.lang.String userName)
                                          throws UserStoreException
Throws:
UserStoreException

getRoleId

public static int getRoleId(java.sql.Connection dbConnection,
                            java.lang.String roleName)
                     throws UserStoreException
Throws:
UserStoreException


Copyright © 2007 Apache Web Services Project. All Rights Reserved.