Package oracle.spatial.network.lod
Class PartitionBlobTranslator11gR2
- java.lang.Object
-
- oracle.spatial.network.lod.PartitionBlobTranslator11gR2
-
- All Implemented Interfaces:
PartitionBlobTranslator
public class PartitionBlobTranslator11gR2 extends java.lang.Object implements PartitionBlobTranslator
The class translates a network partition BLOB to a LogicalPartition object, or vice versa.Structure of a BLOB:
A partition BLOB consists of 4 sections:
- version info: "TRANSLATOR"+translator name
- header: summary info about the partition
- nodes (internal and external): number of nodes and list of nodes
Each node consists of the following fields: node id, node cost, is_active, node partition id, max_link_level, userdata- links: number of links and list of links
Each link consists of the following fields: link id, link level, start node id, end node id, link cost, is_bidirected, is_active, userdata- Since:
- 11gR2
-
-
Constructor Summary
Constructors Constructor Description PartitionBlobTranslator11gR2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LogicalPartition
blobToPartition(java.lang.String networkName, int partitionId, int partitionLevel, java.io.InputStream is, boolean loadUserData)
Reads a partition BLOB from the specified input stream and translates it into a LogicalPartition object.static PartitionBlobTranslator
getPartitionBlobTranslator()
boolean
partitionToBlob(LogicalPartition partition, java.io.OutputStream os, boolean includeUserData)
Translates the LogicalPartition object into a partition BLOB, and outputs it into the specified output stream.
-
-
-
Method Detail
-
getPartitionBlobTranslator
public static PartitionBlobTranslator getPartitionBlobTranslator()
-
blobToPartition
public LogicalPartition blobToPartition(java.lang.String networkName, int partitionId, int partitionLevel, java.io.InputStream is, boolean loadUserData) throws LODNetworkException
Description copied from interface:PartitionBlobTranslator
Reads a partition BLOB from the specified input stream and translates it into a LogicalPartition object.- Specified by:
blobToPartition
in interfacePartitionBlobTranslator
- Parameters:
networkName
- network namepartitionId
- partition IDpartitionLevel
- link level for the partitionis
- input streamloadUserData
- whether to include the user data into the returned LogicalPartition object- Returns:
- logical partition
- Throws:
LODNetworkException
-
partitionToBlob
public boolean partitionToBlob(LogicalPartition partition, java.io.OutputStream os, boolean includeUserData) throws LODNetworkException
Description copied from interface:PartitionBlobTranslator
Translates the LogicalPartition object into a partition BLOB, and outputs it into the specified output stream.- Specified by:
partitionToBlob
in interfacePartitionBlobTranslator
- Parameters:
partition
- logical partitionos
- output streamincludeUserData
- whether to include user data in the generated partition BLOB- Returns:
- whether user data is included in the generated partition BLOB. User data is includes in the partition BLOB if the input logical partition contains users data and the input includeUserData flag is set to true.
- Throws:
LODNetworkException
-
-