# Business Logic — JKKOpSvcHktgiUpdCC.updateAging() [225 LOC]

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

## 1. Role

### JKKOpSvcHktgiUpdCC.updateAging()

This method manages the **aging lifecycle** of operational service target values within the K-Opticom customer base system. "Aging" in this context refers to flagging specific customer identifiers (such as IP addresses, email aliases, URLs, or mailing list entries) as being actively used — i.e., reserved or in a state where they cannot be reassigned to other customers during service transfers (option hikitige: オプション引継ぎ).

The method operates as a **multi-type routing dispatcher**. It reads the **operation service code** (`opSvcCd`) from the input message to determine whether the request applies to an eligible service type — Email (`B001`), My Homepage (`B002`), Mailing List (`B003`), Fixed Global IP Address (`B004`), or Multisection (`B015`). If the service code does not match any of these five, the method returns immediately without processing, effectively filtering out irrelevant operation types.

For eligible service types, the method extracts all available aging-target fields from the incoming `msgEKK0361A010` message and processes **each non-null field independently**. Each field type (Fixed IP, URL, WebID, PopID, Mail Address, Mailing List, and Email Alias) follows an identical three-phase pattern: (1) build an aging map with the target value and a type code, and (2) dispatch to one of three aging state handlers based on the `execKbn` parameter — add (register the target as in-use), kihk (recover the target to available), or end (mark the target as fully consumed). This pattern is repeated across seven distinct target value categories.

For sub-operation services (additional service contracts), the method iterates through the `msgsEKK0401B001` array, resolves each sub-service's email alias via a service component call (`EKK0411A010`), and appends the mail domain portion from the primary mail address before processing it as an aging target under the alias type code.

