Fixing API publishing related issues

revert-70aa11f8
prabathabey 10 years ago
parent 5d02746a5e
commit 36dea72e02

@ -43,10 +43,14 @@ public class APIPublisherServiceImpl implements APIPublisherService {
} }
APIProvider provider = APIManagerFactory.getInstance().getAPIProvider(api.getApiOwner()); APIProvider provider = APIManagerFactory.getInstance().getAPIProvider(api.getApiOwner());
if (provider != null) { if (provider != null) {
provider.addAPI(api); if (!provider.isAPIAvailable(api.getId())) {
if (log.isDebugEnabled()) { provider.addAPI(api);
log.debug("Successfully published API '" + api.getId() + "' with the context '" + log.info("Successfully published API '" + api.getId().getApiName() + "' with context '" +
api.getContext() + "'"); api.getContext() + "' and version '" + api.getId().getVersion() + "'");
} else {
log.info("An API already exists with the name '" + api.getId() + "', context '" +
api.getContext() + "' and verison '" + api.getId().getVersion() +
"'. Thus, the API config is not re-published");
} }
} else { } else {
log.error("API provider configured for the given API configuration is null. Thus, the API is not " + log.error("API provider configured for the given API configuration is null. Thus, the API is not " +

@ -67,9 +67,6 @@ public class APIRegistrationStartupObserver implements ServerStartupObserver {
API api = DeviceManagerUtil.getAPI(apiConfig); API api = DeviceManagerUtil.getAPI(apiConfig);
DeviceManagementDataHolder.getInstance().getApiPublisherService().publishAPI(api); DeviceManagementDataHolder.getInstance().getApiPublisherService().publishAPI(api);
log.info("Successfully published API '" + apiConfig.getName() + "' with the context '" +
apiConfig.getContext() + "' and version '" + apiConfig.getVersion() + "'");
} catch (Throwable e) { } catch (Throwable e) {
/* Throwable is caught as none of the RuntimeExceptions that can potentially occur at this point /* Throwable is caught as none of the RuntimeExceptions that can potentially occur at this point
does not seem to be logged anywhere else within the framework */ does not seem to be logged anywhere else within the framework */

Loading…
Cancel
Save