# Business Logic — JKKCmpMalwareBlockingApiCC.getErrOfUnitParam() [82 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKCmpMalwareBlockingApiCC` |
| Layer | CC / Common Component (shared business logic component within the Fujitsu Futurity BP platform) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKCmpMalwareBlockingApiCC.getErrOfUnitParam()

This method performs unit-level parameter validation for the **Malware Blocking** feature within the e-customer core system (eo kokyaku keiko shisutemu). Malware blocking is a network security function that prevents infected devices from propagating malware threats across the ISP's broadband infrastructure. The method validates three critical business parameters — **Service Contract Number** (svc_kei_no), **Processing Type** (processing_type), and **Post-Revised Blocking Setting** (revised_blocking) — each with multi-layer checks: required-field presence, character-format compliance, length constraints, and allowed-value enumeration. It implements a **validator-router pattern**, branching validation rules by parameter while consistently delegating error report construction to helper methods (`getReqErrInfMap`, `getFormErrInfMap`, `getLenErrInfMap`). Its role in the larger system is as a shared Common Component (CC) unit validator, called during the malware blocking main processing flow to ensure the API receives properly formed input before any data mutation occurs.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getErrOfUnitParam"])
    INIT_ERR["Create errList ArrayList"]
    SET_ITEM_NAME["Set itemName = null"]
    SET_ITEM_VALUE["Set itemValue = null"]

    SVC_ASSIGN["Set itemName = SVC_KEI_NO = svc_kei_no"]
    SVC_GET["Get itemValue from ccMsg map"]
    SVC_NULL_CHECK{isNullBlank check}
    SVC_REQ_ERR["Add required field error to errList via getReqErrInfMap itemName"]
    SVC_FORMAT_CHECK{isEnNumber1Check check}
    SVC_FORMAT_ERR["Add format error to errList via getFormErrInfMap itemName"]
    SVC_LEN_CHECK{isLength1Check check max 10}
    SVC_LEN_ERR["Add length error to errList via getLenErrInfMap itemName"]

    PROC_ASSIGN["Set itemName = PROCESSING_TYPE = processing_type"]
    PROC_GET["Get itemValue from ccMsg map"]
    PROC_NULL_CHECK{isNullBlank check}
    PROC_REQ_ERR["Add required field error to errList via getReqErrInfMap itemName"]
    PROC_FORMAT_CHECK{isNumber1Check check}
    PROC_FORMAT_ERR["Add format error to errList via getFormErrInfMap itemName"]
    PROC_LEN_CHECK{isLength1Check check length 1}
    PROC_LEN_ERR["Add length error to errList via getLenErrInfMap itemName"]
    PROC_VALUE_CHECK{value is 1 or 2}
    PROC_VALUE_ERR["Add format error to errList via getFormErrInfMap itemName"]

    REV_ASSIGN["Set itemName = REVISED_BLOCKING = revised_blocking"]
    REV_GET["Get itemValue from ccMsg map"]
    REV_NULL_CHECK{isNullBlank AND update mode}
    REV_REQ_ERR["Add required field error to errList via getReqErrInfMap itemName"]
    REV_FORMAT_CHECK{isNumber1Check check}
    REV_FORMAT_ERR["Add format error to errList via getFormErrInfMap itemName"]
    REV_LEN_CHECK{isLength1Check length 1 OR blank}
    REV_LEN_ERR["Add length error to errList via getLenErrInfMap itemName"]
    REV_VALUE_CHECK{value is 1 or 2 AND not blank}
    REV_VALUE_ERR["Add format error to errList via getFormErrInfMap itemName"]
    END_RETURN["Return errList"]

    START --> INIT_ERR
    INIT_ERR --> SET_ITEM_NAME
    SET_ITEM_NAME --> SET_ITEM_VALUE
    SET_ITEM_VALUE --> SVC_ASSIGN
    SVC_ASSIGN --> SVC_GET
    SVC_GET --> SVC_NULL_CHECK
    SVC_NULL_CHECK -->|Yes| SVC_REQ_ERR
    SVC_NULL_CHECK -->|No| SVC_FORMAT_CHECK
    SVC_REQ_ERR --> END_RETURN
    SVC_FORMAT_CHECK -->|No| SVC_FORMAT_ERR
    SVC_FORMAT_ERR --> END_RETURN
    SVC_FORMAT_CHECK -->|Yes| SVC_LEN_CHECK
    SVC_LEN_CHECK -->|No| SVC_LEN_ERR
    SVC_LEN_ERR --> END_RETURN
    SVC_LEN_CHECK -->|Yes| PROC_ASSIGN
    PROC_ASSIGN --> PROC_GET
    PROC_GET --> PROC_NULL_CHECK
    PROC_NULL_CHECK -->|Yes| PROC_REQ_ERR
    PROC_NULL_CHECK -->|No| PROC_FORMAT_CHECK
    PROC_REQ_ERR --> END_RETURN
    PROC_FORMAT_CHECK -->|No| PROC_FORMAT_ERR
    PROC_FORMAT_ERR --> END_RETURN
    PROC_FORMAT_CHECK -->|Yes| PROC_LEN_CHECK
    PROC_LEN_CHECK -->|No| PROC_LEN_ERR
    PROC_LEN_ERR --> END_RETURN
    PROC_LEN_CHECK -->|Yes| PROC_VALUE_CHECK
    PROC_VALUE_CHECK -->|No| PROC_VALUE_ERR
    PROC_VALUE_ERR --> END_RETURN
    PROC_VALUE_CHECK -->|Yes| REV_ASSIGN
    REV_ASSIGN --> REV_GET
    REV_GET --> REV_NULL_CHECK
    REV_NULL_CHECK -->|Yes| REV_REQ_ERR
    REV_NULL_CHECK -->|No| REV_FORMAT_CHECK
    REV_REQ_ERR --> END_RETURN
    REV_FORMAT_CHECK -->|No| REV_FORMAT_ERR
    REV_FORMAT_ERR --> END_RETURN
    REV_FORMAT_CHECK -->|Yes| REV_LEN_CHECK
    REV_LEN_CHECK -->|No| REV_LEN_ERR
    REV_LEN_ERR --> END_RETURN
    REV_LEN_CHECK -->|Yes| REV_VALUE_CHECK
    REV_VALUE_CHECK -->|No| REV_VALUE_ERR
    REV_VALUE_ERR --> END_RETURN
    REV_VALUE_CHECK -->|Yes| END_RETURN