**Design pattern:** Strategy + Dispatch — the method routes based on two orthogonal dimensions: the service type (gate) and the aging execution type (`execKbn`: add, kihk, end), applying the same operational logic across multiple data categories.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["updateAging"])
    SKIP(["Skip: Return"])

    START --> GET_OP["Get opSvcCd from msgEKK0351A010"]
    GET_OP --> CHECK_SKIP{Valid opSvcCd?}
    CHECK_SKIP -->|No| SKIP
    CHECK_SKIP -->|Yes| INIT_MAPS["Create agingMap and inputMap"]

    INIT_MAPS --> FETCH_DATA["Get all fields from messages"]
    FETCH_DATA --> IP_CHECK{tmpIp present?}
    IP_CHECK -->|Yes| IP_SET["Set agingMap: type=002, value=tmpIp"]
    IP_CHECK -->|No| URL_CHECK
    IP_SET --> IP_KBN{execKbn?}
    IP_KBN -->|01| IP_ADD["useAddAging"] --> IP_END
    IP_KBN -->|02| IP_KIHK["useKihkAging"] --> IP_END
    IP_KBN -->|03/else| IP_END_S["useEndAging"] --> IP_END
    IP_END --> URL_CHECK
    URL_CHECK{tmpUrlDomain or tmpUrlAccount?} -->|Yes| URL_SET["Set agingMap: type=005, value=urlDomain+urlAccount"]
    URL_CHECK -->|No| WEBID_CHECK
    URL_SET --> URL_KBN{execKbn?}
    URL_KBN -->|01| URL_ADD["useAddAging"] --> URL_END
    URL_KBN -->|02| URL_KIHK["useKihkAging"] --> URL_END
    URL_KBN -->|03/else| URL_END_S["useEndAging"] --> URL_END
    URL_END --> WEBID_CHECK
    WEBID_CHECK{tmpWebId present?} -->|Yes| WEBID_SET["Set agingMap: type=006, value=tmpWebId"]
    WEBID_CHECK -->|No| POPID_CHECK
    WEBID_SET --> WEBID_KBN{execKbn?}
    WEBID_KBN -->|01| WEBID_ADD["useAddAging"] --> WEBID_END
    WEBID_KBN -->|02| WEBID_KIHK["useKihkAging"] --> WEBID_END
    WEBID_KBN -->|03/else| WEBID_END_S["useEndAging"] --> WEBID_END
    WEBID_END --> POPID_CHECK
    POPID_CHECK{tmpPopId present?} -->|Yes| POPID_SET["Set agingMap: type=007, value=tmpPopId"]
    POPID_CHECK -->|No| MLAD_CHECK
    POPID_SET --> POPID_KBN{execKbn?}
    POPID_KBN -->|01| POPID_ADD["useAddAging"] --> POPID_END
    POPID_KBN -->|02| POPID_KIHK["useKihkAging"] --> POPID_END
    POPID_KBN -->|03/else| POPID_END_S["useEndAging"] --> POPID_END
    POPID_END --> MLAD_CHECK
    MLAD_CHECK{tmpMlad present?} -->|Yes| MLAD_SET["Set agingMap: type=009, value=tmpMlad"]
    MLAD_CHECK -->|No| MLLIST_CHECK
    MLAD_SET --> MLAD_KBN{execKbn?}
    MLAD_KBN -->|01| MLAD_ADD["useAddAging"] --> MLAD_END
    MLAD_KBN -->|02| MLAD_KIHK["useKihkAging"] --> MLAD_END
    MLAD_KBN -->|03/else| MLAD_END_S["useEndAging"] --> MLAD_END
    MLAD_END --> MLLIST_CHECK
    MLLIST_CHECK{tmpMllist present?} -->|Yes| MLLIST_PROC["Run EZM0321A010 to get domain"]
    MLLIST_CHECK -->|No| SUBLOOP
    MLLIST_PROC --> MLLIST_SET["Set agingMap: type=010, value=mllist+@+domain"]
    MLLIST_SET --> MLLIST_KBN{execKbn?}
    MLLIST_KBN -->|01| MLLIST_ADD["useAddAging"] --> MLLIST_END
    MLLIST_KBN -->|02| MLLIST_KIHK["useKihkAging"] --> MLLIST_END
    MLLIST_KBN -->|03/else| MLLIST_END_S["useEndAging"] --> MLLIST_END
    MLLIST_END --> SUBLOOP
    SUBLOOP["Loop msgsEKK0401B001"] --> SUB_FETCH["Get sbOpSvcKeiNo from message"]
    SUB_FETCH --> SUB_RUN["runSc EKK0411A010 with FUNC_CD_2"]
    SUB_RUN --> SUB_ALIAS["Get ALIAS from response"]
    SUB_ALIAS --> ALIAS_CHECK{tmpAlias present?}
    ALIAS_CHECK -->|No| SUB_NEXT
    ALIAS_CHECK -->|Yes| ALIAS_SPL["Split tmpMlad by @, append domain to alias"]
    ALIAS_SPL --> ALIAS_SET["Set agingMap: type=008, value=alias+@+mldomain"]
    ALIAS_SET --> ALIAS_KBN{execKbn?}
    ALIAS_KBN -->|01| ALIAS_ADD["useAddAging"] --> ALIAS_END
    ALIAS_KBN -->|02| ALIAS_KIHK["useKihkAging"] --> ALIAS_END
    ALIAS_KBN -->|03/else| ALIAS_END_S["useEndAging"] --> ALIAS_END
    ALIAS_END --> SUB_NEXT
    SUB_NEXT["Next iteration"] --> SUB_DONE{More messages?}
    SUB_DONE -->|Yes| SUB_FETCH
    SUB_DONE -->|No| END(["Return"])
