| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.xmldb.api.sdk.SimpleConfigurableorg.xmldb.api.sdk.SimpleCollectionorg.xmldb.api.reference.CollectionImplpublic class CollectionImplextends SimpleCollectionCollection is implemented as a directory in the file system.
Field Summary | |
protected File | |
Fields inherited from class org.xmldb.api.sdk.SimpleCollection | |
isOpen, services | |
Constructor Summary | |
| |
Method Summary | |
void |
|
String |
|
Resource |
|
Collection |
|
int |
|
String |
|
Collection |
|
Resource |
|
int |
|
String[] |
|
String[] |
|
void |
|
void |
|
protected void |
|
Methods inherited from class org.xmldb.api.sdk.SimpleCollection | |
checkOpen, close, createId, createResource, getChildCollection, getChildCollectionCount, getName, getParentCollection, getResource, getResourceCount, getService, getServices, isOpen, listChildCollections, listResources, registerService, removeResource, storeResource | |
Methods inherited from class org.xmldb.api.sdk.SimpleConfigurable | |
getProperty, setProperty | |
public void close()
throws XMLDBExceptionReleases all resources consumed by theCollection.
- Specified by:
- close in interface Collection
- Overrides:
- close in interface SimpleCollection
public String createId()
throws XMLDBExceptionCreates a new unique ID within the context of theCollection
- Specified by:
- createId in interface Collection
- Overrides:
- createId in interface SimpleCollection
- Returns:
- the created id as a string.
public Resource createResource(String id, String type) throws XMLDBException
Creates a new emptyResourcewith the provided id.
- Specified by:
- createResource in interface Collection
- Overrides:
- createResource in interface SimpleCollection
- Parameters:
id- the unique id to associate with the createdResource.type- theResourcetype to create.
- Returns:
- an empty
Resourceinstance.
public Collection getChildCollection(String name) throws XMLDBException
Returns aCollectioninstance for the requested child collection if it exists.
- Specified by:
- getChildCollection in interface Collection
- Overrides:
- getChildCollection in interface SimpleCollection
- Parameters:
name- the name of the child collection to retrieve.
- Returns:
- the requested child collection or null if it couldn't be found.
public int getChildCollectionCount()
throws XMLDBExceptionReturns the number of child collections under thisCollection.
- Specified by:
- getChildCollectionCount in interface Collection
- Overrides:
- getChildCollectionCount in interface SimpleCollection
- Returns:
- the number of child collections.
public String getName()
throws XMLDBExceptionReturns the name of the collection
- Specified by:
- getName in interface Collection
- Overrides:
- getName in interface SimpleCollection
- Returns:
- the name of the object.
public Collection getParentCollection() throws XMLDBException
Returns the parent collection for this collection or null if no parent collection exists.
- Specified by:
- getParentCollection in interface Collection
- Overrides:
- getParentCollection in interface SimpleCollection
- Returns:
- the parent
Collectioninstance.
public Resource getResource(String id) throws XMLDBException
Retrieves aResourcefrom the database.
- Specified by:
- getResource in interface Collection
- Overrides:
- getResource in interface SimpleCollection
- Parameters:
id- the unique id for the requested resource.
- Returns:
- The retrieved
Resourceinstance.
public int getResourceCount()
throws XMLDBExceptionReturns the number of resources currently stored in this collection or 0 if the collection is empty.
- Specified by:
- getResourceCount in interface Collection
- Overrides:
- getResourceCount in interface SimpleCollection
- Returns:
- the number of resources in the collection.
public String[] listChildCollections()
throws XMLDBExceptionReturns a list of collection names naming all child collections of the current collection.
- Specified by:
- listChildCollections in interface Collection
- Overrides:
- listChildCollections in interface SimpleCollection
- Returns:
- an array containing collection names for all child collections.
public String[] listResources()
throws XMLDBExceptionReturns a list of the ids for all resources stored in the collection.
- Specified by:
- listResources in interface Collection
- Overrides:
- listResources in interface SimpleCollection
- Returns:
- a string array containing the names for all
Resources in the collection.
public void removeResource(Resource res) throws XMLDBException
Removes theResourcefrom the database.
- Specified by:
- removeResource in interface Collection
- Overrides:
- removeResource in interface SimpleCollection
- Parameters:
res- the resource to remove.
public void storeResource(Resource res) throws XMLDBException
Stores the provided resource into the database.
- Specified by:
- storeResource in interface Collection
- Overrides:
- storeResource in interface SimpleCollection
- Parameters:
res- the resource to store in the database.
protected void validateResource(Resource res) throws XMLDBException
Makes sure the resource is valid.