Class EServiceManager
java.lang.Object
org.gcube.smartgears.connector.resourceregistry.resourcemanager.EServiceManager
- All Implemented Interfaces:
ResourceManager
- Author:
- Luca Frosini (ISTI-CNR)
-
Constructor Summary
ConstructorsConstructorDescriptionEServiceManager(org.gcube.smartgears.context.application.ApplicationContext applicationContext, org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher resourceRegistryPublisher) Constructor for EServiceManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the EService to the current context.voidAdds the hosting node to the current context.voidaddToContext(String context) Adds the resource to the specified context.org.gcube.resourcemanagement.model.reference.entities.resources.EServiceCreates a new EService resource.Gets the UUIDs of all contexts where this EService is registered.getContextUUID(String contextFullName) Gets the UUID of a context by its full name.org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherGets the Resource Registry publisher.getState()Gets the current state of the EService.voidremoveFromContext(UUID contextUUID, String context) Removes the resource from the specified context.voidRemoves the resource from the current context.org.gcube.resourcemanagement.model.reference.entities.resources.EServiceUpdates the facets of the EService.
-
Constructor Details
-
EServiceManager
public EServiceManager(org.gcube.smartgears.context.application.ApplicationContext applicationContext, org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher resourceRegistryPublisher) Constructor for EServiceManager.- Parameters:
applicationContext- the application contextresourceRegistryPublisher- the resource registry publisher
-
-
Method Details
-
getResourceRegistryPublisher
public org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher getResourceRegistryPublisher()Gets the Resource Registry publisher.- Returns:
- the resource registry publisher
-
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
-
addEServiceToCurrentContext
public void addEServiceToCurrentContext() 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 EService 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
-
addHostingNodeToCurrentContext
public void addHostingNodeToCurrentContext() 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 resource 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 resource 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 resource 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
-
getState
Gets the current state of the EService.- Returns:
- the state as a string
-
createEService
public org.gcube.resourcemanagement.model.reference.entities.resources.EService createEService() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionCreates a new EService resource.- Returns:
- the created EService
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if an error occurs
-
updateFacets
public org.gcube.resourcemanagement.model.reference.entities.resources.EService updateFacets() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionUpdates the facets of the EService.- Returns:
- the updated EService
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if an error occurs
-
getContextsUUID
Gets the UUIDs of all contexts where this EService is registered.- Returns:
- a map of context UUIDs to their names
- Throws:
Exception- if an error occurs
-