---

# Business Logic — JKKAdchgVLanGetCC.getVLanId() [33 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKAdchgVLanGetCC` |
| Layer | CC/Common Component (Package: `com.fujitsu.futurity.bp.custom.common`, extends `AbstractCommonComponent`) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKAdchgVLanGetCC.getVLanId()

The `getVLanId` method is responsible for assigning (allocating) a VLAN ID for a telephone service order in the context of a residential move (住所変形登録) or new installation scenario. It acts as the VLAN provisioning entry point within the housing change registration common component class (`JKKAdchgVLanGetCC`). The method implements the **delegation pattern**, obtaining a mapper instance (`JKKAdchgMapperCC`) and a service component request invoker (`ServiceComponentRequestInvoker`), building a condition map with all necessary parameters for the `ESC0021D010` telephone VLAN order receipt SC (Service Component), and invoking the S-IF (Service Interface) to request VLAN ID assignment.

This method is called exclusively by the `execute` method of the same class after two preconditions have been validated: (1) `checkSvcKeiKaisenUcwk` confirms the VLAN ID has NOT already been assigned on the service contract line, and (2) `checkKojiAnkenStatus` confirms the work project status is in a range that requires VLAN ID assignment (i.e., the work is not yet in a terminal state where another process will handle VLAN assignment). The method handles the specific business domain of FTTH (Fiber To The Home) broadband telephone service, where a dedicated VLAN must be provisioned for VoIP/telephone traffic on the customer's broadband line. It delegates all SC communication to the `ESC0021D010` service component, which is responsible for the actual VLAN ID allocation and registration in the telecom backend systems.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getVLanId(params)"])
    A["Get JKKAdchgMapperCC instance"] --> B["Create ServiceComponentRequestInvoker"]
    B --> C["Create condMap for ESC0021D010"]
    C --> D["Set FUNC_CODE = 1"]
    D --> E["Set SVC_KEI_NO from paramMap"]
    E --> F["Set YOKYU_MT_APL_SBT_CD = WEB"]
    F --> G["Set VLAN_ORDER_CD = 01"]
    G --> H["Set YOKYU_SBT_CD = 02"]
    H --> I["Set VLAN_SERVER_CD = 1"]
    I --> J["Set REQ_JI_MSKMSHO_NO from paramMap"]
    J --> K["Set REQ_JI_KJAK_NO from paramMap"]
    K --> L["mapper.setESC0021D010(condMap)"]
    L --> M["scCall.run(reqMap, handle)"]
    M --> N["mapper.getESC0021D010(resMap)"]
    N --> O["mapper.scResultCheck()"]
    O --> END_NODE(["Return / Next"])
```

**Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `YOKYU_MT_APL_SBT_CD_WEB` | `"W"` | Requestor Application Type - Web channel (online customer portal) |
| `VLAN_ORDER_CD_VLAN` | `"01"` | VLAN Order Code - Standard VLAN order |
| `YOKYU_SBT_CD_NEW` | `"02"` | Request Type Code - New (not a change or cancellation) |
| `VLAN_SERVER_CD_SETSUBIKANRI` | `"1"` | VLAN Server Code - Sub-office management (subnet management server) |
| `JPCModelConstant.FUNC_CD_1` | `"1"` | Function Code 1 - Inquiry/Registration function |

**Processing Description:**
The method performs a linear, sequential procedure with no conditional branches:

1. Obtains a singleton mapper instance (`JKKAdchgMapperCC`) to handle request/response parameter construction for the S-IF SC call.
2. Creates a new `ServiceComponentRequestInvoker` to execute the SC call.
3. Builds a condition map (`condMap`) by populating 8 key-value pairs: the function code, service contract number (from `paramMap`), application channel (WEB), VLAN order code, request type (NEW), VLAN server code, request submission document number (from `paramMap`), and request project case number (from `paramMap`).
4. Calls `mapper.setESC0021D010()` to build the full request map (`reqMap`) with the condition parameters.
5. Calls `scCall.run()` to execute the `ESC0021D010` SC (telephone VLAN order receipt) via the S-IF interface, passing the request map and the session handle.
6. Calls `mapper.getESC0021D010()` to extract and map the response data back into the request parameters.
7. Calls `mapper.scResultCheck()` to validate the SC result and throw an exception if the SC reported an error.
8. Returns silently (void method) — the VLAN ID result is stored in `paramMap` by the mapper's `getESC0021D010` call.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramMap` | `HashMap<String, Object>` | A request parameter map carrying business context for the VLAN assignment operation. It must contain at minimum: `svc_kei_no` (service contract number), `mskm_mmsho_no` (request submission document number), and `kojiak_no` (project case number). These values are extracted and placed into the SC condition map to identify the specific service contract and project for which a VLAN ID is being requested. |

