# Business Logic — JKKCancelSvcKeiCC.callCloseAgingNet() [199 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKCancelSvcKeiCC` |
| Layer | CC / Common Component (Business component shared across cancellation screens) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKCancelSvcKeiCC.callCloseAgingNet()

This method performs **aging use-end processing for network-type services** (`エイジング使用終了(ネット系)処理呼び出し`) in the context of a customer cancellation (return/withdrawal) workflow. Aging is a business concept at K-Opticom (a Japanese telecommunications provider) referring to the lifecycle management of assigned network resources — specifically, the formal release and invalidation of credentials and identifiers that were provisioned to a customer during their subscription period.

The method handles two service-type categories: **eo Hikari Net** (FTTH fiber-optic broadband, `SVC_SBT_CD_HNET = 1`) and **eo ADSL (Flets)** (legacy ADSL broadband, `SVC_SBT_CD_ADSL = 3`). For eo Hikari Net, it processes a single ISP authentication ID from the work area. For eo ADSL, it iterates over a list of subscription line items, each potentially carrying an ADSL authentication ID.

Additionally, the method handles **optional services (OSVKEI) under the ISP category** by iterating over all active ISP optional service contracts. For each active contract, it evaluates a set of network resources (VoIP phone number, fixed-line phone number, email address, POP ID, fixed IP address, mailing list, Web ID, URL domain/account) and calls `closeAging` for each non-null value. When a Mail Address (MLAD) is present, it also cross-references sub-optional services to construct and release email aliases.

