|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.collections.Collection
This class represents a collection in the database. A collection maintains a list of sub-collections and documents.
Constructor Summary | |
Collection(DBBroker broker)
|
|
Collection(DBBroker broker,
java.lang.String name)
|
Method Summary | |
void |
addCollection(Collection child)
Add a new sub-collection to the collection. |
void |
addCollection(java.lang.String name)
Add a new sub-collection to the collection. |
void |
addDocument(DocumentImpl doc)
Add a document to the collection. |
void |
addDocument(User user,
DocumentImpl doc)
Add a document to the collection. |
DocumentSet |
allDocs(User user,
boolean recursive)
Retrieve all documents contained in this collections. |
java.util.Iterator |
collectionIterator()
Return an iterator over all subcollections. |
int |
compareTo(java.lang.Object obj)
|
void |
decRefCount()
|
boolean |
equals(java.lang.Object obj)
|
protected DBBroker |
getBroker()
Returns the broker instance that created this collection. |
int |
getChildCollectionCount()
Return the number of child-collections managed by this collection. |
long |
getCreationTime()
|
java.util.List |
getDescendants(User user)
Load all collections being descendants of this collections and return them in a List. |
DocumentImpl |
getDocument(java.lang.String name)
Get a child-document. |
int |
getDocumentCount()
Returns the number of documents in this collection. |
void |
getDocuments(DocumentSet docs)
Add all documents to the specified document set. |
short |
getId()
Get the internal id. |
java.lang.String |
getName()
Get the name of this collection. |
Collection |
getParent()
Returns the parent-collection. |
Permission |
getPermissions()
Gets the permissions attribute of the Collection object |
int |
getRefCount()
|
boolean |
hasDocument(java.lang.String name)
Check if the collection has a child document. |
boolean |
hasSubcollection(java.lang.String name)
Check if the collection has a sub-collection. |
void |
incRefCount()
|
java.util.Iterator |
iterator()
Returns an iterator on the child-documents in this collection. |
void |
read(VariableByteInputStream istream)
Read collection contents from the stream. |
void |
removeCollection(java.lang.String name)
Remove the specified sub-collection. |
void |
removeDocument(java.lang.String name)
Remove the specified document from the collection. |
void |
renameDocument(java.lang.String oldName,
java.lang.String newName)
|
void |
setAddress(long addr)
Set the internal storage address of the collection data. |
void |
setBroker(DBBroker newBroker)
|
void |
setCreationTime(long ms)
|
void |
setId(short id)
Set the id of this collection. |
void |
setName(java.lang.String name)
Set the name of this collection. |
void |
setPermissions(int mode)
Set permissions for the collection. |
void |
setPermissions(Permission permissions)
Set permissions for the collection. |
void |
setPermissions(java.lang.String mode)
Set permissions for the collection. |
void |
setRefCount(int initialCount)
|
void |
update(Collection child)
Update the specified child-collection. |
void |
write(VariableByteOutputStream ostream)
Write collection contents to stream. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Collection(DBBroker broker)
public Collection(DBBroker broker, java.lang.String name)
Method Detail |
public void addCollection(Collection child)
public void addCollection(java.lang.String name)
name
- public void update(Collection child)
child
- public void addDocument(DocumentImpl doc)
doc
- public void addDocument(User user, DocumentImpl doc)
user
- doc
- public void renameDocument(java.lang.String oldName, java.lang.String newName)
public java.util.Iterator collectionIterator()
public java.util.List getDescendants(User user)
public DocumentSet allDocs(User user, boolean recursive)
user
- recursive
-
public void getDocuments(DocumentSet docs)
docs
- public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object obj)
public int getChildCollectionCount()
public DocumentImpl getDocument(java.lang.String name)
name
- Description of the Parameter
public int getDocumentCount()
public short getId()
public java.lang.String getName()
public Collection getParent()
protected DBBroker getBroker()
public void setBroker(DBBroker newBroker)
public Permission getPermissions()
public boolean hasDocument(java.lang.String name)
name
- the name (without path) of the document
public boolean hasSubcollection(java.lang.String name)
name
- the name of the subcollection (without path).
public java.util.Iterator iterator()
public void read(VariableByteInputStream istream) throws java.io.IOException
istream
-
java.io.IOException
public void removeCollection(java.lang.String name)
name
- Description of the Parameterpublic void removeDocument(java.lang.String name)
name
- Description of the Parameterpublic void setId(short id)
id
- The new id valuepublic void setName(java.lang.String name)
name
- The new name valuepublic void setPermissions(int mode)
mode
- The new permissions valuepublic void setPermissions(java.lang.String mode) throws SyntaxException
mode
- The new permissions value
SyntaxException
- Description of the Exceptionpublic void setPermissions(Permission permissions)
permissions
- public void write(VariableByteOutputStream ostream) throws java.io.IOException
ostream
-
java.io.IOException
public void setAddress(long addr)
addr
- public void incRefCount()
public void decRefCount()
public void setRefCount(int initialCount)
public int getRefCount()
public void setCreationTime(long ms)
public long getCreationTime()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |