---

# Business Logic — JKKGlobalIpAddCfmCC.getKoteiIpAd() [33 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.getKoteiIpAd()

The `getKoteiIpAd` method retrieves a fixed IP address (固定IPアドレス) for a given ISP authentication ID (ISP認証ID) within the context of a fiber-optic global IP address registration workflow. Its purpose, as stated in the Javadoc, is to acquire the fixed IP address associated with an ISP authentication record identified by `ispNinshoId`. The method acts as a **delegating bridge** between the calling CC (component controller) logic and the dedicated `JKKFixipadCC` component, which encapsulates the full fixed IP address dispatch logic (including data preparation, service calls, and result assembly).

Business-wise, this method operates within the **Fixed Global IP Address Information Display / Dispatch** feature (固定グローバルIPアドレス情報表示 / 固定IPアドレス扺出). It prepares a request map (`ccMap`) carrying the function code, service contract number (`svc_kei_no`), and ISP authentication ID, then delegates to `JKKFixipadCC.runFixipadHradsi` with the command `"get"` to retrieve the fixed IP address record from the database. Finally, it extracts the first result entry from the returned fixed IP address dispatch list and returns it as the result map.

The method follows a **Builder-Delegation pattern**: it constructs a parameter map (building phase), delegates to a specialized service component for the actual data operation (delegation phase), and extracts the relevant result from the returned list (extraction phase). It is a private helper called by the `main()` method of the same class, meaning it serves as an internal utility method within the global IP address registration CC flow, rather than a direct screen entry point.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getKoteiIpAd start"])
    INIT_RESULT["Create result HashMap"]
    INIT_CC_MAP["Create ccMap HashMap"]
    PUT_FUNC["Set FUNC_CODE_KEY in ccMap from ccWorkMap"]
    PUT_SVC["Set SVC_KEI_NO in ccMap from ccWorkMap"]
    PUT_ISP["Set ISP_NINSHO_ID in ccMap from parameter"]
    SET_DATA["param.setData KKSV002201CC ccMap"]
    CALL_FIXIPAD["Call JKKFixipadCC.runFixipadHradsi handle param get"]
    GET_LIST["Get FIXIPAD_HRADSI_LIST from ccMap"]
    CHECK_LIST["fixipadHradsiList is not null and size greater than 0"]
    ASSIGN_RESULT["result = fixipadHradsiList.get 0"]
    RETURN_RESULT["Return result HashMap"]

    START --> INIT_RESULT
    INIT_RESULT --> INIT_CC_MAP
    INIT_CC_MAP --> PUT_FUNC
    PUT_FUNC --> PUT_SVC
    PUT_SVC --> PUT_ISP
    PUT_ISP --> SET_DATA
    SET_DATA --> CALL_FIXIPAD
    CALL_FIXIPAD --> GET_LIST
    GET_LIST --> CHECK_LIST
    CHECK_LIST -- "Yes" --> ASSIGN_RESULT
    CHECK_LIST -- "No" --> RETURN_RESULT
    ASSIGN_RESULT --> RETURN_RESULT
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `JCMConstants.FUNC_CODE_KEY` | `"func_code"` | Function code key — used to carry the operation type in the CC work map (value sourced from `ccWorkMap`) |
| `KKSV0022_KKSV0022OP_KKSV002201CC.SVC_KEI_NO` | `"svc_kei_no"` | Service contract number — identifies the service line item |
| `KKSV0022_KKSV0022OP_KKSV002201CC.ISP_NINSHO_ID` | `"isp_ninsho_id"` | ISP authentication ID — the unique identifier for the ISP authentication record |
| `KKSV0022_KKSV0022OP_KKSV002201CC.FIXIPAD_HRADSI_LIST` | `"fixipad_hradsi_list"` | Fixed IP address dispatch result list — contains the returned fixed IP records |
| `JKKFIXIPADCC_GET` | `"get"` | Key word 1: Fixed IP address retrieval — tells `runFixipadHradsi` to perform only the GET (read) operation |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The database session handle used for the underlying data access operations delegated to `JKKFixipadCC`. It carries the database connection context and transaction boundary. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object that carries data between CC components. It stores the `ccMap` under the key `"KKSV002201CC"` and is passed to `runFixipadHradsi` for the fixed IP retrieval operation. |
| 3 | `ispNinshoId` | `String` | The ISP authentication ID (ISP認証ID) — the unique business key identifying which ISP authentication record's fixed IP address should be retrieved. This is the primary filter criterion for the fixed IP lookup. |

