Fixed build issues

4.x.x
harshanl 9 years ago
parent 3ec54ba941
commit 36ca79d31a

@ -47,7 +47,7 @@
<Bundle-Name>${project.artifactId}</Bundle-Name> <Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-Version>${carbon.device.mgt.version}</Bundle-Version> <Bundle-Version>${carbon.device.mgt.version}</Bundle-Version>
<Bundle-Description>Dynamic Client Registration Bundle</Bundle-Description> <Bundle-Description>Dynamic Client Registration Bundle</Bundle-Description>
<Bundle-Activator>org.wso2.carbon.dynamic.client.registration.internal.DynamicClientRegistrationServiceComponent</Bundle-Activator> <Bundle-Activator>org.wso2.carbon.dynamic.client.registration.internal.DynamicClientRegistrationBundleActivator</Bundle-Activator>
<Private-Package>org.wso2.carbon.dynamic.client.registration.internal</Private-Package> <Private-Package>org.wso2.carbon.dynamic.client.registration.internal</Private-Package>
<Export-Package> <Export-Package>
!org.wso2.carbon.dynamic.client.registration.internal, !org.wso2.carbon.dynamic.client.registration.internal,

@ -160,13 +160,15 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
"Service"); "Service");
} }
ServiceProvider existingServiceProvider = appMgtService.getApplication(applicationName); ServiceProvider existingServiceProvider = appMgtService.getServiceProvider(
applicationName, tenantDomain);
if (existingServiceProvider == null) { 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) { if (createdServiceProvider == null) {
throw new DynamicClientRegistrationException( throw new DynamicClientRegistrationException(
"Couldn't create Service Provider Application " + applicationName); "Couldn't create Service Provider Application " + applicationName);
@ -254,7 +256,7 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
createdServiceProvider.setLocalAndOutBoundAuthenticationConfig(localOutboundAuthConfig); createdServiceProvider.setLocalAndOutBoundAuthenticationConfig(localOutboundAuthConfig);
// Update the Service Provider app to add OAuthApp as an Inbound Authentication Config // 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 oAuthApplicationInfo = new OAuthApplicationInfo();
oAuthApplicationInfo.setClientId(createdApp.getOauthConsumerKey()); oAuthApplicationInfo.setClientId(createdApp.getOauthConsumerKey());
@ -329,12 +331,13 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
"Error occurred while retrieving Application Management" + "Error occurred while retrieving Application Management" +
"Service"); "Service");
} }
ServiceProvider createdServiceProvider = appMgtService.getApplication(applicationName); ServiceProvider createdServiceProvider = appMgtService.getServiceProvider(
applicationName, tenantDomain);
if (createdServiceProvider == null) { if (createdServiceProvider == null) {
throw new DynamicClientRegistrationException( throw new DynamicClientRegistrationException(
"Couldn't retrieve Service Provider Application " + applicationName); "Couldn't retrieve Service Provider Application " + applicationName);
} }
appMgtService.deleteApplication(applicationName); appMgtService.deleteApplication(applicationName, tenantDomain, userName);
status = true; status = true;
} catch (IdentityApplicationManagementException e) { } catch (IdentityApplicationManagementException e) {
throw new DynamicClientRegistrationException( throw new DynamicClientRegistrationException(
@ -361,7 +364,8 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
"Service"); "Service");
} }
try { try {
if (ApplicationManagementService.getInstance().getApplication(applicationName) != null) { if (ApplicationManagementService.getInstance().getServiceProvider(applicationName,
CarbonContext.getThreadLocalCarbonContext().getTenantDomain()) != null) {
return true; return true;
} }
} catch (IdentityApplicationManagementException e) { } catch (IdentityApplicationManagementException e) {

Loading…
Cancel
Save