import UnitIdentifierManager from "@arcgis/core/networks/UnitIdentifierManager.js";const UnitIdentifierManager = await $arcgis.import("@arcgis/core/networks/UnitIdentifierManager.js");- Inheritance
- UnitIdentifierManager→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.34
A UnitIdentifierManager provides access to unit identifier management capabilities for a telecom domain network in a utility network.
- Example
- const utilityNetwork = new UtilityNetwork({layerUrl: "https://host.com/arcgis/rest/services/Test/FeatureServer/0",});await utilityNetwork.load();const unitIdentifierManager = await utilityNetwork.getUnitIdentifierManager();
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| readonly inherited | ||
| readonly | | |
| readonly | | |
| readonly | | |
| readonly | | |
| readonly | |
featureServiceUrl
- Type
- string
Returns the root feature service URL which the utility network is part of.
- Example
- `https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/FeatureServer/`
gdbVersion
The version of the geodatabase of the feature service data used by the utility network. Read the Overview of versioning topic for more details about this capability.
networkServiceUrl
- Type
- string
The URL of the network server.
- Example
- `https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/UtilityNetworkServer/`
utilityNetwork
- Type
- UtilityNetwork
The UtilityNetwork that contains the telecom domain network being managed.
Methods
| Method | Signature | Class |
|---|---|---|
| inherited static | fromJSON(json: any): any | |
| generateCombineNetworkElements(networkElements: NetworkElement[]): ServiceEdits | | |
| generateDivideNetworkElements(networkElement: NetworkElement, numUnits: number[]): ServiceEdits | | |
| query(containers: UnitIdentifier[]): Promise<UnitQueryResult[]> | | |
| reserve(container: UnitIdentifier, firstUnit: number, lastUnit: number): Promise<void> | | |
| reset(containers: UnitIdentifier[]): Promise<void> | | |
| resize(content: UnitIdentifier, lastUnit: number): Promise<void> | | |
| inherited | toJSON(): any |
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
generateCombineNetworkElements
- Signature
-
generateCombineNetworkElements (networkElements: NetworkElement[]): ServiceEdits
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Returns ServiceEdits to combine network elements
in a telecom domain network via the applyEdits method on the FeatureService class.
The objects being combined must have consecutive unit IDs, exist in the same table and unit container, and have the same attribute values.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| networkElements | The network elements to combine in a telecom domain network. | |
- Returns
- ServiceEdits
ServiceEditsfor combining network elements in a telecom domain network.
- Example
- const networkElementA = new NetworkElement({globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",networkSourceId: 20,});const networkElementB = new NetworkElement({globalId: "{74100804-E229-49b8-8CDC-9B5D3EF03EDA}",networkSourceId: 20,});const networkElementC = new NetworkElement({globalId: "{39B856DC-AFE4-4c02-B433-A9361ACD91CF}",networkSourceId: 20,});const serviceEdits = unitIdentifierManager.generateCombineNetworkElements([networkElementA,networkElementB,networkElementC,]);await featureService.applyEdits([serviceEdits]);
generateDivideNetworkElements
- Signature
-
generateDivideNetworkElements (networkElement: NetworkElement, numUnits: number[]): ServiceEdits
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Returns ServiceEdits to divide a grouped network element
in a telecom domain network into two or more grouped elements via the applyEdits method on the FeatureService class.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| networkElement | The grouped network element in a telecom domain network to divide into two or more grouped elements. | | |
| numUnits | number[] | Describes how the unit identifiers of the grouped object should be divided. Each number in this array describes the number of units to assign an object resulting from the division. E.g., to divide one object with 6 units into an object with 5 units and another object with 1 unit, specify [5, 1]. | |
- Returns
- ServiceEdits
ServiceEditsfor dividing a network element in a telecom domain network.
- Example
- const networkElement = new NetworkElement({globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",networkSourceId: 20,});const serviceEdits = unitIdentifierManager.generateDivideNetworkElements(networkElement, [2, 3, 4]);await featureService.applyEdits([serviceEdits]);
query
- Signature
-
query (containers: UnitIdentifier[]): Promise<UnitQueryResult[]>
Returns unit identifiers for, and existing gaps in, a unit container feature's containment hierarchy in a telecom domain network.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| containers | The unit container features or objects to query. | |
- Returns
- Promise<UnitQueryResult[]>
Resolves to an array of objects describing the unit identifiers and gaps for the specified unit containers.
- Example
- const containers: UnitIdentifier[] = [{sourceId: 16,globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",},];const results = await unitIdentifierManager.query(containers);
reserve
- Signature
-
reserve (container: UnitIdentifier, firstUnit: number, lastUnit: number): Promise<void>
Shifts existing records in the containment hierarchy of a unit container's NextUnitID sequence to reserve a range of unit IDs in a telecom domain network.
When this range is inserted at the end of the sequence, the NEXTUNITID attribute value for the unit container increases.
If a range is inserted into the middle of an existing sequence to create a gap, the system will attempt to shift existing
records to accommodate the reserved space. The operation will fail and return an error if the reservation requires
regrouping an object or occurs in the middle of a connectivity assignment.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| container | The unit container to insert a gap into. | | |
| firstUnit | The first unit for the gap to be introduced. | | |
| lastUnit | The last unit for the gap to be introduced. | |
- Example
- const container: UnitIdentifier = {sourceId: 16,globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",};await unitIdentifierManager.reserve(container, 2, 5);
reset
- Signature
-
reset (containers: UnitIdentifier[]): Promise<void>
Resets the unit identifiers associated with one or more unit container features in a telecom domain network. This is done to condense the unit identifier space or overcome unit identifier sequence exhaustion.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| containers | The unit container features or objects to be reset. | |
- Example
- const containers: UnitIdentifier[] = [{sourceId: 16,globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",},];await unitIdentifierManager.reset(containers);
resize
- Signature
-
resize (content: UnitIdentifier, lastUnit: number): Promise<void>
Alters the number of units associated with a unit identifier feature in a telecom domain network.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| content | The unit identifiable feature or object being resized. | | |
| lastUnit | The last unit for the feature or object to be resized to. | |
- Example
- const content: UnitIdentifier = {sourceId: 16,globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",};await unitIdentifierManager.resize(content, 8);
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.