KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapper > storage > _RepositoryCollection


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.mapper.storage;
24
25 import java.sql.SQLException JavaDoc;
26
27 import org.xquark.mapper.RepositoryCollection;
28 import org.xquark.mapper.RepositoryException;
29 import org.xquark.mapper.dbms._RepositoryConnection;
30 import org.xquark.mapper.metadata.CollectionInfo;
31 import org.xquark.mapper.metadata.CollectionMetadata;
32 import org.xquark.xml.xdbc.XMLDBCException;
33
34 /**
35  * Internal version of the XMLCollection interface used for hiding methods to API user.
36  */

37 public interface _RepositoryCollection extends RepositoryCollection
38 {
39
40
41
42     /** Checks whether an XML document exists in this repository and retrieve the
43      * corresponding document OID.
44      * @param ID The name ID of the document
45      * @return the document UDID.
46      * @throws SQLException database error.
47      */

48     long getDocumentID(String JavaDoc ID) throws SQLException JavaDoc, RepositoryException;
49
50     /**
51      * Accessor to the internal connection object that created this collection
52      * object.
53      * @return a repository connection with internal interface.
54      */

55     _RepositoryConnection getRepositoryConnection();
56     
57     /**
58      * Accessor to the shared metadata object for collection.
59      * @return a memory shared metadata object.
60      */

61     CollectionMetadata getMetadata();
62     
63     /**
64      * Accessor to collection features object.
65      * @return a Configurable object with primitive type methods for convenient
66      * access.
67      */

68     CollectionInfo getInfo();
69     
70     /**
71      * Returns an {@link org.xml.sax.XMLReader} object allowing reading
72      * documents stored in the collection.
73      * @return a Repository XMLReader implementation.
74      * @throws XMLDBCException in case of application error.
75      */

76     RepositoryReader getReader() throws XMLDBCException;
77     
78     /**
79      * Internal method used to release a RepositoryReader to its creator in
80      * order it can be closed or cached.
81      * @param reader an object gained by {@link #getReader()}.
82      * @throws RepositoryException in case of application error.
83      */

84     void releaseReader(RepositoryReader reader) throws RepositoryException;
85     
86     /**
87      * Send message to all storage objects to flush storage buffers.
88      * @throws XMLDBCException in case of application error.
89      */

90     void flushFilers() throws XMLDBCException;
91     
92     /**
93      * Accessor to collection name with no XDBC exception returned.
94      * @return the collection name
95      */

96     public String JavaDoc getCollectionName();
97     
98     /**
99      * Message sent when a commit has been performed at the connection level.
100      * @throws XMLDBCException
101      */

102     public void commitPerformed() throws XMLDBCException;
103     
104     /**
105      * Method rollbackPerformed.
106      * @throws XMLDBCException in case of application.
107      */

108     public void rollbackPerformed() throws XMLDBCException;
109     
110     /**
111      * Restore a document OID that could not be used eventually.
112      * @param did the document OID (DID)
113      */

114     public void restoreDID(long did);
115 }
116
Popular Tags