org.objectweb.jorm.api

Interface PMapCluster

public interface PMapCluster

The PMapCluster interface defines a the set of JORM classes which mapping structures have to be managed altogether. It gives access to this set of classes defined at mapping-time, and provides functions to control the associated mapping structures.

Author:
P. Dechamboux

Method Summary

void
addDependency(String jcname)
Add a dependency to the cluster
void
classDefined(String jcname)
void
createMappingStructures(boolean force)
Creates the mapping structures defined by this map cluster.
void
deleteData()
Deletes the data that have been inserted into the mapping structures defined by this map cluster.
void
deleteMappingStructures()
Deletes all or part of the mapping structures defined by this map cluster when they exist.
Collection
getClusterClasses()
Retrieves the collection of all JORM classes whose mapping structures have to be controlled altogether.
Set
getUnResolvedDependencies()
boolean
isDefined()
Indicates if the mapping cluster is fully defined.
void
start()
Starts this map cluster.
void
stop()
Stops this map cluster.
void
updateMappingStructures()
Aligns existing mapping structures to the ones define by this map cluster.

Method Details

addDependency

public void addDependency(String jcname)
Add a dependency to the cluster

Parameters:
jcname - the name of the jorm class


classDefined

public void classDefined(String jcname)


createMappingStructures

public void createMappingStructures(boolean force)
            throws PException
Creates the mapping structures defined by this map cluster.

Parameters:
force - If true, the creation of an existing table leads to an exception.

Throws:
PException - Thrown if it cannot be performed (especially if all or some of these mapping structures already exist.


deleteData

public void deleteData()
            throws PException
Deletes the data that have been inserted into the mapping structures defined by this map cluster.

Throws:
PException - Thrown when the data store cannot perform this operation.


deleteMappingStructures

public void deleteMappingStructures()
            throws PException
Deletes all or part of the mapping structures defined by this map cluster when they exist. If they contain some data, they are also deleted.

Throws:
PException - Thrown when the data store cannot perform this operation.


getClusterClasses

public Collection getClusterClasses()
Retrieves the collection of all JORM classes whose mapping structures have to be controlled altogether.

Returns:
The collection of jorm class name included in this PMapCluster (String)


getUnResolvedDependencies

public Set getUnResolvedDependencies()

Returns:
the collection of unresolved dependencies. This is the set of jorm class names which must be mapped before starting the cluster.


isDefined

public boolean isDefined()
Indicates if the mapping cluster is fully defined.

Returns:
the 'true' value if the mapping cluster is fully defined, false otherwise.


start

public void start()
            throws PException
Starts this map cluster. The following operation cannot be executed anymore: createMappingStructures, deleteMappingStructures, and updateMappingStructures.

Throws:
PException -


stop

public void stop()
            throws PException
Stops this map cluster.

Throws:
PException -


updateMappingStructures

public void updateMappingStructures()
            throws PException,
                   UnsupportedOperationException
Aligns existing mapping structures to the ones define by this map cluster. This operation allows schema evolution on existing data store. It is thus usually difficult to support in the general case.

Throws:
PException - Thrown when the data store cannot perform this operation.