|
|
@ -107,12 +107,14 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi
|
|
|
|
validityPeriod = registrationProfile.getValidityPeriod();
|
|
|
|
validityPeriod = registrationProfile.getValidityPeriod();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String applicationName = "devicetype_app_" + StringUtils.join(registrationProfile.getTags(), "_");
|
|
|
|
String applicationName = registrationProfile.getApplicationName();
|
|
|
|
|
|
|
|
synchronized (ApiApplicationRegistrationServiceImpl.class) {
|
|
|
|
ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
|
|
|
|
ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
|
|
|
|
applicationName, registrationProfile.getTags(),
|
|
|
|
applicationName, registrationProfile.getTags(),
|
|
|
|
ApiApplicationConstants.DEFAULT_TOKEN_TYPE, username,
|
|
|
|
ApiApplicationConstants.DEFAULT_TOKEN_TYPE, username,
|
|
|
|
registrationProfile.isAllowedToAllDomains(), validityPeriod);
|
|
|
|
registrationProfile.isAllowedToAllDomains(), validityPeriod);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(apiApplicationKey.toString()).build();
|
|
|
|
return Response.status(Response.Status.CREATED).entity(apiApplicationKey.toString()).build();
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (APIManagerException e) {
|
|
|
|
} catch (APIManagerException e) {
|
|
|
|
String msg = "Error occurred while registering an application with apis '"
|
|
|
|
String msg = "Error occurred while registering an application with apis '"
|
|
|
|
+ StringUtils.join(registrationProfile.getTags(), ",") + "'";
|
|
|
|
+ StringUtils.join(registrationProfile.getTags(), ",") + "'";
|
|
|
|