Class PostgreServerHandler
java.lang.Object
com.kheops.jmap.server.datasources.egdb.EgdbHandler
com.kheops.jmap.server.datasources.egdb.PostgreServerHandler
Implements all needed methods to handle an Postgre database.
- 
Field SummaryFields inherited from class com.kheops.jmap.server.datasources.egdb.EgdbHandlerrequestFID, requestOID
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidappendAttributeFilter(AttributeFilter filter, StringBuffer filterBuffer) Append to the filter buffer a new condition using the attribute's name and attribute's value.voidappendGeometryTypesFilter(GeometryTypesFilter filter, StringBuffer filterBuffer) Append to the filter buffer a new condition using the geometry type.voidappendSpatialFilter(SpatialQueryFilter filter, StringBuffer filterBuffer) Append to the filter buffer a new condition using the method to determine relationship between geometries.voidappendSqlFilter(SQLQueryFilter filter, StringBuffer queryBuffer, StringBuffer orderByBuffer) Append to the filter buffer a new condition using the boundaries.buildGeometrySelectStatement(Attribute[] attributes) Build the select statement for geometry storage type.Method to decode a geometryvoiddetermineBinaryInformation(EgdbFeatureConfig featureConfig) Set feature geometry table, indexes and spatial column name where the geometry is stored.Method to encode a JMap geometryintExtract the srid form the spatial reference tableprotected StringFor versioned layer, this method establishes the restriction to exclude elements that have been removed.intgetAttributeCount(String attributeName, String queryFilter) Method for attribute statistics.Domain[]Return the available coded value domains if they exist, otherwise return an empty array.Gets the geometry type name of the layer: ST_POINT, ST_POLYGON,...String[]Get all available name of the existing layersDomain[]Return the available range domains if they exist, otherwise return and empty array All available domains will be returned even if they are used or notMethod to return the definition of the all columns of the ESRI Data base.protected StringgetDbInstance(String urlConnection) To return the instance's name of the ESRI databaseReturn an String with the defaults storage type inside the DBTUNE table.The name of Delta table A (adds)The name of Delta table D (deletes)intReturn the total amount of spatial elementsgetFeatureExtent(String queryFilter) Return the extend of the filtered features when the storage type is SDEBINAY and as consequence a feature table must existsProperties of the feature falseX, falseY, minX, minY, maxX, maxY, gSize, xyUnits, dbNameReturn the name of the feature tablegetGeometryExtent(String filter) Return the extend of the filtered features when the storage type is GEOMETRYTo get the geometry column name of the layer.When the storage type is binary then the spatial data is saved in the feature table and its attributes remain in the base table.getGeometryStorageType(String key_config) To get the name of the geometry identifier column name.Return the name of the table which register the last object id value of the layer.Return the name of the spatial index tableintgetJMapAvailableGeometryType(String geometryType) Gets the JMap geometry type of the layerReturn a String with the layer configuration keyword that was specified when the layer was created e.g.intgetLayerGeometryTypeCode(Geometry geometry) Get the SDE geometry type code.intReturn the layer id from the layers tableintThis method is deprecated, use extractSridFromSpatialReference() instead Return the srid from sde_spatial_references table.longgetNextId(int requestId) Used during the insert transaction, to generate the identifier of the new record to insertgetNumericStats(String attributeName, String queryFilter) Calculate MIN, MAX, AVG, STDEV for numeric attributegetRelatedDomainName(String attributeName) Return the domain name related to an attribute if both are related.protected String[]Return an array with the names of the default systems tablesintReturn the identifier of the base table in the SDE_table_registry table.getUniqueValues(String attributeName, String queryFilter) Return the unique values to storing themReturn the version of the Enterprise GeoDataBase e.g 10.0.0 or 10.2.1protected StringFor versioned layer, this method establishes the restriction to exclude elements that have been removed or those elements that correspond to an old version.voidinsertElement(JMapGeoElement geoElement, EditionResult result, Attribute[] attributes) Execute the insertion of the new geoElement.booleanThe feature is versioned or notvoidloadRelationships(Attribute attribute) Find possible relationShips with the given attributeprocessDeleteStatement(long elementsIds) Delete elements from base table.processUpdateStatement(JMapGeoElement[] elements, Attribute[] attributes) Update elements for unversioned layers.processVersionedDeleteStatement(long elementsIds) Insert elements in delete delta tables.processVersionedUpdateStatement(JMapGeoElement[] elements, Attribute[] attributes) Update elements for versioned layers.setupQueryFilters(QueryFilter[] queryFilters) Build the SQL condition to apply the query filters.protected intConvert an EGDB domain type to SQL typeMethods inherited from class com.kheops.jmap.server.datasources.egdb.EgdbHandleravailableSchemaNames, buildBinarySqlQuery, buildGeometrySqlQuery, buildQuery, buildVersionedGeometrySqlQuery, bytesToHex, calculateGeometryArea, calculateGeometryLength, calculateNumOfPts, checkGeodatabaseFromSchema, convertCodedValues, convertComparisonClauses, databaseSchema, existsAdditionalSystemTables, extractAttributeName, extractAttributeValues, extractLayerGeometries, filterExcludeRemovedElementsFromBase, getAttributes, getAvailableDomains, getDefaultVersionState, getEgdbDataSourceInfo, getEgdbDialect, getElementsCount, getStorageType, getVersionedElements, isGeodatabase, queryStatesFromVersion, setEgdbDataSourceInfo, setEgdbDialect, systemSchema, updateEgdbDataSourceInfo
- 
Constructor Details- 
PostgreServerHandler
 
- 
- 
Method Details- 
encodeDescription copied from class:EgdbHandlerMethod to encode a JMap geometry- Specified by:
- encodein class- EgdbHandler
- Throws:
- SQLException
 
- 
decodeDescription copied from class:EgdbHandlerMethod to decode a geometry- Specified by:
- decodein class- EgdbHandler
- Parameters:
- spatialData- Spatial data to decode
- numofpts- Valid for OGCWKB and SDEBINARY storage type. Useful only for SDEBINARY storage type. For the other storage type is null
- Returns:
- The decoded JMap geometry
- Throws:
- Exception
 
- 
appendSqlFilterpublic void appendSqlFilter(SQLQueryFilter filter, StringBuffer queryBuffer, StringBuffer orderByBuffer) throws Exception Description copied from class:EgdbHandlerAppend to the filter buffer a new condition using the boundaries.- Specified by:
- appendSqlFilterin class- EgdbHandler
- Throws:
- Exception
 
- 
appendSpatialFilterDescription copied from class:EgdbHandlerAppend to the filter buffer a new condition using the method to determine relationship between geometries.- Specified by:
- appendSpatialFilterin class- EgdbHandler
- Parameters:
- filter- Spatial relationship method between geometries.
- filterBuffer- String buffer which value is the query which the filter is going to append
 
- 
appendGeometryTypesFilterDescription copied from class:EgdbHandlerAppend to the filter buffer a new condition using the geometry type.- Specified by:
- appendGeometryTypesFilterin class- EgdbHandler
- Parameters:
- filter- Available geometry type
- filterBuffer- String buffer which value is the query which the filter is going to append.
 
- 
appendAttributeFilterDescription copied from class:EgdbHandlerAppend to the filter buffer a new condition using the attribute's name and attribute's value. The statement is build taking into account the attribute's value data type.- Specified by:
- appendAttributeFilterin class- EgdbHandler
- Parameters:
- filter- Attribute used in the condition.
- filterBuffer- String buffer which value is the query which the filter is going to append.
 
- 
getIdColumnDescription copied from class:EgdbHandlerTo get the name of the geometry identifier column name.- Specified by:
- getIdColumnin class- EgdbHandler
- Returns:
- The name of the ID column in the base table
- Throws:
- SQLException
 
- 
getGeometrySpatialColumnDescription copied from class:EgdbHandlerTo get the geometry column name of the layer.- Specified by:
- getGeometrySpatialColumnin class- EgdbHandler
- Returns:
- The name of the Geometry column in the base table
- Throws:
- Exception
 
