001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: * (C) 2004 TOPP - www.openplans.org
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: */
017: package org.geotools.validation;
018:
019: import java.util.Map;
020:
021: import com.vividsolutions.jts.geom.Envelope;
022:
023: /**
024: * Used to check geospatial information for integrity.
025: *
026: * <p>
027: * Each ValidationPlugIn is very specific in nature: it performs one test
028: * extermly well. This simplifies design decisions, documenation
029: * configuration and use.
030: * </p>
031: *
032: * <p>
033: * Following the lead the excelent design work in the JUnit testing framework
034: * validation results are collected by a ValidationResults object. This
035: * interface for the ValidationResults object also allows it to collect
036: * warning information.
037: * </p>
038: *
039: * <p>
040: * The PlugIn is also required to supply some metadata to aid in its
041: * deployment, scripting, logging and execution and error recovery:
042: *
043: * <ul>
044: * <li>
045: * name: user's name of validation test
046: * </li>
047: * <li>
048: * description: user's description of validation test
049: * </li>
050: * <li>
051: * priority: used to schedule validation test
052: * </li>
053: * <li>
054: * typeNames: used to connect validaiton test to transaction opperation
055: * </li>
056: * </ul>
057: * </p>
058: *
059: * <p>
060: * Capabilities:
061: *
062: * <ul>
063: * <li>
064: * Uses FeatureResults to allow environment to gather error/warning information
065: * as required (transaction XML document, JTable, logging system, etc...)
066: * </li>
067: * <li>
068: * Primiarly used as part of processing the Transaction opperation of a Web
069: * Feature Server. Used to ensure that the DataStore is consistent before
070: * commiting a Transaction.
071: * </li>
072: * </ul>
073: * </p>
074: *
075: * @author Jody Garnett, Refractions Research
076: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/IntegrityValidation.java $
077: */
078: public interface IntegrityValidation extends Validation {
079: /**
080: * Used to check features against this validation rule.
081: *
082: * <p>
083: * The layers Map is still under developement, current thinking involves
084: * storing a FeatureSource of the correct typeName requested by
085: * getTypeNames(), using the current geotools2 Transaction as the
086: * opperation being validated.
087: * </p>
088: *
089: * <p>
090: * We may need to extend this information to provide:
091: *
092: * <ul>
093: * <li>
094: * FeatureTypeMetaData: we may with to configure against metadata
095: * </li>
096: * <li>
097: * Networks: networks are expensive to produce, we may be able to have the
098: * ValidationProcessor cache a network for later.
099: * </li>
100: * </ul>
101: * </p>
102: *
103: * @param layers Map of FeatureSource by "dataStoreID:typeName"
104: * @param envelope The bounding box that encloses the unvalidated data
105: * @param results Used to coallate results information
106: *
107: * @return <code>true</code> if all the features pass this test.
108: */
109: public boolean validate(Map layers, Envelope envelope,
110: ValidationResults results) throws Exception;
111: }
|