| name | Direct HLR API Activation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| overview | Replace the file-drop-and-callback bulk activation flow with direct REST API calls to the Summa HSS, reusing Titan's existing HLR vendor module pattern and the same data already gathered by getActivationFileInfo. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| todos |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isProject | false |
sequenceDiagram
participant Client
participant Titan as Titan API
participant iSeries as iSeries IFS
participant Provisioner as External Provisioner
Client->>Titan: POST /imsi/bulkactivation
Titan->>Titan: getActivationFileInfo (DB query)
Titan->>iSeries: Write CSV via JT400
Titan-->>Client: 200 + batch id
Note over iSeries,Provisioner: External job polls IFS,<br/>provisions HLR, writes result zips
Provisioner->>iSeries: Write SUCCESS.txt / ERROR.txt zips
Client->>Titan: POST /imsi/bulkactivationcomplete
Titan->>iSeries: Read result zips
Titan->>Titan: Parse results, update SIM/IMSI status
Pain points: latency waiting for external job, FTP/JT400 dependency, opaque error handling, no per-subscriber feedback.
sequenceDiagram
participant Client
participant Titan as Titan API
participant HSS as Summa HSS REST
Client->>Titan: POST /imsi/bulkactivation (or new endpoint)
Titan->>Titan: getActivationFileInfo (same DB query)
loop Each subscriber row
Titan->>HSS: POST /v1/SubscriberManagement/createSubscriber/{operator}
HSS-->>Titan: 201 or 4xx/5xx
Titan->>Titan: Update SIM/IMSI status per result
end
Titan-->>Client: 200 + per-subscriber results
HlrVendorModuleinterface (HlrVendorModule.java) — extensible vendor abstractionHlrSummaVendor(HlrSummaVendor.java) — already makes SOAP calls viaSummaSoapClientand raw HTTP viahttpPostXml; pattern for adding REST callsHlrDispatcher(HlrDispatcher.java) — resolves which HLR record + account + vendor module to use for a given IMSI/MSISDNHlrUrlResolver(HlrUrlResolver.java) — resolves{{ip}}placeholders in HLR URL settingsHlrService(HlrService.java) — existing JAX-RS/hlr/*endpoints follow the exact resolve-dispatch-vendor patterngetActivationFileInfo(IMSIUtilities.java:1345) — already pulls all fields needed for HSS subscriber creation (IMSI, ICCID, MSISDN, ki, opc, hlrTemplate, lteTemplate, roamingProfile, smsRouteProfile, ssTemplate, imsProfile)updateStatusAfterActivate(IMSIUtilities.java:1864) — status update logic (9 vs 10)- Commented prototype in ImsiService.java:3893-3934 — old
ActivateHLRSubscribersRequestsketch showing the intended subscriber/IMSI/MSISDN structure
- Create:
POST /v1/SubscriberManagement/createSubscriber/{operatorName}— body isSubscriptionDto - Activate:
PUT /v1/SubscriberManagement/activateSubscriber/{subscriberId}/{operatorName}— no body - No bulk endpoint — one subscriber per call; parallelism is our responsibility
- Key fields in
SubscriptionDto:subscriber.subscriberId(e.g."SUB_" + iccid)subscriber.roamingTemplateimsiSubscriptionList[].imsi,.roamingProfile(required),.hlrTemplate,.lteTemplate,.imsTemplatemsisdnInfoList[].msisdn,.smsRouteProfile,.ssTemplate,.imsiRelationshipList[].imsi,.defaultMsisdnisim.iccId
Add a new method to the interface:
void createSubscriber(BigInteger account, SubscriberActivationData data, HLRValue hlr) throws Exception;Where SubscriberActivationData is a new VO holding the parsed CSV row fields (iccid, imsi, msisdn, ki, opc, hlrTemplate, lteTemplate, roamingProfile, smsRouteProfile, ssTemplate, imsProfile, alg, operator).
New class in com.psasoft.titan.hlr (parallel to SummaSoapClient):
- JSON POST/PUT using
HttpURLConnection(same pattern ashttpPostXmlinHlrSummaVendor) - Jackson
ObjectMapperfor request/response serialization - Builds
SubscriptionDtoJSON fromSubscriberActivationData - Uses a new HLR setting key (e.g.
hss_rest_api_ip) resolved viaHlrUrlResolverfor the HSS REST base URL - Handles 200/201 as success, 400/500 as errors with message extraction
- Resolve HSS REST URL from HLR settings via
HlrUrlResolver.resolve(hlr, "hss_rest_api_ip", ...) - Resolve operator name from HLR settings (new key
hss_operator_nameor reuse existinghlr_default_activation_operatorfrom profile settings) - Build the
SubscriptionDtoJSON mapping CSV fields to HSS fields:subscriberId="SUB_" + iccidimsiSubscriptionList[0]= imsi + roamingProfile + hlrTemplate + lteTemplate + imsTemplatemsisdnInfoList[0]= msisdn + smsRouteProfile + ssTemplate + imsiRelationship to the imsiisim.iccId= iccid
- POST to
{baseUrl}/v1/SubscriberManagement/createSubscriber/{operator} - Optionally follow with
PUT .../activateSubscriber/{subscriberId}/{operator}if create does not auto-activate
Currently returns List<String> (CSV rows). Either:
- (a) Add a parallel method
getActivationRows(...)returningList<SubscriberActivationData>(cleaner, avoids re-parsing CSV), or - (b) Parse the existing CSV strings back into fields (quick-and-dirty, fragile)
Option (a) is recommended — reuse the same SQL but map ResultSet columns to the new VO instead of CONCAT_WS.
Two options:
- (a) Add a
"mode": "direct"flag toBulkActivationRequest— when present, skip CSV/file and call HSS REST directly - (b) New endpoint
POST /imsi/activatehlrthat takes same ICCID list / IMSI range
Either way, the handler:
- Calls
getActivationRows(...)for structured data - Loops each row, calling
HlrSummaVendor.createSubscriber(...)viaHlrDispatcher - On success per row: updates that SIM/IMSI status (reuse
updateStatusAfterActivatelogic or per-row variant) - Collects per-subscriber success/failure results
- Returns batch-style response with per-subscriber detail
For >50 subscribers, dispatch via DbQueueAsyncDispatchService (same pattern as current bulk activate) with a new command handler (e.g. hlr_direct_activate). The handler loops through rows calling the HSS REST API and updates batch progress. This avoids HTTP timeout on the initial request.
Add new HLR setting types to module_hlr.hlrs_settings for each HLR definition:
hss_rest_api_ip— base URL of the HSS REST API (e.g.https://hss.example.com)hss_operator_name— operator name for the path parameter (e.g.ChoiceWireless)- Optionally
hss_auth_*keys if the HSS requires HTTP auth (Basic, bearer, mTLS cert path)
Do not remove the CSV/iSeries path. The mode flag or endpoint choice determines which path runs. This allows gradual migration and rollback.
- Auth to HSS REST — The PDF does not document HTTP auth. Need to confirm: is it IP-allowlisted? Basic auth? mTLS? This determines
SummaRestClientauth config. - Create vs Create+Activate — Does
createSubscriberauto-activate, or do we need a separateactivateSubscriberPUT call after each create? - Operator name source — Hard-coded per HLR definition in DB, or derived from account settings?
- Sync vs async threshold — At what batch size should we switch from synchronous (wait for all results) to async (dispatch to queue worker)?
- New endpoint vs mode flag — Preference on API surface?