Class Config
java.lang.Object
org.bgerp.app.cfg.Config
org.bgerp.plugin.bgb.getolt.Config
Configuration for GetOLT plugin.
Reads settings from bgerp.properties with prefix "getolt:".
-
Nested Class Summary
Nested classes/interfaces inherited from class Config
Config.InitStopException -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the API keyintGets the API timeout in millisecondsGets the API URLgetBillingOperatorMapping(String billingId) Gets operator name from billing IDOperator used when it could not be determined either by process parameter or by billing:getolt:operator.default.intID of the 'City' process parameter (text/list/tree); 0 means not configuredintID of the process text parameter for the JSON snapshot of OLT/port selectiongetInetMacConfig(String operator) Gets InetMac API configuration for operatorGets all configured InetMac operatorsgetMacListUrl(String operator) Builds GetInetMacList URL from existing InetMac URL for operator.getOltListUrl(String operator) Builds GetOltList URL from existing InetMac URL for operator.intGets the operator parameter IDGets reverse mapping: operator name → bgbilling billingId.getParamOperatorMapping(int valueId) Gets operator name from process parameter value IDbooleanhasInetMacConfig(String operator) Checks if InetMac is configured for operatorbooleanPasses the operator into ONU search:getolt:api.operator.filter=0disables it.booleanTrusts the GetOLT service certificate without checking the chain:getolt:api.trustSelfSigned=1.booleanChecks if the plugin is configuredresolveOperatorByBillingId(String billingId) Resolves operator name from billingId using all strategies: 1) Explicit config operator.billing.{billingId} 2) URL host match: bgbilling server URL → inetmac config URL 3) Default operator fallbackbooleanChecks if external GetOLT API should be used (vs local DB)Methods inherited from class Config
initWhen, throwValidationException
-
Constructor Details
-
Config
Constructor- Parameters:
config- the configuration map- Throws:
Config.InitStopException- if initialization fails
-
-
Method Details
-
isConfigured
public boolean isConfigured()Checks if the plugin is configured- Returns:
- true if API URL and key are configured
-
getApiUrl
-
getApiKey
-
getApiTimeout
public int getApiTimeout()Gets the API timeout in milliseconds- Returns:
- the API timeout
-
isApiTrustSelfSigned
public boolean isApiTrustSelfSigned()Trusts the GetOLT service certificate without checking the chain:getolt:api.trustSelfSigned=1. Needed for a typical installation in an internal network where the service uses a self-signed certificate — otherwise every request fails withSSLHandshakeException: PKIX path building failed.- Returns:
- true if certificate verification is disabled
-
isApiOperatorFilter
public boolean isApiOperatorFilter()Passes the operator into ONU search:getolt:api.operator.filter=0disables it. The External API filters strictly byolt.operator = ?, so while the OLT operator is not filled in GetOLT, any non-empty operator from ERP gives 404 on all contracts.- Returns:
- true if the operator takes part in ONU search
-
getOperatorParamId
public int getOperatorParamId()Gets the operator parameter ID- Returns:
- the operator parameter ID
-
getDefaultOperator
Operator used when it could not be determined either by process parameter or by billing:getolt:operator.default. Empty by default — the operator name goes into the External API as a filter, and a non-empty value not matching GetOLT data gives 404.- Returns:
- the default operator, empty if not configured
-
getParamOperatorMapping
Gets operator name from process parameter value ID- Parameters:
valueId- the parameter value ID- Returns:
- the operator name or null if not mapped
-
getBillingOperatorMapping
-
getContractLinkPriority
-
resolveOperatorByBillingId
-
getOperatorToBillingIdMap
-
getInetMacConfig
Gets InetMac API configuration for operator- Parameters:
operator- operator name as configured ingetolt:operator.mapping.*- Returns:
- billing config or null if not configured
-
hasInetMacConfig
Checks if InetMac is configured for operator- Parameters:
operator- operator name- Returns:
- true if InetMac API is configured for this operator
-
useExternalApi
public boolean useExternalApi()Checks if external GetOLT API should be used (vs local DB)- Returns:
- true if API URL and key are configured
-
getInetMacConfigs
Gets all configured InetMac operators- Returns:
- map of operator name → BillingConfig
-
getMacListUrl
Builds GetInetMacList URL from existing InetMac URL for operator. Replaces webhook path: ru.webHooks.InetMac/InetMacInterface → ru.webHooks.InetMacList/GetInetMacListInterface- Parameters:
operator- operator name- Returns:
- GetInetMacList URL or null if not configured
-
getOltListUrl
-
getIncidentSelectionParamId
public int getIncidentSelectionParamId()ID of the process text parameter for the JSON snapshot of OLT/port selection -
getIncidentCityParamId
public int getIncidentCityParamId()ID of the 'City' process parameter (text/list/tree); 0 means not configured
-