|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.itinnovation.registry.component.xml.db.XmlDbAccessAdapter<org.xmldb.api.modules.XMLResource>
uk.ac.soton.itinnovation.registry.component.xml.db.xmldb.XmlDbAccessXmlDb
public class XmlDbAccessXmlDb
| Field Summary |
|---|
| Fields inherited from class uk.ac.soton.itinnovation.registry.component.xml.db.XmlDbAccessAdapter |
|---|
cacheManagement, internalUsedQueries, logger |
| Method Summary | |
|---|---|
boolean |
createCollection(String dir)
Creates a collection specified by the directory name, if not already exists. |
ResultIterator<org.xmldb.api.modules.XMLResource> |
executePredefinedQuery(String name,
ParameterValue... parameterValues)
Execute predefined query. |
HashSet<String> |
getIdentifierByFile(String file)
Checks identity of an inserted object. |
HashSet<String> |
getIdentifierByTemporyResource(String tempId,
String dir)
|
HashSet<String> |
getIdentifierByTemporyResource(org.xmldb.api.modules.XMLResource resource,
String dir)
|
HashSet<String> |
getIdentifierByXQuery(String xquery)
This methods returns a set of document identifiers that correspond to the result of the xquery. |
String |
getIdentifierOfResource(org.xmldb.api.modules.XMLResource resource)
Get identifier of specific resource. |
ArrayList<String> |
getIdentifiesByRelation(String id,
String relation)
Get referenced identifiers of a specified relationship based on the entity with specified id. |
ArrayList<String> |
getIdentifiesByRelation(org.xmldb.api.modules.XMLResource resource,
String relation)
Get referenced identifiers of a specified relationship based on a specified entity. |
String |
getLocalDirectoryName(String docId)
Get the local name of the collection storing a specific entity. |
org.xmldb.api.base.Collection |
getOrCreateCollection(String dir)
Get or create a database collection. |
ArrayList<String> |
getRelationships(String id)
Get the provided relationships of an object specified by its identifier. |
ArrayList<String> |
getRelationships(org.xmldb.api.modules.XMLResource resource)
Get the provided relationships of a persistent resource. |
ArrayList<org.xmldb.api.modules.XMLResource> |
getResourcesByRelation(String id,
String relation)
Get referenced objects of a specified relationship based on the entity with specified id. |
ArrayList<org.xmldb.api.modules.XMLResource> |
getResourcesByRelation(org.xmldb.api.modules.XMLResource resource,
String relation)
Get referenced objects of a specified relationship based on a specified entity. |
protected void |
initHook()
Implementation of the init method in derived classes. |
void |
insertRelationship(String fromId,
String fromConcept,
String relationshipName,
String toId,
String toConcept)
Stores a relationship with specific name between two documents specified by their ids. |
protected void |
loadPredefinedQueriesIntoCache(CacheManagement cacheManagement)
Load the predefined queries into the registry cache management. |
org.xmldb.api.modules.XMLResource |
lookup(String docId)
Lookup a specific XML resource by its document identifier. |
org.xmldb.api.modules.XMLResource |
lookup(String docId,
String type)
Lookup a specific XML resource by its document identifier and the directoryPath it belongs to. |
ResultIterator<org.xmldb.api.modules.XMLResource> |
lookupByDirectory(String dir)
Returns documents (resources) that are stored in the specified directory. |
ArrayList<org.xmldb.api.modules.XMLResource> |
lookupByFile(String file)
|
ArrayList<org.xmldb.api.modules.XMLResource> |
lookupByTemporaryResource(org.xmldb.api.modules.XMLResource resource,
String dir)
|
ResultIterator<org.xmldb.api.modules.XMLResource> |
query(org.xmldb.api.base.Collection collection,
String xquery)
Execute an xquery statement on the registry. |
ResultIterator<org.xmldb.api.modules.XMLResource> |
query(String xquery)
Execute an xquery statement on the registry. |
void |
registerPredefinedQuery(String name,
String query,
String... parameterNames)
Register a predefined query expression with the database. |
void |
removeAllDocumentsFromRegistry(String directoryPath)
Removes all resources from the registry specified by the directory. |
void |
removeDocumentFromRegistry(String directoryPath,
String id)
Remove a resource (xml document) from a specified collection. |
void |
resetPredefinedQueries()
Reset the predefined queries. |
void |
setPermission(String directoryPath,
String str)
Change the permissions of a specified directory. |
void |
setPermission(String directoryPath,
String resourceName,
String str)
Change the permissions of a resource under the specified directory. |
String |
storeDocumentInRegistry(String directoryPath,
Document content,
String id)
Stores a resource (dom) in the registry. |
String |
storeDocumentInRegistry(String directoryPath,
File file,
String id)
Stores a resource (xml document) that is specified by a file. |
String |
storeDocumentInRegistry(String directoryPath,
String filename,
String id)
Stores a resource (xml document) that is specified by a file. |
String |
storeDocumentInRegistry(String directoryPath,
URI uri,
String id)
Stores a resource (xml document) that is specified by a URI. |
void |
storePredefinedQuery(String name,
String query,
String... parameterNames)
Stores a predefined query in the database. |
String |
storeStringDocumentInRegistry(String directoryPath,
String content,
String id)
Stores a resource (xml document) that is specified by a string. |
| Methods inherited from class uk.ac.soton.itinnovation.registry.component.xml.db.XmlDbAccessAdapter |
|---|
getCacheManagement, init, loadRegistyDomainModelIntoCache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
protected final void initHook()
throws ExceptionInInitializerError
XmlDbAccessAdapter
initHook in class XmlDbAccessAdapter<org.xmldb.api.modules.XMLResource>ExceptionInInitializerError
public final boolean createCollection(String dir)
throws DatabaseException
XmlDbAccess
createCollection in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>dir - dir has to start with an '/'
DatabaseException
public final org.xmldb.api.base.Collection getOrCreateCollection(String dir)
throws DatabaseException
dir -
DatabaseException
public final String storeDocumentInRegistry(String directoryPath,
String filename,
String id)
throws DatabaseException,
IOException
XmlDbAccess
storeDocumentInRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>directoryPath - concept under which the document is stored (beginning with '/')id - identifier of the resource. If null then a new identifier will be generated.
DatabaseException
IOException
public final String storeDocumentInRegistry(String directoryPath,
URI uri,
String id)
throws DatabaseException,
IOException
XmlDbAccess
storeDocumentInRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>directoryPath - concept under which the document is stored (beginning with '/')id - identifier of the resource. If null then a new identifier will be generated.
DatabaseException
IOException
public final String storeDocumentInRegistry(String directoryPath,
File file,
String id)
throws DatabaseException,
IOException
XmlDbAccess
storeDocumentInRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>directoryPath - concept under which the document is stored (beginning with '/')id - identifier of the resource. If null then a new identifier will be generated.
DatabaseException
IOException
public final String storeStringDocumentInRegistry(String directoryPath,
String content,
String id)
throws DatabaseException,
IOException
XmlDbAccess
storeStringDocumentInRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>directoryPath - concept under which the document is stored (beginning with '/')content - xml contentid - identifier of the resource. If null then a new identifier will be generated.
DatabaseException
IOException
public final String storeDocumentInRegistry(String directoryPath,
Document content,
String id)
throws DatabaseException,
IOException
XmlDbAccess
storeDocumentInRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
IOException
public final void removeDocumentFromRegistry(String directoryPath,
String id)
throws DatabaseException
XmlDbAccess
removeDocumentFromRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>directoryPath - directory under which the document is stored (beginning with '/')
DatabaseException
public final void removeAllDocumentsFromRegistry(String directoryPath)
throws DatabaseException
XmlDbAccess
removeAllDocumentsFromRegistry in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final void insertRelationship(String fromId,
String fromConcept,
String relationshipName,
String toId,
String toConcept)
throws DatabaseException
XmlDbAccess
insertRelationship in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ArrayList<String> getRelationships(String id)
throws DatabaseException
XmlDbAccess
getRelationships in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ArrayList<String> getRelationships(org.xmldb.api.modules.XMLResource resource)
throws DatabaseException
XmlDbAccess
getRelationships in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ArrayList<String> getIdentifiesByRelation(String id,
String relation)
throws DatabaseException
XmlDbAccess
getIdentifiesByRelation in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ArrayList<String> getIdentifiesByRelation(org.xmldb.api.modules.XMLResource resource,
String relation)
throws DatabaseException
XmlDbAccess
getIdentifiesByRelation in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ArrayList<org.xmldb.api.modules.XMLResource> getResourcesByRelation(String id,
String relation)
throws DatabaseException
XmlDbAccess
getResourcesByRelation in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ArrayList<org.xmldb.api.modules.XMLResource> getResourcesByRelation(org.xmldb.api.modules.XMLResource resource,
String relation)
throws DatabaseException
XmlDbAccess
getResourcesByRelation in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ResultIterator<org.xmldb.api.modules.XMLResource> executePredefinedQuery(String name,
ParameterValue... parameterValues)
throws DatabaseException
XmlDbAccess
executePredefinedQuery in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>name - name under with the query is stored.
DatabaseException
public final String getLocalDirectoryName(String docId)
throws DatabaseException,
AccessException
XmlDbAccess
getLocalDirectoryName in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
AccessException
public final org.xmldb.api.modules.XMLResource lookup(String docId)
throws DatabaseException
XmlDbAccess
lookup in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final org.xmldb.api.modules.XMLResource lookup(String docId,
String type)
throws DatabaseException
XmlDbAccess
lookup in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>type - (begins with '/')
DatabaseException
public final ArrayList<org.xmldb.api.modules.XMLResource> lookupByFile(String file)
throws DatabaseException,
IOException
lookupByFile in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
IOException
public final ArrayList<org.xmldb.api.modules.XMLResource> lookupByTemporaryResource(org.xmldb.api.modules.XMLResource resource,
String dir)
throws DatabaseException
lookupByTemporaryResource in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ResultIterator<org.xmldb.api.modules.XMLResource> lookupByDirectory(String dir)
throws DatabaseException
XmlDbAccess
lookupByDirectory in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final HashSet<String> getIdentifierByFile(String file)
throws DatabaseException,
IOException
XmlDbAccess
getIdentifierByFile in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
IOException
public HashSet<String> getIdentifierByTemporyResource(String tempId,
String dir)
throws DatabaseException
getIdentifierByTemporyResource in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>tempId - identifier of temporal resourcedir - search directory
DatabaseException
public HashSet<String> getIdentifierByTemporyResource(org.xmldb.api.modules.XMLResource resource,
String dir)
throws DatabaseException
getIdentifierByTemporyResource in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>dir - search directory
DatabaseException
public final String getIdentifierOfResource(org.xmldb.api.modules.XMLResource resource)
throws DatabaseException
XmlDbAccess
getIdentifierOfResource in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final HashSet<String> getIdentifierByXQuery(String xquery)
throws DatabaseException
XmlDbAccess
getIdentifierByXQuery in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public ResultIterator<org.xmldb.api.modules.XMLResource> query(String xquery)
throws DatabaseException
XmlDbAccess
query in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseException
public final ResultIterator<org.xmldb.api.modules.XMLResource> query(org.xmldb.api.base.Collection collection,
String xquery)
throws DatabaseException
collection - query runs over the specified collection.xquery -
DatabaseException
public final void storePredefinedQuery(String name,
String query,
String... parameterNames)
throws DatabaseException
XmlDbAccess
storePredefinedQuery in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>name - name of the queryquery - xquery expressionparameterNames - parameters used in the query
DatabaseException
public final void registerPredefinedQuery(String name,
String query,
String... parameterNames)
throws DatabaseException
XmlDbAccess
registerPredefinedQuery in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>DatabaseExceptionpublic void resetPredefinedQueries()
XmlDbAccess
resetPredefinedQueries in interface XmlDbAccess<org.xmldb.api.modules.XMLResource>protected void loadPredefinedQueriesIntoCache(CacheManagement cacheManagement)
XmlDbAccessAdapter
loadPredefinedQueriesIntoCache in class XmlDbAccessAdapter<org.xmldb.api.modules.XMLResource>
public void setPermission(String directoryPath,
String resourceName,
String str)
throws PermissionManagementException
PermissionManagement
setPermission in interface PermissionManagementPermissionManagementException
public void setPermission(String directoryPath,
String str)
throws PermissionManagementException
PermissionManagement
setPermission in interface PermissionManagementPermissionManagementException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||