```

**Constant Resolution Reference:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `OP_SVC_CD_EMAIL` | `"B001"` | Operation service code: Email |
| `OP_SVC_CD_MYHOMEPAGE` | `"B002"` | Operation service code: My Homepage |
| `OP_SVC_CD_MAILINGLIST` | `"B003"` | Operation service code: Mailing List |
| `OP_SVC_CD_KOTEI_IP` | `"B004"` | Operation service code: Fixed Global IP Address |
| `OP_SVC_CD_MLTISE` | `"B015"` | Operation service code: Multisection |
| `AGING_EXEC_KBN_ADD` | `"01"` | Aging execution type: Register (add) |
| `AGING_EXEC_KBN_KIHK` | `"02"` | Aging execution type: Recovery (kiharkafuku: 回復) |
| `AGING_EXEC_KBN_END` | `"03"` | Aging execution type: End (usage finished) |
| `AGING_SBT_CD_IP` | `"002"` | Aging type: Fixed IP Address |
| `AGING_SBT_CD_URL` | `"005"` | Aging type: URL |
| `AGING_SBT_CD_WEB_ID` | `"006"` | Aging type: WebID |
| `AGING_SBT_CD_POP_ID` | `"007"` | Aging type: PopID |
| `AGING_SBT_CD_ALIAS` | `"008"` | Aging type: Email Alias |
| `AGING_SBT_CD_MLAD` | `"009"` | Aging type: Mail Address |
| `AGING_SBT_CD_MLLIST` | `"010"` | Aging type: Mailing List |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle — provides the transactional context for all service component calls (e.g., `runSc`, `useAddAging`). Maintains connection state and transaction boundaries. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object — used to read and write model-level parameters such as function codes (`FUNC_CD_2`), operation service contract numbers, and sub-service contract numbers passed to service components. |
| 3 | `msgEKK0351A010` | `CAANMsg` | Operation Service Agreement message — carries the primary operation service contract header data including the operation service code (`opSvcCd`) that determines eligibility, and the operation service contract number (`opSvcKeiNo`) used in sub-service alias queries. |
| 4 | `msgEKK0361A010` | `CAANMsg` | Operation Service Agreement <ISP> message — carries the aging target fields for the ISP-level service: fixed IP address, URL domain, URL account, WebID, PopID, mail address (MLAD), and mailing list name. |
| 5 | `msgsEKK0401B001` | `CAANMsg[]` | Sub-Operation Service Agreement list — an array of sub-service contract messages, each containing a sub-operation service contract number (`sbOpSvcKeiNo`) used to query the corresponding email alias. |
| 6 | `execKbn` | `String` | Execution type classification — determines which aging state transition to apply to each target value. `"01"` = add (register as in-use, `useAddAging`), `"02"` = recovery (restore to available, `useKihkAging`), `"03"` or any other value = end (mark as consumed, `useEndAging`). |

**Instance fields read by the method:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `mapper` | `JKKOpSvcHktgiUpdMapperCC` | Mapper instance used to invoke business parameter management SCs (e.g., `editInMsgEZM0321A010` for mailing list domain lookup). |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKOpSvcHktgiUpdCC.runSc` (EZM0321A010) | EZM0321A010 | — | Reads business parameter mapping to obtain mailing list domain via `EZM0321A010` SC. |
| R | `JKKOpSvcHktgiUpdCC.runSc` (EKK0411A010) | EKK0411A010 | — | Queries sub-service agreement details to retrieve email alias for each sub-operation service. |
| C | `JKKOpSvcHktgiUpdCC.useAddAging` | EZM0111D010 | Aging registration entity | Registers aging targets — marks values as "in use" (登録: registration), preventing reassignment during option transfers. Maps to `EZM0111D010` (Aging Target Registration). |
| U | `JKKOpSvcHktgiUpdCC.useKihkAging` | EZM0111C020 | Aging recovery entity | Recovers aging targets — restores values to "available" status (回復: recovery), allowing reassignment. Maps to `EZM0111C020` (Aging Target Recovery). |
| U | `JKKOpSvcHktgiUpdCC.useEndAging` | EZM0111C010 | Aging end entity | Ends aging targets — marks values as "usage finished" (使用終了: usage ended), indicating the value is fully consumed. Maps to `EZM0111C010` (Aging Target Usage Ended). |
| R | `JZMAdEdit.clear` | — | — | Clears the agingMap before each new aging target type is processed. |
| R | `JCCcomFileSearchUtil.clear` | — | — | Utility clear called during map operations. |