```

**Constant Resolution:**

| Constant Name | Resolved Value | Business Meaning |
|--------------|---------------|-----------------|
| `SVC_KEI_NO` | `"svc_kei_no"` | CC parameter key: Service contract number |
| `PROCESSING_TYPE` | `"processing_type"` | CC parameter key: Processing type (reference vs. update) |
| `REVISED_BLOCKING` | `"revised_blocking"` | CC parameter key: Post-revised blocking setting |
| `PROCESSING_TYPE_REFERENCE` | `"1"` | Processing type: Reference (read-only) |
| `PROCESSING_TYPE_UPDATE` | `"2"` | Processing type: Update (write) |
| `BLOCKING` | `"1"` | Post-revised blocking: Blocking enabled |
| `NON_BLOCKING` | `"2"` | Post-revised blocking: Blocking disabled |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for the current transaction context. Provides the persistence layer connection for any subsequent data operations. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object allowing read/write access to HTTP/form parameters submitted by the caller. Used to retrieve or set request-scoped data. |
| 3 | `fixedText` | `String` | Fixed text used for parameter display/formatting when presenting error messages or form labels to the end user. |
| 4 | `ccMsg` | `Map<String, Object>` | Central parameter map that carries all CC (Common Component) input data. Contains keys `svc_kei_no`, `processing_type`, and `revised_blocking` as String values. This is the primary data source for validation. |
| 5 | `processingType` | `String` | The processing type discriminator indicating whether the operation is a reference (read, value `"1"`) or update (write, value `"2"`). Used to gate conditional required-field checks on the `revised_blocking` field (only mandatory during update operations). |

**Instance fields / external state read:**
- None. The method is entirely stateless with respect to instance fields; it reads only the `ccMsg` map passed in as a parameter.

## 4. CRUD Operations / Called Services

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

No database reads, creates, updates, or deletes occur within this method. It is a **pure validation utility** that only constructs error report structures. All calls are to helper methods, utility classes, and string-check routines:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKCmpMalwareBlockingApiCC.getFormErrInfMap` | - | - | Internal CC helper: Builds a format/attribute error report entry (e.g., wrong character type, invalid value) into a Map<String, String> and adds it to the error list. |
| - | `JKKCmpMalwareBlockingApiCC.getLenErrInfMap` | - | - | Internal CC helper: Builds a length-validation error report entry (field exceeds max length) into a Map<String, String> and adds it to the error list. |
| - | `JKKCmpMalwareBlockingApiCC.getReqErrInfMap` | - | - | Internal CC helper: Builds a required-field (mandatory) error report entry into a Map<String, String> and adds it to the error list. |
| - | `JKKBatClarisAuthCrdt.isNullBlank` | - | - | Utility: Checks whether a String is null, blank, or empty. Called via JKKStringUtil import for the null/blank validation of each parameter. |
| - | `JKKBatClearPassBase.isNullBlank` | - | - | Utility: Same null/blank check utility, imported as JKKStringUtil.isNullBlank in this method's call chain. |
| - | `JKKBatClearPassCrdt.isNullBlank` | - | - | Utility: Same null/blank check utility, imported as JKKStringUtil.isNullBlank in this method's call chain. |
| - | `JBSbatACEoElectPrcInfoTrkm.isNullBlank` | - | - | Utility: Same null/blank check utility, imported as JKKStringUtil.isNullBlank in this method's call chain. |
| - | `JBSbatACTrgtSvcKeiMake.isNullBlank` | - | - | Utility: Same null/blank check utility, imported as JKKStringUtil.isNullBlank in this method's call chain. |
| - | `JFUWebCommon.isNumber1Check` | JFUWebCommon | - | Utility: Validates that a string contains exactly one numeric character (digits only). Called via `HalfCharCheck.isNumber1Check()` for the processing_type parameter. |
| - | `HalfCharCheck.isEnNumber1Check` | HalfCharCheck | - | Utility: Validates that a string contains only English alphanumeric (half-width) characters. Called for the svc_kei_no parameter format check. |
| - | `HalfCharCheck.isNumber1Check` | HalfCharCheck | - | Utility: Validates that a string contains only half-width numeric characters. Called for processing_type and revised_blocking parameter format checks. |
| - | `LengthCheck.isLength1Check` | LengthCheck | - | Utility: Validates that a string's length does not exceed a specified maximum. Used with max length 10 for svc_kei_no and max length 1 for processing_type and revised_blocking. |

