# Business Logic — JKKGlobalIpAddCfmCC.callJKKFixipadCC() [20 LOC]

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

## 1. Role

### JKKGlobalIpAddCfmCC.callJKKFixipadCC()

This method acts as a **delegating adapter** that packages fixed IP address (固定IPアドレス) provisioning data into a structured map and dispatches it to the `JKKFixipadCC.runFixipadHradsi` service component for actual IP allocation. It is a private, single-purpose utility method extracted from the larger `main()` entry point of `JKKGlobalIpAddCfmCC`, which handles the broader business operation of confirming and provisioning global IP addresses when authentication IDs change during customer contract modifications (OM-2016-0000890). The method gathers eight fields from two sources: the method's own `fixipadHradsiMap` parameter (which carries fixed IP address data from the calling screen KKSV0022), and the enclosing component's `ccWorkMap` instance field (which carries functional code and usage start date). It then increments the usage count by one (since the UI layer already incremented it once during input) and writes the assembled payload to the request parameter under the key `"KKSV002201CC"` before invoking the downstream fixed IP provisioning Common Component with an HTTP "post" operation. This delegation pattern keeps the main workflow linear and isolates IP address data preparation into a reusable, testable unit.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callJKKFixipadCC(handle, param, fixipadHradsiMap)"])
    
    START --> INIT["Create ccMap HashMap"]
    INIT --> PUT1["Put func_code: ccWorkMap.get(KEY_FUNC_CD)"]
    PUT1 --> PUT2["Put fixipad_in: fixipadHradsiMap.get(FIXIPAD)"]
    PUT2 --> PUT3["Put zm0101_upd_dtm_bf: fixipadHradsiMap.get(ZM0101_UPD_DTM)"]
    PUT3 --> PUT4["Put use_stat_ymd: ccWorkMap.get(USE_STAT_YMD)"]
    PUT4 --> PUT5["Put shyakk_chuskk_cd_in: fixipadHradsiMap.get(SHYAKK_CHUSKK_CD)"]
    PUT5 --> PUT6["Put kotei_ip_stku_sbt_cd_in: fixipadHradsiMap.get(KOTEI_IP_STKU_SBT_CD)"]
    PUT6 --> INCR["Increment use count by +1"]
    INCR --> PUT7["Put use_cnt_in: String.valueOf(useCnt + 1)"]
    PUT7 --> SETDATA["param.setData(KKSV002201CC, ccMap)"]
    SETDATA --> RUN["new JKKFixipadCC().runFixipadHradsi(handle, param, post)"]
    RUN --> END(["Return void"])
```

The method performs a **linear assembly-and-dispatch** processing pattern with no conditional branches, loops, or exception handling of its own. It creates a temporary map, populates it with eight key-value pairs extracted from the input parameter and instance state, sets the map onto the request parameter, and delegates to the fixed IP provisioning component. Every step is sequential — each `ccMap.put()` operation is independent and ordered purely for logical grouping.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle used for transaction management and persistence operations. Passed through unchanged to `runFixipadHradsi` to maintain the transaction context for the fixed IP allocation. |
| 2 | `param` | `IRequestParameterReadWrite` | Cross-component communication carrier that holds data shared between Common Components. The method writes the assembled IP provisioning payload under the key `"KKSV002201CC"` for consumption by downstream components. |
| 3 | `fixipadHradsiMap` | `HashMap<String, Object>` | Fixed IP address processing data map originating from the KKSV0022 screen's output handler. Contains the raw IP address, mask, usage count, status codes, and timestamps needed for IP allocation. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ccWorkMap` | `Map<String, Object>` | Work area map carrying service contract details, functional code, and usage start date from the parent `main()` method. Accessed for `func_cd` (functional code, value `"1"` or `"2"`) and `use_stat_ymd` (usage start date). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `param.setData` | - | - | Sets the assembled ccMap onto the request parameter under key "KKSV002201CC" for downstream consumption |
| C | `JKKFixipadCC.runFixipadHradsi` | JKKFixipadCC | - | Delegates to the fixed IP address provisioning Common Component with HTTP "post" operation to allocate a fixed IP address |

**How to classify:**
- **U** (Update): `param.setData()` modifies the request parameter's internal data store by writing the ccMap.
- **C** (Create): `runFixipadHradsi` is a fixed IP address allocation method — it provisions (creates) a fixed IP address assignment in the system when invoked with the "post" method, as indicated by the `!JKKFIXIPADCC_POST.equals(magicWord)` check in the called method (when the method is NOT "post", it runs additional fixed IP retrieval logic; with "post" it executes the allocation).

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `runFixipadHradsi` [-], `setData` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: JKKGlobalIpAddCfmCC | `JKKGlobalIpAddCfmCC.main` -> `callJKKFixipadCC` | `runFixipadHradsi [C] JKKFixipadCC` |

**Instructions:**
- The only direct caller is `JKKGlobalIpAddCfmCC.main()`, which is a Common Component entry point method in the same class.
- This method is private and not invoked from any screen (KKSV*) or batch directly.
- The terminal operation chain flows through `runFixipadHradsi` which eventually performs fixed IP address allocation in the system.

## 6. Per-Branch Detail Blocks

The method has a single linear execution path with no conditional branches, loops, or try-catch blocks.

**Block 1** — [LINEAR EXECUTION] `(no condition)` (L841)