The method serves as a **delegated processing step** within the broader `ctlCancelData` cancellation orchestration method. It is invoked only for net-type services (HNET, ADSL, MOBA) and is called after optional service contract cancellation and deletion processing, ensuring all dependent resources are released before the cancellation workflow completes. It implements a **conditional dispatch pattern** based on `svcSbtCd` and a **bulk iteration pattern** over optional service data.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callCloseAgingNet begin"])
    END_NODE(["Return statusCode"])

    START --> SET_STATUS["Set statusCode = STAT_NORMAL (0)"]
    SET_STATUS --> CHECK_SVC["svcSbtCd == SVC_SBT_CD_HNET (1)?"]

    CHECK_SVC -->|Yes| HNET["eo Hikari Net processing"]
    HNET --> GET_HNET["Get workField(SVKEIUW_EOH_NET)"]
    GET_HNET --> GET_ISP["Get isp_ninsho_id from inHashSvkeiUwEohNet"]
    GET_ISP --> CHECK_ISP_ISBNL("isp_ninsho_id != null and length > 0?")
    CHECK_ISP_ISBNL -->|Yes| ENCODE_ISP["Encode isp_ninsho_id via JKKBpCommon.getAgingNinshoId"]
    ENCODE_ISP --> CLOSE_ISP["closeAging(param, handle, AGING_SBT_CD_ISP_ID(013), isp_ninsho_id)"]
    CHECK_ISP_ISBNL -->|No| GET_ADSL_LIST
    CLOSE_ISP --> GET_ADSL_LIST

    CHECK_SVC -->|No| CHECK_ADSL["svcSbtCd == SVC_SBT_CD_ADSL (3)?"]
    CHECK_ADSL -->|Yes| ADSL["eo ADSL(Flets) processing"]
    ADSL --> GET_ADSL_LIST["Get workField(SVKEIUW_EOADSL) as list"]
    GET_ADSL_LIST --> ADSL_LOOP["For each item in list"]
    ADSL_LOOP --> GET_ADSSL_NINSHO["Get adsl_ninsho_id from item"]
    GET_ADSSL_NINSHO --> CHECK_ADSSL("adsl_ninsho_id != null and length > 0?")
    CHECK_ADSSL -->|Yes| ADSSL_SPLIT["Split adsl_ninsho_id by @, take first part"]
    ADSSL_SPLIT --> CLOSE_ADSSL["closeAging(param, handle, AGING_SBT_CD_ADSL_ID(015), adsl_ninsho_id)"]
    CHECK_ADSSL -->|No| GET_OP_LIST
    CLOSE_ADSSL --> GET_OP_LIST
    CHECK_ADSL -->|No| GET_OP_LIST

    GET_OP_LIST["Get workField(OPSVKEI_ISP)"] --> GET_SBOP_LIST["Get workField(SBOPSVKEI_ISP)"]
    GET_SBOP_LIST --> OP_LOOP["For each op in inHashlistOp"]
    OP_LOOP --> GET_OP_STAT["Get tmpOpSvcKeiStat"]
    GET_OP_STAT --> CHECK_STAT("isTrgtBySvcKeiStat(tmpOpSvcKeiStat)?")
    CHECK_STAT -->|No| OP_LOOP_END
    CHECK_STAT -->|Yes| INIT_VARS["Initialize tmp* variables"]
    INIT_VARS --> EXTRACT_FIELDS["Extract fields: VOIP_TELNO, KOSHUMO_TELNO, MLAD, POP_ID, KOTEI_IP_AD, MLLIST_NM, WEB_ID, URL_ACCOUNT, URL_DOMAIN"]

    EXTRACT_FIELDS --> CHECK_VOIP("tmpVoipTelNo != null and not empty?")
    CHECK_VOIP -->|Yes| CLOSE_VOIP["closeAging(param, handle, AGING_SBT_CD_TELNO(001), tmpVoipTelNo)"]
    CHECK_VOIP -->|No| CHECK_KOSHUMO
    CLOSE_VOIP --> CHECK_KOSHUMO

    CHECK_KOSHUMO("tmpKoshumoTelNo != null and not empty?") -->|Yes| CLOSE_KOSHUMO["closeAging(param, handle, AGING_SBT_CD_TELNO(001), tmpKoshumoTelNo)"]
    CHECK_KOSHUMO -->|No| CHECK_MLAD
    CLOSE_KOSHUMO --> CHECK_MLAD

    CHECK_MLAD("tmpMlad != null and not empty?") -->|Yes| CLOSE_MLAD["closeAging(param, handle, AGING_SBT_CD_MLAD(009), tmpMlad)"]
    CLOSE_MLAD --> MLAD_SUBLOOP_START["For each sbOp in inHashlistSbOp"]
    MLAD_SUBLOOP_START --> GET_SBOP_STAT["Get tmpSbOpSvcKeiStat"]
    GET_SBOP_STAT --> CHECK_SBOP_STAT("isTrgtBySvcKeiStat(tmpSbOpSvcKeiStat)?")
    CHECK_SBOP_STAT -->|No| MLAD_SUBLOOP_END
    CHECK_SBOP_STAT -->|Yes| GET_ALIAS["Get tmpAlias from sbOp"]
    GET_ALIAS --> CHECK_ALIAS("tmpAlias != null and not empty?")
    CHECK_ALIAS -->|No| MLAD_SUBLOOP_END
    CHECK_ALIAS -->|Yes| GET_KO_OP["Get koOpSvcKeiNo"]
    GET_KO_OP --> CHECK_KO_OP("koOpSvcKeiNo != null and not empty?")
    CHECK_KO_OP -->|No| MLAD_SUBLOOP_END
    CHECK_KO_OP -->|Yes| CHECK_KO_MATCH("koOpSvcKeiNo equals oyaOpSvcKeiNo?")
    CHECK_KO_MATCH -->|No| MLAD_SUBLOOP_END
    CHECK_KO_MATCH -->|Yes| SPLI_ALIAS["Split tmpMlad by @, join tmpAlias + last part"]
    SPLI_ALIAS --> CLOSE_ALIAS["closeAging(param, handle, AGING_SBT_CD_MAILALIAS(008), tmpAlias)"]
    CLOSE_ALIAS --> MLAD_SUBLOOP_END
    MLAD_SUBLOOP_END --> MLAD_SUBLOOP_CHECK["k < inHashlistSbOp.size?"]
    MLAD_SUBLOOP_CHECK -->|Yes| MLAD_SUBLOOP_START
    MLAD_SUBLOOP_CHECK -->|No| CHECK_POPID

    CLOSE_MLAD --> CHECK_POPID

    CHECK_POPID("tmpPopId != null and not empty?") -->|Yes| CLOSE_POPID["closeAging(param, handle, AGING_SBT_CD_POPID(007), tmpPopId)"]
    CHECK_POPID -->|No| CHECK_IP
    CLOSE_POPID --> CHECK_IP

    CHECK_IP("tmpIp != null and not empty?") -->|Yes| CLOSE_IP["closeAging(param, handle, AGING_SBT_CD_FIXIPAD(002), tmpIp)"]
    CHECK_IP -->|No| CHECK_MLLIST
    CLOSE_IP --> CHECK_MLLIST

    CHECK_MLLIST("tmpMllist != null and not empty?") -->|Yes| CALL_EZM["callEZM0321A010SC with KK_MLLIST_NM_DOMAIN"]
    CALL_EZM --> GET_DOMAIN["Get mlListDomain from result"]
    GET_DOMAIN --> CLOSE_MLLIST["closeAging(param, handle, AGING_SBT_CD_MLLIST(010), tmpMllist + @ + mlListDomain)"]
    CHECK_MLLIST -->|No| CHECK_WEBID
    CLOSE_MLLIST --> CHECK_WEBID

    CHECK_WEBID("tmpWebId != null and not empty?") -->|Yes| CLOSE_WEBID["closeAging(param, handle, AGING_SBT_CD_WEBID(006), tmpWebId)"]
    CHECK_WEBID -->|No| CHECK_URL
    CLOSE_WEBID --> CHECK_URL

    CHECK_URL("tmpUrlAccount not empty AND tmpUrlDomain not empty?") -->|Yes| CLOSE_URL["closeAging(param, handle, AGING_SBT_CD_URL(005), tmpUrlDomain + tmpUrlAccount)"]
    CHECK_URL -->|No| OP_LOOP_END
    CLOSE_URL --> OP_LOOP_END

    OP_LOOP_END["End if block"] --> OP_LOOP_CHECK["i < inHashlistOp.size?"]
    OP_LOOP_CHECK -->|Yes| OP_LOOP
    OP_LOOP_CHECK -->|No| RETURN
    RETURN --> END_NODE

    style START fill:#90EE90
    style END_NODE fill:#90EE90
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying screen input, control data, and output parameters. It is passed through to `closeAging` and `callEZM0321A010SC` to maintain request context and to write back results (e.g., domain resolution for mailing list). |
| 2 | `handle` | `SessionHandle` | The EJB session handle providing access to the database connection and transaction context. It is forwarded to all service calls (`closeAging`, `callEZM0321A010SC`) for database operations. |
| 3 | `workField` | `HashMap<String, Object>` | A shared result storage area (work area) populated by prior processing steps. It contains service contract data for eo Hikari Net (`SVKEIUW_EOH_NET`), eo ADSL (`SVKEIUW_EOADSL`), ISP optional services (`OPSVKEI_ISP`), and sub-optional services (`SBOPSVKEI_ISP`). The keys are: `SVKEIUW_EOH_NET = "svkeiuw_eoh_net"`, `SVKEIUW_EOADSL = "KK0221A010"`, `OPSVKEI_ISP = "opsvkei_isp"`, `SBOPSVKEI_ISP = "sbopsvkei_isp"`. |
| 4 | `svcSbtCd` | `int` | Service subtype code that determines which service category is being cancelled. Values: `SVC_SBT_CD_HNET = 1` (eo Hikari Net / FTTH fiber), `SVC_SBT_CD_ADSL = 3` (eo ADSL / Flets). This code dispatches the method into different processing branches. |

