|
Xindice API version 1.2m1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xindice.client.xmldb.CommonConfigurable org.apache.xindice.client.xmldb.XindiceCollection org.apache.xindice.client.xmldb.embed.CollectionImpl
Implementation of XML:DB's Collection
interface using
direct access to interact with database server
Field Summary |
Fields inherited from class org.apache.xindice.client.xmldb.XindiceCollection |
collPath, QUERY_NS, services |
Constructor Summary | |
CollectionImpl(Database db,
String collPath)
Creates new CollectionImpl instance representing connection
to server collection. |
Method Summary | |
void |
close()
Releases all resources consumed by the Collection . |
org.xmldb.api.base.Collection |
createCollection(String name)
Creates a new child collection in this collection |
org.xmldb.api.base.Collection |
createCollection(String path,
org.w3c.dom.Document configuration)
Creates a new child collection. |
String |
createId()
Creates a new unique ID within the context of the Collection |
void |
createIndexer(org.w3c.dom.Document configuration)
Creates a new Indexer for this collection. |
void |
dropIndexer(String name)
Drops the indexer from the collection |
org.xmldb.api.base.Collection |
getChildCollection(String name)
Returns a Collection instance for the requested child collection
if it exists. |
int |
getChildCollectionCount()
Returns the number of child collections under this Collection or 0 if no child collections exist. |
MetaData |
getMetaData(String id)
Returns MetaData object for the specified document or the current
collection |
org.xmldb.api.base.Collection |
getParentCollection()
Returns the parent collection for this collection or null if no parent collection exists. |
org.xmldb.api.base.Resource |
getResource(String id)
Retrieves a Resource from the database. |
int |
getResourceCount()
Returns the number of resources currently stored in this collection or 0 if the collection is empty. |
String |
getURI()
Returns XML:DB URI that would retrieve this collection |
boolean |
isOpen()
Checks if the collection is still open. |
String[] |
listChildCollections()
Returns a list of collection names naming all child collections of the current collection. |
String[] |
listIndexers()
Returns a list of all indexers for this collection. |
String[] |
listResources()
Returns a list of the ids for all resources stored in the collection. |
org.xmldb.api.base.ResourceSet |
query(String name,
String queryLang,
String query,
Hashtable nsMap)
Queries a specific document or the entire collection and returns result |
void |
removeCollection(String childName)
Removes child collection from this collection |
void |
removeResource(org.xmldb.api.base.Resource res)
Removes the Resource from the database. |
void |
setMetaData(String id,
MetaData meta)
Updates MetaData object for the specified document or the current
collection |
void |
shutdown()
Shutsdown the Database instance |
void |
storeResource(org.xmldb.api.base.Resource res)
Stores the provided resource into the database. |
Methods inherited from class org.apache.xindice.client.xmldb.XindiceCollection |
checkOpen, createResource, getCanonicalName, getName, getService, getServices, query, registerService |
Methods inherited from class org.apache.xindice.client.xmldb.CommonConfigurable |
getProperty, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xmldb.api.base.Configurable |
getProperty, setProperty |
Constructor Detail |
public CollectionImpl(Database db, String collPath) throws org.xmldb.api.base.XMLDBException
CollectionImpl
instance representing connection
to server collection.
db
- Database this collection resides incollPath
- Canonical path of this collection (including database name)
org.xmldb.api.base.XMLDBException
- thrown if a connection could not be established,
because of URL syntax errors, or connection failure, or if no
collection with path collPath
could be located.Method Detail |
public org.xmldb.api.base.Resource getResource(String id) throws org.xmldb.api.base.XMLDBException
Resource
from the database. If the
Resource
could not be
located a null value will be returned.
id
- the unique id for the requested resource.
Resource
instance.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public int getResourceCount() throws org.xmldb.api.base.XMLDBException
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public void storeResource(org.xmldb.api.base.Resource res) throws org.xmldb.api.base.XMLDBException
res
- the resource to store in the database.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.INVALID_RESOURCE
if the Resource
is
not valid.
ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public boolean isOpen()
XindiceCollection
isOpen
in interface org.xmldb.api.base.Collection
isOpen
in class XindiceCollection
public String getURI()
XindiceCollection
getURI
in class XindiceCollection
public org.xmldb.api.base.Collection getChildCollection(String name) throws org.xmldb.api.base.XMLDBException
Collection
instance for the requested child collection
if it exists.
name
- the name of the child collection to retrieve.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public String createId() throws org.xmldb.api.base.XMLDBException
Collection
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public void close() throws org.xmldb.api.base.XMLDBException
Collection
.
The close
method must
always be called when use of a Collection
is complete. It is
not safe to use a Collection
after the close
method has been called.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public org.xmldb.api.base.Collection getParentCollection() throws org.xmldb.api.base.XMLDBException
Collection
instance.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public void removeResource(org.xmldb.api.base.Resource res) throws org.xmldb.api.base.XMLDBException
Resource
from the database.
res
- the resource to remove.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.INVALID_RESOURCE
if the Resource
is
not valid.ErrorCodes.NO_SUCH_RESOURCE
if the Resource
is
not known to this Collection
.
ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public String[] listChildCollections() throws org.xmldb.api.base.XMLDBException
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public int getChildCollectionCount() throws org.xmldb.api.base.XMLDBException
Collection
or 0 if no child collections exist.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public String[] listResources() throws org.xmldb.api.base.XMLDBException
Resource
s in the collection.
org.xmldb.api.base.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.COLLECTION_CLOSED
if the close
method has been called on the Collection
public org.xmldb.api.base.ResourceSet query(String name, String queryLang, String query, Hashtable nsMap) throws org.xmldb.api.base.XMLDBException
XindiceCollection
query
in class XindiceCollection
name
- name of document to query, or null
to query
entire collection.queryLang
- XUpdate
or XPath
.query
- the text of the query statementnsMap
- namespace bindings to use when evaluating query
org.xmldb.api.base.XMLDBException
- thrown in case of invalid query or other errorpublic org.xmldb.api.base.Collection createCollection(String name) throws org.xmldb.api.base.XMLDBException
XindiceCollection
createCollection
in class XindiceCollection
name
- The name for new child collection
org.xmldb.api.base.XMLDBException
- thrown if collection creation fails for some
reasonpublic org.xmldb.api.base.Collection createCollection(String path, org.w3c.dom.Document configuration) throws org.xmldb.api.base.XMLDBException
XindiceCollection
createCollection
in class XindiceCollection
path
- The path for new child collection
org.xmldb.api.base.XMLDBException
- thrown if collection creation fails for some
reasonpublic void removeCollection(String childName) throws org.xmldb.api.base.XMLDBException
XindiceCollection
removeCollection
in class XindiceCollection
childName
- name of child collection
org.xmldb.api.base.XMLDBException
- thrown if collection creation fails for some
reasonpublic String[] listIndexers() throws org.xmldb.api.base.XMLDBException
XindiceCollection
listIndexers
in class XindiceCollection
org.xmldb.api.base.XMLDBException
public void createIndexer(org.w3c.dom.Document configuration) throws org.xmldb.api.base.XMLDBException
XindiceCollection
createIndexer
in class XindiceCollection
configuration
- The configuration to use for this indexer.
org.xmldb.api.base.XMLDBException
public void dropIndexer(String name) throws org.xmldb.api.base.XMLDBException
XindiceCollection
dropIndexer
in class XindiceCollection
name
- The name of the indexer to drop.
org.xmldb.api.base.XMLDBException
public void shutdown() throws org.xmldb.api.base.XMLDBException
XindiceCollection
shutdown
in class XindiceCollection
org.xmldb.api.base.XMLDBException
public MetaData getMetaData(String id) throws org.xmldb.api.base.XMLDBException
XindiceCollection
MetaData
object for the specified document or the current
collection
getMetaData
in class XindiceCollection
id
- name of document to get meta, or null
to get meta
of the collection.
org.xmldb.api.base.XMLDBException
- thrown if unable to obtain meta informationpublic void setMetaData(String id, MetaData meta) throws org.xmldb.api.base.XMLDBException
XindiceCollection
MetaData
object for the specified document or the current
collection
setMetaData
in class XindiceCollection
id
- name of document to update meta, or null
to update meta
of the collection.meta
- meta data object
org.xmldb.api.base.XMLDBException
- thrown if unable to obtain meta information
|
Xindice API version 1.2m1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |