KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > api > PMapCluster


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.api;
25
26 import java.util.Collection JavaDoc;
27 import java.util.Set JavaDoc;
28
29 /**
30  * The <b>PMapCluster</b> interface defines a the set of JORM classes which
31  * mapping structures have to be managed altogether. It gives access to this
32  * set of classes defined at mapping-time, and provides functions to control
33  * the associated mapping structures.
34  * @author P. Dechamboux
35  */

36 public interface PMapCluster {
37     /**
38      * Retrieves the collection of all JORM classes whose
39      * mapping structures have to be controlled altogether.
40      * @return The collection of jorm class name included in this PMapCluster
41      * (String)
42      */

43     Collection JavaDoc getClusterClasses();
44
45     /**
46      * Indicates if the mapping cluster is fully defined.
47      * @return the 'true' value if the mapping cluster is fully defined, false
48      * otherwise.
49      */

50     boolean isDefined();
51
52     /**
53      * @return the collection of unresolved dependencies. This is the set of
54      * jorm class names which must be mapped before starting the cluster.
55      */

56     Set JavaDoc getUnResolvedDependencies();
57
58     /**
59      * Creates the mapping structures defined by this map cluster.
60      * @param force If true, the creation of an existing table leads to an exception.
61      * @throws PException Thrown if it cannot be performed (especially
62      * if all or some of these mapping structures already exist.
63      */

64     void createMappingStructures(boolean force) throws PException;
65
66     /**
67      * Deletes the data that have been inserted into the mapping structures
68      * defined by this map cluster.
69      * @throws PException Thrown when the data store cannot perform this
70      * operation.
71      */

72     void deleteData() throws PException;
73
74     /**
75      * Deletes all or part of the mapping structures defined by this map
76      * cluster when they exist. If they contain some data, they are also
77      * deleted.
78      * @throws PException Thrown when the data store cannot perform this
79      * operation.
80      */

81     void deleteMappingStructures() throws PException;
82
83     /**
84      * Starts this map cluster. The following operation cannot be executed
85      * anymore: createMappingStructures, deleteMappingStructures, and
86      * updateMappingStructures.
87      * @throws PException
88      */

89     void start() throws PException;
90
91     /**
92      * Stops this map cluster.
93      * @throws PException
94      */

95     void stop() throws PException;
96
97     /**
98      * Aligns existing mapping structures to the ones define by this map
99      * cluster. This operation allows schema evolution on existing data store.
100      * It is thus usually difficult to support in the general case.
101      * @throws PException Thrown when the data store cannot perform this
102      * operation.
103      * @throws UnsupportedOperationException Thrown if this operation is not
104      * supported by the mapping.
105      */

106     void updateMappingStructures()
107             throws PException, UnsupportedOperationException JavaDoc;
108
109     void classDefined(String JavaDoc jcname);
110
111     /**
112      * Add a dependency to the cluster
113      * @param jcname the name of the jorm class
114      */

115     void addDependency(String JavaDoc jcname);
116
117
118 }
119
Popular Tags