Package oracle.spatial.network.lod
Class LODNetworkManager
- java.lang.Object
-
- oracle.spatial.network.lod.LODNetworkManager
-
public class LODNetworkManager extends java.lang.Object
This class is the entry point of all functionalities provided by the lod package.- Since:
- 11gR1
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CachedNetworkIO
getCachedNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata)
Returns the cached network I/O object for the specified network.static CachedNetworkIO
getCachedNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, boolean readFromBlob, LODUserDataIO[] udios, PartitionBlobTranslator translator)
Deprecated.user getCachedNetworkIO(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata);static CachedNetworkIO
getCachedNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, LODUserDataIO[] udios)
Deprecated.user getCachedNetworkIO(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata);static CachedNetworkIO
getCachedNetworkIO(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata)
static CachedNetworkIOWM
getCachedNetworkIOWM(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata)
Returns the cached network I/O object for the specified network.static CachedNetworkIOWM
getCachedNetworkIOWM(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, boolean readFromBlob, LODUserDataIO[] udios, PartitionBlobTranslator translator)
Deprecated.use getCachedNetworkIOWM(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata)static CachedNetworkIOWM
getCachedNetworkIOWM(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata)
static ConfigManager
getConfigManager()
Returns the LOD configuration manager singleton.static java.sql.Connection
getConnection(java.lang.String connectURL, java.lang.String user, java.lang.String password)
Returns a new OracleConnection instance.static NetworkAnalyst
getNetworkAnalyst(NetworkIO reader)
Returns a new NetworkAnalyst instance, which uses the input network IO adaptor to retrieve information about the network.static javax.sql.DataSource
getNetworkDataSource(java.lang.String networkName)
static NetworkIO
getNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata)
Returns the network I/O object for the specified network.static NetworkIO
getNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, boolean readFromBlob, LODUserDataIO[] udios, PartitionBlobTranslator translator)
Deprecated.use getNetworkIO(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata);static NetworkIO
getNetworkIO(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata)
static NetworkIO
getNetworkIOForInMemoryNetwork(LogicalBasicNetwork[] networks)
Return the NetworkIO object for the in-memory network.static NetworkMetadata
getNetworkMetadata(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName)
Returns the network metadata for the specified network.static NetworkMetadata
getNetworkMetadata(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName)
static javax.sql.DataSource
getOracleDataSource(java.lang.String url, java.lang.String user, java.lang.String password)
Returns a new OracleDataSource instance.protected static CachingPolicy[]
parseCachingPolicies(org.w3c.dom.Element[] cachingPolicyElems, int maxLinkLevel)
static java.lang.Object
readJavaObject(java.sql.Connection conn, java.lang.String name)
Reads in the given Java object from the database to memory Explicit casting is required before usestatic NetworkMetadata
readMetadata(java.sql.Connection conn, java.lang.String networkName)
static java.lang.Object
readNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName)
Reads in the given network constraint from the database to memorystatic void
setNetworkDataSource(java.lang.String networkName, javax.sql.DataSource dataSource)
static void
setNetworkMetadata(java.lang.String globalNetworkName, NetworkMetadata metadata)
-
-
-
Method Detail
-
getOracleDataSource
public static javax.sql.DataSource getOracleDataSource(java.lang.String url, java.lang.String user, java.lang.String password) throws java.sql.SQLException
Returns a new OracleDataSource instance.- Parameters:
url
- database urluser
- database userpassword
- database password- Returns:
- a new DataSource instance
- Throws:
java.sql.SQLException
-
setNetworkDataSource
public static void setNetworkDataSource(java.lang.String networkName, javax.sql.DataSource dataSource)
-
getNetworkDataSource
public static javax.sql.DataSource getNetworkDataSource(java.lang.String networkName)
-
getConnection
public static java.sql.Connection getConnection(java.lang.String connectURL, java.lang.String user, java.lang.String password) throws java.sql.SQLException
Returns a new OracleConnection instance.- Parameters:
connectURL
- database urluser
- database userpassword
- database password- Returns:
- a new OracleConnection instance
- Throws:
java.sql.SQLException
-
getNetworkAnalyst
public static NetworkAnalyst getNetworkAnalyst(NetworkIO reader) throws LODNetworkException
Returns a new NetworkAnalyst instance, which uses the input network IO adaptor to retrieve information about the network.- Parameters:
reader
- the cached network IO adaptor- Returns:
- a new NetworkAnalyst instance
- Throws:
LODNetworkException
-
getNetworkMetadata
public static NetworkMetadata getNetworkMetadata(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName) throws LODNetworkException
Returns the network metadata for the specified network. If network metadata exists in the cache for the globalNetworkName, then the cached network metadata is returned; otherwise, a new network metadata instance is returned. If the globalNetworkName is not null, the returned network metadata instance is cached using globalNetworkName as the cache key.- Parameters:
conn
- database connection for the networknetworkName
- network nameglobalNetworkName
- global network name that is used as the cache key for the network metadata. globalNetworkName should be unique across different connections as well as different subnetworks with the same master network.- Returns:
- network metadata
- Throws:
LODNetworkException
-
setNetworkMetadata
public static void setNetworkMetadata(java.lang.String globalNetworkName, NetworkMetadata metadata)
-
getNetworkMetadata
public static NetworkMetadata getNetworkMetadata(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName) throws LODNetworkException
- Throws:
LODNetworkException
-
readMetadata
public static NetworkMetadata readMetadata(java.sql.Connection conn, java.lang.String networkName) throws LODNetworkException
- Throws:
LODNetworkException
-
getNetworkIOForInMemoryNetwork
public static NetworkIO getNetworkIOForInMemoryNetwork(LogicalBasicNetwork[] networks)
Return the NetworkIO object for the in-memory network.- Parameters:
networks
- network objects on different link levels for the same network of interest. network[i] is the network on link level i+1. For example, network[0] is the network on link level 1; network[1] is the network on link level 2, and so on. If the network of interest is a flat network, the length of the networks array is 1, and network[0] should be the flat network.
-
getNetworkIO
public static NetworkIO getNetworkIO(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata) throws LODNetworkException
- Throws:
LODNetworkException
-
getNetworkIO
public static NetworkIO getNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata) throws LODNetworkException
Returns the network I/O object for the specified network. The configurations for the network I/O object, such as partition BLOB translator and user data I/O implementation, are obtained from the LOD configuration XML.- Parameters:
conn
- database connection for the networknetworkName
- network nameglobalNetworkName
- global network name. globalNetworkName should be unique across different connections as well as different subnetworks with the same master network.metadata
- network metadata. If not null, the input metadata will be used for the returning network I/O object; Otherwise, the network metadata will be retrieved from the database and assigned to the returning network I/O object.- Returns:
- network I/O
- Throws:
LODNetworkException
-
getNetworkIO
public static NetworkIO getNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, boolean readFromBlob, LODUserDataIO[] udios, PartitionBlobTranslator translator) throws LODNetworkException
Deprecated.use getNetworkIO(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata);Returns the network I/O object for the specified network.- Parameters:
conn
- database connection for the networknetworkName
- network nameglobalNetworkName
- global network name. globalNetworkName should be unique across different connections as well as different subnetworks with the same master network.metadata
- network metadata. If not null, the input metadata will be used for the returning network I/O object; Otherwise, the network metadata will be retrieved from the database and assigned to the returning network I/O object.readFromBlob
- true if partitions are loaded from BLOB table; false if partitions are loaded from node/link tables.udios
- user data I/O implementationtranslator
- partition BLOB translator- Returns:
- network I/O
- Throws:
LODNetworkException
-
getCachedNetworkIO
public static CachedNetworkIO getCachedNetworkIO(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata) throws LODNetworkException
- Throws:
LODNetworkException
-
getCachedNetworkIO
public static CachedNetworkIO getCachedNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata) throws LODNetworkException
Returns the cached network I/O object for the specified network. If network reader exists in the cache for the globalNetworkName, then the cached network reader is returned; otherwise, a new network reader instance is returned. If the globalNetworkName is not null, the returned network reader instance is cached using globalNetworkName as the cache key.- Parameters:
conn
- database connection for the networknetworkName
- network nameglobalNetworkName
- global network name that is used as the cache key for the network reader. globalNetworkName should be unique across different connections as well as different subnetworks with the same master network.metadata
- network metadata. If not null, the input metadata will be used for the returning network I/O object; Otherwise, the network metadata will be retrieved from the database and assigned to the returning network I/O object.- Returns:
- cached network I/O
- Throws:
LODNetworkException
-
getCachedNetworkIO
public static CachedNetworkIO getCachedNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, LODUserDataIO[] udios) throws LODNetworkException
Deprecated.user getCachedNetworkIO(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata);Returns the cached network IO object for the specified network.- Parameters:
conn
-networkName
-globalNetworkName
-metadata
-udios
-- Returns:
- Throws:
LODNetworkException
-
getCachedNetworkIO
public static CachedNetworkIO getCachedNetworkIO(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, boolean readFromBlob, LODUserDataIO[] udios, PartitionBlobTranslator translator) throws LODNetworkException
Deprecated.user getCachedNetworkIO(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata);Returns the cached network IO object for the specified network.- Parameters:
conn
-networkName
-globalNetworkName
-metadata
-readFromBlob
-udios
-translator
-- Returns:
- Throws:
LODNetworkException
-
getCachedNetworkIOWM
public static CachedNetworkIOWM getCachedNetworkIOWM(oracle.spatial.network.ds.DbDataSource dataSource, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata) throws LODNetworkException
- Throws:
LODNetworkException
-
getCachedNetworkIOWM
public static CachedNetworkIOWM getCachedNetworkIOWM(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata) throws LODNetworkException
Returns the cached network I/O object for the specified network. If network reader exists in the cache for the globalNetworkName, then the cached network reader is returned; otherwise, a new network reader instance is returned. If the globalNetworkName is not null, the returned network reader instance is cached using globalNetworkName as the cache key.- Parameters:
conn
- database connection for the networknetworkName
- network nameglobalNetworkName
- global network name that is used as the cache key for the network reader. globalNetworkName should be unique across different connections as well as different subnetworks with the same master network.metadata
- network metadata. If not null, the input metadata will be used for the returning network I/O object; Otherwise, the network metadata will be retrieved from the database and assigned to the returning network I/O object.- Returns:
- cached network I/O
- Throws:
LODNetworkException
-
getCachedNetworkIOWM
public static CachedNetworkIOWM getCachedNetworkIOWM(java.sql.Connection conn, java.lang.String networkName, java.lang.String globalNetworkName, NetworkMetadata metadata, boolean readFromBlob, LODUserDataIO[] udios, PartitionBlobTranslator translator) throws LODNetworkException
Deprecated.use getCachedNetworkIOWM(Connection conn, String networkName, String globalNetworkName, NetworkMetadata metadata)Returns the cached network I/O object for the specified network. If network reader exists in the cache for the globalNetworkName, then the cached network reader is returned; otherwise, a new network reader instance is returned. If the globalNetworkName is not null, the returned network reader instance is cached using globalNetworkName as the cache key.- Parameters:
conn
- database connection for the networknetworkName
- network nameglobalNetworkName
- global network name that is used as the cache key for the network reader. globalNetworkName should be unique across different connections as well as different subnetworks with the same master network.metadata
- network metadata. If not null, the input metadata will be used for the returning network I/O object; Otherwise, the network metadata will be retrieved from the database and assigned to the returning network I/O object.- Returns:
- cached network I/O
- Throws:
LODNetworkException
-
parseCachingPolicies
protected static CachingPolicy[] parseCachingPolicies(org.w3c.dom.Element[] cachingPolicyElems, int maxLinkLevel) throws LODConfigException
- Throws:
LODConfigException
-
getConfigManager
public static ConfigManager getConfigManager()
Returns the LOD configuration manager singleton. This method is equivalent to ConfigManager.getConfigManager.- Returns:
- the LOD configuration manager singleton
-
readNetworkConstraint
public static java.lang.Object readNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName) throws java.sql.SQLException, NetworkDataException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
Reads in the given network constraint from the database to memory- Parameters:
conn
- database connectionnetworkConstraintName
- the name of the network constraint- Returns:
- the desired network constraint
- Throws:
java.sql.SQLException
NetworkDataException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
-
readJavaObject
public static java.lang.Object readJavaObject(java.sql.Connection conn, java.lang.String name) throws java.sql.SQLException, NetworkDataException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
Reads in the given Java object from the database to memory Explicit casting is required before use- Parameters:
conn
- database connectionname
- the name of the object- Returns:
- the desired Java object
- Throws:
java.sql.SQLException
NetworkDataException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
-
-