[Carbon-dev] svn commit r42242 - trunk/carbon-components/profile-mgt/org.wso2.carbon.profiles.mgt/src/main/java/org/wso2/carbon/profiles/mgt

dimuthu at wso2.com dimuthu at wso2.com
Thu Jul 30 21:01:25 PDT 2009


Author: dimuthu
Date: Thu Jul 30 21:01:25 2009
New Revision: 42242
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=42242

Log:
syncing with the API changes done to user core


Modified:
   trunk/carbon-components/profile-mgt/org.wso2.carbon.profiles.mgt/src/main/java/org/wso2/carbon/profiles/mgt/ProfileMgtAdmin.java

Modified: trunk/carbon-components/profile-mgt/org.wso2.carbon.profiles.mgt/src/main/java/org/wso2/carbon/profiles/mgt/ProfileMgtAdmin.java
URL: http://wso2.org/svn/browse/wso2/trunk/carbon-components/profile-mgt/org.wso2.carbon.profiles.mgt/src/main/java/org/wso2/carbon/profiles/mgt/ProfileMgtAdmin.java?rev=42242&r1=42241&r2=42242&view=diff
==============================================================================
--- trunk/carbon-components/profile-mgt/org.wso2.carbon.profiles.mgt/src/main/java/org/wso2/carbon/profiles/mgt/ProfileMgtAdmin.java	(original)
+++ trunk/carbon-components/profile-mgt/org.wso2.carbon.profiles.mgt/src/main/java/org/wso2/carbon/profiles/mgt/ProfileMgtAdmin.java	Thu Jul 30 21:01:25 2009
@@ -16,11 +16,11 @@
 import org.wso2.carbon.profiles.mgt.dto.DialectDTO;
 import org.wso2.carbon.profiles.mgt.dto.ProfileConfigurationDTO;
 import org.wso2.carbon.profiles.mgt.util.ServiceHodler;
-import org.wso2.carbon.user.core.Claim;
-import org.wso2.carbon.user.core.ProfileConfiguration;
-import org.wso2.carbon.user.core.UserClaimsAdmin;
+import org.wso2.carbon.user.core.claim.Claim;
+import org.wso2.carbon.user.core.profile.ProfileConfiguration;
+import org.wso2.carbon.user.core.profile.ProfileConfigurationManager;
+import org.wso2.carbon.user.core.claim.ClaimManager;
 import org.wso2.carbon.user.core.UserCoreConstants;
-import org.wso2.carbon.user.core.UserProfileAdmin;
 import org.wso2.carbon.user.core.UserRealm;
 import org.wso2.carbon.user.core.UserStoreException;
 
