From 1d18c6de1ec7ef30254ec3686e90421df5dbb4c0 Mon Sep 17 00:00:00 2001 From: milanperera Date: Tue, 14 Jul 2015 14:43:01 +0530 Subject: [PATCH] Refactored DCA --- .../oauth/extension/DynamicClientRegistrationUtil.java | 9 ++------- .../oauth/extension/impl/RegistrationServiceImpl.java | 7 +++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/DynamicClientRegistrationUtil.java b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/DynamicClientRegistrationUtil.java index 3678284842a..9e9fe4db409 100644 --- a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/DynamicClientRegistrationUtil.java +++ b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/DynamicClientRegistrationUtil.java @@ -58,8 +58,7 @@ public class DynamicClientRegistrationUtil { private static final Log log = LogFactory.getLog(DynamicClientRegistrationUtil.class); - @POST - @Override + public Response register(RegistrationProfile profile) { try { PrivilegedCarbonContext.startTenantFlow(); @@ -78,11 +77,7 @@ public class DynamicClientRegistrationUtil { } } - @DELETE - @Override - public Response unregister(@QueryParam("applicationName") String applicationName, - @QueryParam("userId") String userId, - @QueryParam("consumerKey") String consumerKey) { + public Response unregister(String applicationName, String userId, String consumerKey) { try { this.unregisterApplication(userId, applicationName, consumerKey); return Response.status(Response.Status.ACCEPTED).build(); diff --git a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/RegistrationServiceImpl.java b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/RegistrationServiceImpl.java index 0da5ec47ac8..0a9078b037d 100644 --- a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/RegistrationServiceImpl.java +++ b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/RegistrationServiceImpl.java @@ -35,9 +35,11 @@ import org.wso2.carbon.identity.application.mgt.ApplicationManagementService; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.oauth.OAuthAdminService; import org.wso2.carbon.identity.oauth.dto.OAuthConsumerAppDTO; -import org.wso2.carbon.identity.oauth.extension.*; +import org.wso2.carbon.identity.oauth.extension.DynamicClientRegistrationUtil; +import org.wso2.carbon.identity.oauth.extension.FaultResponse; +import org.wso2.carbon.identity.oauth.extension.OAuthApplicationInfo; +import org.wso2.carbon.identity.oauth.extension.RegistrationService; import org.wso2.carbon.identity.oauth.extension.profile.RegistrationProfile; -import org.wso2.carbon.identity.oauth.extension.profile.UnregistrationProfile; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; @@ -47,6 +49,7 @@ import javax.ws.rs.POST; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import javax.ws.rs.QueryParam; @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)