Class JDBCFeatureIOService
- java.lang.Object
-
- oracle.spatial.network.nfe.io.jdbc.service.JDBCAbstractIOService
-
- oracle.spatial.network.nfe.io.jdbc.service.JDBCFeatureIOService
-
- All Implemented Interfaces:
NFEFeatureIOService
,NFEIOService
public class JDBCFeatureIOService extends JDBCAbstractIOService implements NFEFeatureIOService
Provides the default implementation for the feature service.
-
-
Constructor Summary
Constructors Constructor Description JDBCFeatureIOService(NFEIOServiceProvider serviceProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JGeometry
calculatePersistedNetworkMBR()
Returns the minimum bounding rectangle of the model network.java.util.List<java.lang.Long>
findFeaturesIds(NFESearchParams searchParams)
Searches features based on the specified parameters.java.util.List<NFEFeature>
getChildFeatures(NFEFeature nfeFeature)
Returns the child features of the specified feature.JGeometry
getMBRForNodes(java.lang.String geoColumn, java.lang.String table, java.util.List<java.lang.Long> nodeIds, java.lang.String workspace)
Returns the minimum bounding rectangle of the specified nodes.java.util.List<java.lang.Long>
getRelatedLinkIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId)
Returns the links identifiers of the links related by the specified feature.java.util.List<java.lang.Long>
getRelatedNodeIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId)
Returns the nodes identifiers of the nodes related by the specified feature.java.util.List<java.lang.Long>
getRelatedNodesIdsForLink(java.lang.Long linkId)
Returns the start and end nodes identifiers of the specified link.void
importNetworkElementsAsFeatures(java.lang.String srcNetworkName, long linesFeatureLayerId, long linesFeatureClassId, long nodesFeatureLayerId, long nodesFeatureClassId)
Imports all the links and nodes from the specified network to the current model in the database, translating them into line and point features respectively.NFEFeature
loadFeature(long featureLayerId, long featureId)
Loads the feature, network elements, feature elements and rules instances related to the specified feature.void
loadFeatureLayersContent(java.awt.geom.Area queryArea, java.util.Collection<java.lang.Long> featLayerIds)
Loads the network elements, feature elements, features and rules instances that interact spatially with the specified area.java.util.Collection<NFEFeature>
loadLinkFeatures(long linkId)
Loads into the Model the link and the features associated to the link.java.util.Collection<NFEFeature>
loadNodeFeatures(long nodeId)
Loads into the Model the node and the features associated to the node.void
saveModelContent()
Saves the feature layers network elements, feature elements, features and rules instances that were created, modified or deleted.void
saveModelContent(java.sql.Connection conn)
Saves the feature layers network elements, feature elements, features and rules instances that were created, modified or deleted, the specified connection will NOT be closed, rollback or commited.void
updateAttributeForFeatures(NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue, java.lang.String oldValue)
Updates the features attributes from the old value to the new value.-
Methods inherited from class oracle.spatial.network.nfe.io.jdbc.service.JDBCAbstractIOService
close, commit, commitAndClose, getDataSource, getModel, getServiceProvider, rollback, rollbackAndClose, setDataSource, setModel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oracle.spatial.network.nfe.io.service.NFEIOService
getDataSource, getModel, getServiceProvider, setDataSource, setModel
-
-
-
-
Constructor Detail
-
JDBCFeatureIOService
public JDBCFeatureIOService(NFEIOServiceProvider serviceProvider)
-
-
Method Detail
-
loadNodeFeatures
public java.util.Collection<NFEFeature> loadNodeFeatures(long nodeId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Loads into the Model the node and the features associated to the node.- Specified by:
loadNodeFeatures
in interfaceNFEFeatureIOService
- Parameters:
nodeId
- id of the node to be loaded along with its features- Returns:
- A collection containing the features associated to the passed nodeId
- Throws:
NFEIOException
-
loadLinkFeatures
public java.util.Collection<NFEFeature> loadLinkFeatures(long linkId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Loads into the Model the link and the features associated to the link.- Specified by:
loadLinkFeatures
in interfaceNFEFeatureIOService
- Parameters:
linkId
- id of the link to be loaded along with its features- Returns:
- A collection containing the features associated to the passed linkId
- Throws:
NFEIOException
-
loadFeature
public NFEFeature loadFeature(long featureLayerId, long featureId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Loads the feature, network elements, feature elements and rules instances related to the specified feature. Note that the deleted features in the model will not be loaded.- Specified by:
loadFeature
in interfaceNFEFeatureIOService
- Parameters:
featureLayerId
- feature layer identifier of the feature to loadfeatureId
- feature identifier- Returns:
- feature
- Throws:
NFEIOException
- if an NFE error occurs.
-
loadFeatureLayersContent
public void loadFeatureLayersContent(java.awt.geom.Area queryArea, java.util.Collection<java.lang.Long> featLayerIds) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Loads the network elements, feature elements, features and rules instances that interact spatially with the specified area. Note that the deleted elements in the model will not be loaded.- Specified by:
loadFeatureLayersContent
in interfaceNFEFeatureIOService
- Parameters:
queryArea
- area to load the feature layers contentfeatLayerIds
- identifiers of the feature layers to load the content- Throws:
NFEIOException
- if an NFE error occurs.
-
saveModelContent
public void saveModelContent() throws NFEIOException
Description copied from interface:NFEFeatureIOService
Saves the feature layers network elements, feature elements, features and rules instances that were created, modified or deleted.- Specified by:
saveModelContent
in interfaceNFEFeatureIOService
- Throws:
NFEIOException
- if an NFE error occurs.
-
saveModelContent
public void saveModelContent(java.sql.Connection conn) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Saves the feature layers network elements, feature elements, features and rules instances that were created, modified or deleted, the specified connection will NOT be closed, rollback or commited. This saving function allow to perform more tasks and to commit and close the connection when needed.- Specified by:
saveModelContent
in interfaceNFEFeatureIOService
- Parameters:
conn
- Connection- Throws:
NFEIOException
- if an NFE error occurs.
-
calculatePersistedNetworkMBR
public JGeometry calculatePersistedNetworkMBR() throws NFEIOException
Description copied from interface:NFEFeatureIOService
Returns the minimum bounding rectangle of the model network.- Specified by:
calculatePersistedNetworkMBR
in interfaceNFEFeatureIOService
- Returns:
- minimum bounding rectangle of the model network
- Throws:
NFEIOException
- if an NFE error occurs.
-
findFeaturesIds
public java.util.List<java.lang.Long> findFeaturesIds(NFESearchParams searchParams) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Searches features based on the specified parameters. In the object searchParams the featureLayerId is mandatory, the parameters featureClassId, featureId and conditionString are optional. The conditionString parameter will be added to the where clause of the search query on the feature table.- Specified by:
findFeaturesIds
in interfaceNFEFeatureIOService
- Parameters:
searchParams
- search parameters- Returns:
- identifiers of the resulting features
- Throws:
NFEIOException
- if an NFE error occurs.
-
getRelatedNodeIdsForFeature
public java.util.List<java.lang.Long> getRelatedNodeIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Returns the nodes identifiers of the nodes related by the specified feature.- Specified by:
getRelatedNodeIdsForFeature
in interfaceNFEFeatureIOService
- Parameters:
featureLayer
- feature layerfeatureId
- feature id- Returns:
- list of nodes identifiers
- Throws:
NFEIOException
- if an NFE error occurs.
-
getRelatedLinkIdsForFeature
public java.util.List<java.lang.Long> getRelatedLinkIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Returns the links identifiers of the links related by the specified feature.- Specified by:
getRelatedLinkIdsForFeature
in interfaceNFEFeatureIOService
- Parameters:
featureLayer
- feature layerfeatureId
- feature id- Returns:
- list of links identifiers
- Throws:
NFEIOException
- if an NFE error occurs.
-
getChildFeatures
public java.util.List<NFEFeature> getChildFeatures(NFEFeature nfeFeature) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Returns the child features of the specified feature. Note that the deleted features in the model will not be returned.- Specified by:
getChildFeatures
in interfaceNFEFeatureIOService
- Parameters:
nfeFeature
- feature parent- Returns:
- child features
- Throws:
NFEIOException
- if an NFE error occurs.
-
getRelatedNodesIdsForLink
public java.util.List<java.lang.Long> getRelatedNodesIdsForLink(java.lang.Long linkId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Returns the start and end nodes identifiers of the specified link.- Specified by:
getRelatedNodesIdsForLink
in interfaceNFEFeatureIOService
- Parameters:
linkId
- link id- Returns:
- start and end nodes identifiers
- Throws:
NFEIOException
- if an NFE error occurs.
-
getMBRForNodes
public JGeometry getMBRForNodes(java.lang.String geoColumn, java.lang.String table, java.util.List<java.lang.Long> nodeIds, java.lang.String workspace) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Returns the minimum bounding rectangle of the specified nodes.- Specified by:
getMBRForNodes
in interfaceNFEFeatureIOService
- Parameters:
geoColumn
- geometry column name in nodes tabletable
- nodes tablenodeIds
- nodes identifiersworkspace
- workspace that will be used by the connection, if null the current workspace will be used- Returns:
- the minimum bounding rectangle of the specified nodes
- Throws:
NFEIOException
- if an NFE error occurs.
-
updateAttributeForFeatures
public void updateAttributeForFeatures(NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue, java.lang.String oldValue) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Updates the features attributes from the old value to the new value. The features have to belong to the specified feature layer and feature class. Only the attributes having the current value as the old value will be updated. This method can be used for example to update all the affected attributes when a catalog value changes.- Specified by:
updateAttributeForFeatures
in interfaceNFEFeatureIOService
- Parameters:
nfeFeatureLayer
- feature layerfeatureClassId
- feature class identifierattributeName
- attribute namenewValue
- new valueoldValue
- old value- Throws:
NFEIOException
- if an NFE error occurs.
-
importNetworkElementsAsFeatures
public void importNetworkElementsAsFeatures(java.lang.String srcNetworkName, long linesFeatureLayerId, long linesFeatureClassId, long nodesFeatureLayerId, long nodesFeatureClassId) throws NFEIOException
Description copied from interface:NFEFeatureIOService
Imports all the links and nodes from the specified network to the current model in the database, translating them into line and point features respectively.- Specified by:
importNetworkElementsAsFeatures
in interfaceNFEFeatureIOService
- Parameters:
srcNetworkName
- network name to be importedlinesFeatureLayerId
- translating line features' feature layer idlinesFeatureClassId
- translating line features' feature class idnodesFeatureLayerId
- translating node features' feature layer idnodesFeatureClassId
- translating node features' feature class id- Throws:
NFEIOException
- if an NFE error occurs.
-
-