|
|
@ -172,6 +172,7 @@ public final class DeviceManagerUtil {
|
|
|
|
APIIdentifier id = new APIIdentifier(config.getOwner(), config.getName(), config.getVersion());
|
|
|
|
APIIdentifier id = new APIIdentifier(config.getOwner(), config.getName(), config.getVersion());
|
|
|
|
API api = new API(id);
|
|
|
|
API api = new API(id);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
if(!provider.isAPIAvailable(id)) {
|
|
|
|
api.setContext(config.getContext());
|
|
|
|
api.setContext(config.getContext());
|
|
|
|
api.setUrl(config.getEndpoint());
|
|
|
|
api.setUrl(config.getEndpoint());
|
|
|
|
api.setUriTemplates(getURITemplates(config.getEndpoint(),
|
|
|
|
api.setUriTemplates(getURITemplates(config.getEndpoint(),
|
|
|
@ -183,6 +184,7 @@ public final class DeviceManagerUtil {
|
|
|
|
api.setTransports(config.getTransports());
|
|
|
|
api.setTransports(config.getTransports());
|
|
|
|
|
|
|
|
|
|
|
|
provider.addAPI(api);
|
|
|
|
provider.addAPI(api);
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (APIManagementException e) {
|
|
|
|
} catch (APIManagementException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while registering the API", e);
|
|
|
|
throw new DeviceManagementException("Error occurred while registering the API", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|