|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.complex.AppSchemaDataAccess
public class AppSchemaDataAccess
A DataAccess
that maps a "simple" source DataStore
into a source of full Feature
features conforming to an application schema.
Constructor Summary | |
---|---|
AppSchemaDataAccess(java.util.Set<FeatureTypeMapping> mappings)
Constructor. |
Method Summary | |
---|---|
void |
createSchema(org.opengis.feature.type.FeatureType featureType)
Not a supported operation. |
void |
dispose()
Disposes of this data store and releases any resource that it is using. |
protected ReferencedEnvelope |
getBounds(Query query)
Computes the bounds of the features for the specified feature type that satisfy the query provided that there is a fast way to get that result. |
protected int |
getCount(Query targetQuery)
Gets the number of the features that would be returned by this query for the specified feature type. |
FeatureSource<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> |
getFeatureSource(org.opengis.feature.type.Name typeName)
Return a feature source that can be used to obtain features of a particular type. |
FeatureSource<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> |
getFeatureSourceByName(org.opengis.feature.type.Name typeName)
Return a feature source that can be used to obtain features of a particular name. |
ServiceInfo |
getInfo()
Not a supported operation. |
FeatureTypeMapping |
getMappingByElement(org.opengis.feature.type.Name typeName)
Returns the mapping suite for the given target type name. |
FeatureTypeMapping |
getMappingByName(org.opengis.feature.type.Name typeName)
Returns the mapping suite for the given targetElement name or mappingName. |
java.util.List<org.opengis.feature.type.Name> |
getNames()
Return the names of the target features. |
org.opengis.feature.type.FeatureType |
getSchema(org.opengis.feature.type.Name typeName)
Finds the target FeatureType named typeName in this ComplexDatastore's internal
list of FeatureType mappings and returns it. |
org.opengis.feature.type.Name[] |
getTypeNames()
Returns the set of target type names this DataAccess holds, where the term 'target type name' refers to the name of one of the types this DataAccess produces by mapping another ones through the definitions stored in its FeatureTypeMappings |
protected org.opengis.filter.Filter |
getUnsupportedFilter(java.lang.String typeName,
org.opengis.filter.Filter filter)
Returns Filter.INCLUDE , as the whole filter is unrolled and passed back to the
underlying DataStore to be treated. |
boolean |
hasElement(org.opengis.feature.type.Name typeName)
|
boolean |
hasName(org.opengis.feature.type.Name name)
|
protected void |
register()
Registers this data access to the registry so the mappings can be retrieved globally |
static org.opengis.filter.Filter |
unrollFilter(org.opengis.filter.Filter complexFilter,
FeatureTypeMapping mapping)
Takes a filter that operates against a FeatureTypeMapping's target FeatureType, and unrolls it creating a new Filter that operates against the mapping's source FeatureType. |
Query |
unrollQuery(Query query,
FeatureTypeMapping mapping)
Creates a org.geotools.data.Query that operates over the surrogate DataStore, by
unrolling the org.geotools.filter.Filter contained in the passed
query , and replacing the list of required attributes by the ones of the mapped
FeatureType. |
void |
updateSchema(org.opengis.feature.type.Name typeName,
org.opengis.feature.type.FeatureType featureType)
Not a supported operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AppSchemaDataAccess(java.util.Set<FeatureTypeMapping> mappings) throws java.io.IOException
mappings
- a Set containing a FeatureTypeMapping for each FeatureType this
DataAccess is going to produce.
java.io.IOException
Method Detail |
---|
protected void register()
public org.opengis.feature.type.Name[] getTypeNames() throws java.io.IOException
java.io.IOException
public org.opengis.feature.type.FeatureType getSchema(org.opengis.feature.type.Name typeName) throws java.io.IOException
typeName
in this ComplexDatastore's internal
list of FeatureType mappings and returns it.
getSchema
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
typeName
- Type name a the resource from getNames()
java.io.IOException
public FeatureTypeMapping getMappingByName(org.opengis.feature.type.Name typeName) throws java.io.IOException
Note this method is public just for unit testing purposes
typeName
-
java.io.IOException
public FeatureTypeMapping getMappingByElement(org.opengis.feature.type.Name typeName) throws java.io.IOException
Note this method is public just for unit testing purposes
typeName
-
java.io.IOException
public boolean hasName(org.opengis.feature.type.Name name)
name
- mappingName or targetElement
public boolean hasElement(org.opengis.feature.type.Name typeName)
typeName
- targetElement name
protected ReferencedEnvelope getBounds(Query query) throws java.io.IOException
Will return null if there is not fast way to compute the bounds. Since it's based on some kind of header/cached information, it's not guaranteed to be real bound of the features
query
-
SchemaNotFoundException
java.io.IOException
protected int getCount(Query targetQuery) throws java.io.IOException
If getBounds(Query) returns -1
due to expense consider using
getFeatures(Query).getCount()
as a an alternative.
targetQuery
- Contains the Filter and MaxFeatures to find the bounds for.
-1
if count is too
expensive to calculate or any errors or occur.
java.io.IOException
java.io.IOException
- if there are errors getting the countprotected org.opengis.filter.Filter getUnsupportedFilter(java.lang.String typeName, org.opengis.filter.Filter filter)
Filter.INCLUDE
, as the whole filter is unrolled and passed back to the
underlying DataStore to be treated.
Filter.INLCUDE
public Query unrollQuery(Query query, FeatureTypeMapping mapping)
org.geotools.data.Query
that operates over the surrogate DataStore, by
unrolling the org.geotools.filter.Filter
contained in the passed
query
, and replacing the list of required attributes by the ones of the mapped
FeatureType.
query
- mapping
-
public static org.opengis.filter.Filter unrollFilter(org.opengis.filter.Filter complexFilter, FeatureTypeMapping mapping)
complexFilter
-
public void dispose()
DataAccess
A DataStore
cannot be used after dispose
has
been called, neither can any data access object it helped create, such
as FeatureReader
, FeatureSource
or FeatureCollection
.
This operation can be called more than once without side effects.
There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.
dispose
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
public ServiceInfo getInfo()
getInfo
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
DataAccess.getInfo()
public java.util.List<org.opengis.feature.type.Name> getNames()
getNames
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
DataAccess.getNames()
public void createSchema(org.opengis.feature.type.FeatureType featureType) throws java.io.IOException
createSchema
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
featureType
- FetureType to add to DataStore
java.io.IOException
- If featureType cannot be createdDataAccess.createSchema(org.opengis.feature.type.FeatureType)
public FeatureSource<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> getFeatureSource(org.opengis.feature.type.Name typeName) throws java.io.IOException
getFeatureSource
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
java.io.IOException
DataAccess.getFeatureSource(org.opengis.feature.type.Name)
public void updateSchema(org.opengis.feature.type.Name typeName, org.opengis.feature.type.FeatureType featureType) throws java.io.IOException
updateSchema
in interface DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>
java.io.IOException
- if the operation failedDataAccess.updateSchema(org.opengis.feature.type.Name,
org.opengis.feature.type.FeatureType)
public FeatureSource<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> getFeatureSourceByName(org.opengis.feature.type.Name typeName) throws java.io.IOException
typeName
- mappingName or targetElement
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |