Class AggregationDataProvider
- java.lang.Object
-
- com.supermap.services.providers.AggregationDataProvider
-
- All Implemented Interfaces:
- DataProvider, ProviderContextAware
public class AggregationDataProvider extends java.lang.Object implements DataProvider, ProviderContextAware
A data service provider with aggregation capabilities.
A GIS service provider with aggregation capability is a special kind of GIS service provider, which is also known as Service Aggregator in SuperMap iServer. A data service provider with aggregation capability may be referred to as a data service aggregator, which is an aggregator with data service aggregation capability in the aggregator.
Unlike other service providers (such as
WFSDataProvider, WMS service providers), the service aggregator does not directly access remote or local services, or directly inside the GIS functionality package, but by calling different Service type of GIS service provider to achieve GIS functionality. These GIS service providers encapsulate and integrate a variety of different types of services from different sources.For example, can implement the aggregation of the data provided by the local SuperMap Objects and the data capabilities provided by the remote WFS service by calling
UGCDataProviderandWFSDataProvider(WFS service provider).
-
-
Constructor Summary
Constructors Constructor and Description AggregationDataProvider()AggregationDataProvider(AggregationDataProviderSetting setting, java.util.List<DataProvider> dataProviders)
-
Method Summary
Methods Modifier and Type Method and Description EditResultaddFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)Adds a set of features of the same type to the specified dataset.booleanclearFeatures(java.lang.String datasourceName, java.lang.String datasetName)Clears the elements of the specified dataset.booleancontainsDataset(java.lang.String datasourceName, java.lang.String datasetName)Determines whether the specified data source contains the specified data set.booleancopyDataset(java.lang.String srcDatasourceName, java.lang.String srcDatasetName, java.lang.String destDatasourceName, java.lang.String destDatasetName)Copy the data set.booleancreateDataset(java.lang.String datasourceName, DatasetInfo datasetInfo)In the specified data source, it creates a new data set based on the data set information.booleandeleteDataset(java.lang.String datasourceName, java.lang.String datasetName)Deletes the specified dataset in the specified data source.EditResultdeleteFeatures(java.lang.String datasourceName, QueryParameter parameters)Specifies the data source to remove the feature via sql.EditResultdeleteFeatures(java.lang.String datasourceName, java.lang.String datasetName, int[] ids)Removes a set of features in the specified dataset.DatasetInfogetDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName)Gets the specified data set information for the specified data source.java.util.List<DatasetInfo>getDatasetInfos(java.lang.String datasourceName)Gets all dataset information for the specified data source.java.util.List<java.lang.String>getDatasetNames(java.lang.String datasourceName)Gets all dataset names for the current data source.DatasourceInfogetDatasourceInfo(java.lang.String datasourceName)Gets information about the specified data source.java.util.List<DatasourceInfo>getDatasourceInfos()Get all the data source information corresponding to the current data service provider.java.util.List<DomainInfo>getDomainInfos(java.lang.String datasourceName, java.lang.String datasetName)Gets all the domain information for the specified datasetGetFeatureResultgetFeature(GetFeatureParameters parameters)Query and return the feature results.java.util.List<Feature>getFeature(java.lang.String datasourceName, QueryParameter queryParam)Gets the elements through SQL query criteria.java.util.List<Feature>getFeature(java.lang.String datasourceName, QueryParameter queryParam, int maxFeatures)Gets the elements through SQL query criteria.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, double distance, java.lang.String attributeFilter, java.lang.String[] fields)Gets the elements that fall within the buffer of the specified space object and satisfy certain attribute filters.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, SpatialQueryMode spatialQueryMode, java.lang.String attributeFilter, java.lang.String[] fields)Gets the elements that specify a geometric object that has a specific spatial query mode and satisfies the specified attribute filter.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields)Gets the feature in the specified dataset based on the specified feature ID.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields, int fromIndex, int toIndex)Gets the feature in the specified data set according to the specified feature ID in the way of supporting paging.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, Rectangle2D bounds, java.lang.String attributeFilter, java.lang.String[] fields)Get the elements within the specified space and meet certain attribute filters.java.util.List<FieldInfo>getFieldInfos(java.lang.String datasourceName, java.lang.String datasetName)Gets all the field information for the specified dataset.booleanrenameDataset(java.lang.String datasourceName, java.lang.String oldName, java.lang.String newName)Modifies the name of the specified dataset.voidsetProviderContext(ProviderContext context)Sets the service provider contextdoublestatistic(java.lang.String datasourceName, java.lang.String datasetName, int fieldIndex, StatisticMode statisticMode)In the specified data set, statistics and calculations the specified field according to the specified statistical method.doublestatistic(java.lang.String datasourceName, java.lang.String datasetName, java.lang.String fieldName, StatisticMode statisticMode)In the specified data set, statistics and calculations the specified field according to the specified statistical method.voidupdateDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName, DatasetInfo newDatasetInfo)In the specified data source, update the information for the specified data set.voidupdateDatasourceInfo(java.lang.String datasourceName, DatasourceInfo newDatasourceInfo)Updates the original data source information with the new data source information.EditResultupdateFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)Updates a set of features in the specified dataset.voidupdateFieldInfos(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<FieldInfo> newFieldInfos)Updates the field information for the specified dataset.
-
-
-
Constructor Detail
-
AggregationDataProvider
public AggregationDataProvider()
-
AggregationDataProvider
public AggregationDataProvider(AggregationDataProviderSetting setting, java.util.List<DataProvider> dataProviders)
-
-
Method Detail
-
addFeatures
public EditResult addFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
Description copied from interface:DataProviderAdds a set of features of the same type to the specified dataset.
Each dataset of SuperMap has a type (
DatasetType), which can be a point dataset, a line dataset, a surface dataset, etc., and the elements in each dataset have corresponding types, such as those stored in a point dataset must be a point element. Therefore, when adding features to a dataset, the added elements must be of the same type.- Specified by:
addFeaturesin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.targetFeatures- To add a list of features, the elements in the list must be of the same type.- Returns:
- edit the results.
-
clearFeatures
public boolean clearFeatures(java.lang.String datasourceName, java.lang.String datasetName)Description copied from interface:DataProviderClears the elements of the specified dataset.
- Specified by:
clearFeaturesin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.- Returns:
- Returns true if the dataset is deleted successfully, false otherwise.
-
containsDataset
public boolean containsDataset(java.lang.String datasourceName, java.lang.String datasetName)Description copied from interface:DataProviderDetermines whether the specified data source contains the specified data set.
- Specified by:
containsDatasetin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.- Returns:
- Returns true if contains the specified dataset, false otherwise.
-
copyDataset
public boolean copyDataset(java.lang.String srcDatasourceName, java.lang.String srcDatasetName, java.lang.String destDatasourceName, java.lang.String destDatasetName)Description copied from interface:DataProviderCopy the data set.
From the specified source data source, the specified source data set is copied to the target dataset in the specified target data source.
- Specified by:
copyDatasetin interfaceDataProvidersrcDatasetName- Source data set name.destDatasourceName- Target data source name.destDatasetName- Target data set name.- Returns:
- Returns true if the dataset is copied successfully, false otherwise.
-
createDataset
public boolean createDataset(java.lang.String datasourceName, DatasetInfo datasetInfo)Description copied from interface:DataProviderIn the specified data source, it creates a new data set based on the data set information.
- Specified by:
createDatasetin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetInfo- Data set info.- Returns:
- Returns true if the dataset is created successfully, false otherwise.
-
deleteDataset
public boolean deleteDataset(java.lang.String datasourceName, java.lang.String datasetName)Description copied from interface:DataProviderDeletes the specified dataset in the specified data source.
- Specified by:
deleteDatasetin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.
-
deleteFeatures
public EditResult deleteFeatures(java.lang.String datasourceName, java.lang.String datasetName, int[] ids)
Description copied from interface:DataProviderRemoves a set of features in the specified dataset.
- Specified by:
deleteFeaturesin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.ids- The ID array of the feature to be deleted.- Returns:
- edit the results.
-
getDatasetInfo
public DatasetInfo getDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName)
Description copied from interface:DataProviderGets the specified data set information for the specified data source.
- Specified by:
getDatasetInfoin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.- Returns:
- Data set information.
-
getDatasetInfos
public java.util.List<DatasetInfo> getDatasetInfos(java.lang.String datasourceName)
Description copied from interface:DataProviderGets all dataset information for the specified data source.
- Specified by:
getDatasetInfosin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.- Returns:
- the list of dataset information.
-
getDatasourceInfo
public DatasourceInfo getDatasourceInfo(java.lang.String datasourceName)
Description copied from interface:DataProviderGets information about the specified data source.
- Specified by:
getDatasourceInfoin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.- Returns:
- data source information.
-
getDatasourceInfos
public java.util.List<DatasourceInfo> getDatasourceInfos()
Description copied from interface:DataProviderGet all the data source information corresponding to the current data service provider.
- Specified by:
getDatasourceInfosin interfaceDataProvider- Returns:
- data source information list.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields)
Description copied from interface:DataProviderGets the feature in the specified dataset based on the specified feature ID.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.ids- Feature ID.fields- An array of fields to be returned. When the parameter is null, all fields are returned.- Returns:
- feature list.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Rectangle2D bounds, java.lang.String attributeFilter, java.lang.String[] fields)
Description copied from interface:DataProviderGet the elements within the specified space and meet certain attribute filters.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.bounds- The specified query range.attributeFilter- Attribute query filter. Such as fieldValue <100, name like '% hotel%'fields- An array of fields to be returned. When the parameter is null, all fields are returned.- Returns:
- feature list.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, double distance, java.lang.String attributeFilter, java.lang.String[] fields)
Description copied from interface:DataProviderGets the elements that fall within the buffer of the specified space object and satisfy certain attribute filters.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.geometry- Geometric object.distance- The radius of the buffer.attributeFilter- Filter condition of attribute quering Such as fieldValue <100, name like '% hotel%'fields- An array of fields to be returned. When the parameter is null, all fields are returned.- Returns:
- feature list.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, SpatialQueryMode spatialQueryMode, java.lang.String attributeFilter, java.lang.String[] fields)
Description copied from interface:DataProviderGets the elements that specify a geometric object that has a specific spatial query mode and satisfies the specified attribute filter.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.geometry- Geometric object.spatialQueryMode- spatial query mode.attributeFilter- Filter condition of attribute quering Such as fieldValue <100, name like '% hotel%'fields- An array of fields to be returned. When the parameter is null, all fields are returned.- Returns:
- feature list.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, QueryParameter queryParam)
Description copied from interface:DataProviderGets the elements through SQL query criteria.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.queryParam- Query parameters.- Returns:
- feature list.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, QueryParameter queryParam, int maxFeatures)
Description copied from interface:DataProviderGets the elements through SQL query criteria.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.queryParam- Query parameters.maxFeatures- The maximum number of features that can be returned.- Returns:
- Feature lists.
-
getFeature
public GetFeatureResult getFeature(GetFeatureParameters parameters)
Description copied from interface:DataProviderQuery and return the feature results.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
parameters- Is the encapsulation of other getFeature parameters.- Returns:
-
getFieldInfos
public java.util.List<FieldInfo> getFieldInfos(java.lang.String datasourceName, java.lang.String datasetName)
Description copied from interface:DataProviderGets all the field information for the specified dataset.
- Specified by:
getFieldInfosin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.- Returns:
- Field information list.
-
renameDataset
public boolean renameDataset(java.lang.String datasourceName, java.lang.String oldName, java.lang.String newName)Description copied from interface:DataProviderModifies the name of the specified dataset.
- Specified by:
renameDatasetin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.oldName- Old data set name.newName- New data set name.- Returns:
- Returns true if the dataset is modified successfully, false otherwise.
-
statistic
public double statistic(java.lang.String datasourceName, java.lang.String datasetName, int fieldIndex, StatisticMode statisticMode)Description copied from interface:DataProviderIn the specified data set, statistics and calculations the specified field according to the specified statistical method.
- Specified by:
statisticin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.fieldIndex- Field number.statisticMode- Statistical methods.- Returns:
- statistics result.
-
statistic
public double statistic(java.lang.String datasourceName, java.lang.String datasetName, java.lang.String fieldName, StatisticMode statisticMode)Description copied from interface:DataProviderIn the specified data set, statistics and calculations the specified field according to the specified statistical method.
- Specified by:
statisticin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.fieldName- Field name.statisticMode- Statistical methods.- Returns:
- statistics result.
-
updateDatasetInfo
public void updateDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName, DatasetInfo newDatasetInfo)Description copied from interface:DataProviderIn the specified data source, update the information for the specified data set.
- Specified by:
updateDatasetInfoin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- The name of the dataset to be updated.newDatasetInfo- New data source information.
-
updateDatasourceInfo
public void updateDatasourceInfo(java.lang.String datasourceName, DatasourceInfo newDatasourceInfo)Description copied from interface:DataProviderUpdates the original data source information with the new data source information.
- Specified by:
updateDatasourceInfoin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.newDatasourceInfo- new data source information.
-
updateFeatures
public EditResult updateFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
Description copied from interface:DataProviderUpdates a set of features in the specified dataset.
The parameter targetFeatures is a new feature list whose feature ID is the same as the feature ID to be updated in the dataset, finds the element to be updated based on the ID, and then updates the original feature to the new feature.
- Specified by:
updateFeaturesin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.targetFeatures- new feature list. Its ID is the same as the feature ID to be updated.- Returns:
- edit the results.
-
updateFieldInfos
public void updateFieldInfos(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<FieldInfo> newFieldInfos)Description copied from interface:DataProviderUpdates the field information for the specified dataset.
Use this method to achieve add, delete, modify operation to the field, that is, the entire data set field (except SuperMap system field) is replaced with the new field.
If you are using SuperMap data, updating the alias of SuperMap system field is not currently supported.
- Specified by:
updateFieldInfosin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.newFieldInfos- new field information. If you are using SuperMap data, the new field information list can not contain SuperMap's system fields.
-
setProviderContext
public void setProviderContext(ProviderContext context)
Description copied from interface:ProviderContextAwareSets the service provider context
- Specified by:
setProviderContextin interfaceProviderContextAware- Parameters:
context- service provider context
-
getDomainInfos
public java.util.List<DomainInfo> getDomainInfos(java.lang.String datasourceName, java.lang.String datasetName)
Description copied from interface:DataProviderGets all the domain information for the specified dataset
- Specified by:
getDomainInfosin interfaceDataProvider- Parameters:
datasourceName- the name of the datasourcedatasetName- the dataset name- Returns:
- Domain information list
-
deleteFeatures
public EditResult deleteFeatures(java.lang.String datasourceName, QueryParameter parameters)
Description copied from interface:DataProviderSpecifies the data source to remove the feature via sql.
- Specified by:
deleteFeaturesin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.parameters- Query parameter.- Returns:
- Edits the results.
-
getDatasetNames
public java.util.List<java.lang.String> getDatasetNames(java.lang.String datasourceName)
Description copied from interface:DataProviderGets all dataset names for the current data source.
- Specified by:
getDatasetNamesin interfaceDataProvider- Parameters:
datasourceName- the data source name.- Returns:
- A list of dataset names.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields, int fromIndex, int toIndex)
Description copied from interface:DataProviderGets the feature in the specified data set according to the specified feature ID in the way of supporting paging.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.ids- Feature ID.fields- An array of fields to be returned. When the parameter is null, all fields are returned.fromIndex- The minimum index number for the result of the pagingtoIndex- The maximum index number for the result of the paging- Returns:
- Feature lists.
-
-