i3.dragos.gm.core
Class DefaultGraphPoolChecker

java.lang.Object
  extended by i3.dragos.gm.core.DefaultGraphPoolChecker
All Implemented Interfaces:
GraphPoolChecker

public final class DefaultGraphPoolChecker
extends java.lang.Object
implements GraphPoolChecker

The GraphPoolChecker verifies the correctness of the GraphPool's contents regarding some general basic assumptions and the requirements specified in the Schema.

Its purpose is to make sure that certain conditions that are only allowed temporarily during the course of a single transaction (dangling edges and relation ends, violations of min / max cardinalities) are not committed to the database (please consult the "Consistency" section in the documentation for details). It may be extended with custom GraphPoolCheckers by extensions or an application GM to perform additional checks.

Author:
Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>
See Also:
GraphPoolChecker

Constructor Summary
DefaultGraphPoolChecker()
           
 
Method Summary
 void addCustomGraphPoolChecker(GraphPoolChecker gpc)
          Adds a custom GraphPoolChecker that can perform additional checks.
 void check(java.util.Collection<? extends GraphEntity> c)
          Checks all entities in the Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGraphPoolChecker

public DefaultGraphPoolChecker()
Method Detail

addCustomGraphPoolChecker

public void addCustomGraphPoolChecker(GraphPoolChecker gpc)
Adds a custom GraphPoolChecker that can perform additional checks. It will be appended after any other custom GraphPoolCheckers that may have already been added.

Parameters:
gpc - The custom GraphPoolChecker (null is allowed for convenience, and will result in no modification).

check

public void check(java.util.Collection<? extends GraphEntity> c)
           throws GraphPoolCheckException,
                  DragosException
Checks all entities in the Collection.

This implementation will first perform its own checks on all the entities in the Collection, and then forward the call to the custom checkers in the order they were added. Thereby, we ensure consistency at the core level first because otherwise the methods used in the custom checkers might return invalid / undefined results.

Specified by:
check in interface GraphPoolChecker
Parameters:
c - A Collection containing the entities to check.
Throws:
GraphPoolCheckException - if an inconsistency or similar problem was found.
DragosException - in case of internal errors.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.