Class HostingNodeManager
java.lang.Object
org.gcube.smartgears.connector.resourceregistry.resourcemanager.ResourceManager
org.gcube.smartgears.connector.resourceregistry.resourcemanager.HostingNodeManager
- Author:
- Luca Frosini (ISTI-CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCPU frequency field name.static final StringCPU model field name with word boundary.static final StringCPU model name field name.static final StringCPU model number field name.static final StringCPU model field name with tab separator.static final StringCPU processor field name.static final StringCPU vendor ID field name.static final StringJVM maximum memory property name.static final StringMemory type property name.static final StringJVM memory type value.static final StringRAM memory type value.static final StringMessage property name.Fields inherited from class org.gcube.smartgears.connector.resourceregistry.resourcemanager.ResourceManager
resourceRegistryPublisher -
Constructor Summary
ConstructorsConstructorDescriptionHostingNodeManager(org.gcube.smartgears.context.container.ContainerContext containerContext) Constructor for HostingNodeManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToContext(String context) Adds the hosting node to the specified context.voidAdds the hosting node to the current context.org.gcube.resourcemanagement.model.reference.entities.resources.HostingNodeCreates a new hosting node resource.Gets the UUIDs of all contexts where this hosting node is registered.static List<org.gcube.resourcemanagement.model.reference.entities.facets.CPUFacet>Gets the CPU facets for the system.org.gcube.resourcemanagement.model.reference.entities.resources.HostingNodeGets the hosting node instance.static org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacetGets the operative system information as a SoftwareFacet.getState()Gets the current state of the hosting node.voidremoveFromContext(UUID contextUUID, String context) Removes the hosting node from the specified context.voidRemoves the hosting node from the current context.org.gcube.resourcemanagement.model.reference.entities.resources.HostingNodeUpdates the facets of the hosting node.Methods inherited from class org.gcube.smartgears.connector.resourceregistry.resourcemanager.ResourceManager
getContextUUID
-
Field Details
-
MEMORY_TYPE
Memory type property name.- See Also:
-
MEMORY_TYPE_RAM
RAM memory type value.- See Also:
-
MEMORY_TYPE_JVM
JVM memory type value.- See Also:
-
JVM_MAX_MEMORY
JVM maximum memory property name.- See Also:
-
MESSAGE
Message property name.- See Also:
-
CPU_PROCESSOR
CPU processor field name.- See Also:
-
CPU_VENDOR_ID
CPU vendor ID field name.- See Also:
-
CPU_MODEL_NAME
CPU model name field name.- See Also:
-
CPU_CPU_MHZ
CPU frequency field name.- See Also:
-
CPU_MODEL_T
CPU model field name with tab separator.- See Also:
-
CPU_MODEL_B
CPU model field name with word boundary.- See Also:
-
CPU_MODEL_NUMBER
CPU model number field name.- See Also:
-
-
Constructor Details
-
HostingNodeManager
public HostingNodeManager(org.gcube.smartgears.context.container.ContainerContext containerContext) Constructor for HostingNodeManager.- Parameters:
containerContext- the container context
-
-
Method Details
-
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.ResourceRegistryExceptionAdds the hosting node to the current context.- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException- if the resource is not foundorg.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the context is not foundorg.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 foundorg.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the context is not foundorg.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.ResourceRegistryExceptionRemoves the hosting node from the current context.- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException- if the resource is not foundorg.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the context is not foundorg.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 contextcontext- the context name- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException- if the resource is not foundorg.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the context is not foundorg.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.ResourceRegistryExceptionUpdates 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.ResourceRegistryExceptionCreates a new hosting node resource.- Returns:
- the created hosting node
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if an error occurs
-
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
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
-