**Instance fields referenced by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `STAT_NORMAL` | `int` | Status code constant = 0. Represents normal/healthy processing status. |
| `AGING_SBT_CD_ISP_ID` | `String` | Aging subtype code for ISP authentication ID, resolved to `"013"`. |
| `AGING_SBT_CD_ADSL_ID` | `String` | Aging subtype code for ADSL authentication ID, resolved to `"015"`. |
| `AGING_SBT_CD_TELNO` | `String` | Aging subtype code for telephone numbers, resolved to `"001"`. |
| `AGING_SBT_CD_FIXIPAD` | `String` | Aging subtype code for fixed IP address, resolved to `"002"`. |
| `AGING_SBT_CD_URL` | `String` | Aging subtype code for URL, resolved to `"005"`. |
| `AGING_SBT_CD_WEBID` | `String` | Aging subtype code for Web ID, resolved to `"006"`. |
| `AGING_SBT_CD_POPID` | `String` | Aging subtype code for POP ID, resolved to `"007"`. |
| `AGING_SBT_CD_MAILALIAS` | `String` | Aging subtype code for email alias, resolved to `"008"`. |
| `AGING_SBT_CD_MLAD` | `String` | Aging subtype code for mail address, resolved to `"009"`. |
| `AGING_SBT_CD_MLLIST` | `String` | Aging subtype code for mailing list, resolved to `"010"`. |
| `WORK_PARAM_ID_MLLIST_NM_DOMAIN` | `String` | Work parameter ID for mailing list name/domain resolution, value `"KK_MLLIST_NM_DOMAIN"`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKBpCommon.getAgingNinshoId` | JKKBpCommon | - | Reads and encodes an authentication ID (ISP) before use-end processing |
| - | `JKKCancelSvcKeiCC.callEZM0321A010SC` | EZM0321A010SC | - | Calls the business parameter management consultation service to resolve mailing list domain name |
| - | `JKKCancelSvcKeiCC.closeAging` | (internal) | - | Internal helper that initiates aging use-end processing for a specific resource |
| - | `JKKCancelSvcKeiCC.isTrgtBySvcKeiStat` | (internal) | - | Internal helper that determines if a service contract status qualifies for cancellation processing |
| - | `String.split("@")` | - | - | Splits authentication IDs or email addresses by the `@` delimiter |
| R | `callEZM0321A010SC` terminal | EZM0321A010SC | KK_T_MLLIST_NM_DOMAIN (inferred) | Resolves mailing list domain name for domain suffix attachment |
| D | `closeAging` terminal | (aging CBS) | ZM_M_AGING / aging management tables (inferred) | Terminates/invalidates aging resources across 10 distinct aging subtype categories |

**CRUD Classification Detail:**

- **R (Read):** `JKKBpCommon.getAgingNinshoId` reads an ISP authentication ID to encode/normalize it before use-end. `callEZM0321A010SC` reads the domain name associated with a mailing list name to append as a domain suffix for the aging resource.
- **D (Delete / Use-end):** `closeAging` is the terminal operation that releases aging resources. It is called up to 10 distinct times per optional service iteration, covering: phone number (001), fixed IP (002), URL (005), Web ID (006), POP ID (007), mail alias (008), mail address (009), mailing list (010), ISP auth ID (013), ADSL auth ID (015).

## 5. Dependency Trace

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `callCancelData` (JKKCancelSvcKeiCC) | `ctlCancelData` -> `callCloseAgingNet` | `closeAging` [-], `callEZM0321A010SC` [R] |

**Caller Analysis:**

The method is called from `JKKCancelSvcKeiCC.callCancelData()` at line 1397. The `callCancelData` method is a private cancellation orchestration method that performs the full sequence of service contract cancellation steps. It is invoked only when `svcSbtCd` is a net-type service (`SVC_SBT_CD_HNET`, `SVC_SBT_CD_ADSL`, or `SVC_SBT_CD_MOBA`), specifically after optional service and sub-optional service cancellation processing.

The call chain leads back to cancellation screens (e.g., KKSV0004 or similar screens handling customer withdrawal) through CBS methods that orchestrate the end-to-end cancellation workflow. The terminal operations from this method are `closeAging` (aging use-end for multiple resource types) and `callEZM0321A010SC` (mailing list domain name resolution).

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize status code (L3895)

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = STAT_NORMAL` // `STAT_NORMAL = 0` [-> `STAT_NORMAL = 0`] |