**Instance fields / External state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `keepReqParam` | `ThreadLocal<IRequestParameterReadWrite>` | Thread-local storage holding the original request parameter object. Used as input to mapper calls for setting/getting SC request and response data. |
| `keepFixedText` | `ThreadLocal<String>` | Thread-local storage holding user-defined string text (localized labels). Passed to the mapper for label association in the SC request. |
| `keepSesHandle` | `ThreadLocal<SessionHandle>` | Thread-local storage holding the session handle (managing session manager state). Passed to the SC request invoker to maintain session context across the S-IF call. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdchgMapperCC.getInstance` | JKKAdchgMapperCC | - | Obtains singleton mapper instance for housing change registration parameter mapping |
| - | `ServiceComponentRequestInvoker` (constructor) | - | - | Creates new SC request invoker to execute S-IF calls |
| S | `JKKAdchgMapperCC.setESC0021D010` | ESC0021D010 | - | Builds the SC request map for telephone VLAN order receipt. Sets up condition parameters (function code, service contract number, application type, VLAN order code, request type, VLAN server code, submission document number, project case number) into the request structure. |
| C | `ServiceComponentRequestInvoker.run` | ESC0021D010 | ESC0021 (Telephone VLAN Order Receipt) | Executes the `ESC0021D010` service component via S-IF. This is a **Create** operation — it invokes the SC that allocates and registers a new VLAN ID for the telephone service on the specified broadband line. |
| R | `JKKAdchgMapperCC.getESC0021D010` | ESC0021D010 | ESC0021 (Telephone VLAN Order Receipt) | Extracts and maps the SC response data back into the request parameters. The allocated VLAN ID and related result fields are populated into `paramMap` for downstream processing. |
| R | `JKKAdchgMapperCC.scResultCheck` | - | - | Validates the SC execution result. Checks for errors and throws an exception if the SC reported a failure condition. |

**CRUD Summary:** This method performs **one Create (C)** operation (the actual VLAN ID allocation via `ESC0021D010`) and **three Read (R)** operations (mapper result extraction, result validation). The `setESC0021D010` call is a data preparation step (SET).

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `scResultCheck` [-], `setESC0021D010` [-], `getESC0021D010` [-], `run` [-]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC:JKKAdchgVLanGetCC.execute | `execute(handle, param, fixedText)` → (after `checkSvcKeiKaisenUcwk` passes and `checkKojiAnkenStatus` passes) → `getVLanId(paramMap)` | `setESC0021D010 [-]`, `scCall.run [C] ESC0021 (Telephone VLAN Order)`, `getESC0021D010 [R] ESC0021` |

**Caller context:** The `getVLanId` method is a private method called only from the public `execute` method in the same class (`JKKAdchgVLanGetCC`). The `execute` method serves as the entry point invoked by screen or CBS handlers. Before `getVLanId` is called, the `execute` method:
1. Stores the session handle, request parameters, and fixed text in thread-local fields.
2. Extracts a `HashMap<String, Object>` from the request parameters.
3. Runs `checkSvcKeiKaisenUcwk` to confirm the VLAN ID has NOT been assigned yet (returns early if already assigned).
4. Runs `checkKojiAnkenStatus` to confirm the work project status is in the allocation range (returns early if another process will handle it).
5. Only if both checks pass (meaning VLAN ID is unassigned AND status requires allocation), `getVLanId` is invoked.

## 6. Per-Branch Detail Blocks

### Block 1 — INIT (mapper & invoker creation) (L269)

The method begins by obtaining the mapper singleton and creating a new service component request invoker. This sets up the communication infrastructure for the SC call.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JKKAdchgMapperCC.getInstance()` // Obtain mapper for housing change registration [-> mapper] |
| 2 | NEW | `new ServiceComponentRequestInvoker()` // Create SC request invoker for S-IF call |

### Block 2 — condMap population (L275-L291)

