org.exist.xmldb
Class LocalResourceSet

java.lang.Object
  extended byorg.exist.xmldb.LocalResourceSet
All Implemented Interfaces:
ResourceSet

public class LocalResourceSet
extends java.lang.Object
implements ResourceSet


Field Summary
protected  BrokerPool brokerPool
           
protected  LocalCollection collection
           
protected  java.util.Map properties
           
protected  java.util.Vector resources
           
 
Constructor Summary
LocalResourceSet(User user, BrokerPool pool, LocalCollection col)
           
LocalResourceSet(User user, BrokerPool pool, LocalCollection col, Value val, java.util.Map properties, java.lang.String sortExpr)
           
 
Method Summary
 void addResource(Resource resource)
          Adds a Resource instance to the set.
 void clear()
          Removes all Resource instances from the set.
 ResourceIterator getIterator()
          Returns an iterator over all Resource instances stored in the set.
 ResourceIterator getIterator(long start)
           
 Resource getMembersAsResource()
          Returns a Resource containing an XML representation of all resources stored in the set.
 Resource getResource(long pos)
          Returns the Resource instance stored at the index specified by index.
 long getSize()
          Gets the size attribute of the LocalResourceSet object
 void removeResource(long pos)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

brokerPool

protected BrokerPool brokerPool

collection

protected LocalCollection collection

resources

protected java.util.Vector resources

properties

protected java.util.Map properties
Constructor Detail

LocalResourceSet

public LocalResourceSet(User user,
                        BrokerPool pool,
                        LocalCollection col)

LocalResourceSet

public LocalResourceSet(User user,
                        BrokerPool pool,
                        LocalCollection col,
                        Value val,
                        java.util.Map properties,
                        java.lang.String sortExpr)
                 throws XMLDBException
Method Detail

addResource

public void addResource(Resource resource)
                 throws XMLDBException
Description copied from interface: ResourceSet
Adds a Resource instance to the set.

Specified by:
addResource in interface ResourceSet
Parameters:
resource - The Resource to add to the set.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

clear

public void clear()
           throws XMLDBException
Description copied from interface: ResourceSet
Removes all Resource instances from the set.

Specified by:
clear in interface ResourceSet
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getIterator

public ResourceIterator getIterator()
                             throws XMLDBException
Description copied from interface: ResourceSet
Returns an iterator over all Resource instances stored in the set.

Specified by:
getIterator in interface ResourceSet
Returns:
a ResourceIterator over all Resource instances in the set.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getIterator

public ResourceIterator getIterator(long start)
                             throws XMLDBException
Throws:
XMLDBException

getMembersAsResource

public Resource getMembersAsResource()
                              throws XMLDBException
Description copied from interface: ResourceSet
Returns a Resource containing an XML representation of all resources stored in the set.

TODO: Specify the schema used for this

Specified by:
getMembersAsResource in interface ResourceSet
Returns:
A Resource instance containing an XML representation of all set members.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getResource

public Resource getResource(long pos)
                     throws XMLDBException
Description copied from interface: ResourceSet
Returns the Resource instance stored at the index specified by index.

If the underlying implementation uses a paging or streaming optimization for retrieving Resource instances. Calling this method MAY result in a block until the requested Resource has been downloaded.

Specified by:
getResource in interface ResourceSet
Parameters:
pos - the index of the resource to retrieve.
Returns:
The Resource instance
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
ErrorCodes.NO_SUCH_RESOURCE if the index is out of range for the set.

getSize

public long getSize()
             throws XMLDBException
Gets the size attribute of the LocalResourceSet object

Specified by:
getSize in interface ResourceSet
Returns:
The size value
Throws:
XMLDBException - Description of the Exception

removeResource

public void removeResource(long pos)
                    throws XMLDBException
Description of the Method

Specified by:
removeResource in interface ResourceSet
Parameters:
pos - Description of the Parameter
Throws:
XMLDBException - Description of the Exception


Copyright (C) Wolfgang Meier. All rights reserved.