01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.outerj.daisy.repository;
18:
19: import java.util.Date;
20:
21: import org.outerx.daisy.x10.CollectionDocument;
22:
23: /**
24: * A collection of documents in the repository. This interface is called
25: * DocumentCollection to avoid a name collision with the often-used Collection
26: * interface from the Java API.
27: *
28: * <p>Using {@link Document#getCollections()}, you can retrieve the collections
29: * to which a document belongs. To get a list of all documents belonging to
30: * a collection, peform a query using the {@link org.outerj.daisy.repository.query.QueryManager}.
31: *
32: * <p>Creating and deleting collection is done using the
33: * {@link CollectionManager} which can be obtained using
34: * {@link Repository#getCollectionManager()}.
35: */
36: public interface DocumentCollection {
37: /**
38: * Returns the ID of this collection. For newly created collections, this method
39: * returns -1 until {@link #save()} is called.
40: */
41: long getId();
42:
43: /**
44: * Returns the name of this collection.
45: */
46: String getName();
47:
48: /**
49: * Sets the name of this collection.
50: */
51: void setName(String name);
52:
53: /**
54: * Stores the modified collection.
55: */
56: void save() throws RepositoryException;
57:
58: /**
59: * Get an XML document describing this collection.
60: */
61: CollectionDocument getXml();
62:
63: /**
64: * Gets the date when this collection was last saved. This
65: * does NOT include the adding or removing of documents to
66: * the collection.
67: */
68: Date getLastModified();
69:
70: /**
71: * Get the id of the user that last modified this collection.
72: */
73: long getLastModifier();
74:
75: long getUpdateCount();
76: }
|