- 
getColumnDefinitionDescription copied from class:EgdbHandlerMethod to return the definition of the all columns of the ESRI Data base. Every particular handler need to implement the way to get it. In the return array is included the OBJECT_ID and the SHAPE columns- Specified by:
- getColumnDefinitionin class- EgdbHandler
- Throws:
- SQLException
 
- 
getVersionDescription copied from class:EgdbHandlerReturn the version of the Enterprise GeoDataBase e.g 10.0.0 or 10.2.1- Specified by:
- getVersionin class- EgdbHandler
- Throws:
- SQLException- Error occurred while retrieving the version of the Enterprise GeoDatabase
 
- 
getLayerConfigDescription copied from class:EgdbHandlerReturn a String with the layer configuration keyword that was specified when the layer was created e.g. DEFAULTS, GEOMETRY, WKB_GEOMETRY. Other values need to be explored- Specified by:
- getLayerConfigin class- EgdbHandler
- Throws:
- SQLException- Error raised extracting the configuration of a layer
 
- 
getDefaultsStorageTypeDescription copied from class:EgdbHandlerReturn an String with the defaults storage type inside the DBTUNE table. The result depends of the DBMS e.g. SQLServer: Geometry, Geography, SDEBinary, OGCWKB- Specified by:
- getDefaultsStorageTypein class- EgdbHandler
- Throws:
- SQLException- Error raised extracting the default storage type
 
- 
getGeometryStorageType- Specified by:
- getGeometryStorageTypein class- EgdbHandler
- Throws:
- SQLException- Error raised extracting the geometry storage type
 
- 
getAvailableLayerNamesDescription copied from class:EgdbHandlerGet all available name of the existing layers- Specified by:
- getAvailableLayerNamesin class- EgdbHandler
- Throws:
- SQLException
 
- 
getDbInstanceDescription copied from class:EgdbHandlerTo return the instance's name of the ESRI database- Specified by:
- getDbInstancein class- EgdbHandler
 
- 
getLayerIdpublic int getLayerId()Description copied from class:EgdbHandlerReturn the layer id from the layers table- Specified by:
- getLayerIdin class- EgdbHandler
 
- 
getFeatureTableNameDescription copied from class:EgdbHandlerReturn the name of the feature table- Specified by:
- getFeatureTableNamein class- EgdbHandler
 
- 
getIndexTableNameDescription copied from class:EgdbHandlerReturn the name of the spatial index table- Specified by:
- getIndexTableNamein class- EgdbHandler
 
- 
getDeltaTableAddsDescription copied from class:EgdbHandlerThe name of Delta table A (adds)- Specified by:
- getDeltaTableAddsin class- EgdbHandler
- Throws:
- SQLException
 
- 
getDeltaTableDeletesDescription copied from class:EgdbHandlerThe name of Delta table D (deletes)- Specified by:
- getDeltaTableDeletesin class- EgdbHandler
- Throws:
- SQLException
 
- 
getFeaturePropertiesDescription copied from class:EgdbHandlerProperties of the feature falseX, falseY, minX, minY, maxX, maxY, gSize, xyUnits, dbName- Specified by:
- getFeaturePropertiesin class- EgdbHandler
- Throws:
- SQLException- Raised when an exception occurs retrieving the properties of the feature
 
- 
getAvailableCodedValueDomainsDescription copied from class:EgdbHandlerReturn the available coded value domains if they exist, otherwise return an empty array. All available domains will be returned even if they are used or not- Specified by:
- getAvailableCodedValueDomainsin class- EgdbHandler
- Throws:
- Exception- Raised while loading the coded value domains
 
- 
getAvailableRangeDomainsDescription copied from class:EgdbHandlerReturn the available range domains if they exist, otherwise return and empty array All available domains will be returned even if they are used or not- Specified by:
- getAvailableRangeDomainsin class- EgdbHandler
- Throws:
- Exception- Raised while loading the range domains
 
- 
getRelatedDomainNameDescription copied from class:EgdbHandlerReturn the domain name related to an attribute if both are related. Otherwise return null- Specified by:
- getRelatedDomainNamein class- EgdbHandler
- Throws:
- SQLException
 