## 5. Dependency Trace

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `getFormErrInfMap` [R], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `getLenErrInfMap` [R], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `getFormErrInfMap` [R], `isNumber1Check` [-], `getReqErrInfMap` [R], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: JKKCmpMalwareBlockingApiCC.malwareBlockingMain() | `malwareBlockingMain()` -> `getErrOfUnitParam(handle, param, fixedText, ccMsg, processingType)` | `getReqErrInfMap [R]`, `getFormErrInfMap [R]`, `getLenErrInfMap [R]`, `isNullBlank [-]`, `isNumber1Check [-]`, `isEnNumber1Check [-]`, `isLength1Check [-]` |

This method is a private utility called exclusively by the `malwareBlockingMain()` method within the same class (`JKKCmpMalwareBlockingApiCC`). It serves as an internal validation step in the malware blocking API processing flow, verifying that all required unit parameters are well-formed before the main processing logic continues. No direct screen or batch entry points reach this method directly.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(variable initialization)` (L233)

Initialize the error list container and working variables.

| # | Type | Code |
|---|------|------|
| 1 | SET | `errList = new ArrayList<Map<String, String>>()` // Create empty error list to collect validation failures [-> SVC_KEI_NO="svc_kei_no"] |
| 2 | SET | `itemName = null` // Working variable for parameter name |
| 3 | SET | `itemValue = null` // Working variable for parameter value |

---

**Block 2** — [IF/ELSE-IF/ELSE-IF] `(svc_kei_no validation chain)` (L237)

Validate the **Service Contract Number** (SVC_KEI_NO). Three cascading checks: required-field, format, and length.

> Business Description: The service contract number uniquely identifies a customer's service subscription. It must be present (not blank), contain only half-width English alphanumeric characters, and not exceed 10 characters in length.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = SVC_KEI_NO` // [-> "svc_kei_no"] |
| 2 | SET | `itemValue = (String)ccMsg.get(itemName)` // Retrieve from parameter map |
| 3 | IF | `JKKStringUtil.isNullBlank(itemValue)` (required-field check) [L240] |

