public class XMLStorage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XMLStorage.XMLStorageNotAvailableException
XMLStorage not initialized exception
|
Constructor and Description |
---|
XMLStorage()
Creates a new manager
|
Modifier and Type | Method and Description |
---|---|
boolean |
collectionExists(java.lang.String collectionName)
Checks whether a collection exists or not
|
Collection |
createCollection(java.lang.String name)
Creates a collection in the XML storage.
|
void |
deleteCollection(java.lang.String collectionName)
Deletes the collection from the storage
|
void |
deleteResource(GCUBEXMLResource resource)
Deletes a resource
|
GCUBEXMLResource |
executeXPathQuery(java.lang.String xpathquery) |
org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS |
getStatus() |
void |
initialize(boolean... lock)
Initializes the local XML Storage repository
|
void |
initialize(long maxOperationsPerConnection,
boolean... lock)
Initializes the local XML Storage repository
|
boolean |
isLocked() |
java.lang.String[] |
listAllCollectionResourceIDs(java.lang.String collectionName)
Lists all the identifiers of the resources belonging the collection
|
Collection |
loadAllCollections()
Loads the root collection.
|
void |
printResourcesIDs()
Prints all the IDs of the Resources stored in the DB instance
|
boolean |
resourceExists(GCUBEXMLResource resource)
Checks if the resource does exist in the storage
|
void |
retrieveResourceContent(GCUBEXMLResource resource)
Retrieves a resource's content from the storage
|
void |
setStatus(org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS status) |
boolean |
shutdown(boolean lock)
Shutdowns the XML Storage repository
|
void |
storeResource(GCUBEXMLResource resource)
Stores a XMLDBDocument in the current collection.
|
public void initialize(boolean... lock) throws XMLStorage.XMLStorageNotAvailableException
lock
- if the storage has to be locked or not during the initalizationjava.lang.Exception
- if the connection to eXist or its initialization failXMLStorage.XMLStorageNotAvailableException
public void initialize(long maxOperationsPerConnection, boolean... lock) throws XMLStorage.XMLStorageNotAvailableException
maxOperationsPerConnection
- max number of operation per active connectionlock
- if the storage has to be locked or not during the initalizationjava.lang.Exception
- if the connection to eXist or its initialization failXMLStorage.XMLStorageNotAvailableException
public Collection createCollection(java.lang.String name) throws XMLDBException, XMLStorage.XMLStorageNotAvailableException
name
- the collection to createXMLDBException
XMLStorage.XMLStorageNotAvailableException
public boolean shutdown(boolean lock)
public Collection loadAllCollections()
public void storeResource(GCUBEXMLResource resource) throws XMLStorage.XMLStorageNotAvailableException, GCUBEXMLResource.MalformedXMLResourceException
resource
- the resource to storeGCUBEXMLResource.MalformedXMLResourceException
java.lang.Exception
- if the storing failsXMLStorage.XMLStorageNotAvailableException
public boolean isLocked()
public void retrieveResourceContent(GCUBEXMLResource resource) throws java.lang.Exception
resource
- java.lang.Exception
public boolean resourceExists(GCUBEXMLResource resource) throws GCUBEXMLResource.MalformedXMLResourceException, XMLStorage.XMLStorageNotAvailableException
resource
- the resource to checkGCUBEXMLResource.MalformedXMLResourceException
- if the input resource is not validXMLStorage.XMLStorageNotAvailableException
public GCUBEXMLResource executeXPathQuery(java.lang.String xpathquery)
xpathquery
- public void deleteResource(GCUBEXMLResource resource) throws java.lang.Exception
java.lang.Exception
public void printResourcesIDs()
public boolean collectionExists(java.lang.String collectionName)
collectionName
- the name of the collection to checkpublic void deleteCollection(java.lang.String collectionName) throws XMLStorage.XMLStorageNotAvailableException
collectionName
- the name of the collection to deleteXMLStorage.XMLStorageNotAvailableException
public java.lang.String[] listAllCollectionResourceIDs(java.lang.String collectionName) throws XMLStorage.XMLStorageNotAvailableException
collectionName
- the collection nameXMLStorage.XMLStorageNotAvailableException
public org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS getStatus()
public void setStatus(org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS status)
status
- the status to set