|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.xmldb.RemoteCollection
public class RemoteCollection
A remote implementation of the Collection interface. This implementation communicates with the server through the XMLRPC protocol.
| Constructor Summary | |
|---|---|
RemoteCollection(org.apache.xmlrpc.XmlRpcClient client,
RemoteCollection parent,
XmldbURI path)
|
|
RemoteCollection(org.apache.xmlrpc.XmlRpcClient client,
XmldbURI path)
|
|
| Method Summary | |
|---|---|
void |
close()
Releases all resources consumed by the Collection. |
String |
createId()
Creates a new unique ID within the context of the Collection |
Resource |
createResource(String id,
String type)
Creates a new empty Resource with the provided id. |
Collection |
getChildCollection(String name)
Returns a Collection instance for the requested child collection
if it exists. |
Collection |
getChildCollection(XmldbURI name)
|
int |
getChildCollectionCount()
Returns the number of child collections under this Collection or 0 if no child collections exist. |
String[] |
getChildCollections()
|
Date |
getCreationTime()
Returns the time of creation of the collection. |
String |
getName()
Returns the name associated with the Collection instance. |
Collection |
getParentCollection()
Returns the parent collection for this collection or null if no parent collection exists. |
String |
getPath()
|
XmldbURI |
getPathURI()
|
Permission |
getPermissions()
|
Properties |
getProperties()
|
String |
getProperty(String property)
Returns the value of the property identified by name. |
Resource |
getResource(String name)
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[] |
getResources()
|
Service |
getService(String name,
String version)
Returns a Service instance for the requested service name and version. |
Service[] |
getServices()
Provides a list of all services known to the collection. |
XmldbURI |
getURI()
|
boolean |
isOpen()
Returns true if the Collection is open false otherwise. |
boolean |
isRemoteCollection()
|
String[] |
listChildCollections()
Returns a list of collection names naming all child collections of the current collection. |
String[] |
listResources()
Returns a list of the ids for all resources stored in the collection. |
void |
registerService(Service serv)
|
void |
removeChildCollection(String name)
|
void |
removeChildCollection(XmldbURI name)
|
void |
removeResource(Resource res)
Removes the Resource from the database. |
void |
setProperty(String property,
String value)
Sets the property name to have the value provided in
value. |
void |
storeResource(Resource res)
Stores the provided resource into the database. |
void |
storeResource(Resource res,
Date a,
Date b)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteCollection(org.apache.xmlrpc.XmlRpcClient client,
XmldbURI path)
throws XMLDBException
XMLDBException
public RemoteCollection(org.apache.xmlrpc.XmlRpcClient client,
RemoteCollection parent,
XmldbURI path)
throws XMLDBException
XMLDBException| Method Detail |
|---|
public void close()
throws XMLDBException
CollectionCollection.
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.
close in interface CollectionXMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.
public String createId()
throws XMLDBException
CollectionCollection
createId in interface CollectionXMLDBException - 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 Resource createResource(String id,
String type)
throws XMLDBException
CollectionResource with the provided id.
The type of Resource
returned is determined by the type parameter. The XML:DB API currently
defines "XMLResource" and "BinaryResource" as valid resource types.
The id provided must be unique within the scope of the
collection. If
id is null or its value is empty then an id is generated by
calling createId(). The
Resource created is not stored to the database until
storeResource() is called.
createResource in interface Collectionid - the unique id to associate with the created Resource.type - the Resource type to create.
Resource instance.
XMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.ErrorCodes.UNKNOWN_RESOURCE_TYPE if the type
parameter is not a known Resource type.
ErrorCodes.COLLECTION_CLOSED if the close
method has been called on the Collection
public Collection getChildCollection(String name)
throws XMLDBException
CollectionCollection instance for the requested child collection
if it exists.
getChildCollection in interface Collectionname - the name of the child collection to retrieve.
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 Collection getChildCollection(XmldbURI name)
throws XMLDBException
XMLDBException
public int getChildCollectionCount()
throws XMLDBException
CollectionCollection or 0 if no child collections exist.
getChildCollectionCount in interface CollectionXMLDBException - 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 getName()
throws XMLDBException
Collection
getName in interface CollectionXMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.
public Collection getParentCollection()
throws XMLDBException
Collection
getParentCollection in interface CollectionCollection instance.
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 getPath()
throws XMLDBException
XMLDBExceptionpublic XmldbURI getPathURI()
getPathURI in interface CollectionImpl
public String getProperty(String property)
throws XMLDBException
Configurablename.
getProperty in interface Configurableproperty - the name of the property to retrieve.
XMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.public Properties getProperties()
public int getResourceCount()
throws XMLDBException
Collection
getResourceCount in interface CollectionXMLDBException - 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 Service getService(String name,
String version)
throws XMLDBException
CollectionService instance for the requested service name and version. If
no Service exists for those parameters a null value is returned.
getService in interface Collectionname - Description of Parameterversion - Description of Parameter
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 Service[] getServices()
throws XMLDBException
Collection
getServices in interface CollectionService implementations.
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 boolean isOpen()
throws XMLDBException
CollectionCollection is open false otherwise.
Calling the close method on
Collection will result in isOpen
returning false. It is not safe to use Collection instances
that have been closed.
isOpen in interface CollectionCollection is open, false otherwise.
XMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.
public String[] listChildCollections()
throws XMLDBException
listChildCollections in interface CollectionXMLDBException - Description of the Exception
public String[] getChildCollections()
throws XMLDBException
getChildCollections in interface CollectionImplXMLDBException
public String[] listResources()
throws XMLDBException
Collection
listResources in interface CollectionResources in the collection.
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[] getResources()
throws XMLDBException
getResources in interface CollectionImplXMLDBException
public Resource getResource(String name)
throws XMLDBException
CollectionResource from the database. If the
Resource could not be
located a null value will be returned.
getResource in interface Collectionname - the unique id for the requested resource.
Resource instance.
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 registerService(Service serv)
throws XMLDBException
XMLDBException
public void removeChildCollection(String name)
throws XMLDBException
XMLDBException
public void removeChildCollection(XmldbURI name)
throws XMLDBException
XMLDBException
public void removeResource(Resource res)
throws XMLDBException
CollectionResource from the database.
removeResource in interface Collectionres - the resource to remove.
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 Date getCreationTime()
throws XMLDBException
CollectionImpl
getCreationTime in interface CollectionImplXMLDBException
public void setProperty(String property,
String value)
throws XMLDBException
Configurablename to have the value provided in
value.
setProperty in interface Configurableproperty - the name of the property to set.value - the value to set for the property.
XMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.
public void storeResource(Resource res)
throws XMLDBException
Collection
storeResource in interface Collectionres - the resource to store in the database.
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 void storeResource(Resource res,
Date a,
Date b)
throws XMLDBException
storeResource in interface CollectionImplXMLDBExceptionpublic Permission getPermissions()
public boolean isRemoteCollection()
throws XMLDBException
isRemoteCollection in interface CollectionImplXMLDBExceptionpublic XmldbURI getURI()
getURI in interface CollectionImpl
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||