001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.data;
017:
018: import java.util.Collection;
019:
020: import org.geotools.catalog.GeoResourceInfo;
021: import org.opengis.feature.type.Name;
022: import org.opengis.filter.Filter;
023: import org.opengis.filter.capability.FilterCapabilities;
024:
025: /**
026: * A read-only source of geospatial information.
027: * <p>
028: * Access to the spatial information in a filtered/queried or not. Access
029: * is purely <strong>read-only</strong> with this interface.
030: * </p>
031: *
032: * @author Jody Garnett
033: * @author Thomas Marti
034: * @author Stefan Schmid
035: *
036: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/community-schemas/community-schema-ds/src/main/java/org/geotools/data/Source.java $
037: * @version $Id: Source.java 26649 2007-08-22 09:55:31Z groldan $
038: * @since 2.4
039: * @deprecated This is a Proposal, we need your feedback!
040: * @author Jody Garnett, Refractions Research Inc.
041: */
042: public interface Source /*<Content,Description>*/{
043: /**
044: * Information about the data available here.
045: * <p>
046: * Focus is on human readable description of the service,
047: * with enough information for searching.
048: * </p>
049: * The following information is important for programatic things like rendering:
050: * <ul>
051: * <li>bounds
052: * <li>crs
053: * </ul>
054: *
055: * @return GridServiceInfo ?
056: */
057: GeoResourceInfo getInfo();
058:
059: /**
060: * Get the corresponding DataService, that created this Source.
061: */
062:
063: // Comment this out, if you think it is needed!
064: // DataAccess<Content,Description> getDataAccess();
065: /**
066: * Description of the supported filter capabilities.
067: *
068: * @return Supported filter capabilities
069: */
070: FilterCapabilities getFilterCapabilities();
071:
072: /**
073: * Get the complete data of this <code>Source</code> implementation. No filters or
074: * queries are applied.
075: *
076: * @return An immutable Collection, may be empty, but never <code>null</code>
077: */
078: Collection /*<Content>*/content();
079:
080: /**
081: * Get the complete data of this <code>Source</code> implementation. No filters are
082: * applied.
083: *
084: * @return A immutable Collection, may be empty, but never <code>null</code>
085: */
086:
087: // TODO check catalog service web spec. and change param types accordingly
088: Collection /*<Content>*/content(String query, String queryLanguage);
089:
090: /**
091: * A collection containing all the data indicated by the filter.
092: *
093: * @return A immutable Collection, may be empty, but never <code>null</code>
094: */
095: Collection /*<Content>*/content(Filter filter);
096:
097: /**
098: * A collection containing all the data indicated by the filter, with a maximum
099: * of <code>countLimit</code> elements.
100: *
101: * @return A immutable Collection, may be empty, but never <code>null</code>
102: */
103: Collection /*<Content>*/content(Filter filter, int countLimit);
104:
105: /**
106: * Description of content in an appropriate format.
107: * <ul>
108: * <li>AttributeDescriptor: when serving up features</li>
109: * <li>Class: when providing access to a java domain model</li>
110: * <li>URL: of XSD document when working with XML document</li>
111: * <li>etc...</li>
112: * </ul>
113: *
114: * @return FeatureType, ResultSetMetaData, Class, whatever?
115: */
116: Object /*Description*/describe();
117:
118: /**
119: * Names of the content this data source provides.
120: *
121: * @return The type name
122: */
123: Name getName();
124:
125: /**
126: * Provides a transaction for commit/rollback control of this <code>Source</code>.
127: *
128: * @param t The transaction
129: */
130: void setTransaction(Transaction t);
131:
132: /**
133: * Clean up any resources, listeners, etc that made use of this Source of data.
134: * <p>
135: * Please note this <code>Source</code> will not function after this method is
136: * called. Any {@link Transaction.State} mementos placed on the current transaction
137: * will also be cleaned up (although the transaction itself will not be canceled
138: * - as it may be in use by others).
139: * </p>
140: */
141: void dispose();
142: }
|