aligned resource registry APIs

master
Luca Frosini 3 years ago
parent a74fed3036
commit 017b0026e9

@ -82,7 +82,7 @@ public class EServiceManager {
HostingNode hostingNode = applicationContext.container().properties()
.lookup(Constants.HOSTING_NODE_MANAGER_PROPERTY).value(HostingNodeManager.class).getHostingNode();
try {
resourceRegistryPublisher.addResourceToCurrentContext(hostingNode);
resourceRegistryPublisher.addResourceToCurrentContext(hostingNode, false);
logger.info("{} successfully added to current context ({})", eService, ContextUtility.getCurrentContextName());
} catch (Exception e) {
logger.error("Unable to add {} to current context ({})", eService, ContextUtility.getCurrentContextName(), e);
@ -92,7 +92,7 @@ public class EServiceManager {
public void removeFromContext()
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
try {
resourceRegistryPublisher.removeResourceFromCurrentContext(eService);
resourceRegistryPublisher.removeResourceFromCurrentContext(eService, false);
logger.info("{} successfully removed from current context ({})", eService,
ContextUtility.getCurrentContextName());
} catch (Exception e) {
@ -105,7 +105,7 @@ public class EServiceManager {
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
String contextFullName = ContextCache.getInstance().getContextFullNameByUUID(contextUUID);
try {
resourceRegistryPublisher.removeResourceFromContext(eService, contextUUID);
resourceRegistryPublisher.removeResourceFromContext(eService, contextUUID, false);
logger.info("{} successfully removed from context ({})", eService, contextFullName);
} catch (Exception e) {
logger.error("Unable to remove {} from current context ({})", eService, contextFullName, e);
@ -211,7 +211,7 @@ public class EServiceManager {
try {
eService = resourceRegistryClient.getInstance(EService.class, eServiceUUID);
} catch (AvailableInAnotherContextException ex) {
resourceRegistryPublisher.addResourceToCurrentContext(eService);
resourceRegistryPublisher.addResourceToCurrentContext(eService, false);
// addToContext() is executed on HostingNode.
// If the EService is still not available we need to create activates
// relation because does not exists otherwise the EService should

@ -105,7 +105,7 @@ public class HostingNodeManager {
public void addToContext() throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
try {
resourceRegistryPublisher.addResourceToCurrentContext(hostingNode);
resourceRegistryPublisher.addResourceToCurrentContext(hostingNode, false);
logger.info("{} successfully added to current context ({})", hostingNode, ContextUtility.getCurrentContextName());
} catch (Exception e) {
logger.error("Unable to add {} to current context ({})", hostingNode, ContextUtility.getCurrentContextName(), e);
@ -115,7 +115,7 @@ public class HostingNodeManager {
public void removeFromContext()
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
try {
resourceRegistryPublisher.removeResourceFromCurrentContext(hostingNode);
resourceRegistryPublisher.removeResourceFromCurrentContext(hostingNode, false);
logger.info("{} successfully removed from current context ({})", hostingNode,
ContextUtility.getCurrentContextName());
} catch (Exception e) {
@ -127,7 +127,7 @@ public class HostingNodeManager {
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
String contextFullName = ContextCache.getInstance().getContextFullNameByUUID(contextUUID);
try {
resourceRegistryPublisher.removeResourceFromContext(hostingNode, contextUUID);
resourceRegistryPublisher.removeResourceFromContext(hostingNode, contextUUID, false);
logger.info("{} successfully removed from context ({})", hostingNode, contextFullName);
} catch (Exception e) {
logger.error("Unable to remove {} from current context ({})", hostingNode, contextFullName, e);

Loading…
Cancel
Save