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(java.lang.String jcname)
          Add a dependency to the cluster
 void classDefined(java.lang.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.
 java.util.Collection getClusterClasses()
          Retrieves the collection of all JORM classes whose mapping structures have to be controlled altogether.
 java.util.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 Detail

getClusterClasses

public java.util.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)

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.

getUnResolvedDependencies

public java.util.Set getUnResolvedDependencies()
Returns:
the collection of unresolved dependencies. This is the set of jorm class names which must be mapped before starting the cluster.

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.

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,
                                    java.lang.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.
java.lang.UnsupportedOperationException - Thrown if this operation is not supported by the mapping.

classDefined

public void classDefined(java.lang.String jcname)

addDependency

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

Parameters:
jcname - the name of the jorm class