**Block 2** — [IF] eo Hikari Net service processing `[SVC_SBT_CD_HNET = 1]` (L3901)

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_SBT_CD_HNET == svcSbtCd` [-> `SVC_SBT_CD_HNET = 1`] |

**Block 2.1** — [GET / SET] Retrieve eo Hikari Net subscription data from work area (L3904)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashSvkeiUwEohNet = (HashMap) workField.get(SVKEIUW_EOH_NET)` [-> `SVKEIUW_EOH_NET = "svkeiuw_eoh_net"`] |

**Block 2.2** — [GET] Retrieve ISP authentication ID (L3907)

| # | Type | Code |
|---|------|------|
| 1 | SET | `isp_ninsho_id = (String) inHashSvkeiUwEohNet.get(ISP_NINSHO_ID)` [from `EKK0171A010CBSMsg1List`] |

**Block 2.3** — [IF] ISP authentication ID is non-null and non-empty (L3908)

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != isp_ninsho_id && 0 < isp_ninsho_id.length()` |
| 2 | SET | `isp_ninsho_id = JKKBpCommon.getAgingNinshoId(isp_ninsho_id)` // Encode the ISP authentication ID |
| 3 | CALL | `closeAging(param, handle, AGING_SBT_CD_ISP_ID, isp_ninsho_id)` [-> `AGING_SBT_CD_ISP_ID = "013" (ISP Auth ID)`] |

**Block 3** — [ELSE-IF] eo ADSL (Flets) service processing `[SVC_SBT_CD_ADSL = 3]` (L3915)

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_SBT_CD_ADSL == svcSbtCd` [-> `SVC_SBT_CD_ADSL = 3`] |

**Block 3.1** — [GET] Retrieve eo ADSL subscription list from work area (L3918)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashlistSvkeiUwEoADSL = (ArrayList) workField.get(SVKEIUW_EOADSL)` [-> `SVKEIUW_EOADSL = "KK0221A010"`] |

**Block 3.2** — [FOR] Iterate over eo ADSL subscription items (L3919)

| # | Type | Code |
|---|------|------|
| 1 | FOR | `i = 0; null != inHashlistSvkeiUwEoADSL && i < inHashlistSvkeiUwEoADSL.size()` |
| 2 | SET | `inHash = inHashlistSvkeiUwEoADSL.get(i)` |

**Block 3.3** — [GET] Retrieve ADSL authentication ID (L3923)

| # | Type | Code |
|---|------|------|
| 1 | SET | `adsl_ninsho_id = (String) inHash.get(ADSL_NINSHO_ID)` [from `EKK0221A010CBSMsg1List`] |

**Block 3.4** — [IF] ADSL authentication ID is non-null and non-empty (L3924)

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != adsl_ninsho_id && 0 < adsl_ninsho_id.length()` |
| 2 | SET | `adsl_ninsho_id = adsl_ninsho_id.split("@")[0]` // Strip VR identifier; ADSL auth ID managed without VR identity [IT1-2013-0001098] |
| 3 | CALL | `closeAging(param, handle, AGING_SBT_CD_ADSL_ID, adsl_ninsho_id)` [-> `AGING_SBT_CD_ADSL_ID = "015" (ADSL Auth ID)`] |

**Block 4** — [GET] Retrieve optional service (ISP) and sub-optional service lists (L3937-3939)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashlistOp = (ArrayList) workField.get(OPSVKEI_ISP)` [-> `OPSVKEI_ISP = "opsvkei_isp"`] |
| 2 | SET | `inHashlistSbOp = (ArrayList) workField.get(SBOPSVKEI_ISP)` [-> `SBOPSVKEI_ISP = "sbopsvkei_isp"`] |

**Block 5** — [FOR] Iterate over ISP optional service contracts (L3942)

| # | Type | Code |
|---|------|------|
| 1 | FOR | `i = 0; i < inHashlistOp.size()` |

**Block 5.1** — [SET] Retrieve service contract status from optional service item (L3945)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpOpSvcKeiStat = (String) inHashlistOp.get(i).get(OP_SVC_KEI_STAT)` [from `EKK0351A010CBSMsg1List`] |

**Block 5.2** — [IF] Filter: only active/non-cancelled contracts `[isTrgtBySvcKeiStat]` (L3947)

> "解約済、キャンセル済は処理対象外" — Cancelled or already-cancelled contracts are excluded from processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isTrgtBySvcKeiStat(tmpOpSvcKeiStat)` |

**Block 5.2.1** — [SET] Initialize temporary variables for optional service fields (L3950-3959)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpVoipTelNo = ""` // VOIP phone number |
| 2 | SET | `tmpKoshumoTelNo = ""` // Public/fixed-line phone number |
| 3 | SET | `tmpIp = ""` // Fixed IP address |
| 4 | SET | `tmpUrlDomain = ""` // URL domain |
| 5 | SET | `tmpUrlAccount = ""` // URL account |
| 6 | SET | `tmpWebId = ""` // Web ID |
| 7 | SET | `tmpPopId = ""` // POP ID |
| 8 | SET | `tmpMlad = ""` // Mail address |
| 9 | SET | `tmpMllist = ""` // Mailing list |

**Block 5.2.2** — [GET] Retrieve all optional service fields (L3962-3972)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpVoipTelNo = get(OP_SVC_KEI_ITEM, VOIP_TELNO)` [from `EKK0361A010CBSMsg1List`] |
| 2 | SET | `tmpKoshumoTelNo = get(OP_SVC_KEI_ITEM, KOSHUMO_TELNO)` |
| 3 | SET | `tmpMlad = get(OP_SVC_KEI_ITEM, MLAD)` |
| 4 | SET | `tmpPopId = get(OP_SVC_KEI_ITEM, POP_ID)` |
| 5 | SET | `tmpIp = get(OP_SVC_KEI_ITEM, KOTEI_IP_AD)` |
| 6 | SET | `tmpMllist = get(OP_SVC_KEI_ITEM, MLLIST_NM)` |
| 7 | SET | `tmpWebId = get(OP_SVC_KEI_ITEM, WEB_ID)` |
| 8 | SET | `tmpUrlAccount = get(OP_SVC_KEI_ITEM, URL_ACCOUNT)` |
| 9 | SET | `tmpUrlDomain = get(OP_SVC_KEI_ITEM, URL_DOMAIN)` |

**Block 5.2.3** — [IF] Process VOIP phone number (L3975)

> "VOIP電話番号" — VOIP phone number

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpVoipTelNo && !"".equals(tmpVoipTelNo)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_TELNO, tmpVoipTelNo)` [-> `AGING_SBT_CD_TELNO = "001" (Phone Number)`] |

