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