org.wso2.solutions.identity.users
Class IdentityDefaultUserStoreReader

java.lang.Object
  extended by org.wso2.usermanager.readwrite.DefaultUserStoreReader
      extended by org.wso2.solutions.identity.users.IdentityDefaultUserStoreReader
All Implemented Interfaces:
IdentityUserStoreReader, org.wso2.usermanager.UserStoreReader

public class IdentityDefaultUserStoreReader
extends org.wso2.usermanager.readwrite.DefaultUserStoreReader
implements IdentityUserStoreReader


Field Summary
 
Fields inherited from class org.wso2.usermanager.readwrite.DefaultUserStoreReader
data, dataSource
 
Constructor Summary
IdentityDefaultUserStoreReader(javax.sql.DataSource dataSource)
          Class constructor specifying the data-source
IdentityDefaultUserStoreReader(javax.sql.DataSource dataSource, org.wso2.usermanager.readwrite.DefaultStrategy store)
          Class constructor specifying the data-source and the default strategy
 
Method Summary
 java.lang.String getDefaultUserProfileName(java.lang.String userName)
          A given user should have a default profile name.
 java.util.List<java.lang.String> getUserProfileNames(java.lang.String userName)
          A given user can have multiple profiles.
 java.util.Map<java.lang.String,java.lang.String> getUserProperties(java.lang.String userName)
          
 java.util.Map<java.lang.String,java.lang.String> getUserProperties(java.lang.String userName, java.lang.String profileName)
          Get the user properties corresponding to the given user name and the profile name.
 java.lang.String[] getUserPropertyNames()
          
 boolean isExistingUserProfile(java.lang.String userName, java.lang.String profileName)
          Profile name for a given user should be unique.
 
Methods inherited from class org.wso2.usermanager.readwrite.DefaultUserStoreReader
getAllRoleNames, getAllUserNames, getRoleProperties, getUserNamesWithPropertyValue, getUserRoles, getUsersInRole, isExistingUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityDefaultUserStoreReader

public IdentityDefaultUserStoreReader(javax.sql.DataSource dataSource)
Class constructor specifying the data-source

Parameters:
dataSource - DataSource

IdentityDefaultUserStoreReader

public IdentityDefaultUserStoreReader(javax.sql.DataSource dataSource,
                                      org.wso2.usermanager.readwrite.DefaultStrategy store)
Class constructor specifying the data-source and the default strategy

Parameters:
dataSource - DataSource
store - DefaultStrategy
Method Detail

getUserProperties

public java.util.Map<java.lang.String,java.lang.String> getUserProperties(java.lang.String userName)
                                                                   throws org.wso2.usermanager.UserManagerException

Specified by:
getUserProperties in interface org.wso2.usermanager.UserStoreReader
Overrides:
getUserProperties in class org.wso2.usermanager.readwrite.DefaultUserStoreReader
Throws:
org.wso2.usermanager.UserManagerException

getUserPropertyNames

public java.lang.String[] getUserPropertyNames()
                                        throws org.wso2.usermanager.UserManagerException

Specified by:
getUserPropertyNames in interface org.wso2.usermanager.UserStoreReader
Overrides:
getUserPropertyNames in class org.wso2.usermanager.readwrite.DefaultUserStoreReader
Throws:
org.wso2.usermanager.UserManagerException

getDefaultUserProfileName

public java.lang.String getDefaultUserProfileName(java.lang.String userName)
                                           throws org.wso2.usermanager.UserManagerException
A given user should have a default profile name. This returns the name of the default profile for a given user.

Specified by:
getDefaultUserProfileName in interface IdentityUserStoreReader
Parameters:
userName - Unique user name
Returns:
Default profile name corresponding to the given user name.
Throws:
org.wso2.usermanager.UserManagerException

getUserProfileNames

public java.util.List<java.lang.String> getUserProfileNames(java.lang.String userName)
                                                     throws org.wso2.usermanager.UserManagerException
A given user can have multiple profiles. This returns all the profile names for a given user.

Specified by:
getUserProfileNames in interface IdentityUserStoreReader
Parameters:
userName - Unique user name
Returns:
Profile names corresponding to the given user name.
Throws:
org.wso2.usermanager.UserManagerException

getUserProperties

public java.util.Map<java.lang.String,java.lang.String> getUserProperties(java.lang.String userName,
                                                                          java.lang.String profileName)
                                                                   throws org.wso2.usermanager.UserManagerException
Get the user properties corresponding to the given user name and the profile name.

Specified by:
getUserProperties in interface IdentityUserStoreReader
Parameters:
userName - Unique user name
profileName - Profile name, unique to a given user
Returns:
User properties corresponding to the given user name and the profile name
Throws:
org.wso2.usermanager.UserManagerException

isExistingUserProfile

public boolean isExistingUserProfile(java.lang.String userName,
                                     java.lang.String profileName)
                              throws org.wso2.usermanager.UserManagerException
Profile name for a given user should be unique. A single user cannot have multiple profiles with the same profile name. This checks whether the given user have a profile of the provided profile name.

Specified by:
isExistingUserProfile in interface IdentityUserStoreReader
Parameters:
userName - Unique user name
profileName - Profile name
Returns:
True, if the given user does have a profile with the same name, else false
Throws:
org.wso2.usermanager.UserManagerException