|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.exist.collections.Collection
org.exist.cluster.ClusterCollection
public final class ClusterCollection
Created by Francesco Mondora. TODO ... verify TRANSACTION IN CLUSTER
Field Summary |
---|
Fields inherited from class org.exist.collections.Collection |
---|
LENGTH_COLLECTION_ID, POOL_PARSER_THRESHOLD, UNKNOWN_COLLECTION_ID |
Fields inherited from interface org.exist.storage.cache.Cacheable |
---|
MAX_REF |
Constructor Summary | |
---|---|
ClusterCollection(Collection collection)
|
Method Summary | |
---|---|
BinaryDocument |
addBinaryResource(Txn transaction,
DBBroker broker,
XmldbURI name,
byte[] data,
String mimeType)
|
void |
addCollection(DBBroker broker,
Collection child,
boolean isNew)
Add a new sub-collection to the collection. |
void |
addDocument(Txn transaction,
DBBroker broker,
DocumentImpl doc)
Add a document to the collection. |
void |
addObserver(Observer o)
|
DocumentSet |
allDocs(DBBroker broker,
DocumentSet docs,
boolean recursive,
boolean checkPermissions)
|
boolean |
allowUnload()
Check if this collection may be safely removed from the cache. |
Iterator |
collectionIterator()
Return an iterator over all subcollections. |
int |
compareTo(Object obj)
|
int |
decReferenceCount()
Decrease the reference count of this object by one and return it. |
void |
deleteObservers()
|
boolean |
equals(Object obj)
|
long |
getAddress()
|
int |
getChildCollectionCount()
Return the number of child-collections managed by this collection. |
long |
getCreationTime()
|
List |
getDescendants(DBBroker broker,
User user)
Load all collections below this collections and return them in a List. |
DocumentImpl |
getDocument(DBBroker broker,
XmldbURI name)
Get a child resource as identified by path. |
int |
getDocumentCount()
Returns the number of documents in this collection. |
DocumentSet |
getDocuments(DBBroker broker,
DocumentSet docs,
boolean checkPermissions)
Add all documents to the specified document set. |
DocumentImpl |
getDocumentWithLock(DBBroker broker,
XmldbURI name)
Retrieve a child resource after putting a read lock on it. |
DocumentImpl |
getDocumentWithLock(DBBroker broker,
XmldbURI name,
int lockMode)
Retrieve a child resource after putting a read lock on it. |
int |
getId()
Get the internal id. |
long |
getKey()
Get a unique key for the object. |
Lock |
getLock()
|
XmldbURI |
getParentURI()
Returns the parent-collection. |
Permission |
getPermissions()
Gets the permissions attribute of the Collection object |
Permission |
getPermissionsNoLock()
|
int |
getReferenceCount()
Get the current reference count. |
int |
getTimestamp()
Get the current timestamp marker. |
XmldbURI |
getURI()
Get the name of this collection. |
boolean |
hasChildCollection(XmldbURI name)
|
boolean |
hasDocument(XmldbURI name)
Check if the collection has a child document. |
boolean |
hasSubcollection(XmldbURI name)
Check if the collection has a sub-collection. |
boolean |
hasSubcollectionNoLock(XmldbURI name)
|
int |
incReferenceCount()
Increase the reference count of this object by one and return it. |
boolean |
isDirty()
|
Iterator |
iterator(DBBroker broker)
Returns an iterator on the child-documents in this collection. |
void |
read(DBBroker broker,
VariableByteInput istream)
Read collection contents from the stream. |
void |
release(int mode)
Closes the collection, i.e. |
void |
releaseDocument(DocumentImpl doc)
Release any locks held on the document. |
void |
releaseDocument(DocumentImpl doc,
int mode)
Release any locks held on the document. |
void |
removeBinaryResource(Txn transaction,
DBBroker broker,
DocumentImpl doc)
|
void |
removeBinaryResource(Txn transaction,
DBBroker broker,
XmldbURI docname)
|
void |
removeCollection(XmldbURI name)
Remove the specified sub-collection. |
void |
removeXMLResource(Txn transaction,
DBBroker broker,
XmldbURI docURI)
Remove the specified document from the collection. |
void |
setAddress(long addr)
Set the internal storage address of the collection data. |
void |
setCreationTime(long ms)
|
void |
setId(int id)
|
void |
setPermissions(int mode)
|
void |
setPermissions(Permission permissions)
Set permissions for the collection. |
void |
setPermissions(String mode)
|
void |
setReader(XMLReader reader)
set user-defined Reader |
void |
setReferenceCount(int count)
Set the reference count of this object. |
void |
setTimestamp(int timestamp)
Set the timestamp marker. |
void |
setTriggersEnabled(boolean enabled)
|
void |
store(Txn transaction,
DBBroker broker,
IndexInfo info,
InputSource source,
boolean privileged)
This method is used by the XML RPC client. |
void |
store(Txn txn,
DBBroker broker,
IndexInfo info,
Node node,
boolean privileged)
Stores an XML document in the database. |
void |
store(Txn txn,
DBBroker broker,
IndexInfo info,
String data,
boolean privileged)
Stores an XML document in the database. |
boolean |
sync(boolean syncJournal)
Called before the object is released by the cache. |
String |
toString()
|
void |
update(Collection child)
Update the specified child-collection. |
IndexInfo |
validateXMLResource(Txn txn,
DBBroker broker,
XmldbURI name,
InputSource source)
Validates an XML document et prepares it for further storage. |
IndexInfo |
validateXMLResource(Txn txn,
DBBroker broker,
XmldbURI name,
Node node)
Validates an XML document et prepares it for further storage. |
IndexInfo |
validateXMLResource(Txn txn,
DBBroker broker,
XmldbURI name,
String data)
Validates an XML document et prepares it for further storage. |
void |
write(DBBroker broker,
VariableByteOutputStream ostream)
Write collection contents to stream. |
Methods inherited from class org.exist.collections.Collection |
---|
addBinaryResource, addBinaryResource, addBinaryResource, allDocs, allDocs, getConfiguration, getDocumentNoLock, getDocuments, getFulltextIndexConfiguration, getIndexByPathConfiguration, getIndexByQNameConfiguration, getIndexConfiguration, getMemorySize, isTempCollection, setConfigEnabled, setPath, unlinkDocument |
Methods inherited from class java.util.Observable |
---|
countObservers, deleteObserver, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClusterCollection(Collection collection)
Method Detail |
---|
public void store(Txn txn, DBBroker broker, IndexInfo info, String data, boolean privileged) throws EXistException, PermissionDeniedException, TriggerException, SAXException, LockException
Collection
Collection.validateXMLResourceInternal(org.exist.storage.txn.Txn,
org.exist.storage.DBBroker, org.exist.xmldb.XmldbURI, CollectionConfiguration, org.exist.collections.Collection.ValidateBlock)
should have been called previously in order to acquire a write lock for the document. Launches the finish trigger.
store
in class Collection
EXistException
PermissionDeniedException
TriggerException
SAXException
LockException
public void removeXMLResource(Txn transaction, DBBroker broker, XmldbURI docURI) throws PermissionDeniedException, TriggerException, LockException
Collection
removeXMLResource
in class Collection
PermissionDeniedException
TriggerException
LockException
public void store(Txn transaction, DBBroker broker, IndexInfo info, InputSource source, boolean privileged) throws EXistException, PermissionDeniedException, TriggerException, SAXException, LockException
store
in class Collection
broker
- info
- source
- privileged
-
EXistException
PermissionDeniedException
TriggerException
SAXException
LockException
public BinaryDocument addBinaryResource(Txn transaction, DBBroker broker, XmldbURI name, byte[] data, String mimeType) throws EXistException, PermissionDeniedException, LockException, TriggerException
addBinaryResource
in class Collection
EXistException
PermissionDeniedException
LockException
TriggerException
public Lock getLock()
getLock
in class Collection
public void addCollection(DBBroker broker, Collection child, boolean isNew)
Collection
addCollection
in class Collection
public void removeCollection(XmldbURI name) throws LockException
Collection
removeCollection
in class Collection
name
- Description of the Parameter
LockException
public boolean hasChildCollection(XmldbURI name)
hasChildCollection
in class Collection
public void release(int mode)
Collection
release
in class Collection
public void update(Collection child)
Collection
update
in class Collection
public void addDocument(Txn transaction, DBBroker broker, DocumentImpl doc)
Collection
addDocument
in class Collection
public Iterator collectionIterator()
Collection
collectionIterator
in class Collection
public List getDescendants(DBBroker broker, User user)
Collection
getDescendants
in class Collection
public DocumentSet allDocs(DBBroker broker, DocumentSet docs, boolean recursive, boolean checkPermissions)
allDocs
in class Collection
public DocumentSet getDocuments(DBBroker broker, DocumentSet docs, boolean checkPermissions)
Collection
getDocuments
in class Collection
public boolean allowUnload()
Collection
allowUnload
in interface Cacheable
allowUnload
in class Collection
public int compareTo(Object obj)
compareTo
in interface Comparable
compareTo
in class Collection
public boolean equals(Object obj)
equals
in class Collection
public int getChildCollectionCount()
Collection
getChildCollectionCount
in class Collection
public DocumentImpl getDocument(DBBroker broker, XmldbURI name)
Collection
getDocument
in class Collection
name
- The name of the document (without collection path)
public DocumentImpl getDocumentWithLock(DBBroker broker, XmldbURI name) throws LockException
Collection
getDocumentWithLock
in class Collection
LockException
public DocumentImpl getDocumentWithLock(DBBroker broker, XmldbURI name, int lockMode) throws LockException
Collection
getDocumentWithLock
in class Collection
LockException
public void releaseDocument(DocumentImpl doc)
Collection
releaseDocument
in class Collection
public void releaseDocument(DocumentImpl doc, int mode)
Collection
releaseDocument
in class Collection
public int getDocumentCount()
Collection
getDocumentCount
in class Collection
public int getId()
Collection
getId
in class Collection
public XmldbURI getURI()
Collection
getURI
in class Collection
public XmldbURI getParentURI()
Collection
getParentURI
in class Collection
public Permission getPermissions()
Collection
getPermissions
in class Collection
public Permission getPermissionsNoLock()
getPermissionsNoLock
in class Collection
public boolean hasDocument(XmldbURI name)
Collection
hasDocument
in class Collection
name
- the name (without path) of the document
public boolean hasSubcollection(XmldbURI name)
Collection
hasSubcollection
in class Collection
name
- the name of the subcollection (without path).
public boolean hasSubcollectionNoLock(XmldbURI name)
hasSubcollectionNoLock
in class Collection
public Iterator iterator(DBBroker broker)
Collection
iterator
in class Collection
public void read(DBBroker broker, VariableByteInput istream) throws IOException
Collection
read
in class Collection
IOException
public void removeBinaryResource(Txn transaction, DBBroker broker, XmldbURI docname) throws PermissionDeniedException, LockException, TriggerException
removeBinaryResource
in class Collection
PermissionDeniedException
LockException
TriggerException
public void removeBinaryResource(Txn transaction, DBBroker broker, DocumentImpl doc) throws PermissionDeniedException, LockException, TriggerException
removeBinaryResource
in class Collection
PermissionDeniedException
LockException
TriggerException
public IndexInfo validateXMLResource(Txn txn, DBBroker broker, XmldbURI name, InputSource source) throws EXistException, PermissionDeniedException, TriggerException, SAXException, LockException, IOException
Collection
validateXMLResource
in class Collection
IndexInfo
with a write lock on the document.
EXistException
PermissionDeniedException
TriggerException
SAXException
LockException
IOException
public IndexInfo validateXMLResource(Txn txn, DBBroker broker, XmldbURI name, String data) throws EXistException, PermissionDeniedException, TriggerException, SAXException, LockException, IOException
Collection
validateXMLResource
in class Collection
IndexInfo
with a write lock on the document.
EXistException
PermissionDeniedException
TriggerException
SAXException
LockException
IOException
public IndexInfo validateXMLResource(Txn txn, DBBroker broker, XmldbURI name, Node node) throws EXistException, PermissionDeniedException, TriggerException, SAXException, LockException, IOException
Collection
validateXMLResource
in class Collection
IndexInfo
with a write lock on the document.
EXistException
PermissionDeniedException
TriggerException
SAXException
LockException
IOException
public void store(Txn txn, DBBroker broker, IndexInfo info, Node node, boolean privileged) throws EXistException, PermissionDeniedException, TriggerException, SAXException, LockException
Collection
Collection.validateXMLResourceInternal(org.exist.storage.txn.Txn,
org.exist.storage.DBBroker, org.exist.xmldb.XmldbURI, CollectionConfiguration, org.exist.collections.Collection.ValidateBlock)
should have been called previously in order to acquire a write lock for the document. Launches the finish trigger.
store
in class Collection
EXistException
PermissionDeniedException
TriggerException
SAXException
LockException
public void setId(int id)
setId
in class Collection
public void setPermissions(int mode) throws LockException
setPermissions
in class Collection
LockException
public void setPermissions(String mode) throws SyntaxException, LockException
setPermissions
in class Collection
SyntaxException
LockException
public void setPermissions(Permission permissions) throws LockException
Collection
setPermissions
in class Collection
LockException
public void write(DBBroker broker, VariableByteOutputStream ostream) throws IOException
Collection
write
in class Collection
IOException
public void setAddress(long addr)
Collection
setAddress
in class Collection
public long getAddress()
getAddress
in class Collection
public void setCreationTime(long ms)
setCreationTime
in class Collection
public long getCreationTime()
getCreationTime
in class Collection
public void setTriggersEnabled(boolean enabled)
setTriggersEnabled
in class Collection
public void setReader(XMLReader reader)
Collection
setReader
in class Collection
public void addObserver(Observer o)
addObserver
in class Collection
public void deleteObservers()
deleteObservers
in class Collection
public long getKey()
Cacheable
getKey
in interface Cacheable
getKey
in class Collection
public int getReferenceCount()
Cacheable
getReferenceCount
in interface Cacheable
getReferenceCount
in class Collection
public int incReferenceCount()
Cacheable
incReferenceCount
in interface Cacheable
incReferenceCount
in class Collection
public int decReferenceCount()
Cacheable
decReferenceCount
in interface Cacheable
decReferenceCount
in class Collection
public void setReferenceCount(int count)
Cacheable
setReferenceCount
in interface Cacheable
setReferenceCount
in class Collection
public void setTimestamp(int timestamp)
Cacheable
setTimestamp
in interface Cacheable
setTimestamp
in class Collection
public int getTimestamp()
Cacheable
getTimestamp
in interface Cacheable
getTimestamp
in class Collection
public boolean sync(boolean syncJournal)
Cacheable
sync
in interface Cacheable
sync
in class Collection
public boolean isDirty()
isDirty
in interface Cacheable
isDirty
in class Collection
public String toString()
toString
in class Collection
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |