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: /**
020: * Used to define a type of validation test that is performed on Features.
021: *
022: * <p>
023: * Each ValidationPlugIn is very specific in nature: it performs one test
024: * extermly well. This simplifies design decisions, documenation
025: * configuration and use.
026: * </p>
027: *
028: * <p>
029: * The PlugIn is also required to supply some metadata to aid in its
030: * deployment, scripting, logging and execution and error recovery:
031: *
032: * <ul>
033: * <li>
034: * name: user's name of validation test
035: * </li>
036: * <li>
037: * description: user's description of validation test
038: * </li>
039: * <li>
040: * priority: used to schedule validation test
041: * </li>
042: * <li>
043: * typeNames: used to connect validaiton test to transaction opperation
044: * </li>
045: * </ul>
046: * </p>
047: *
048: * @author bowens, Refractions Research, Inc.
049: * @author $Author: dmzwiers $ (last modification)
050: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/Validation.java $
051: * @version $Id: Validation.java 20884 2006-08-07 14:10:46Z jgarnett $
052: */
053: public interface Validation {
054: /**
055: * A constant for getPriority() used for Trivial validation checks.
056: *
057: * <p>
058: * This is a Priority Hint to Validation Processor based on computational
059: * expense.
060: * </p>
061: *
062: * <p>
063: * Trivial is used for thing that don't require any real work - like
064: * checking for any O(1) opperations such as checking null values.
065: * </p>
066: */
067: public static final int PRIORITY_TRIVIAL = 100;
068:
069: /**
070: * A constant for getPriority() used for simple validation checks.
071: *
072: * <p>
073: * This is a Priority Hint to Validation Processor based on computational
074: * expense.
075: * </p>
076: *
077: * <p>
078: * Used for simple attribute or geometry validations, basically anything
079: * that is Order(N) like a Bounds check.
080: * </p>
081: */
082: public static final int PRIORITY_SIMPLE = 200;
083:
084: /**
085: * A constant for getPriority() used for complex validation checks.
086: *
087: * <p>
088: * This is a Priority Hint to Validation Processor based on computational
089: * expense.
090: * </p>
091: *
092: * <p>
093: * Used for complex validations, basically anything that is has a Chance of
094: * being worse then O(N).
095: * </p>
096: *
097: * <p>
098: * Any integrity tests between two FeatureTypes should be an example of a
099: * PRIORITY_COMPLEX.
100: * </p>
101: */
102: public static final int PRIORITY_COMPLEX = 1000;
103:
104: /**
105: * A constant for getPriority() used for involved validation checks.
106: *
107: * <p>
108: * This is a Priority Hint to Validation Processor based on computational
109: * expense.
110: * </p>
111: *
112: * <p>
113: * Used for involved validations, basically anything that is has a Chance
114: * of being worse then O(N^2).
115: * </p>
116: *
117: * <p>
118: * Any integrity tests involving network code, were we have to build the
119: * network and then walk it, is an example of PRIORITY_INVOLVED.
120: * </p>
121: */
122: public static final int PRIORITY_INVOLVED = 10000;
123:
124: /**
125: * Empty String array for use with getTypeNames().
126: *
127: * <p>
128: * Used to denote that all FeatureTypes should be tested. (If this does not
129: * Pan out we may have to define the wild-card character "" or support
130: * Regex based typeName matching.
131: * </p>
132: */
133: public static final String[] ALL = null; // test all featureTypes
134:
135: /**
136: * Sets the name of the validation.
137: *
138: * @param name the name of the validation.
139: */
140: void setName(String name);
141:
142: /**
143: * User's name for the validation.
144: *
145: * @return the name of the validation.
146: */
147: String getName();
148:
149: /**
150: * Sets the description of the validation.
151: *
152: * @param description of the validation
153: */
154: void setDescription(String description);
155:
156: /**
157: * User's Description of this Validation.
158: *
159: * @return the description of the validation.
160: */
161: String getDescription();
162:
163: /**
164: * Priority used in scheduling this Validation test.
165: *
166: * @return The priority (time cost) of the validation test
167: */
168: int getPriority();
169:
170: /**
171: * Identify the FeatureTypes that this validation test is run against.
172: *
173: * <p>
174: * If this list is empty the ValidationProcess will run the test against
175: * all FeatureTypes. The ValidationProcess expects these names to be in
176: * the format dataStoreId:typeName.
177: * </p>
178: *
179: * @return FeatureType names that this validation test is run against,
180: * empty for all, null to disable
181: */
182: String[] getTypeRefs();
183: }
|