**Block 5.2.4** — [IF] Process public/fixed-line phone number (L3980)

> "公衆網電話番号" — Public network telephone number

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpKoshumoTelNo && !"".equals(tmpKoshumoTelNo)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_TELNO, tmpKoshumoTelNo)` [-> `AGING_SBT_CD_TELNO = "001" (Phone Number)`] |

**Block 5.2.5** — [IF] Process mail address (MLAD) with nested sub-optional service alias handling (L3984)

> "メールアドレス" — Mail address. ST3-2013-0000919 2013/05/23 START/END

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpMlad && !"".equals(tmpMlad)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_MLAD, tmpMlad)` [-> `AGING_SBT_CD_MLAD = "009" (Mail Address)`] |
| 3 | SET | `oyaOpSvcKeiNo = get(OP_SVC_KEI_ITEM, OP_SVC_KEI_NO)` [-> `OP_SVC_KEI_NO` from `EKK0361A010CBSMsg1List`] |

**Block 5.2.5.1** — [FOR] Iterate over sub-optional services (L3988)

| # | Type | Code |
|---|------|------|
| 1 | FOR | `k = 0; k < inHashlistSbOp.size()` |

**Block 5.2.5.2** — [SET] Retrieve sub-optional service status (L3991)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpSbOpSvcKeiStat = get(SBOP_ITEM, SBOP_SVC_KEI_STAT)` [from `EKK0401A010CBSMsg1List`] |

**Block 5.2.5.3** — [IF] Filter: only active non-cancelled sub-optional contracts (L3994)

| # | Type | Code |
|---|------|------|
| 1 | IF | `isTrgtBySvcKeiStat(tmpSbOpSvcKeiStat)` |

**Block 5.2.5.4** — [SET] Retrieve email alias (L3998)

> "エイリアス" — Alias

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpAlias = get(SBOP_ITEM, ALIAS)` [from `EKK0411A010CBSMsg1List`] |

**Block 5.2.5.5** — [IF] Alias is non-null and non-empty (L4001)

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpAlias && !"".equals(tmpAlias)` |

**Block 5.2.5.6** — [SET] Retrieve sub-optional service's parent optional service number (L4005)

> "エイリアスのオプションサービス契約番号取得" — Get the optional service contract number of this alias

| # | Type | Code |
|---|------|------|
| 1 | SET | `koOpSvcKeiNo = get(SBOP_ITEM, OP_SVC_KEI_NO)` [from `EKK0411A010CBSMsg1List`] |

**Block 5.2.5.7** — [IF] Parent optional service number is non-null and non-empty (L4007)

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != koOpSvcKeiNo && !"".equals(koOpSvcKeiNo)` |

**Block 5.2.5.8** — [IF] Sub-optional service matches the parent optional service number (L4010)

> "このエイリアスはこの親のSBPか。親OPの特定に" — This alias belongs to this parent sub-optional service. Used to identify the parent optional service.

| # | Type | Code |
|---|------|------|
| 1 | IF | `koOpSvcKeiNo.equals(oyaOpSvcKeiNo)` |
| 2 | SET | `tmpMladBunkatsu = tmpMlad.split("@")` // Split mail address by @ [-> `@` delimiter] |
| 3 | SET | `tmpAlias = tmpAlias + "@" + tmpMladBunkatsu[tmpMladBunkatsu.length - 1]` // Combine alias with mail address's domain part |
| 4 | CALL | `closeAging(param, handle, AGING_SBT_CD_MAILALIAS, tmpAlias)` [-> `AGING_SBT_CD_MAILALIAS = "008" (Mail Alias)`] |

**Block 5.2.6** — [IF] Process POP ID (L4021)

