Class GenericResourceManager
- java.lang.Object
-
- org.gcube.resourcemanagement.support.server.managers.resources.AbstractResourceManager
-
- org.gcube.resourcemanagement.support.server.managers.resources.GenericResourceManager
-
public class GenericResourceManager extends AbstractResourceManager
- Author:
- Massimiliano Assante (ISTI-CNR), Daniele Strollo (ISTI-CNR)
-
-
Constructor Summary
Constructors Constructor Description GenericResourceManager()Deprecated.discouraged use.GenericResourceManager(String id)GenericResourceManager(String id, String name)GenericResourceManager(String id, String name, String subtype)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidappendXmlFragment(org.gcube.common.resources.gcore.GenericResource.Profile profile, String fragment)append a well formed xml string to the bodyprotected org.gcube.common.resources.gcore.ResourcebuildResource(String xmlRepresentation)Given the XML profile representation of a gcube resource, its GCUBEResource is built.static Stringcreate(String ID, org.gcube.common.scope.impl.ScopeBean scope, String name, String description, String body, String subType)Creates a Generic Resource and returns the ID given by the resource manager at creation phase.voidupdate(String name, String description, String body, String subType, org.gcube.common.scope.impl.ScopeBean scope)Updates the resource.-
Methods inherited from class org.gcube.resourcemanagement.support.server.managers.resources.AbstractResourceManager
addToExistingScope, copyFromToVO, delete, forceDelete, getID, getName, getRegistryPublisher, getReportResourceManager, getResource, getResourceManager, getSubType, getType, getXMLDescription, removeFromScope, setID, validateScopes
-
-
-
-
Constructor Detail
-
GenericResourceManager
public GenericResourceManager() throws ResourceParameterException, ResourceAccessExceptionDeprecated.discouraged use. With no ID some operations cannot be accessed.
-
GenericResourceManager
public GenericResourceManager(String id) throws ResourceParameterException, ResourceAccessException
-
GenericResourceManager
public GenericResourceManager(String id, String name) throws ResourceParameterException, ResourceAccessException
- Parameters:
id-name-type-- Throws:
ResourceParameterExceptionResourceAccessException
-
GenericResourceManager
public GenericResourceManager(String id, String name, String subtype) throws ResourceParameterException, ResourceAccessException
- Parameters:
id-name-type-subtype-- Throws:
ResourceParameterExceptionResourceAccessException
-
-
Method Detail
-
update
public final void update(String name, String description, String body, String subType, org.gcube.common.scope.impl.ScopeBean scope) throws Exception
Updates the resource.- Parameters:
name- (Mandatory) the name to assign to the resourcedescription- (optional) if null it will not be changedbody- (optional) if null it will not be changedsubType- (optional) if null it will not be changedscope- (optional) if null it will not be changed- Throws:
AbstractResourceExceptionParserConfigurationExceptionSAXExceptionIOExceptionException
-
create
public static final String create(String ID, org.gcube.common.scope.impl.ScopeBean scope, String name, String description, String body, String subType) throws Exception
Creates a Generic Resource and returns the ID given by the resource manager at creation phase.- Returns:
- the id assigned to the newly created resource
- Throws:
Exception
-
buildResource
protected final org.gcube.common.resources.gcore.Resource buildResource(String xmlRepresentation) throws AbstractResourceException
Description copied from class:AbstractResourceManagerGiven the XML profile representation of a gcube resource, its GCUBEResource is built. Since it depends on the type of the resource, each concrete implementation of resource managers must implement it.- Specified by:
buildResourcein classAbstractResourceManager- Returns:
- Throws:
AbstractResourceException
-
appendXmlFragment
public static void appendXmlFragment(org.gcube.common.resources.gcore.GenericResource.Profile profile, String fragment) throws IOException, ParserConfigurationExceptionappend a well formed xml string to the body- Parameters:
parent-fragment-- Throws:
IOExceptionSAXExceptionParserConfigurationException
-
-