org.exist.xmldb
Class RemoteCollection

java.lang.Object
  extended by org.exist.xmldb.RemoteCollection
All Implemented Interfaces:
CollectionImpl, Collection, Configurable

public class RemoteCollection
extends Object
implements CollectionImpl

A remote implementation of the Collection interface. This implementation communicates with the server through the XMLRPC protocol.

Author:
wolf Updated Andy Foster - Updated code to allow child collection cache to resync with the remote collection.

Method Summary
 void close()
           
 String createId()
           
 Resource createResource(String id, String type)
           
 Collection getChildCollection(String name)
           
 Collection getChildCollection(XmldbURI name)
           
 int getChildCollectionCount()
           
 String[] getChildCollections()
           
 Date getCreationTime()
          Returns the time of creation of the collection.
 String getName()
           
 Collection getParentCollection()
           
 String getPath()
           
 XmldbURI getPathURI()
           
 Properties getProperties()
           
 String getProperty(String property)
           
 Resource getResource(String name)
           
 int getResourceCount()
           
 String[] getResources()
           
 Service getService(String name, String version)
           
 Service[] getServices()
           
 Long getSubCollectionCreationTime(String name)
           
 Permission getSubCollectionPermissions(String name)
           
 Permission getSubResourcePermissions(String name)
           
static RemoteCollection instance(XmlRpcClient xmlRpcClient, RemoteCollection parent, XmldbURI path)
           
static RemoteCollection instance(XmlRpcClient xmlRpcClient, XmldbURI path)
           
 boolean isOpen()
           
 boolean isRemoteCollection()
           
 String[] listChildCollections()
          Returns a list of collection names naming all child collections of the current collection.
 String[] listResources()
           
 void registerService(Service serv)
           
 void removeResource(Resource res)
           
 void setProperty(String property, String value)
           
 void setTriggersEnabled(boolean triggersEnabled)
           
 void storeResource(Resource res)
           
 void storeResource(Resource res, Date a, Date b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static RemoteCollection instance(XmlRpcClient xmlRpcClient,
                                        XmldbURI path)
                                 throws XMLDBException
Throws:
XMLDBException

instance

public static RemoteCollection instance(XmlRpcClient xmlRpcClient,
                                        RemoteCollection parent,
                                        XmldbURI path)
                                 throws XMLDBException
Throws:
XMLDBException

close

public void close()
           throws XMLDBException
Specified by:
close in interface Collection
Throws:
XMLDBException

createId

public String createId()
                throws XMLDBException
Specified by:
createId in interface Collection
Throws:
XMLDBException

createResource

public Resource createResource(String id,
                               String type)
                        throws XMLDBException
Specified by:
createResource in interface Collection
Throws:
XMLDBException

getChildCollection

public Collection getChildCollection(String name)
                              throws XMLDBException
Specified by:
getChildCollection in interface Collection
Throws:
XMLDBException

getChildCollection

public Collection getChildCollection(XmldbURI name)
                              throws XMLDBException
Throws:
XMLDBException

getChildCollectionCount

public int getChildCollectionCount()
                            throws XMLDBException
Specified by:
getChildCollectionCount in interface Collection
Throws:
XMLDBException

getName

public String getName()
               throws XMLDBException
Specified by:
getName in interface Collection
Throws:
XMLDBException

getParentCollection

public Collection getParentCollection()
                               throws XMLDBException
Specified by:
getParentCollection in interface Collection
Throws:
XMLDBException

getPath

public String getPath()
               throws XMLDBException
Throws:
XMLDBException

getPathURI

public XmldbURI getPathURI()
Specified by:
getPathURI in interface CollectionImpl

getProperty

public String getProperty(String property)
                   throws XMLDBException
Specified by:
getProperty in interface Configurable
Throws:
XMLDBException

getProperties

public Properties getProperties()

getResourceCount

public int getResourceCount()
                     throws XMLDBException
Specified by:
getResourceCount in interface Collection
Throws:
XMLDBException

getService

public Service getService(String name,
                          String version)
                   throws XMLDBException
Specified by:
getService in interface Collection
Throws:
XMLDBException

getServices

public Service[] getServices()
                      throws XMLDBException
Specified by:
getServices in interface Collection
Throws:
XMLDBException

isOpen

public boolean isOpen()
               throws XMLDBException
Specified by:
isOpen in interface Collection
Throws:
XMLDBException

listChildCollections

public String[] listChildCollections()
                              throws XMLDBException
Returns a list of collection names naming all child collections of the current collection. Only the name of the collection is returned - not the entire path to the collection.

Specified by:
listChildCollections in interface Collection
Returns:
Description of the Return Value
Throws:
XMLDBException - Description of the Exception

getChildCollections

public String[] getChildCollections()
                             throws XMLDBException
Specified by:
getChildCollections in interface CollectionImpl
Throws:
XMLDBException

listResources

public String[] listResources()
                       throws XMLDBException
Specified by:
listResources in interface Collection
Throws:
XMLDBException

getResources

public String[] getResources()
                      throws XMLDBException
Specified by:
getResources in interface CollectionImpl
Throws:
XMLDBException

getSubCollectionPermissions

public Permission getSubCollectionPermissions(String name)
                                       throws PermissionDeniedException,
                                              XMLDBException
Throws:
PermissionDeniedException
XMLDBException

getSubResourcePermissions

public Permission getSubResourcePermissions(String name)
                                     throws PermissionDeniedException,
                                            XMLDBException
Throws:
PermissionDeniedException
XMLDBException

getSubCollectionCreationTime

public Long getSubCollectionCreationTime(String name)
                                  throws XMLDBException
Throws:
XMLDBException

getResource

public Resource getResource(String name)
                     throws XMLDBException
Specified by:
getResource in interface Collection
Throws:
XMLDBException

registerService

public void registerService(Service serv)
                     throws XMLDBException
Throws:
XMLDBException

removeResource

public void removeResource(Resource res)
                    throws XMLDBException
Specified by:
removeResource in interface Collection
Throws:
XMLDBException

getCreationTime

public Date getCreationTime()
                     throws XMLDBException
Description copied from interface: CollectionImpl
Returns the time of creation of the collection.

Specified by:
getCreationTime in interface CollectionImpl
Throws:
XMLDBException

setProperty

public void setProperty(String property,
                        String value)
                 throws XMLDBException
Specified by:
setProperty in interface Configurable
Throws:
XMLDBException

storeResource

public void storeResource(Resource res)
                   throws XMLDBException
Specified by:
storeResource in interface Collection
Throws:
XMLDBException

storeResource

public void storeResource(Resource res,
                          Date a,
                          Date b)
                   throws XMLDBException
Specified by:
storeResource in interface CollectionImpl
Throws:
XMLDBException

isRemoteCollection

public boolean isRemoteCollection()
                           throws XMLDBException
Specified by:
isRemoteCollection in interface CollectionImpl
Throws:
XMLDBException

setTriggersEnabled

public void setTriggersEnabled(boolean triggersEnabled)
                        throws XMLDBException
Specified by:
setTriggersEnabled in interface CollectionImpl
Throws:
XMLDBException


Copyright (C) The eXist-db Project. All rights reserved.