> "PopID" — POP (Post Office Protocol) ID

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpPopId && !"".equals(tmpPopId)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_POPID, tmpPopId)` [-> `AGING_SBT_CD_POPID = "007" (POP ID)`] |

**Block 5.2.7** — [IF] Process fixed IP address (L4026)

> "固定IPアドレス" — Fixed IP address

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpIp && !"".equals(tmpIp)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_FIXIPAD, tmpIp)` [-> `AGING_SBT_CD_FIXIPAD = "002" (Fixed IP Address)`] |

**Block 5.2.8** — [IF] Process mailing list (L4031)

> "メーリングリスト" — Mailing list. IT2-2012-0000328 2012-03-09

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpMllist && !"".equals(tmpMllist)` |
| 2 | SET | `ezm0321A010Hash = new HashMap()` // Create hash for business parameter management consultation service |
| 3 | CALL | `callEZM0321A010SC(param, handle, WORK_PARAM_ID_MLLIST_NM_DOMAIN, ezm0321A010Hash)` [-> `WORK_PARAM_ID_MLLIST_NM_DOMAIN = "KK_MLLIST_NM_DOMAIN"`] |
| 4 | SET | `mlListDomain = ezm0321A010Hash.get(WORK_PARAM_SETTE_VALUE)` [-> `WORK_PARAM_SETTE_VALUE = "work_param_sette_value"`] |
| 5 | CALL | `closeAging(param, handle, AGING_SBT_CD_MLLIST, tmpMllist + "@" + mlListDomain)` [-> `AGING_SBT_CD_MLLIST = "010" (Mailing List)`] |

**Block 5.2.9** — [IF] Process Web ID (L4053)

> "WebID" — Web ID

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpWebId && !"".equals(tmpWebId)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_WEBID, tmpWebId)` [-> `AGING_SBT_CD_WEBID = "006" (Web ID)`] |

**Block 5.2.10** — [IF] Process URL domain + URL account (L4058)