@@ -100,7 +100,7 @@
     public DetailedProfileConfigurationDTO getAllAvailableProfileConfiguraionsForDialect(
             String userStore, String dialect) throws ProfileManagementException {
         UserRealm realm = null;
-        UserProfileAdmin profileAdmin = null;
+        ProfileConfigurationManager profileManager = null;
         // This map contains profile configurations against their corresponding
         // configuration name.
         ProfileConfiguration[] profileConfigs = null;
@@ -118,9 +118,9 @@
 
             // Get available profile configurations for internal user store.
             realm = ServiceHodler.getRealm();
-            profileAdmin = realm.getUserProfileAdmin(userStore);
+            profileManager = realm.getProfileConfigurationManager();
 
-            if (profileAdmin == null) {
+            if (profileManager == null) {
                 String message = "No profile configurations defined for the given user store "
                         + userStore;
                 if (log.isDebugEnabled()) {
@@ -130,9 +130,9 @@
             }
 
             // Get all profile configurations defined for the given user store.
-            // profileConfigurations = profileAdmin.getProfileConfigs();
+            // profileConfigurations = profileManager.getProfileConfigs();
             detailedConfiguration = new DetailedProfileConfigurationDTO();
-            profileConfigs = profileAdmin.getAllProfiles();
+            profileConfigs = profileManager.getAllProfiles();
             // We are interested on the given dialect only.
             detailedConfiguration.setDialect(dialect);
             configurations = new ArrayList<ProfileConfigurationDTO>();
@@ -223,8 +223,8 @@
     public ClaimConfigurationDTO[] getProfileConfiguration(String userStore, String dialect,
             String profileConfig) throws ProfileManagementException {
         UserRealm realm = null;
-        UserProfileAdmin profileAdmin = null;
-        UserClaimsAdmin claimsAdmin = null;
+        ProfileConfigurationManager profileManager = null;
+        ClaimManager claimManager = null;
         ProfileConfiguration profileConfiguration = null;
         ClaimConfigurationDTO claim = null;
         List<ClaimConfigurationDTO> claimList = null;
@@ -238,9 +238,9 @@
 
         try {
             realm = ServiceHodler.getRealm();
-            profileAdmin = realm.getUserProfileAdmin(userStore);
+            profileManager = realm.getProfileConfigurationManager();
 
-            if (profileAdmin == null) {
+            if (profileManager == null) {
                 String message = "No profile configurations defined for the given user store "
                         + userStore;
                 if (log.isDebugEnabled()) {
@@ -249,9 +249,9 @@
                 return null;
             }
 
-            claimsAdmin = realm.getClaimsAdmin(userStore);
+            claimManager = realm.getClaimManager();
 
-            if (claimsAdmin == null) {
+            if (claimManager == null) {
                 String message = "No claim configurations defined for the given user store "
                         + userStore;
                 if (log.isDebugEnabled()) {
@@ -261,13 +261,13 @@
             }
 
             definedClaimsList = new ArrayList<String>();
-            definedClaims = claimsAdmin.getAllClaims(dialect);
+            definedClaims = claimManager.getAllClaims(dialect);
 
             for (int i = 0; i < definedClaims.length; i++) {
                 definedClaimsList.add(definedClaims[i].getClaimUri());
             }
 
-            profileConfiguration = profileAdmin.getProfileConfig(profileConfig);
+            profileConfiguration = profileManager.getProfileConfig(profileConfig);
 
             // A container for all the claims applicable to the current profile
             // configuration.
@@ -352,7 +352,7 @@
      */
     public DialectDTO[] getDialectsForUserStore(String userStore) throws ProfileManagementException {
         UserRealm realm = null;
-        UserProfileAdmin profileAdmin = null;
+        ProfileConfigurationManager profileManager = null;
         // This map contains profile configurations against their corresponding
         // configuration name.
         ProfileConfiguration[] profileConfigs = null;
@@ -367,9 +367,9 @@
 
             // Get available profile configurations for internal user store.
             realm = ServiceHodler.getRealm();
-            profileAdmin = realm.getUserProfileAdmin(userStore);
+            profileManager = realm.getProfileConfigurationManager();
 
-            if (profileAdmin == null) {
+            if (profileManager == null) {
                 String message = "No profile configurations defined for the given user store "
                         + userStore;
                 if (log.isDebugEnabled()) {
@@ -379,7 +379,7 @@
             }
 
             // Get all profile configurations defined for the given user store.
-            profileConfigs = profileAdmin.getAllProfiles();
+            profileConfigs = profileManager.getAllProfiles();
             basicConfigurations = new HashMap<String, DialectDTO>();
 
             // Okay - we have profile configurations.
@@ -434,7 +434,7 @@
             if (UserCoreConstants.DEFAULT_PROFILE.equals(profileName)) {
                 throw new ProfileManagementException("Cannot delete default profile");
             }
-            UserProfileAdmin admin = realm.getUserProfileAdmin(userStore);
+            ProfileConfigurationManager admin = realm.getProfileConfigurationManager();
             ProfileConfiguration profileConfig = new ProfileConfiguration(profileName, dialect,
                     new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>());
             admin.deleteProfileConfig(profileConfig);
@@ -452,7 +452,7 @@
      * @throws Exception
      */
     private String[] getAllClaimDailects(String userStore) throws Exception {
-        UserClaimsAdmin claimsAdmin = null;
+        ClaimManager claimsManager = null;
         UserRealm realm = null;
         Claim[] claims = null;
         List<String> dialects;
@@ -460,9 +460,9 @@
         validateInputParameters(new String[]{userStore});
 
         realm = ServiceHodler.getRealm();
-        claimsAdmin = realm.getClaimsAdmin(userStore);
+        claimsManager = realm.getClaimManager();
 
-        if (claimsAdmin == null) {
+        if (claimsManager == null) {
             String message = "No claim configurations defined for the given user store "
                     + userStore;
             if (log.isDebugEnabled()) {
@@ -471,7 +471,7 @@
             return null;
         }
 
-        claims = claimsAdmin.getAllClaims();
+        claims = claimsManager.getAllClaims();
         dialects = new ArrayList<String>();
 
         for (int i = 0; i < claims.length; i++) {
@@ -497,11 +497,11 @@
 
         try {
             UserRealm realm = null;
-            UserProfileAdmin profileAdmin = null;
+            ProfileConfigurationManager profileManager = null;
             realm = ServiceHodler.getRealm();
-            profileAdmin = realm.getUserProfileAdmin(userstore);
+            profileManager = realm.getProfileConfigurationManager();
 
-            if (profileAdmin == null) {
+            if (profileManager == null) {
                 String message = "No profile configurations defined for the given user store "
                         + userstore;
                 if (log.isDebugEnabled()) {
@@ -510,7 +510,7 @@
                 throw new ProfileManagementException(message);
             }
 
-            ProfileConfiguration profConfig = profileAdmin.getProfileConfig(profileName);
+            ProfileConfiguration profConfig = profileManager.getProfileConfig(profileName);
             if (profConfig != null) {
                 String message = "Profile configuration already exist for the user store. Please select a different name."
                         + userstore;
@@ -538,7 +538,7 @@
             ProfileConfiguration config = new ProfileConfiguration(profileName, hidden, overridden,
                     inherited);
             config.setDialectName(dialectName);
-            profileAdmin.addProfileConfig(config);
+            profileManager.addProfileConfig(config);
         } catch (UserStoreException e) {
             String message = "Error while adding profile configurations for user store "
                     + userstore + " for dialect " + dialectName;
@@ -557,15 +557,15 @@
     public void updateClaimMappingBehavior(String userstore, String profileName,
             ClaimConfigurationDTO[] claimsConfiguration) throws ProfileManagementException {
         UserRealm realm = null;
-        UserProfileAdmin profileAdmin = null;
+        ProfileConfigurationManager profileManager = null;
 
         validateInputParameters(new String[]{userstore, profileName});
 
         try {
             realm = ServiceHodler.getRealm();
-            profileAdmin = realm.getUserProfileAdmin(userstore);
+            profileManager = realm.getProfileConfigurationManager();
 
-            if (profileAdmin == null) {
+            if (profileManager == null) {
                 String message = "No profile configurations defined for the given user store "
                         + userstore;
                 if (log.isDebugEnabled()) {
@@ -574,7 +574,7 @@
                 throw new ProfileManagementException(message);
             }
 
-            ProfileConfiguration config = profileAdmin.getProfileConfig(profileName);
+            ProfileConfiguration config = profileManager.getProfileConfig(profileName);
             List<String> hidden = new ArrayList<String>();
             List<String> overridden = new ArrayList<String>();
             List<String> inherited = new ArrayList<String>();
@@ -593,7 +593,7 @@
             config.setHiddenClaims(hidden);
             config.setInheritedClaims(inherited);
             config.setOverriddenClaims(overridden);
-            profileAdmin.updateProfileConfig(config);
+            profileManager.updateProfileConfig(config);
         } catch (UserStoreException e) {
             String message = "Error occurred while upating profile configurations for user store "
                     + userstore + "profile name " + profileName;
@@ -612,7 +612,7 @@
     public ClaimConfigurationDTO[] getClaimConfigurations(String userStore, String dialect)
             throws ProfileManagementException {
         UserRealm realm = null;
-        UserClaimsAdmin claimsAdmin = null;
+        ClaimManager claimsManager = null;
         Claim[] claims = null;
         List<ClaimConfigurationDTO> claimList = null;
 
@@ -620,9 +620,9 @@
 
         try {
             realm = ServiceHodler.getRealm();
-            claimsAdmin = realm.getClaimsAdmin(userStore);
+            claimsManager = realm.getClaimManager();
 
-            if (claimsAdmin == null) {
+            if (claimsManager == null) {
                 String message = "No claim configurations defined for the given user store "
                         + userStore;
                 if (log.isDebugEnabled()) {
@@ -631,7 +631,7 @@
                 throw null;
             }
 
-            claims = claimsAdmin.getAllClaims(dialect);
+            claims = claimsManager.getAllClaims(dialect);
             claimList = new ArrayList<ClaimConfigurationDTO>();
 
             for (int i = 0; i < claims.length; i++) {



More information about the Carbon-dev mailing list