#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using ObjCommon = OSGeo.MapGuide.ObjectModels.Common;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.MaestroAPI.Feature;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
using OSGeo.MapGuide.ObjectModels.Common;
namespace OSGeo.MapGuide.MaestroAPI.Services
{
///
/// Provides services for accessing, querying and inspecting feature sources
///
///
/// Note that provides
/// built-in access to resource and feature services. Using the
/// method is not necessary
///
public interface IFeatureService : IService
{
///
/// Gets the capabilities of the specified provider
///
///
///
OSGeo.MapGuide.ObjectModels.Capabilities.FdoProviderCapabilities GetProviderCapabilities(string provider);
///
/// Gets an array of all registered providers
///
ObjCommon.FeatureProviderRegistryFeatureProvider[] FeatureProviders { get; }
///
/// Tests the specified connection settings
///
///
///
///
string TestConnection(string providername, NameValueCollection parameters);
///
/// Tests the connection settings of the specified feature source
///
///
///
string TestConnection(string featureSourceId);
///
/// Removes the version numbers from a providername
///
/// The name of the provider, with or without version numbers
/// The provider name without version numbers
string RemoveVersionFromProviderName(string providername);
///
/// Gets the possible values for a given connection property
///
/// The FDO provider name
/// The property name
/// A partial connection string if certain providers require such information
/// A list of possible values for the given property
string[] GetConnectionPropertyValues(string providerName, string propertyName, string partialConnectionString);
///
/// Returns an installed provider, given the name of the provider
///
/// The name of the provider
/// The first matching provider or null
ObjCommon.FeatureProviderRegistryFeatureProvider GetFeatureProvider(string providername);
///
/// Executes a SQL query
///
///
/// No validation is done on the SQL query string. The calling application should validate the SQL string to ensure
/// that it does not contain any malicious operations.
///
/// The Feature Source ID
/// The SQL query string
/// A containing the results of the query
IReader ExecuteSqlQuery(string featureSourceID, string sql);
///
/// Executes a feature query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The FDO filter string that determines what features will be returned
/// A containing the results of the query
IFeatureReader QueryFeatureSource(string resourceID, string className, string filter);
///
/// Executes a feature query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// A containing the results of the query
IFeatureReader QueryFeatureSource(string resourceID, string className);
///
/// Executes a feature query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The FDO filter string that determines what features will be returned
/// A list of properties that are to be returned in the query result
/// A containing the results of the query
IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames);
///
/// Executes a feature query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The FDO filter string that determines what features will be returned
/// A list of properties that are to be returned in the query result
/// A list of name/value pairs that contain the alias (name) for an FDO expression (value)
/// A containing the results of the query
IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames, NameValueCollection computedProperties);
///
/// Executes an aggregate query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The FDO filter string that determines what features will be returned
/// A containing the results of the query
IReader AggregateQueryFeatureSource(string resourceID, string className, string filter);
///
/// Executes an aggregate query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The FDO filter string that determines what features will be returned
/// An array of property names to include in the result
/// A containing the results of the query
IReader AggregateQueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames);
///
/// Executes an aggregate query on the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The FDO filter string that determines what features will be returned
/// A list of name/value pairs that contain the alias (name) for an FDO aggregate expression (value)
/// A containing the results of the query
IReader AggregateQueryFeatureSource(string resourceID, string className, string filter, NameValueCollection aggregateFunctions);
///
/// Gets the geometric extent of the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The geometry property to get the geometric extent of
///
ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string className, string geometryPropertyName);
///
/// Gets the geometric extent of the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The geometry property to get the geometric extent of
/// The FDO filter string that determines what features will be returned
///
ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string className, string geometryPropertyName, string filter);
///
/// Gets the geometric extent of the specified feature source
///
/// The Feature Source ID
/// The feature class name
/// The geometry property to get the geometric extent of
/// If true, the geometric extent of the feature class's spatial context will be used in the event that computing the extents fails
/// Thrown if the geometric extent is null
///
ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string className, string geometryPropertyName, bool allowFallbackToContextInformation);
///
/// Describes the specified feature source
///
/// The Feature Source ID
///
/// If you only need to list schemas and class names, use the respective and
/// methods. Using this API will have a noticeable performance impact on
/// really large datastores (whose size is in the 100s of classes).
///
///
FeatureSourceDescription DescribeFeatureSource(string resourceID);
///
/// Describes the specified feature source
///
/// The Feature Source ID
/// The name of the schema to describe
///
/// If you only need to list schemas and class names, use the respective and
/// methods. Using this API will have a noticeable performance impact on
/// really large datastores (whose size is in the 100s of classes).
///
///
FeatureSchema DescribeFeatureSource(string resourceID, string schema);
///
/// Describes the specified feature source restricted to only the specified schema and the specified class names
///
/// The feature source id
/// The schema name
/// The array of class names to include in the resulting schema
///
/// If you only need to list schemas and class names, use the respective and
/// methods. Using this API will have a noticeable performance impact on
/// really large datastores (whose size is in the 100s of classes).
///
///
FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string [] classNames);
///
/// Gets the specified class definition
///
/// The Feature Source ID
/// The feature class name. You can pass a qualified class name to be explicit about which class definition you are after
///
ClassDefinition GetClassDefinition(string resourceID, string className);
///
/// Get the spatial context information for the specified feature source
///
/// The Feature Source ID
/// If true, will only return the active spatial context
///
ObjCommon.FdoSpatialContextList GetSpatialContextInfo(string resourceID, bool activeOnly);
///
/// Gets the names of the identity properties from a feature
///
/// The Feature Source ID
/// The classname of the feature, including schema
/// A string array with the found identities
string[] GetIdentityProperties(string resourceID, string classname);
///
/// Enumerates all the data stores and if they are FDO enabled for the specified provider and partial connection string
///
/// The FDO provider name
/// The partial connection string. Certain providers require a partial conection string in order to be able to enumerate data stores
///
OSGeo.MapGuide.ObjectModels.Common.DataStoreList EnumerateDataStores(string providerName, string partialConnString);
///
/// Gets an array of schema names from the specified feature source
///
/// The Feature Source ID
///
string[] GetSchemas(string resourceID);
///
/// Gets an array of qualified feature class names from the specified feature source
///
/// The feature source id
///
/// The name of the schema whose class names are to be returned. If null, class names from all schemas in the feature source
/// are returned
///
///
string[] GetClassNames(string resourceID, string schemaName);
///
/// Gets the long transactions for the specified feature source
///
/// The Feature Source ID
/// If true, will only return active long transactions
///
ILongTransactionList GetLongTransactions(string resourceID, bool activeOnly);
///
/// Gets the schema mappings for the given FDO provider. These mappings form the basis for a custom configuration document
/// for a feature source that supports configuration
///
/// The FDO provider
/// The connection string
///
ConfigurationDocument GetSchemaMapping(string provider, string partialConnString);
}
}