> "URLドメイン + URLアカウント" — URL domain + URL account

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != tmpUrlAccount && !"".equals(tmpUrlAccount) && null != tmpUrlDomain && !"".equals(tmpUrlDomain)` |
| 2 | CALL | `closeAging(param, handle, AGING_SBT_CD_URL, tmpUrlDomain + tmpUrlAccount)` [-> `AGING_SBT_CD_URL = "005" (URL)`] |

**Block 6** — [RETURN] Return status code (L4085)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return statusCode` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `aging` | Business concept | Resource lifecycle management — tracking, managing, and ultimately releasing network resources (identifiers, addresses, credentials) that were provisioned to a customer during their subscription. "エイジング" |
| `aging use-end` | Business concept | The process of formally invalidating and releasing a network resource so it is no longer assigned to any customer. "エイジング使用終了" |
| `closeAging` | Method | Internal method that initiates the aging use-end processing for a specific resource type and value. |
| `svcSbtCd` | Field | Service subtype code — classifies the type of service being cancelled (e.g., HNET=1 for FTTH, ADSL=3 for ADSL). |
| `workField` | Field | Work area — a shared HashMap passed across method calls to preserve intermediate results and data between cancellation processing steps. |
| `AGING_SBT_CD_TELNO` | Constant | Aging subtype code "001" — Phone number resource type. |
| `AGING_SBT_CD_FIXIPAD` | Constant | Aging subtype code "002" — Fixed IP address resource type. |
| `AGING_SBT_CD_URL` | Constant | Aging subtype code "005" — URL resource type. |
| `AGING_SBT_CD_WEBID` | Constant | Aging subtype code "006" — Web ID resource type. |
| `AGING_SBT_CD_POPID` | Constant | Aging subtype code "007" — POP ID resource type. |
| `AGING_SBT_CD_MAILALIAS` | Constant | Aging subtype code "008" — Mail alias resource type. |
| `AGING_SBT_CD_MLAD` | Constant | Aging subtype code "009" — Mail address resource type. |
| `AGING_SBT_CD_MLLIST` | Constant | Aging subtype code "010" — Mailing list resource type. |
| `AGING_SBT_CD_ISP_ID` | Constant | Aging subtype code "013" — ISP authentication ID resource type (eo Hikari Net). |
| `AGING_SBT_CD_ADSL_ID` | Constant | Aging subtype code "015" — ADSL authentication ID resource type (eo ADSL Flets). |
| `SVC_SBT_CD_HNET` | Constant | Service subtype code 1 — eo Hikari Net (FTTH fiber-optic broadband service). |
| `SVC_SBT_CD_ADSL` | Constant | Service subtype code 3 — eo ADSL / Flets (ADSL broadband service). |
| `SVKEIUW_EOH_NET` | Constant | Work area key "svkeiuw_eoh_net" — HashMap of eo Hikari Net subscription contract details. |
| `SVKEIUW_EOADSL` | Constant | Work area key "KK0221A010" — ArrayList of eo ADSL subscription contract details. |
| `OPSVKEI_ISP` | Constant | Work area key "opsvkei_isp" — ArrayList of ISP optional service contract details. |
| `SBOPSVKEI_ISP` | Constant | Work area key "sbopsvkei_isp" — ArrayList of sub-optional service contract details. |
| `isp_ninsho_id` | Field | ISP authentication ID — the ID used to authenticate against the ISP network for eo Hikari Net subscribers. "ISP認証ID" |
| `adsl_ninsho_id` | Field | ADSL authentication ID — the ID used for ADSL network authentication. "ADSL認証ID" |
| `VOIP_TELNO` | Field | VOIP telephone number assigned to an optional service subscriber. |
| `KOSHUMO_TELNO` | Field | Public network (fixed-line) telephone number. "公衆網電話番号" |
| `MLAD` | Field | Mail address assigned to an optional service subscriber. "メールアドレス" |
| `POP_ID` | Field | POP (Post Office Protocol) ID for email retrieval. |
| `KOTEI_IP_AD` | Field | Fixed (static) IP address assigned to a subscriber. "固定IPアドレス" |
| `MLLIST_NM` | Field | Mailing list name assigned to a subscriber. "メーリングリスト" |
| `WEB_ID` | Field | Web ID for portal or service web access. "WebID" |
| `URL_ACCOUNT` | Field | Account identifier for a URL-based service. |
| `URL_DOMAIN` | Field | Domain name for a URL-based service. |
| `ALIAS` | Field | Email alias — an alternate email address that forwards to a primary address. "エイリアス" |
| `OP_SVC_KEI_STAT` | Field | Optional service contract status — indicates whether a contract is active, cancelled, or pending. |
| `OP_SVC_KEI_NO` | Field | Optional service contract number — unique identifier for an optional service line item. |
| `SBOP_SVC_KEI_STAT` | Field | Sub-optional service contract status. |
| `oyaOpSvcKeiNo` | Field | Parent optional service contract number — used to match a sub-optional service (alias) to its parent optional service. |
| `koOpSvcKeiNo` | Field | Sub-optional service's own optional service contract number — compared against the parent to confirm matching. |
| `callEZM0321A010SC` | Method | Business Parameter Management Consultation Service — resolves domain names for mailing list entries. "業務パラメータ管理一応照会サービス" |
| `WORK_PARAM_SETTE_VALUE` | Constant | Work parameter key "work_param_sette_value" — the resolved domain value returned by `callEZM0321A010SC`. |
| `isTrgtBySvcKeiStat` | Method | Internal filter — determines whether a service contract status qualifies for cancellation processing (excludes already-cancelled or terminated contracts). |
| `STAT_NORMAL` | Constant | Status code 0 — indicates normal/healthy processing. |
| `EKK0171A010CBSMsg1List` | Class | Message list constants for eo Hikari Net subscription contract inquiry SC. |
| `EKK0221A010CBSMsg1List` | Class | Message list constants for eo ADSL subscription contract inquiry SC. |
| `EKK0351A010CBSMsg1List` | Class | Message list constants for ISP optional service inquiry SC. |
| `EKK0361A010CBSMsg1List` | Class | Message list constants for ISP optional service contract details SC. |
| `EKK0401A010CBSMsg1List` | Class | Message list constants for sub-optional service inquiry SC. |
| `EKK0411A010CBSMsg1List` | Class | Message list constants for sub-optional service contract details SC. |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service. In the system, represented as "eo Hikari Net". |
| ISP | Acronym | Internet Service Provider — the underlying internet connectivity service layer. |
| VR | Acronym | Virtual Realm / Virtual Router — a logical network segmentation identifier sometimes appended to ADSL authentication IDs with an `@` separator. |
| OSVKEI | Acronym | Optional Service — supplementary services attached to a main service contract (e.g., VOIP, fixed IP, email alias). |
| SBOP | Acronym | Sub-Optional Service — services nested under an optional service (e.g., an email alias under a mail address optional service). |
