public class NetworkDAO extends AbstractDAO
Constructor and Description |
---|
NetworkDAO(java.sql.Connection conn, NFEModel model)
Creates a NetworkDAO with the specified connection and model.
|
Modifier and Type | Method and Description |
---|---|
void |
createNetwork(long modelId, java.lang.String networkName, java.lang.Integer hierarchyLevels, boolean directed, boolean nodeWithCost)
Creates the network and the related sequences.
|
void |
deleteDanglingLinks(NFENetworkMetadata nfeNetworkMetadata)
Deletes the links that are not referenced by any feature in any feature layer.
|
void |
deleteDanglingNodes(NFENetworkMetadata nfeNetworkMetadata)
Deletes the nodes that are not referenced by any feature in any feature layer.
|
void |
deleteLinks(java.util.Collection<NFELink> delLinks)
Deletes the specified links.
|
void |
deleteNetwork(java.lang.String networkName)
Drops the NFE Network (an SDO Network associated with a NFE project) along with its tables and sequences, and the relations with the NFE project.
|
void |
deleteNodes(java.util.Collection<NFENode> delNodes)
Deletes the specified nodes and all the dependent network elements.
|
NFELink |
fetchLink(NFENetwork network, java.lang.Long linkId)
Returns the link object related to the specified link identifier.
|
NFENetworkMetadata |
fetchNetworkMetadata(java.lang.String networkName)
Returns the network metadata from the view user_sdo_network_metadata.
|
NFENode |
fetchNode(NFENetwork network, java.lang.Long nodeId)
Returns the node object related to the specified node identifier.
|
java.util.List<NFELink> |
getLinkInformation(NFEModel nfeModel, java.util.List<java.lang.Long> linkIds)
Returns the links objects for the specified links identifiers list.
|
java.util.List<java.lang.Long> |
getLinksIdsByNodeId(long nodeId, NFENetworkMetadata nfeNetworkMetadata)
Returns the links identifiers from the links having as start node or end node the specified node.
|
JGeometry |
getMBRForNodes(java.lang.String geoColumn, java.lang.String table, java.util.List<java.lang.Long> nodeIds)
Returns the minimum bounding rectangle of the specified nodes.
|
java.util.List<NFENode> |
getNodeInformation(NFEModel nfeModel, java.util.List<java.lang.Long> nodeIds)
Returns the NFE node objects related to the specified nodes identifiers.
|
java.util.List<java.lang.Long> |
getRelatedNodesIdsForLink(java.lang.Long linkId, NFENetworkMetadata nfeNetworkMetadata)
Returns start and end nodes identifiers of the link.
|
void |
importNetwork(java.lang.String srcNetworkName, long linesFeatureLayerId, long linesFeatureClassId, long pointsFeatureLayerId, long pointsFeatureClassId)
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.
|
java.util.Collection<NFENetworkElement> |
loadNetworkElements(java.util.Collection<JGeometry> mbrs)
Returns the network elements that interact spatially with the specified minimum bounding rectangle (MBR).
|
boolean |
networkExistsTest(java.lang.String networkName)
Returns true if the specified network exists, false otherwise.
|
void |
saveLinks(java.util.Collection<NFELink> newLinks)
Persists the new links in the link table.
|
void |
saveNodes(java.util.Collection<NFENode> newNodes)
Persists the new nodes in the node table.
|
void |
updateLinkCostAsLenght(NFENetworkMetadata netMetadata, java.util.List<java.lang.Long> linksIds)
Updates the link cost of the specified links to be equals to the links lengths.
|
void |
updateLinks(java.util.Collection<NFELink> updLinks)
Updates the links information in the link table.
|
void |
updateLinksGeometry(NFENetworkMetadata networkMetadata, java.util.List<java.lang.Long> linksIds)
Updates the geometry of the specified links.
|
void |
updateNodes(java.util.Collection<NFENode> updNodes)
Updates the nodes information in the node table.
|
getConnection, getModel, getSQLValidator
public NetworkDAO(java.sql.Connection conn, NFEModel model)
conn
- connectionmodel
- modelpublic java.util.Collection<NFENetworkElement> loadNetworkElements(java.util.Collection<JGeometry> mbrs) throws NFEIOException
mbrs
- minimum bounding rectangle geometriesNFEIOException
- if an NFE error occurs.public void saveNodes(java.util.Collection<NFENode> newNodes) throws NFEIOException
newNodes
- nodes to persistNFEIOException
- if an NFE error occurs.public void saveLinks(java.util.Collection<NFELink> newLinks) throws NFEIOException
newLinks
- links to persistNFEIOException
- if an NFE error occurs.public void updateNodes(java.util.Collection<NFENode> updNodes) throws NFEIOException
updNodes
- nodes to updateNFEIOException
- if an NFE error occurs.public void updateLinks(java.util.Collection<NFELink> updLinks) throws NFEIOException
updLinks
- links to updateNFEIOException
- if an NFE error occurs.public void deleteNodes(java.util.Collection<NFENode> delNodes) throws NFEIOException
delNodes
- nodes to deleteNFEIOException
- if an NFE error occurs.public void deleteLinks(java.util.Collection<NFELink> delLinks) throws NFEIOException
delLinks
- links to deleteNFEIOException
- if an NFE error occurs.public NFENode fetchNode(NFENetwork network, java.lang.Long nodeId) throws NFEIOException
network
- network that contains the nodenodeId
- node identifierNFEIOException
- if an NFE error occurs.public NFELink fetchLink(NFENetwork network, java.lang.Long linkId) throws NFEIOException
network
- networklinkId
- link identifierNFEIOException
- if an NFE error occurs.public boolean networkExistsTest(java.lang.String networkName) throws NFEIOException
networkName
- network nameNFEIOException
- if an NFE error occurs.public void createNetwork(long modelId, java.lang.String networkName, java.lang.Integer hierarchyLevels, boolean directed, boolean nodeWithCost) throws NFEIOException
modelId
- model identifiernetworkName
- network namehierarchyLevels
- Number of hierarchy levels for the links in the network. For an explanation of network hierarchy, see Section 5.5 of the NDM Developer Guide.directed
- true indicates that the links are directed; false indicates that the links are undirected (not directed)nodeWithCost
- true causes a column named COST to be included in the <network-name>_NODE$ table; false causes a column named COST not to be included in the <network-name>_NODE$ tableNFEIOException
- if an NFE error occurs.public NFENetworkMetadata fetchNetworkMetadata(java.lang.String networkName) throws NFEIOException
networkName
- network nameNFEIOException
- if an NFE error occurs.public void importNetwork(java.lang.String srcNetworkName, long linesFeatureLayerId, long linesFeatureClassId, long pointsFeatureLayerId, long pointsFeatureClassId) throws NFEIOException
srcNetworkName
- network name to be importedlinesFeatureLayerId
- translating line features' feature layer idlinesFeatureClassId
- translating line features' feature class idpointsFeatureLayerId
- translating node features' feature layer idpointsFeatureClassId
- translating node features' feature class idNFEIOException
- if an NFE error occurs.public java.util.List<java.lang.Long> getRelatedNodesIdsForLink(java.lang.Long linkId, NFENetworkMetadata nfeNetworkMetadata) throws NFEIOException
linkId
- link identifiernfeNetworkMetadata
- network metadataNFEIOException
- if an NFE error occurs.public java.util.List<java.lang.Long> getLinksIdsByNodeId(long nodeId, NFENetworkMetadata nfeNetworkMetadata) throws NFEIOException
nodeId
- node identifiernfeNetworkMetadata
- network metadataNFEIOException
- if an NFE error occurs.public java.util.List<NFELink> getLinkInformation(NFEModel nfeModel, java.util.List<java.lang.Long> linkIds) throws NFEIOException
nfeModel
- modellinkIds
- links identifiers listNFEIOException
- if an NFE error occurs.public void deleteDanglingLinks(NFENetworkMetadata nfeNetworkMetadata) throws NFEIOException
nfeNetworkMetadata
- network metadataNFEIOException
- if an NFE error occurs.public void deleteDanglingNodes(NFENetworkMetadata nfeNetworkMetadata) throws NFEIOException
nfeNetworkMetadata
- network metadataNFEIOException
- if an NFE error occurs.public void updateLinksGeometry(NFENetworkMetadata networkMetadata, java.util.List<java.lang.Long> linksIds) throws NFEIOException
networkMetadata
- network metadatalinksIds
- links identifiersNFEIOException
- if an NFE error occurs.public void updateLinkCostAsLenght(NFENetworkMetadata netMetadata, java.util.List<java.lang.Long> linksIds) throws NFEIOException
netMetadata
- network metadatalinksIds
- links identifiersNFEIOException
- if an NFE error occurs.public JGeometry getMBRForNodes(java.lang.String geoColumn, java.lang.String table, java.util.List<java.lang.Long> nodeIds) throws NFEIOException
geoColumn
- geometry column in node tabletable
- node tablenodeIds
- nodes identifiersNFEIOException
- if an NFE error occurs.public java.util.List<NFENode> getNodeInformation(NFEModel nfeModel, java.util.List<java.lang.Long> nodeIds) throws NFEIOException
nfeModel
- modelnodeIds
- nodes identifiersNFEIOException
- if an NFE error occurs.public void deleteNetwork(java.lang.String networkName) throws NFEIOException
networkName
- network name to be deleted.NFEIOException
- if an NFE error occurs.