From 36ca79d31aeb067ed892b004390f0bc57d56a712 Mon Sep 17 00:00:00 2001 From: harshanl Date: Wed, 7 Oct 2015 00:17:17 +0530 Subject: [PATCH] Fixed build issues --- .../pom.xml | 2 +- .../impl/DynamicClientRegistrationImpl.java | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml index 88b54304e8..51bce89c19 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml @@ -47,7 +47,7 @@ ${project.artifactId} ${carbon.device.mgt.version} Dynamic Client Registration Bundle - org.wso2.carbon.dynamic.client.registration.internal.DynamicClientRegistrationServiceComponent + org.wso2.carbon.dynamic.client.registration.internal.DynamicClientRegistrationBundleActivator org.wso2.carbon.dynamic.client.registration.internal !org.wso2.carbon.dynamic.client.registration.internal, diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/src/main/java/org/wso2/carbon/dynamic/client/registration/impl/DynamicClientRegistrationImpl.java b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/src/main/java/org/wso2/carbon/dynamic/client/registration/impl/DynamicClientRegistrationImpl.java index cc09b05be5..fa8c10d1c6 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/src/main/java/org/wso2/carbon/dynamic/client/registration/impl/DynamicClientRegistrationImpl.java +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/src/main/java/org/wso2/carbon/dynamic/client/registration/impl/DynamicClientRegistrationImpl.java @@ -160,13 +160,15 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS "Service"); } - ServiceProvider existingServiceProvider = appMgtService.getApplication(applicationName); + ServiceProvider existingServiceProvider = appMgtService.getServiceProvider( + applicationName, tenantDomain); if (existingServiceProvider == null) { - appMgtService.createApplication(serviceProvider); + appMgtService.createApplication(serviceProvider, userName, tenantDomain); } - ServiceProvider createdServiceProvider = appMgtService.getApplication(applicationName); + ServiceProvider createdServiceProvider = appMgtService.getServiceProvider( + applicationName, tenantDomain); if (createdServiceProvider == null) { throw new DynamicClientRegistrationException( "Couldn't create Service Provider Application " + applicationName); @@ -254,7 +256,7 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS createdServiceProvider.setLocalAndOutBoundAuthenticationConfig(localOutboundAuthConfig); // Update the Service Provider app to add OAuthApp as an Inbound Authentication Config - appMgtService.updateApplication(createdServiceProvider); + appMgtService.updateApplication(createdServiceProvider, tenantDomain, userName); OAuthApplicationInfo oAuthApplicationInfo = new OAuthApplicationInfo(); oAuthApplicationInfo.setClientId(createdApp.getOauthConsumerKey()); @@ -329,12 +331,13 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS "Error occurred while retrieving Application Management" + "Service"); } - ServiceProvider createdServiceProvider = appMgtService.getApplication(applicationName); + ServiceProvider createdServiceProvider = appMgtService.getServiceProvider( + applicationName, tenantDomain); if (createdServiceProvider == null) { throw new DynamicClientRegistrationException( "Couldn't retrieve Service Provider Application " + applicationName); } - appMgtService.deleteApplication(applicationName); + appMgtService.deleteApplication(applicationName, tenantDomain, userName); status = true; } catch (IdentityApplicationManagementException e) { throw new DynamicClientRegistrationException( @@ -361,7 +364,8 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS "Service"); } try { - if (ApplicationManagementService.getInstance().getApplication(applicationName) != null) { + if (ApplicationManagementService.getInstance().getServiceProvider(applicationName, + CarbonContext.getThreadLocalCarbonContext().getTenantDomain()) != null) { return true; } } catch (IdentityApplicationManagementException e) {