> Creates the output data map and populates it with fixed IP address provisioning parameters. This is the core data-assembly block that gathers all eight fields needed by the downstream `runFixipadHradsi` Common Component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMap = new HashMap<String, Object>()` // Create temporary map for IP provisioning data |
| 2 | EXEC | `ccMap.put(FUNC_CODE_KEY, this.ccWorkMap.get(KEY_FUNC_CD))` // Put functional code from work map [-> KEY_FUNC_CD="func_cd"] |
| 3 | EXEC | `ccMap.put("fixipad_in", fixipadHradsiMap.get(FIXIPAD))` // Put fixed IP address [-> FIXIPAD="fixipad"] |
| 4 | EXEC | `ccMap.put("zm0101_upd_dtm_bf", fixipadHradsiMap.get(ZM0101_UPD_DTM))` // Put update timestamp before change [-> ZM0101_UPD_DTM="zm0101_upd_dtm"] |
| 5 | EXEC | `ccMap.put("use_stat_ymd", this.ccWorkMap.get(USE_STAT_YMD))` // Put usage start date [-> USE_STAT_YMD="use_stat_ymd"] |
| 6 | EXEC | `ccMap.put("shyakk_chuskk_cd_in", fixipadHradsiMap.get(SHYAKK_CHUSKK_CD))` // Put shipping method code [-> SHYAKK_CHUSKK_CD="shyakk_chuskk_cd"] |
| 7 | EXEC | `ccMap.put("kotei_ip_stku_sbt_cd_in", fixipadHradsiMap.get(KOTEI_IP_STKU_SBT_CD))` // Put fixed IP stock type code [-> KOTEI_IP_STKU_SBT_CD="kotei_ip_stku_sbt_cd"] |

**Block 1.1** — [SET: usage count increment] (L851)

> Increments the usage count by 1. As noted in the Japanese comment: the usage count is incremented by +1 because the screen layer has already incremented it during input, and this represents the actual usage count after this allocation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `useCnt = Integer.parseInt((String)fixipadHradsiMap.get(USE_CNT)) + 1` // Parse current usage count and add 1 [-> USE_CNT="use_cnt"] |
| 2 | EXEC | `ccMap.put("use_cnt_in", String.valueOf(useCnt))` // Put incremented usage count as string |

**Block 2** — [EXEC: parameter write] (L854)

> Writes the assembled ccMap onto the request parameter so downstream Common Components can read it.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.setData("KKSV002201CC", ccMap)` // Store ccMap under KKSV002201CC key |

**Block 3** — [CALL: delegation] (L856)

> Instantiates and invokes the fixed IP provisioning Common Component with the prepared data and HTTP "post" method to trigger IP allocation.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `new JKKFixipadCC().runFixipadHradsi(handle, param, "post")` // Delegate fixed IP allocation; magicWord="post" bypasses additional IP retrieval |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `fixipad` | Field | Fixed IP Address (Output) — the IP address string to be provisioned to the customer |
| `fixipad_in` | Field | Fixed IP Address (Input) — the fixed IP address passed to the provisioning component |
| `zm0101_upd_dtm_bf` | Field | Update Date/Time Before — the timestamp of the last update to the ZM0101 table record before this change |
| `use_stat_ymd` | Field | Usage Start Date — the year-month-day when the service usage begins |
| `shyakk_chuskk_cd` | Field | Shipping Method Code — code indicating the shipping/dispatch method for the service |
| `kotei_ip_stku_sbt_cd` | Field | Fixed IP Stock Type Code — code specifying the type/category of the fixed IP address inventory |
| `use_cnt` | Field | Usage Count — the number of times the fixed IP address has been used, incremented by 1 on each allocation |
| `func_cd` | Field | Functional Code — code identifying the business function (values: "1" or "2") |
| `KEY_FUNC_CD` | Constant | Work map key for functional code |
| `USE_STAT_YMD` | Constant | Work map key for usage start date |
| `FIXIPAD` | Constant | Key for fixed IP address in fixipadHradsiMap, value: `"fixipad"` |
| `ZM0101_UPD_DTM` | Constant | Key for update timestamp before change |
| `SHYAKK_CHUSKK_CD` | Constant | Key for shipping method code |
| `KOTEI_IP_STKU_SBT_CD` | Constant | Key for fixed IP stock type code |
| `USE_CNT` | Constant | Key for usage count |
| `JKKFIXIPADCC_POST` | Constant | Magic word constant, value: `"post"` — indicates HTTP POST operation for fixed IP allocation |
| JKKFixipadCC | Class | Fixed IP Address Provisioning Common Component — handles the actual fixed IP address allocation logic |
| `runFixipadHradsi` | Method | Fixed IP address processing method — prepares and dispatches IP allocation data |
| KKSV0022 | Screen | K-Opticom screen number for customer service contract detail handling with fixed IP address configuration |
| KKSV002201CC | Key | Request parameter key for the KKSV0022 screen's output processing Common Component |
| ccWorkMap | Field | Cross-component work map — shared data area between Common Components carrying contract and configuration details |
| SessionHandle | Class | Database session handle for transaction and persistence management |
| IRequestParameterReadWrite | Interface | Cross-component data carrier interface for passing parameters between Common Components |
| Fixed IP Address (固定IPアドレス) | Business term | A static IP address assigned to a customer's service, as opposed to a dynamic (DHCP) address |
| IP Address Allocation (払出) | Business term | The process of assigning a fixed IP address to a customer's service contract line item |
| Authentication ID Change (認証IDの変更) | Business concept | A customer contract modification scenario where the authentication ID changes, requiring re-allocation of the fixed IP address (OM-2016-0000890) |