- 
isVersionedDescription copied from class:EgdbHandlerThe feature is versioned or not- Specified by:
- isVersionedin class- EgdbHandler
- Throws:
- SQLException- raised while retrieving the definition column of the layer
 
- 
setupQueryFiltersDescription copied from class:EgdbHandlerBuild the SQL condition to apply the query filters. The method also reduce the search when storage type is SDEBinary- Specified by:
- setupQueryFiltersin class- EgdbHandler
- Throws:
- Exception
 
- 
getAvailableGeometryTypeDescription copied from class:EgdbHandlerGets the geometry type name of the layer: ST_POINT, ST_POLYGON,...- Specified by:
- getAvailableGeometryTypein class- EgdbHandler
- Returns:
- ST_GEOMETRY type
- Throws:
- SQLException
 
- 
getTableRegistryIdDescription copied from class:EgdbHandlerReturn the identifier of the base table in the SDE_table_registry table. This identifier is used to find the delta tables when the layer is versioned- Specified by:
- getTableRegistryIdin class- EgdbHandler
- Throws:
- SQLException- Raised when an error occurs retrieving the registry id of the layer
 
- 
getGeometrySpatialDataColumnDescription copied from class:EgdbHandlerWhen the storage type is binary then the spatial data is saved in the feature table and its attributes remain in the base table. So it is necessary to know where to look for the geometry spatial data to extract the layer's elements.- Specified by:
- getGeometrySpatialDataColumnin class- EgdbHandler
- Throws:
- SQLException
 
- 
getFeatureExtentDescription copied from class:EgdbHandlerReturn the extend of the filtered features when the storage type is SDEBINAY and as consequence a feature table must exists- Specified by:
- getFeatureExtentin class- EgdbHandler
 
- 
getJMapAvailableGeometryTypeDescription copied from class:EgdbHandlerGets the JMap geometry type of the layer- Specified by:
- getJMapAvailableGeometryTypein class- EgdbHandler
- Returns:
- ST_GEOMETRY type
 
- 
getAttributeCountDescription copied from class:EgdbHandlerMethod for attribute statistics. Calculate the distinct count of a attribute- Specified by:
- getAttributeCountin class- EgdbHandler
- Throws:
- Exception
 
- 
getUniqueValuespublic Hashtable<Object,Object> getUniqueValues(String attributeName, String queryFilter) throws Exception Description copied from class:EgdbHandlerReturn the unique values to storing them- Specified by:
- getUniqueValuesin class- EgdbHandler
- Throws:
- Exception
 
- 
getNumericStatsDescription copied from class:EgdbHandlerCalculate MIN, MAX, AVG, STDEV for numeric attribute- Specified by:
- getNumericStatsin class- EgdbHandler
- Throws:
- Exception
 
- 
getElementCountDescription copied from class:EgdbHandlerReturn the total amount of spatial elements- Specified by:
- getElementCountin class- EgdbHandler
- Throws:
- SQLException
 
- 
getSystemTablesDescription copied from class:EgdbHandlerReturn an array with the names of the default systems tables- Specified by:
- getSystemTablesin class- EgdbHandler
 
- 
determineBinaryInformationDescription copied from class:EgdbHandlerSet feature geometry table, indexes and spatial column name where the geometry is stored.- Specified by:
- determineBinaryInformationin class- EgdbHandler
- Throws:
- SQLException- Raised when an error occurs extracting feature geometry table, indexes or spatial column name
 
- 
extractSridFromSpatialReferenceDescription copied from class:EgdbHandlerExtract the srid form the spatial reference table- Specified by:
- extractSridFromSpatialReferencein class- EgdbHandler
- Throws:
- SQLException- Error occurred while retrieving the srid of the layer
 
- 
getLayerSridDescription copied from class:EgdbHandlerThis method is deprecated, use extractSridFromSpatialReference() instead Return the srid from sde_spatial_references table. This value is used to work with SQLServer geo-database to extract and insert elements- Specified by:
- getLayerSridin class- EgdbHandler
- Throws:
- Exception
 