**External state read by the method:**
| Field | Source | Business Description |
|-------|--------|---------------------|
| `ccWorkMap.get(KEY_FUNC_CD)` | Instance field `ccWorkMap` | Function code — the operation type context stored in the CC's working map |
| `ccWorkMap.get(KEY_SVC_KEI_NO)` | Instance field `ccWorkMap` | Service contract number — retrieved from the CC's working map to include in the dispatch request |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKFixipadCC.runFixipadHradsi` | JKKFixipadCC | — | Calls `runFixipadHradsi` with command `"get"` to retrieve fixed IP address records. Internally dispatches to `runGetFixipad` which queries the fixed IP address database tables. |

**Detailed breakdown:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKFixipadCC.runFixipadHradsi` | JKKFixipadCC | — | Delegates to the dedicated fixed IP address component. With the `"get"` command, it enters read-only mode: calls `runGetFixipad` to query the database for the fixed IP address record matching the ISP authentication ID and service contract number. The `runFixipadHradsi` method extracts the `kksv002201cc` data map from the parameter, initializes control map data (return code, return message), performs the GET operation, then compiles the result list via `editResultList`. |
| U | `param.setData` | — | — | Sets the prepared `ccMap` into `param` under the data key `"KKSV002201CC"`, making it available for downstream processing by `runFixipadHradsi`. |

The method itself performs **no direct database operations**. It is a pure orchestrator that prepares data, delegates to the `JKKFixipadCC` service component, and extracts results. All database read operations are encapsulated within `JKKFixipadCC.runFixipadHradsi` → `runGetFixipad`.

## 5. Dependency Trace

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

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `main()` (JKKGlobalIpAddCfmCC) | `JKKGlobalIpAddCfmCC.main()` → `JKKGlobalIpAddCfmCC.getKoteiIpAd` | `runFixipadHradsi [R] (fixed IP address retrieval)` |

**Analysis:**
- The only direct caller in the pre-computed data is the `main()` method of `JKKGlobalIpAddCfmCC` itself, indicating this is an **internal utility method** called from within the same class.
- The `main()` method of `JKKGlobalIpAddCfmCC` is itself part of the global IP address registration workflow (Fixed Global IP Address Information Display / Dispatch feature).
- The method does not have any known screen/batch entry points within 8 hops, confirming it is a private helper method in the CC layer.
- The terminal operation `runFixipadHradsi` with command `"get"` performs a database read for fixed IP address records.

## 6. Per-Branch Detail Blocks

**Block 1** — INITIALIZATION `(lines 793–795)`

> Initialize the result and working maps.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> result = new HashMap<String, Object>();` // Initialize the return value map |
| 2 | SET | `HashMap<String, Object> ccMap = new HashMap<String, Object>();` // Create the CC work map |

**Block 2** — MAP BUILDING `(lines 798–807)`

> Populate the ccMap with function code, service contract number, and ISP authentication ID. Then set this map into the parameter object.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMap.put(FUNC_CODE_KEY, this.ccWorkMap.get(KEY_FUNC_CD))` // Put function code from ccWorkMap [-> `JCMConstants.FUNC_CODE_KEY` = `"func_code"`] |
| 2 | SET | `ccMap.put(SVC_KEI_NO, this.ccWorkMap.get(KEY_SVC_KEI_NO))` // Put service contract number from ccWorkMap [-> `SVC_KEI_NO` = `"svc_kei_no"` (Service contract number)] |
| 3 | SET | `ccMap.put(ISP_NINSHO_ID, ispNinshoId)` // Put ISP authentication ID from parameter [-> `ISP_NINSHO_ID` = `"isp_ninsho_id"` (ISP authentication ID)] |
| 4 | EXEC | `param.setData("KKSV002201CC", ccMap)` // Store ccMap in param under key "KKSV002201CC" for downstream consumption |

**Block 3** — DELEGATION `(lines 810–811)`

> Call the dedicated fixed IP address component to retrieve the fixed IP address data. The `"get"` command (KEYWORD 1: Fixed IP address retrieval) tells the component to perform a read-only database query.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `new JKKFixipadCC().runFixipadHradsi(handle, param, "get")` // Delegate to JKKFixipadCC for fixed IP address retrieval. With `"get"` command (KEYWORD 1: 固定IPアドレス取得), it skips post-processing and performs only the GET operation (queries `runGetFixipad` internally). |

**Block 4** — RESULT EXTRACTION `(lines 814–819)`

> Retrieve the fixed IP address dispatch result list from ccMap, then extract the first element if available.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<HashMap<String, Object>> fixipadHradsiList = (ArrayList<HashMap<String, Object>>)ccMap.get(FIXIPAD_HRADSI_LIST)` // Cast and retrieve the fixed IP address dispatch result list [-> `FIXIPAD_HRADSI_LIST` = `"fixipad_hradsi_list"` (Fixed IP address dispatch result list)] |

