java.lang.Object
org.gcube.smartgears.connector.resourceregistry.resourcemanager.HostingNodeManager
All Implemented Interfaces:
ResourceManager

public class HostingNodeManager extends Object implements ResourceManager
Author:
Luca Frosini (ISTI-CNR)
  • Field Details

  • Constructor Details

    • HostingNodeManager

      public HostingNodeManager(org.gcube.smartgears.context.container.ContainerContext containerContext, org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher resourceRegistryPublisher)
      Constructor for HostingNodeManager.
      Parameters:
      containerContext - the container context
      resourceRegistryPublisher - the resource registry publisher
  • Method Details

    • getContextUUID

      public UUID getContextUUID(String contextFullName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Gets the UUID of a context by its full name.
      Parameters:
      contextFullName - the full name of the context
      Returns:
      the UUID of the context
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • getHostingNode

      public org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode getHostingNode()
      Gets the hosting node instance.
      Returns:
      the hosting node
    • addToCurrentContext

      public void addToCurrentContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Adds the hosting node to the current context.
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException - if the resource is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • addToContext

      public void addToContext(String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Adds the hosting node to the specified context.
      Parameters:
      context - the context to add to
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException - if the resource is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • removeFromCurrentContext

      public void removeFromCurrentContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Removes the hosting node from the current context.
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException - if the resource is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • removeFromContext

      public void removeFromContext(UUID contextUUID, String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Removes the hosting node from the specified context.
      Parameters:
      contextUUID - the UUID of the context
      context - the context name
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException - if the resource is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • updateFacets

      public org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode updateFacets() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Updates the facets of the hosting node.
      Returns:
      the updated hosting node
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • getOperativeSystem

      public static org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet getOperativeSystem()
      Gets the operative system information as a SoftwareFacet.
      Returns:
      the operative system software facet
    • createHostingNode

      public org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode createHostingNode() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Creates a new hosting node resource.
      Returns:
      the created hosting node
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs
    • getState

      public String getState()
      Gets the current state of the hosting node.
      Returns:
      the state as a string
    • getCPUFacets

      public static List<org.gcube.resourcemanagement.model.reference.entities.facets.CPUFacet> getCPUFacets()
      Gets the CPU facets for the system.
      Returns:
      a list of CPU facets
    • getContextsUUID

      public Map<UUID,String> getContextsUUID() throws Exception
      Gets the UUIDs of all contexts where this hosting node is registered.
      Returns:
      a map of context UUIDs to their names
      Throws:
      Exception - if an error occurs