- 
getGeometryExtentDescription copied from class:EgdbHandlerReturn the extend of the filtered features when the storage type is GEOMETRY- Specified by:
- getGeometryExtentin class- EgdbHandler
- Throws:
- Exception
 
- 
insertElementpublic void insertElement(JMapGeoElement geoElement, EditionResult result, Attribute[] attributes) throws Exception Description copied from class:EgdbHandlerExecute the insertion of the new geoElement. Prepare insertion query statement.- Specified by:
- insertElementin class- EgdbHandler
- Parameters:
- geoElement- New element to be inserted
- result- Out parameter with the operation's result
- Throws:
- Exception
 
- 
getIdentifierManagerTableNameDescription copied from class:EgdbHandlerReturn the name of the table which register the last object id value of the layer. This name is useful to identify the store procedure's name to execute and return the next objectId value. This value is going to be use into an insert statement.- Specified by:
- getIdentifierManagerTableNamein class- EgdbHandler
- Throws:
- SQLException
 
- 
getNextIdDescription copied from class:EgdbHandlerUsed during the insert transaction, to generate the identifier of the new record to insert- Specified by:
- getNextIdin class- EgdbHandler
- Returns:
- The next ID available or 0 if none exists
- Throws:
- Exception
 
- 
processDeleteStatementDescription copied from class:EgdbHandlerDelete elements from base table. This method is used to delete element for unversioned layers- Specified by:
- processDeleteStatementin class- EgdbHandler
 
- 
processVersionedDeleteStatementDescription copied from class:EgdbHandlerInsert elements in delete delta tables. This method is used to delete elements for versioned layers.- Specified by:
- processVersionedDeleteStatementin class- EgdbHandler
- Throws:
- Exception
 
- 
processUpdateStatementDescription copied from class:EgdbHandlerUpdate elements for unversioned layers.- Specified by:
- processUpdateStatementin class- EgdbHandler
 
- 
processVersionedUpdateStatementpublic EditionResult[] processVersionedUpdateStatement(JMapGeoElement[] elements, Attribute[] attributes) throws Exception Description copied from class:EgdbHandlerUpdate elements for versioned layers.- Specified by:
- processVersionedUpdateStatementin class- EgdbHandler
- Throws:
- Exception
 
- 
getLayerGeometryTypeCodeDescription copied from class:EgdbHandlerGet the SDE geometry type code. This is the code inserted in entity column when a geometry is inserted in F# table. POINT_SHAPE 1 LINE_SHAPE 2 AREA_SHAPE 8- Specified by:
- getLayerGeometryTypeCodein class- EgdbHandler
 
- 
toSqlTypeDescription copied from class:EgdbHandlerConvert an EGDB domain type to SQL type- Specified by:
- toSqlTypein class- EgdbHandler
 
- 
loadRelationshipsDescription copied from class:EgdbHandlerFind possible relationShips with the given attribute- Specified by:
- loadRelationshipsin class- EgdbHandler
- Throws:
- SQLException
 
- 
buildGeometrySelectStatementDescription copied from class:EgdbHandlerBuild the select statement for geometry storage type.- Specified by:
- buildGeometrySelectStatementin class- EgdbHandler
 
- 
getVersionedElements10Description copied from class:EgdbHandlerFor versioned layer, this method establishes the restriction to exclude elements that have been removed or those elements that correspond to an old version. Elements from delta table 'A' which are in delta table 'D' are not included in the result. This method may change depending on DMBS because it call the function SDE_get_view_state() included on ArcGIS 10.x- Specified by:
- getVersionedElements10in class- EgdbHandler
- Returns:
- Sql query to be used into a sql condition.
 
- 
filterExcludeRemovedElementsFromBase10Description copied from class:EgdbHandlerFor versioned layer, this method establishes the restriction to exclude elements that have been removed. Elements from base table which are in delta table 'D' are not included in the result. This method may change depending on DMBS because it call the function SDE_get_view_state() included on ArcGIS 10.x- Specified by:
- filterExcludeRemovedElementsFromBase10in class- EgdbHandler
- Returns:
- Sql query to be used into a sql condition.
- Throws:
- SQLException
 
 
-