Class JDBCModelIOService
- java.lang.Object
-
- oracle.spatial.network.nfe.io.jdbc.service.JDBCAbstractIOService
-
- oracle.spatial.network.nfe.io.jdbc.service.JDBCModelIOService
-
- All Implemented Interfaces:
NFEIOService
,NFEModelIOService
public class JDBCModelIOService extends JDBCAbstractIOService implements NFEModelIOService
Provides the default implementation for the model service.
-
-
Constructor Summary
Constructors Constructor Description JDBCModelIOService(NFEIOServiceProvider serviceProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NFEFeatureLayer
createFeatureLayer(java.lang.String featureLayerName, java.lang.String featureTable, java.lang.String relationTable, java.lang.String hierarchyTable, java.util.Collection<NFEAttributeDescriptor> attrDescriptors, int hierarchyLevel, int zOrder)
Creates a feature layer.NFEModel
createFromScratchModel(java.lang.String modelName, boolean directedNetwork, NFEGeometryDescriptor geomDescriptor)
Creates a model in from scratch mode.NFEModel
createOverExistingNetworkModel(java.lang.String modelName, java.lang.String networkName)
Creates a model in from existing network mode.void
deleteCatalog(long catalogId)
Deletes the specified catalog.void
deleteFeatureClass(NFEFeatureClass featClass)
Deletes the feature class.void
deleteFeatureLayer(NFEFeatureLayer featLayer)
Deletes the feature layer.void
deleteFeatureLayerAttributes(NFEFeatureLayer featLayer, java.util.Collection<NFEAttributeDescriptor> attrDescriptors)
Deletes the feature layer attributes.void
deleteModel()
Deletes the model.void
enableAnalysisInModel()
Enables the analysis searching creating the path layer.java.util.Collection<NFECatalog>
getCatalogs()
Returns all the catalogs related to the model.java.util.Map<java.lang.Long,java.util.Collection<java.lang.String>>
getFeatureLayersAttributesUsingCatalog(long catalogId)
Returns a map with as key the feature layer identifiers and as values the list of attributes using the catalog.java.util.Map<java.lang.Long,java.lang.String>
getModelsIdentificators()
Returns a map with identifiers and names of all the existing models.NFEModel
loadModel(java.lang.String modelName)
Loads the NFE model.void
persistCatalog(NFECatalog catalog)
Persists a catalog.void
persistFeatureClass(NFEFeatureClass featClass)
Persists a feature class.void
persistFeatureLayerAttributes(NFEFeatureLayer featLayer, java.util.Collection<NFEAttributeDescriptor> attrDescriptors)
Persists the feature layer attributes.void
persistRules(java.util.Collection<NFEConnectivityRule> newRules, java.util.Collection<NFEConnectivityRule> deletedRules, java.util.Collection<NFEConnectivityRule> updatedRules)
Persists the NFE rules.long
registerRuleHandler(java.lang.String handlerFQClassName, NFEConnectivityRule.ConnectivityRuleType ruleType)
Registers the rule handler for the specified rule.void
updateAttributeConstraints(java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue)
Updates the attribute default value for the specified feature class.void
updateCatalog(NFECatalog catalog)
Updates the catalog values of the specified catalog.void
updateFeatureClass(NFEFeatureClass featClass)
Updates the feature class.void
updateFeatureLayersZOrder(java.util.Collection<NFEFeatureLayer> featLayers)
Updates the feature layers Z-order.-
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
-
JDBCModelIOService
public JDBCModelIOService(NFEIOServiceProvider serviceProvider)
-
-
Method Detail
-
createFromScratchModel
public NFEModel createFromScratchModel(java.lang.String modelName, boolean directedNetwork, NFEGeometryDescriptor geomDescriptor) throws NFEIOException
Description copied from interface:NFEModelIOService
Creates a model in from scratch mode. The function will create the initial model infrastructure if it doesn't exists along with the network used by the model. Also the function creates the tables related to the model: FT_CLASS, FT_CLASS_REL, FT_CLASS_ATTR_CSTR, FT_USR_DATA, FT_USR_DATA_CATLG, FT_USR_DATA_CVAL, FT_CLASS_DEF_CON_PT, LINE_LINE_RULE, LINE_POINT_RULE, RULE_INSTANCE, FT_RULE_REL, RULE_DEC_HANDLER, POINT_CARD_RULE.- Specified by:
createFromScratchModel
in interfaceNFEModelIOService
- Parameters:
modelName
- NFE model namedirectedNetwork
- true if the network to create has to be directed, false otherwisegeomDescriptor
- network geometry descriptor- Returns:
- NFE model
- Throws:
NFEIOException
- if an NFE error occurs.
-
createOverExistingNetworkModel
public NFEModel createOverExistingNetworkModel(java.lang.String modelName, java.lang.String networkName) throws NFEIOException
Description copied from interface:NFEModelIOService
Creates a model in from existing network mode. The function will create the initial model infrastructure if it doesn't exists. Also the function creates the tables related to the model: FT_CLASS, FT_CLASS_REL, FT_CLASS_ATTR_CSTR, FT_USR_DATA, FT_USR_DATA_CATLG, FT_USR_DATA_CVAL, FT_CLASS_DEF_CON_PT, LINE_LINE_RULE, LINE_POINT_RULE, RULE_INSTANCE, FT_RULE_REL, RULE_DEC_HANDLER, POINT_CARD_RULE.- Specified by:
createOverExistingNetworkModel
in interfaceNFEModelIOService
- Parameters:
modelName
- model namenetworkName
- network name- Returns:
- NFE model
- Throws:
NFEIOException
- if an NFE error occurs.
-
createFeatureLayer
public NFEFeatureLayer createFeatureLayer(java.lang.String featureLayerName, java.lang.String featureTable, java.lang.String relationTable, java.lang.String hierarchyTable, java.util.Collection<NFEAttributeDescriptor> attrDescriptors, int hierarchyLevel, int zOrder) throws NFEIOException
Description copied from interface:NFEModelIOService
Creates a feature layer. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
createFeatureLayer
in interfaceNFEModelIOService
- Parameters:
featureLayerName
- feature layer namefeatureTable
- feature tablerelationTable
- relation tablehierarchyTable
- hierarchy tableattrDescriptors
- attributes descriptorshierarchyLevel
- hierarchy level of the feature layerzOrder
- Z-order of the feature layer. The Z-order determines which feature layer appears on top of the other.- Returns:
- NFE feature layer
- Throws:
NFEIOException
- if an NFE error occurs.
-
enableAnalysisInModel
public void enableAnalysisInModel() throws NFEIOException
Description copied from interface:NFEModelIOService
Enables the analysis searching creating the path layer. It is mandatory to call this function before to perform any analysis. Additionally the paths that are saved in database will be load in Model. Note that if your model is analysis enabled the path features will be deleted when any related link or node is deleted.- Specified by:
enableAnalysisInModel
in interfaceNFEModelIOService
- Throws:
NFEIOException
-
loadModel
public NFEModel loadModel(java.lang.String modelName) throws NFEIOException
Description copied from interface:NFEModelIOService
Loads the NFE model. Note that the metadata and information about the feature layers will loaded but not the related features.- Specified by:
loadModel
in interfaceNFEModelIOService
- Parameters:
modelName
- model name- Returns:
- NFE model
- Throws:
NFEIOException
- if an NFE error occurs.
-
persistFeatureClass
public void persistFeatureClass(NFEFeatureClass featClass) throws NFEIOException
Description copied from interface:NFEModelIOService
Persists a feature class. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
persistFeatureClass
in interfaceNFEModelIOService
- Parameters:
featClass
- feature class- Throws:
NFEIOException
- if an NFE error occurs.
-
persistFeatureLayerAttributes
public void persistFeatureLayerAttributes(NFEFeatureLayer featLayer, java.util.Collection<NFEAttributeDescriptor> attrDescriptors) throws NFEIOException
Description copied from interface:NFEModelIOService
Persists the feature layer attributes. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
persistFeatureLayerAttributes
in interfaceNFEModelIOService
- Parameters:
featLayer
- feature layerattrDescriptors
- attributes descriptors- Throws:
NFEIOException
- if an NFE error occurs.
-
persistCatalog
public void persistCatalog(NFECatalog catalog) throws NFEIOException
Description copied from interface:NFEModelIOService
Persists a catalog.- Specified by:
persistCatalog
in interfaceNFEModelIOService
- Parameters:
catalog
- catalog- Throws:
NFEIOException
- if an NFE error occurs.
-
updateFeatureLayersZOrder
public void updateFeatureLayersZOrder(java.util.Collection<NFEFeatureLayer> featLayers) throws NFEIOException
Description copied from interface:NFEModelIOService
Updates the feature layers Z-order. The Z-order determines which feature layer appears on top of the other.- Specified by:
updateFeatureLayersZOrder
in interfaceNFEModelIOService
- Parameters:
featLayers
- feature layers to update- Throws:
NFEIOException
- if an NFE error occurs.
-
updateFeatureClass
public void updateFeatureClass(NFEFeatureClass featClass) throws NFEIOException
Description copied from interface:NFEModelIOService
Updates the feature class. Updates the name, shape, cardinality rules, style, predefined points and attribute constraints. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reloads the model after to execute it.- Specified by:
updateFeatureClass
in interfaceNFEModelIOService
- Parameters:
featClass
- feature class- Throws:
NFEIOException
- if an NFE error occurs.
-
updateAttributeConstraints
public void updateAttributeConstraints(java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue) throws NFEIOException
Description copied from interface:NFEModelIOService
Updates the attribute default value for the specified feature class. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
updateAttributeConstraints
in interfaceNFEModelIOService
- Parameters:
featureClassId
- feature class idattributeName
- attribute namenewValue
- new attribute default value- Throws:
NFEIOException
- if an NFE error occurs.
-
updateCatalog
public void updateCatalog(NFECatalog catalog) throws NFEIOException
Description copied from interface:NFEModelIOService
Updates the catalog values of the specified catalog. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
updateCatalog
in interfaceNFEModelIOService
- Parameters:
catalog
- catalog- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteModel
public void deleteModel() throws NFEIOException
Description copied from interface:NFEModelIOService
Deletes the model. Use carefully since this function will delete all the feature layers, tables and the network related to the model.- Specified by:
deleteModel
in interfaceNFEModelIOService
- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteFeatureLayer
public void deleteFeatureLayer(NFEFeatureLayer featLayer) throws NFEIOException
Description copied from interface:NFEModelIOService
Deletes the feature layer. Use carefully since this function will delete all the data related to the feature layer. Before to execute this function delete the related features and rules. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
deleteFeatureLayer
in interfaceNFEModelIOService
- Parameters:
featLayer
- feature layer- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteFeatureClass
public void deleteFeatureClass(NFEFeatureClass featClass) throws NFEIOException
Description copied from interface:NFEModelIOService
Deletes the feature class. Use carefully since this function will delete all the data related to the feature class. Before to execute this function delete the related features and rules. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
deleteFeatureClass
in interfaceNFEModelIOService
- Parameters:
featClass
- feature class- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteFeatureLayerAttributes
public void deleteFeatureLayerAttributes(NFEFeatureLayer featLayer, java.util.Collection<NFEAttributeDescriptor> attrDescriptors) throws NFEIOException
Description copied from interface:NFEModelIOService
Deletes the feature layer attributes. Version disable the model before to execute this function (NFEWorkspaceIOService.disableAllVersioning) and reload the model after to execute it.- Specified by:
deleteFeatureLayerAttributes
in interfaceNFEModelIOService
- Parameters:
featLayer
- feature layerattrDescriptors
- attributes to delete- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteCatalog
public void deleteCatalog(long catalogId) throws NFEIOException
Description copied from interface:NFEModelIOService
Deletes the specified catalog. The function getFeatureLayersAttributesUsingCatalog can be used to ensure that the catalog is not in use.- Specified by:
deleteCatalog
in interfaceNFEModelIOService
- Parameters:
catalogId
- catalog id- Throws:
NFEIOException
- if an NFE error occurs.
-
getModelsIdentificators
public java.util.Map<java.lang.Long,java.lang.String> getModelsIdentificators() throws NFEIOException
Description copied from interface:NFEModelIOService
Returns a map with identifiers and names of all the existing models.- Specified by:
getModelsIdentificators
in interfaceNFEModelIOService
- Returns:
- map with identifiers (key) and names (value) of all the existing models.
- Throws:
NFEIOException
- if an NFE error occurs.
-
getCatalogs
public java.util.Collection<NFECatalog> getCatalogs() throws NFEIOException
Description copied from interface:NFEModelIOService
Returns all the catalogs related to the model.- Specified by:
getCatalogs
in interfaceNFEModelIOService
- Returns:
- all the catalogs related to the model
- Throws:
NFEIOException
- if an NFE error occurs.
-
getFeatureLayersAttributesUsingCatalog
public java.util.Map<java.lang.Long,java.util.Collection<java.lang.String>> getFeatureLayersAttributesUsingCatalog(long catalogId) throws NFEIOException
Description copied from interface:NFEModelIOService
Returns a map with as key the feature layer identifiers and as values the list of attributes using the catalog.- Specified by:
getFeatureLayersAttributesUsingCatalog
in interfaceNFEModelIOService
- Parameters:
catalogId
- catalog id- Returns:
- map with as key the feature layer identifiers and as values the list of attributes using the catalog
- Throws:
NFEIOException
- if an NFE error occurs.
-
persistRules
public void persistRules(java.util.Collection<NFEConnectivityRule> newRules, java.util.Collection<NFEConnectivityRule> deletedRules, java.util.Collection<NFEConnectivityRule> updatedRules) throws NFEIOException
Description copied from interface:NFEModelIOService
Persists the NFE rules. In case of update or delete operations the rule has to be unused by any feature. This implies that no record related to the rule has to be in the table FT_RULE_REL_[model_id]. In case of the line line rules create or update operations the line point rules have to refer to the same point feature including the same attributes conditions if any.- Specified by:
persistRules
in interfaceNFEModelIOService
- Parameters:
newRules
- rules to adddeletedRules
- rules to deleteupdatedRules
- rules to update- Throws:
NFEIOException
- if an NFE error occurs.
-
registerRuleHandler
public long registerRuleHandler(java.lang.String handlerFQClassName, NFEConnectivityRule.ConnectivityRuleType ruleType) throws NFEIOException
Description copied from interface:NFEModelIOService
Registers the rule handler for the specified rule.- Specified by:
registerRuleHandler
in interfaceNFEModelIOService
- Parameters:
handlerFQClassName
- rule handler full qualified class nameruleType
- type of rule the handler is for- Returns:
- the id of the registered rule handler
- Throws:
NFEIOException
- if an NFE error occurs.
-
-