Class Config

java.lang.Object
org.bgerp.app.cfg.Config
org.bgerp.plugin.bgb.getolt.Config

public class Config extends Config
Configuration for GetOLT plugin. Reads settings from bgerp.properties with prefix "getolt:".
  • Constructor Details

  • Method Details

    • isConfigured

      public boolean isConfigured()
      Checks if the plugin is configured
      Returns:
      true if API URL and key are configured
    • getApiUrl

      public String getApiUrl()
      Gets the API URL
      Returns:
      the API URL
    • getApiKey

      public String getApiKey()
      Gets the API key
      Returns:
      the API key
    • 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 with SSLHandshakeException: 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=0 disables it. The External API filters strictly by olt.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

      public String 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

      public String getParamOperatorMapping(int valueId)
      Gets operator name from process parameter value ID
      Parameters:
      valueId - the parameter value ID
      Returns:
      the operator name or null if not mapped
    • getBillingOperatorMapping

      public String getBillingOperatorMapping(String billingId)
      Gets operator name from billing ID
      Parameters:
      billingId - the billing ID
      Returns:
      the operator name or null if not mapped
    • getContractLinkPriority

      public List<String> getContractLinkPriority()
      Returns:
      IDs of contract link source providers in priority order
    • resolveOperatorByBillingId

      public String resolveOperatorByBillingId(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 fallback
    • getOperatorToBillingIdMap

      public Map<String,String> getOperatorToBillingIdMap()
      Gets reverse mapping: operator name → bgbilling billingId. Built from operator.billing.{billingId}={operatorName} config.
      Returns:
      map of operator name → billingId
    • getInetMacConfig

      public BillingConfig getInetMacConfig(String operator)
      Gets InetMac API configuration for operator
      Parameters:
      operator - operator name as configured in getolt:operator.mapping.*
      Returns:
      billing config or null if not configured
    • hasInetMacConfig

      public boolean hasInetMacConfig(String operator)
      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

      public Map<String, BillingConfig> getInetMacConfigs()
      Gets all configured InetMac operators
      Returns:
      map of operator name → BillingConfig
    • getMacListUrl

      public String getMacListUrl(String operator)
      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

      public String getOltListUrl(String operator)
      Builds GetOltList URL from existing InetMac URL for operator. Replaces webhook path: ru.webHooks.InetMac/InetMacInterface → ru.webHooks.OltList/GetOltListInterface
      Parameters:
      operator - operator name
      Returns:
      GetOltList URL or null if not configured
    • 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