ru.bitel.bgbilling.modules.tv.runtime

## Class TvApplication

- java.lang.Object
- - ru.bitel.bgbilling.modules.tv.runtime.TvApplication

- All Implemented Interfaces:
    ru.bitel.bgbilling.kernel.application.server.CommandListener, ru.bitel.bgbilling.kernel.application.server.Lifecycle, ru.bitel.common.worker.ThreadContextFactory<ru.bitel.bgbilling.kernel.container.managed.ServerContext>

      public abstract class TvApplication
      extends java.lang.Object
      implements ru.bitel.bgbilling.kernel.application.server.CommandListener, ru.bitel.common.worker.ThreadContextFactory<ru.bitel.bgbilling.kernel.container.managed.ServerContext>, ru.bitel.bgbilling.kernel.application.server.Lifecycle

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `applicationId`
    `static int` | `CHECK_TARIFF_PRICE_DISABLE`
    `static int` | `CHECK_TARIFF_PRICE_ENABLE`
    `static int` | `CHECK_TARIFF_PRICE_ENABLE_WITHOUT_TIME`
    `static int` | `CHECK_TARIFF_PRICE_STRICT`
    `static int` | `CHECK_TARIFF_PRICE_STRICT_WITHOUT_TIME`
    `int` | `checkTariffPrice` Нужно ли выдавать ошибку, если цена не найдена
    `java.util.Set<java.lang.Integer>` | `childrenDeviceIds` Все устройства-дети
    `ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntimeMap` | `contractRuntimeMap`
    `ru.bitel.bgbilling.kernel.contract.balance.server.ConvergenceBalanceManager` | `convergenceBalanceManager`
    `protected java.util.Date` | `dateFrom`
    `TvDeviceRuntimeMap` | `deviceMap` Мап устройств
    `static int` | `EMPTY_ROOT_DEVICE_ID`
    `java.util.Date` | `initialDate`
    `int` | `moduleId`
    `ProductSpecRuntimeMap` | `productSpecRuntimeMap`
    `boolean` | `realtime`
    `int` | `rootDeviceId`
    `protected java.util.concurrent.ScheduledExecutorService` | `scheduledExecutorService`
    `ServiceSpecRuntimeMap` | `serviceSpecRuntimeMap`
    `Setup` | `setup`
    `TvAccountRuntimeMap` | `tvAccountRuntimeMap`
    `TvAccountSpecRuntimeMap` | `tvAccountSpecRuntimeMap` Динамически обновляемый справочник типов сервисов
    `ru.bitel.bgbilling.modules.tv.tariff.server.TvTariffContext` | `tvTariffContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TvApplication(boolean realtime, Setup setup, int applicationId, int moduleId, boolean loadSaScripts)`
    `TvApplication(boolean realtime, Setup setup, int applicationId, int moduleId, boolean loadSaScripts, int rootDeviceId, java.util.Date dateFrom)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AuthResult` | `authorization(ConnectionSet connectionSet, TvAccountRuntime tvAccountRuntime, java.util.Date now, java.math.BigDecimal accountDelta)`
    `java.lang.String` | `executeCommand(java.lang.String cmd, java.lang.String param)`
    `java.lang.String` | `getCommandsHelp()`
    `ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntimeMap` | `getContractRuntimeMap()`
    `ProductSpecRuntimeMap` | `getProductSpecRuntimeMap()`
    `TvAccountRuntimeMap` | `getTvAccountRuntimeMap()`
    `TvAccountSpecRuntimeMap` | `getTvAccountSpecRuntimeMap()`
    `TvDeviceRuntimeMap` | `getTvDeviceRuntimeMap()`
    `void` | `load()`
    `ru.bitel.bgbilling.kernel.container.managed.ServerContext` | `newThreadContext()`
    `void` | `start()`
    `void` | `stop()`
    `java.util.Set<java.lang.Integer>` | `tvAccountOptionSet(ConnectionSet connectionSet, TvAccountRuntime tvAccountRuntime, java.util.Date now)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### scheduledExecutorService

          protected final java.util.concurrent.ScheduledExecutorService scheduledExecutorService

    - #### realtime

          public final boolean realtime

    - #### initialDate

          public final java.util.Date initialDate

    - #### setup

          public final Setup setup

    - #### applicationId

          public final int applicationId

    - #### moduleId

          public final int moduleId

    - #### rootDeviceId

          public final int rootDeviceId

    - #### tvTariffContext

          public final ru.bitel.bgbilling.modules.tv.tariff.server.TvTariffContext tvTariffContext

    - #### contractRuntimeMap

          public final ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntimeMap contractRuntimeMap

    - #### tvAccountRuntimeMap

          public final TvAccountRuntimeMap tvAccountRuntimeMap

    - #### tvAccountSpecRuntimeMap

          public TvAccountSpecRuntimeMap tvAccountSpecRuntimeMap

      Динамически обновляемый справочник типов сервисов

    - #### serviceSpecRuntimeMap

          public ServiceSpecRuntimeMap serviceSpecRuntimeMap

    - #### productSpecRuntimeMap

          public ProductSpecRuntimeMap productSpecRuntimeMap

    - #### childrenDeviceIds

          public volatile java.util.Set<java.lang.Integer> childrenDeviceIds

      Все устройства-дети

    - #### deviceMap

          public final TvDeviceRuntimeMap deviceMap

      Мап устройств

    - #### convergenceBalanceManager

          public final ru.bitel.bgbilling.kernel.contract.balance.server.ConvergenceBalanceManager convergenceBalanceManager

    - #### EMPTY_ROOT_DEVICE_ID

          public static final int EMPTY_ROOT_DEVICE_ID

      See Also:
        Constant Field Values

    - #### dateFrom

          protected final java.util.Date dateFrom

    - #### CHECK_TARIFF_PRICE_DISABLE

          public static final int CHECK_TARIFF_PRICE_DISABLE

      See Also:
        Constant Field Values

    - #### CHECK_TARIFF_PRICE_ENABLE

          public static final int CHECK_TARIFF_PRICE_ENABLE

      See Also:
        Constant Field Values

    - #### CHECK_TARIFF_PRICE_STRICT

          public static final int CHECK_TARIFF_PRICE_STRICT

      See Also:
        Constant Field Values

    - #### CHECK_TARIFF_PRICE_ENABLE_WITHOUT_TIME

          public static final int CHECK_TARIFF_PRICE_ENABLE_WITHOUT_TIME

      See Also:
        Constant Field Values

    - #### CHECK_TARIFF_PRICE_STRICT_WITHOUT_TIME

          public static final int CHECK_TARIFF_PRICE_STRICT_WITHOUT_TIME

      See Also:
        Constant Field Values

    - #### checkTariffPrice

          public final int checkTariffPrice

      Нужно ли выдавать ошибку, если цена не найдена

  - ### Constructor Detail

    - #### TvApplication

          public TvApplication(boolean realtime,
                               Setup setup,
                               int applicationId,
                               int moduleId,
                               boolean loadSaScripts)
                        throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### TvApplication

          public TvApplication(boolean realtime,
                               Setup setup,
                               int applicationId,
                               int moduleId,
                               boolean loadSaScripts,
                               int rootDeviceId,
                               java.util.Date dateFrom)
                        throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

  - ### Method Detail

    - #### start

          public void start()
                     throws java.lang.Exception

      Specified by:
        `start` in interface `ru.bitel.bgbilling.kernel.application.server.Lifecycle`
      Throws:
        `java.lang.Exception`

    - #### load

          public void load()

    - #### stop

          public void stop()
                    throws java.lang.Exception

      Specified by:
        `stop` in interface `ru.bitel.bgbilling.kernel.application.server.Lifecycle`
      Throws:
        `java.lang.Exception`

    - #### newThreadContext

          public ru.bitel.bgbilling.kernel.container.managed.ServerContext newThreadContext()

      Specified by:
        `newThreadContext` in interface `ru.bitel.common.worker.ThreadContextFactory<ru.bitel.bgbilling.kernel.container.managed.ServerContext>`

    - #### getCommandsHelp

          public java.lang.String getCommandsHelp()

      Specified by:
        `getCommandsHelp` in interface `ru.bitel.bgbilling.kernel.application.server.CommandListener`

    - #### executeCommand

          public java.lang.String executeCommand(java.lang.String cmd,
                                                 java.lang.String param)

      Specified by:
        `executeCommand` in interface `ru.bitel.bgbilling.kernel.application.server.CommandListener`

    - #### tvAccountOptionSet

          public java.util.Set<java.lang.Integer> tvAccountOptionSet(ConnectionSet connectionSet,
                                                                     TvAccountRuntime tvAccountRuntime,
                                                                     java.util.Date now)
                                                              throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### authorization

          public AuthResult authorization(ConnectionSet connectionSet,
                                          TvAccountRuntime tvAccountRuntime,
                                          java.util.Date now,
                                          java.math.BigDecimal accountDelta)
                                   throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### getContractRuntimeMap

          public ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntimeMap getContractRuntimeMap()

    - #### getTvAccountRuntimeMap

          public TvAccountRuntimeMap getTvAccountRuntimeMap()

    - #### getTvAccountSpecRuntimeMap

          public TvAccountSpecRuntimeMap getTvAccountSpecRuntimeMap()

    - #### getProductSpecRuntimeMap

          public ProductSpecRuntimeMap getProductSpecRuntimeMap()

    - #### getTvDeviceRuntimeMap

          public TvDeviceRuntimeMap getTvDeviceRuntimeMap()