Builds the condition map with 8 key-value pairs required by the `ESC0021D010` telephone VLAN order receipt SC. Each condition is explained below.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | NEW | `new HashMap<String, String>()` // Create condition map [-> condMap] |
| 2 | SET | `condMap.put(ESC0021D010CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1)` // Set function code [-> FUNC_CD_1 = "1" (Inquiry/Registration)] |
| 3 | SET | `condMap.put(ESC0021D010CBSMsg.SVC_KEI_NO, (String)paramMap.get("svc_kei_no"))` // Service contract number — identifies the specific service contract line item |
| 4 | SET | `condMap.put(ESC0021D010CBSMsg.YOKYU_MT_APL_SBT_CD, YOKYU_MT_APL_SBT_CD_WEB)` // Requestor application type [-> YOKYU_MT_APL_SBT_CD_WEB = "W" (WEB channel)] |
| 5 | SET | `condMap.put(ESC0021D010CBSMsg.VLAN_ORDER_CD, VLAN_ORDER_CD_VLAN)` // VLAN order code [-> VLAN_ORDER_CD_VLAN = "01" (Standard VLAN order)] |
| 6 | SET | `condMap.put(ESC0021D010CBSMsg.YOKYU_SBT_CD, YOKYU_SBT_CD_NEW)` // Request type code [-> YOKYU_SBT_CD_NEW = "02" (New request)] |
| 7 | SET | `condMap.put(ESC0021D010CBSMsg.VLAN_SERVER_CD, VLAN_SERVER_CD_SETSUBIKANRI)` // VLAN server code [-> VLAN_SERVER_CD_SETSUBIKANRI = "1" (Sub-office management server)] |
| 8 | SET | `condMap.put(ESC0021D010CBSMsg.REQ_JI_MSKMSHO_NO, (String)paramMap.get("mskm_mmsho_no"))` // Request submission document number — identifies the request document |
| 9 | SET | `condMap.put(ESC0021D010CBSMsg.REQ_JI_KJAK_NO, (String)paramMap.get("kojiak_no"))` // Request project case number — identifies the work project |

### Block 3 — S-IF call execution (L294-L297)

Executes the telephone VLAN order receipt SC through the S-IF interface. This is the core business operation that allocates and registers the VLAN ID.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `mapper.setESC0021D010(keepReqParam.get(), keepFixedText.get(), condMap)` // Build request map from condition parameters [-> reqMap] |
| 2 | CALL | `scCall.run(reqMap, keepSesHandle.get())` // Execute ESC0021D010 SC via S-IF — allocates VLAN ID [-> resMap] |
| 3 | CALL | `mapper.getESC0021D010(keepReqParam.get(), keepFixedText.get(), resMap)` // Extract SC response into request params |
| 4 | CALL | `mapper.scResultCheck(keepReqParam.get())` // Validate SC result; throws exception on error |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service Contract Number — the unique identifier for a service contract line item in the telecom ordering system |
| `mskm_mmsho_no` | Field | Request Submission Document Number — the internal document number associated with the request submission |
| `kojiak_no` | Field | Project Case Number — the case number for the work project (工事案件) tracking installation/migration work |
| `esc0021` | SC | ESC0021 — Telephone VLAN Order Receipt (電話用VLANオーダ受付) service component. Handles VLAN ID allocation for telephone (VoIP) services on broadband lines |
| `yoku_mt_apl_sbt_cd` | Field | Requestor Application Type Code — identifies the channel through which the request was made (WEB = online customer portal) |
| `vlan_order_cd` | Field | VLAN Order Code — classifies the type of VLAN order (01 = standard VLAN order for telephone service) |
| `yoku_sbt_cd` | Field | Request Type Code — indicates whether the request is new, change, or cancellation (02 = new) |
| `vlan_server_cd` | Field | VLAN Server Code — identifies which VLAN server manages the allocation (1 = sub-office management / subnet management server) |
| `func_code` | Field | Function Code — specifies the SC function type (1 = inquiry/registration) |
| `vlan_id_fix_flg` | Field | VLAN ID Fix Flag — indicates whether a VLAN ID has been permanently assigned (1 = assigned/fixed) |
| `kojiake_stat` | Field | Work Project Status Code — tracks the lifecycle state of an installation/migration work project |
| `tk_hoshiki_ptn_cd_net_saki` | Field | Delivery Method Pattern Code (Net Front End) — identifies the delivery method (51 = Fiber Concentrator / 光コンセント) |
| S-IF | Acronym | Service Interface — the middleware layer for invoking service components (SCs) in the Futurity platform |
| SC | Acronym | Service Component — a backend business logic module that performs CRUD operations on telecom entities |
| CC | Acronym | Common Component — a shared reusable code module (Extends `AbstractCommonComponent`) used across screens and CBS |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| VoIP | Business term | Voice over Internet Protocol — telephone service delivered over IP networks using dedicated VLANs |
| VLAN | Business term | Virtual Local Area Network — a logical network segmentation used to isolate telephone (VoIP) traffic from data traffic on the customer's broadband connection |
| 住所変更に登録 | Japanese | Housing Change Registration — the business process of registering a customer's move to a new address, which may involve VLAN re-provisioning |
| 工事案件 | Japanese | Work Project — the installation or migration work order that tracks the lifecycle from registration through completion |
| 払出 | Japanese | Allocation/Assignment — the act of assigning (provisioning) a VLAN ID to a broadband line for telephone service |
| 光コンセント | Japanese | Fiber Concentrator / Fiber Optical Terminal — a fiber-optic termination device used in Fujitsu's fiber broadband deployments |
| マンション | Japanese | Apartment Building — refers to multi-unit dwellings where different VLAN assignment logic may apply (managed via status codes) |

---