**Block 4.1** — IF `(condition: fixipadHradsiList != null && fixipadHradsiList.size() > 0)` `(line 815)`

> Check whether the dispatch result list contains at least one fixed IP address record. If so, extract the first record as the result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `result = fixipadHradsiList.get(0)` // Set the first fixed IP address record from the dispatch list to result |

**Block 4.2** — ELSE-IMPLICIT `(condition: fixipadHradsiList is null or empty)` `(lines 815–819)`

> If no fixed IP address records were returned, the result map remains empty (initialized in Block 1).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | *(no assignment — result remains the empty HashMap initialized in Block 1)* |

**Block 5** — RETURN `(line 821)`

> Return the result map, which either contains the first fixed IP address record or is an empty map.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return result` // Return the fixed IP address map (or empty if no records found) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `getKoteiIpAd` | Method | Fixed IP address acquisition — retrieves a fixed IP address record for a given ISP authentication ID |
| `kotei_ip_ad` | Field | Fixed IP address — the static IP address assigned to a customer's service line |
| `isp_ninsho_id` | Field | ISP authentication ID — unique identifier for the ISP authentication record; used to locate the fixed IP address |
| `svc_kei_no` | Field | Service contract number — the identifier for a service line item (service detail/keiyaku no) |
| `func_code` | Field | Function code — carries the operation type context (e.g., display vs. registration) within CC work maps |
| `fixipad_hradsi_list` | Field | Fixed IP address dispatch result list — ArrayList containing the retrieved fixed IP address records |
| `ccWorkMap` | Instance Field | CC work map — the component controller's instance-level working map that holds operation context data (function code, service number, etc.) |
| `handle` | Parameter | Session handle — the database session/transaction context used for data access operations |
| `param` | Parameter | Request parameter — the IRequestParameterReadWrite interface that carries data between CC components in the request/response chain |
| JKKFixipadCC | Class | Fixed IP Address Dispatch CC — the dedicated component controller for fixed IP address operations (retrieval, registration, usage) |
| JKKFixipadConstCC | Class | Fixed IP Address Dispatch CC Constants — defines constant values for the fixed IP address component, including operation keywords |
| `JKKFIXIPADCC_GET` | Constant | `"get"` — KEYWORD 1: Fixed IP address retrieval; instructs the component to perform only the read (GET) operation |
| `JKKFIXIPADCC_POST` | Constant | `"post"` — KEYWORD 2: Fixed IP address usage registration; instructs the component to perform registration (POST) operations |
| `JKKFIXIPADCC_BOTH` | Constant | `"both"` — KEYWORD 3: Fixed IP address retrieval and usage registration; instructs the component to perform both GET and POST operations |
| KKSV0022 | Screen | Fixed Global IP Address Information Display screen — the screen that displays and dispatches fixed global IP address information |
| KKSV002201CC | Data Key | The parameter data key under which the fixed IP address dispatch map is stored in the request parameter |
| ISP | Acronym | Internet Service Provider — the entity providing internet connectivity services |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband service delivered to residential premises |
| CC | Acronym | Component Controller — the business logic component in this architecture that coordinates data operations, validation, and service calls |
| `IRequestParameterReadWrite` | Interface | Request parameter interface — the data transport mechanism for passing structured data between CC components |

---
