Added method level comments and null checks in DCA

This commit is contained in:
mharindu 2015-08-26 17:14:12 +05:30
parent 5e285071d8
commit 97c19c23b0
2 changed files with 20 additions and 0 deletions

View File

@ -228,6 +228,11 @@ public class DynamicClientRegistrationUtil {
oAuthAdminService.removeOAuthApplicationData(consumerKey);
ApplicationManagementService appMgtService = ApplicationManagementService.getInstance();
if (appMgtService == null) {
throw new APIManagementException("Error occurred while retrieving Application Management" +
"Service");
}
ServiceProvider createdServiceProvider = appMgtService.getApplication(applicationName);
if (createdServiceProvider == null) {

View File

@ -45,9 +45,24 @@ public interface RegistrationService {
}
}
/**
* This method is used to register an Oauth application.
*
* @param profile contains the necessary attributes that are
* needed in order to register an app.
* @return Status 200 if success including consumerKey and consumerSecret.
*/
@POST
Response register(RegistrationProfile profile);
/**
* This method is used to remove already registered Oauth application.
*
* @param applicationName name of the application.
* @param userId name of the application owner.
* @param consumerKey provided consumerKey for the registered application.
* @return Status 200 if success.
*/
@DELETE
public Response unregister(@QueryParam("applicationName") String applicationName,
@QueryParam("userId") String userId,