**Block 2.3** — [required-field error for svc_kei_no] (L242)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `errList.add(getReqErrInfMap(itemName))` // Required field error: service contract number is missing |

**Block 2.4** — [ELSE-IF, format check for svc_kei_no] `(HalfCharCheck.isEnNumber1Check check)` (L246)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!HalfCharCheck.isEnNumber1Check(itemValue)` // Check: must be half-width English alphanumeric [-> isEnNumber1Check] |
| 2 | CALL | `errList.add(getFormErrInfMap(itemName))` // Attribute/Format error: invalid character type |

**Block 2.5** — [ELSE-IF, length check for svc_kei_no] `(LengthCheck.isLength1Check(itemValue, 10))` (L250)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!LengthCheck.isLength1Check(itemValue, 10)` // Check: max length is 10 characters [-> max 10] |
| 2 | CALL | `errList.add(getLenErrInfMap(itemName))` // Length error: exceeds maximum length of 10 |

---

**Block 3** — [IF/ELSE-IF/ELSE-IF/ELSE-IF] `(processing_type validation chain)` (L256)

Validate the **Processing Type** (PROCESSING_TYPE). Four cascading checks: required-field, format, length, and allowed-value enumeration.

> Business Description: The processing type indicates whether the operation is a read-only reference (value `"1"`) or a write update (value `"2"`). This determines downstream behavior — reference mode allows viewing current malware blocking configuration, while update mode allows modifying it. The parameter must be exactly one digit and must be either `"1"` or `"2"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = PROCESSING_TYPE` // [-> "processing_type"] |
| 2 | SET | `itemValue = (String)ccMsg.get(itemName)` // Retrieve from parameter map |
| 3 | IF | `JKKStringUtil.isNullBlank(itemValue)` (required-field check) [L261] |

**Block 3.3** — [required-field error for processing_type] (L263)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `errList.add(getReqErrInfMap(itemName))` // Required field error: processing type is missing |

**Block 3.4** — [ELSE-IF, format check for processing_type] `(isNumber1Check)` (L267)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!HalfCharCheck.isNumber1Check(itemValue)` // Check: must be half-width numeric [-> isNumber1Check] |
| 2 | CALL | `errList.add(getFormErrInfMap(itemName))` // Format error: must be a numeric character |

**Block 3.5** — [ELSE-IF, length check for processing_type] `(isLength1Check itemValue 1)` (L271)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!LengthCheck.isLength1Check(itemValue, 1)` // Check: must be exactly 1 character [-> length 1] |
| 2 | CALL | `errList.add(getLenErrInfMap(itemName))` // Length error: must be exactly 1 character |

**Block 3.6** — [ELSE-IF, allowed-value check for processing_type] `(PROCESSING_TYPE_REFERENCE="1" || PROCESSING_TYPE_UPDATE="2")` (L275)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!(PROCESSING_TYPE_REFERENCE.equals(itemValue) \|\| PROCESSING_TYPE_UPDATE.equals(itemValue))` // Must be "1" (reference) or "2" (update) [-> REFERENCE="1", UPDATE="2"] |
| 2 | CALL | `errList.add(getFormErrInfMap(itemName))` // Format error: invalid processing type value (must be "1" or "2") |

---

**Block 4** — [IF/ELSE-IF/ELSE-IF/ELSE-IF] `(revised_blocking validation chain)` (L282)

Validate the **Post-Revised Blocking Setting** (REVISED_BLOCKING). Four cascading checks with conditional required-field logic.

> Business Description: The revised_blocking field determines whether the device remains blocked from the network after a revision/update operation. Value `"1"` means blocking is enabled (the device stays blocked), and value `"2"` means blocking is disabled (the device is unblocked). Critically, this field is only **required when the processing type is "2" (update)** — it is optional in reference mode. This conditional mandatory check reflects the business rule that you only need to specify a blocking action when actively modifying the configuration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = REVISED_BLOCKING` // [-> "revised_blocking"] |
| 2 | SET | `itemValue = (String)ccMsg.get(itemName)` // Retrieve from parameter map |
| 3 | IF | `JKKStringUtil.isNullBlank(itemValue) && PROCESSING_TYPE_UPDATE.equals(processingType)` (conditional required-field: only required in update mode) [L288] [-> PROCESSING_TYPE_UPDATE="2"] |