**How SC codes are derived:**
- `useAddAging` internally invokes `EZM0111D010` (defined as constant `"EZM0111D010"` in the class: "エージング対象登録" / Aging Target Registration) — a **Create** operation.
- `useKihkAging` internally invokes `EZM0111C020` (defined as constant `"EZM0111C020"` in the class: "エージング対象回復" / Aging Target Recovery) — an **Update** operation.
- `useEndAging` internally invokes `EZM0111C010` (defined as constant `"EZM0111C010"` in the class: "エージング対象使用終了" / Aging Target Usage Ended) — an **Update** operation.
- `runSc` with `EZM0321A010` invokes the business parameter management agreement SC to retrieve the mailing list domain.
- `runSc` with `EKK0411A010` invokes the sub-operation service agreement SC to retrieve email alias data.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKOpSvcHktgiUpdCC.addMyHomePage()` | `addMyHomePage()` -> `updateAging()` | `useEndAging [U] EZM0111C010` |
| 2 | `JKKOpSvcHktgiUpdCC.dslOption()` | `dslOption()` -> `updateAging()` | `useEndAging [U] EZM0111C010` |

**Terminal operations reached from this method:**
`useAddAging` [C], `useKihkAging` [U], `useEndAging` [U], `clear` [R], `runSc` [R], `getString` [R]

## 6. Per-Branch Detail Blocks

### Block 1 — [IF] `opSvcCd eligibility check` (L4999)

> Gate: Only process if the operation service code matches one of the five eligible types. If none match, return immediately.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `msgEKK0351A010.getString(EKK0351A010CBSMsg1List.OP_SVC_CD)` // Get operation service code [-> `OP_SVC_CD_EMAIL="B001"`, `OP_SVC_CD_MYHOMEPAGE="B002"`, `OP_SVC_CD_MAILINGLIST="B003"`, `OP_SVC_CD_KOTEI_IP="B004"`, `OP_SVC_CD_MLTISE="B015"] |
| 2 | IF | `!OP_SVC_CD_EMAIL.equals(opSvcCd) && !OP_SVC_CD_MYHOMEPAGE.equals(opSvcCd) && !OP_SVC_CD_MAILINGLIST.equals(opSvcCd) && !OP_SVC_CD_KOTEI_IP.equals(opSvcCd) && !OP_SVC_CD_MLTISE.equals(opSvcCd)` [-> No match = return] |
| 3 | RETURN | `return;` // Skip: not an eligible operation service type |

### Block 2 — [SET] Initialize aging maps (L5010)

> Allocate HashMaps for aging target data and sub-service input parameters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `agingMap = new HashMap<String, Object>()` // Aging destination mapping |
| 2 | SET | `inputMap = new HashMap<String, Object>()` // Input mapping for sub-service queries |

### Block 2.1 — [SET] Fetch operation service contract number (L510)

| # | Type | Code |
|---|------|------|
| 1 | SET | `opSvcKeiNo = msgEKK0351A010.getString(EKK0351A010CBSMsg1List.OP_SVC_KEI_NO)` // Operation service contract number |

### Block 2.2 — [SET] Fetch aging target data from message (L513–L520)

> Extract all possible aging target fields from the ISP-level message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpIp = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.KOTEI_IP_AD)` // Fixed IP address |
| 2 | SET | `tmpUrlDomain = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.URL_DOMAIN)` // URL domain |
| 3 | SET | `tmpUrlAccount = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.URL_ACCOUNT)` // URL account |
| 4 | SET | `tmpWebId = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.WEB_ID)` // WebID |
| 5 | SET | `tmpPopId = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.POP_ID)` // PopID |
| 6 | SET | `tmpMlad = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.MLAD)` // Mail address |
| 7 | SET | `tmpMllist = msgEKK0361A010.getString(EKK0361A010CBSMsg1List.MLLIST_NM)` // Mailing list name |

### Block 3 — [IF] Process Fixed IP Address (L523)

> Check if a fixed IP address is present, and if so, age it according to execKbn.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tmpIp != null && !"".equals(tmpIp)` [CONST: `tmpIp` has a non-null, non-empty value] (L523) |
| 2 | EXEC | `agingMap.clear()` // Clear the aging map |
| 3 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_IP)` [-> `aging_sbt_cd = "002"` (Fixed IP Address)] |
| 4 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpIp)` [-> `aging_tg_value = tmpIp`] |
| 5 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"` (Add / Register)] (L535) |
| 6 | CALL | `useAddAging(handle, param, agingMap)` // Register IP as in-use |
| 7 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"` (Recovery)] (L539) |
| 8 | CALL | `useKihkAging(handle, param, agingMap)` // Recover IP to available |
| 9 | ELSE | `execKbn` is `"03"` or other (L543) |
| 10 | CALL | `useEndAging(handle, param, agingMap)` // Mark IP as usage finished |