**Block 4.3** — [conditional required-field error for revised_blocking] (L290)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `errList.add(getReqErrInfMap(itemName))` // Required field error: revised blocking must be specified when processing type is update |

**Block 4.4** — [ELSE-IF, format check for revised_blocking] `(isNumber1Check)` (L294)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!HalfCharCheck.isNumber1Check(itemValue)` // Check: must be half-width numeric [-> isNumber1Check] |
| 2 | CALL | `errList.add(getFormErrInfMap(itemName))` // Format error: must be a numeric character |

**Block 4.5** — [ELSE-IF, length check for revised_blocking] `(isLength1Check itemValue 1 OR isNullBlank)` (L298)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!LengthCheck.isLength1Check(itemValue, 1) && !JKKStringUtil.isNullBlank(itemValue)` // Check: if not blank, length must be 1 [-> length 1, skips if blank] |
| 2 | CALL | `errList.add(getLenErrInfMap(itemName))` // Length error: must be exactly 1 character (only enforced when value is provided) |

**Block 4.6** — [ELSE-IF, allowed-value check for revised_blocking] `(BLOCKING="1" || NON_BLOCKING="2" AND not blank)` (L302)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!(BLOCKING.equals(itemValue) \|\| NON_BLOCKING.equals(itemValue)) && !JKKStringUtil.isNullBlank(itemValue)` // Must be "1" (blocking) or "2" (non-blocking), only if not blank [-> BLOCKING="1", NON_BLOCKING="2"] |
| 2 | CALL | `errList.add(getFormErrInfMap(itemName))` // Format error: invalid revised blocking value (must be "1" or "2") |

---

**Block 5** — [RETURN] `(errList)` (L305)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return errList;` // Return all accumulated validation errors (empty list if all checks pass) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a customer's broadband service subscription in the ISP's billing and provisioning system |
| `processing_type` | Field | Processing type discriminator — indicates whether the current operation is a read-only reference (`"1"`) or a data update (`"2"`) |
| `revised_blocking` | Field | Post-revised blocking setting — specifies whether a device remains network-blocked (`"1"`) or is unblocked (`"2"`) after a configuration update |
| `errList` | Field | Error list — a `List<Map<String, String>>` that accumulates validation error entries, each containing error code, message, and field name |
| CC | Acronym | Common Component — a shared business logic class in the Fujitsu Futurity platform that provides reusable validation and processing functions across multiple screens and services |
| Malware Blocking | Business term | A network security function that blocks infected devices from accessing the ISP network to prevent malware propagation across the broadband infrastructure |
| eo kokyaku keiko shisutemu | Business term | The e-customer core contract system (Japanese: eo 顧客契約システム) — the core telecom billing and service management platform operated by K-Opticom (a Japanese fiber ISP) |
| JKKStringUtil.isNullBlank | Utility method | A utility check that returns true if a String is null, empty, or contains only whitespace characters |
| HalfCharCheck.isEnNumber1Check | Utility method | Validates that a string contains only half-width English alphanumeric characters (letters and digits, no full-width or special characters) |
| HalfCharCheck.isNumber1Check | Utility method | Validates that a string contains only half-width numeric characters (0-9) |
| LengthCheck.isLength1Check | Utility method | Validates that a string's length does not exceed a specified maximum character count |
| getReqErrInfMap | Internal helper | Constructs a required-field error map entry with error code and message for a given field name |
| getFormErrInfMap | Internal helper | Constructs a format/attribute error map entry with error code and message for a given field name |
| getLenErrInfMap | Internal helper | Constructs a length-validation error map entry with error code and message for a given field name |
| ccMsg | Parameter | Central Common Component parameter map — a `Map<String, Object>` carrying all input parameters for the malware blocking API request |
| K-Opticom | Business term | A Japanese broadband ISP (Internet Service Provider) operating a fiber-to-the-home (FTTH) network |
| Fujitsu Futurity BP | Technology | The Fujitsu Futurity Business Platform — an enterprise application framework used for telecom billing, customer management, and service provisioning systems |