### Block 4 — [IF] Process URL (L550)

> Check if URL domain or URL account is present, and if so, age the combined value.

| # | Type | Code |
|---|------|------|
| 1 | IF | `(tmpUrlDomain != null && !"".equals(tmpUrlDomain)) || (tmpUrlAccount != null && !"".equals(tmpUrlAccount))` [CONST: URL-related fields present] (L550) |
| 2 | EXEC | `agingMap.clear()` // Clear the aging map |
| 3 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_URL)` [-> `aging_sbt_cd = "005"` (URL)] |
| 4 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpUrlDomain + tmpUrlAccount)` [-> Concatenated URL value] |
| 5 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"`] (L562) |
| 6 | CALL | `useAddAging(handle, param, agingMap)` |
| 7 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"`] (L566) |
| 8 | CALL | `useKihkAging(handle, param, agingMap)` |
| 9 | ELSE | `execKbn = "03"` or other (L570) |
| 10 | CALL | `useEndAging(handle, param, agingMap)` |

### Block 5 — [IF] Process WebID (L577)

> Check if a WebID is present, and if so, age it.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tmpWebId != null && !"".equals(tmpWebId)` (L577) |
| 2 | EXEC | `agingMap.clear()` |
| 3 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_WEB_ID)` [-> `aging_sbt_cd = "006"` (WebID)] |
| 4 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpWebId)` |
| 5 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"`] (L589) |
| 6 | CALL | `useAddAging(handle, param, agingMap)` |
| 7 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"`] (L593) |
| 8 | CALL | `useKihkAging(handle, param, agingMap)` |
| 9 | ELSE | (L597) |
| 10 | CALL | `useEndAging(handle, param, agingMap)` |

### Block 6 — [IF] Process PopID (L604)

> Check if a PopID is present, and if so, age it.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tmpPopId != null && !"".equals(tmpPopId)` (L604) |
| 2 | EXEC | `agingMap.clear()` |
| 3 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_POP_ID)` [-> `aging_sbt_cd = "007"` (PopID)] |
| 4 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpPopId)` |
| 5 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"`] (L616) |
| 6 | CALL | `useAddAging(handle, param, agingMap)` |
| 7 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"`] (L620) |
| 8 | CALL | `useKihkAging(handle, param, agingMap)` |
| 9 | ELSE | (L624) |
| 10 | CALL | `useEndAging(handle, param, agingMap)` |

### Block 7 — [IF] Process Mail Address (L631)

> Check if a mail address (MLAD) is present, and if so, age it.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tmpMlad != null && !"".equals(tmpMlad)` (L631) |
| 2 | EXEC | `agingMap.clear()` |
| 3 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_MLAD)` [-> `aging_sbt_cd = "009"` (Mail Address)] |
| 4 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpMlad)` |
| 5 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"`] (L643) |
| 6 | CALL | `useAddAging(handle, param, agingMap)` |
| 7 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"`] (L647) |
| 8 | CALL | `useKihkAging(handle, param, agingMap)` |
| 9 | ELSE | (L651) |
| 10 | CALL | `useEndAging(handle, param, agingMap)` |

### Block 8 — [IF] Process Mailing List (L658)

> Check if a mailing list name is present. Requires a service component call to resolve the mailing list domain before aging.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tmpMllist != null && !"".equals(tmpMllist)` (L658) |
| 2 | CALL | `this.mapper.editInMsgEZM0321A010(WORK_PARAM_ID_MLLIST_NM_DOMAIN)` [-> `WORK_PARAM_ID_MLLIST_NM_DOMAIN = "KK_MLLIST_NM_DOMAIN"`] // Business parameter management agreement execution |
| 3 | CALL | `(CAANMsg[])runSc(handle, param, EZM0321A010, mapEZM0321A010)` // Call EZM0321A010 SC to get mailing list domain |
| 4 | SET | `domain = msgsEZM0321A010[0].getString(EZM0321A010CBSMsg1List.WORK_PARAM_SETTE_VALUE)` // Get mailing list domain from response |
| 5 | EXEC | `agingMap.clear()` |
| 6 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_MLLIST)` [-> `aging_sbt_cd = "010"` (Mailing List)] |
| 7 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpMllist + "@" + domain)` // Concatenate mailing list name with domain |
| 8 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"`] (L672) |
| 9 | CALL | `useAddAging(handle, param, agingMap)` |
| 10 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"`] (L676) |
| 11 | CALL | `useKihkAging(handle, param, agingMap)` |
| 12 | ELSE | (L680) |
| 13 | CALL | `useEndAging(handle, param, agingMap)` |

### Block 9 — [FOR] Process Sub-Operation Service Email Aliases (L687)

> Iterate through all sub-operation service contract messages, resolve the email alias for each, and age the alias with the appended mail domain.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int i = 0; i < msgsEKK0401B001.length; i++)` (L687) |
| 2 | SET | `sbOpSvcKeiNo = msgsEKK0401B001[i].getString(EKK0401B001CBSMsg1List.SBOP_SVC_KEI_NO)` // Sub-operation service contract number |
| 3 | SET | `inputMap = new HashMap<String, Object>()` // Reinitialize input map per iteration |
| 4 | SET | `inputMap.put(JCMConstants.FUNC_CODE_KEY, JPCModelConstant.FUNC_CD_2)` [-> `FUNC_CD_2` (sub-service inquiry function code)] |
| 5 | SET | `inputMap.put(EKK0411A010CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` // Primary operation service contract number |
| 6 | SET | `inputMap.put(EKK0411A010CBSMsg.KEY_SBOP_SVC_KEI_NO, sbOpSvcKeiNo)` // Sub-service contract number |
| 7 | CALL | `(CAANMsg[])runSc(handle, param, EKK0411A010, inputMap)` // Query sub-service agreement for alias |
| 8 | SET | `tmpAlias = retEKK0411A010[0].getString(EKK0411A010CBSMsg1List.ALIAS)` // Get email alias |
| 9 | IF | `tmpAlias != null && !"".equals(tmpAlias)` (L700) — Note: `AT_MARK = "@"` |
| 10 | SET | `String[] spritMlad = tmpMlad.split(AT_MARK)` // Split mail address by "@" [-> `spritMlad` = ["user", "domain"]] |
| 11 | IF | `spritMlad != null && spritMlad.length > 0` |
| 12 | SET | `tmpAlias += AT_MARK + spritMlad[1]` // Append domain to alias (e.g., "alias@example.com") |
| 13 | EXEC | `agingMap.clear()` |
| 14 | SET | `agingMap.put(AGING_MAP_KEY_AGING_SBT_CD, AGING_SBT_CD_ALIAS)` [-> `aging_sbt_cd = "008"` (Email Alias)] |
| 15 | SET | `agingMap.put(AGING_MAP_KEY_AGING_TG_VALUE, tmpAlias)` // Full email alias with domain |
| 16 | IF | `AGING_EXEC_KBN_ADD.equals(execKbn)` [CONST: `execKbn = "01"`] (L719) |
| 17 | CALL | `useAddAging(handle, param, agingMap)` |
| 18 | ELSE-IF | `AGING_EXEC_KBN_KIHK.equals(execKbn)` [CONST: `execKbn = "02"`] (L723) |
| 19 | CALL | `useKihkAging(handle, param, agingMap)` |
| 20 | ELSE | (L727) |
| 21 | CALL | `useEndAging(handle, param, agingMap)` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opSvcCd` | Field | Operation service code — classifies the type of optional service (Email, My Homepage, Mailing List, Fixed IP, Multisection) |
| `opSvcKeiNo` | Field | Operation service contract number — internal identifier for the operation service contract line item |
| `sbOpSvcKeiNo` | Field | Sub-operation service contract number — internal identifier for a sub-service contract linked to the primary service |
| `execKbn` | Field | Execution type classification — determines the aging state transition: "01"=add/register, "02"=recovery, "03"=end |
| `AGING_SBT_CD_IP` | Constant | Aging type code "002" — Fixed IP Address aging |
| `AGING_SBT_CD_URL` | Constant | Aging type code "005" — URL aging |
| `AGING_SBT_CD_WEB_ID` | Constant | Aging type code "006" — WebID aging |
| `AGING_SBT_CD_POP_ID` | Constant | Aging type code "007" — PopID aging |
| `AGING_SBT_CD_ALIAS` | Constant | Aging type code "008" — Email alias aging |
| `AGING_SBT_CD_MLAD` | Constant | Aging type code "009" — Mail address aging |
| `AGING_SBT_CD_MLLIST` | Constant | Aging type code "010" — Mailing list aging |
| `AGING_EXEC_KBN_ADD` | Constant | Execution type "01" — Register aging target (add) |
| `AGING_EXEC_KBN_KIHK` | Constant | Execution type "02" — Recover aging target (kiharkafuku: 回復) |
| `AGING_EXEC_KBN_END` | Constant | Execution type "03" — End aging target (usage finished) |
| aging | Concept | Resource reservation mechanism — flags customer identifiers as "in use" so they cannot be reassigned to other customers during service contract transfers (option hikitige: オプション引継ぎ) |
| エージング対象登録 | Japanese field | Aging target registration — registers a value as being actively in use (via EZM0111D010 SC) |
| エージング対象回復 | Japanese field | Aging target recovery — restores a value to available status so it can be reassigned (via EZM0111C020 SC) |
| エージング対象使用終了 | Japanese field | Aging target usage ended — marks a value as fully consumed (via EZM0111C010 SC) |
| オプション引継ぎ | Japanese term | Option transfer / service contract handover — the process of transferring optional services between customers |
| opSvcCd | Field | Operation service code — classifies the type of optional service (Email, My Homepage, Mailing List, Fixed IP, Multisection) |
| OP_SVC_CD_EMAIL | Constant | "B001" — Email optional service |
| OP_SVC_CD_MYHOMEPAGE | Constant | "B002" — My Homepage optional service |
| OP_SVC_CD_MAILINGLIST | Constant | "B003" — Mailing List optional service |
| OP_SVC_CD_KOTEI_IP | Constant | "B004" — Fixed Global IP Address optional service |
| OP_SVC_CD_MLTISE | Constant | "B015" — Multisection optional service |
| KOTEI_IP_AD | Field | Fixed IP address — the globally assigned static IP address for the customer |
| URL_DOMAIN | Field | URL domain — the domain portion of the My Homepage URL |
| URL_ACCOUNT | Field | URL account — the account/path portion of the My Homepage URL |
| WEB_ID | Field | WebID — the customer's web identification string |
| POP_ID | Field | PopID — the POP (Post Office Protocol) email account identifier |
| MLAD | Field | Mail address — the customer's full email address |
| MLLIST_NM | Field | Mailing list name — the name of the mailing list subscription |
| ALIAS | Field | Email alias — an alternative email address configured for the sub-service |
| FUNC_CD_2 | Constant | Function code "2" — sub-service inquiry function identifier |
| K-Opticom | Business term | Japanese broadband ISP operated by KDDI, providing fiber-optic internet and related optional services |
| エオ光ネット | Business term | eo Hikari Net — KDDI's fiber-optic broadband service brand (eo光ネット「シンプルプラン」) |
| SOD | Acronym | Service Order Data — order data entity in the system |
| EZM0111D010 | SC Code | Aging Target Registration service component — registers aging targets as in-use |
| EZM0111C010 | SC Code | Aging Target Usage Ended service component — marks aging targets as fully consumed |
| EZM0111C020 | SC Code | Aging Target Recovery service component — recovers aging targets to available status |
| EZM0321A010 | SC Code | Business Parameter Management Agreement SC — retrieves parameter mappings such as mailing list domain |
| EKK0351A010 | SC Code | Operation Service Agreement SC — primary operation service contract data |
| EKK0361A010 | SC Code | Operation Service Agreement <ISP> SC — ISP-level service contract data with aging targets |
| EKK0401B001 | SC Code | Sub-Operation Service Agreement list SC — list of sub-service contracts |
| EKK0411A010 | SC Code | Sub-Operation Service Agreement <ISP> SC — queries sub-service details including email alias |
