Class TvUtils
java.lang.Object
ru.bitel.bgbilling.modules.tv.server.TvUtils
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckDependent(ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntime contractRuntime, TvAccountRuntimeRoot tvAccountRuntime, int accountId, Calendar tariffRequestTime, Set<Integer> prolongatedProductSpecId, ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost serviceCost) Проверка на то, что продукт зависимы и может ли быть он продлен.static booleancheckIncompatible(ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntime contractRuntime, TvAccountRuntimeRoot tvAccountRuntime, int accountId, Calendar requestTime, Set<Integer> prolongatedProductSpecId, ProductSpec productSpec) Проверка на то, что есть активные несовместимые.static List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost>createServiceCostList(ProductSpecRuntimeMap productSpecRuntimeMap, List<ProductManager.Entry> entryList) static List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost>createServiceCostList(ProductSpecRuntimeMap productSpecRuntimeMap, TvAccountRuntime tvAccountRuntime, long millis) Список TvServiceCost для текущих активных периодов.static List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost>createServiceCostListForRecalculate(ProductSpecRuntimeMap productSpecRuntimeMap, List<ProductManager.Entry> entryList) static longstatic longstatic voidfilterServiceCostList(List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> serviceCostList, Calendar tariffPeriodStart, Calendar tariffPeriodStop, List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> workingServiceCostList, Set<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> processedSet) Отфильтровывание по началу нового тарифаgetProductOfferingMap(List<ProductOffering> productOfferingList) getTariffPeriods(Date begin, ru.bitel.bgbilling.kernel.tariff.server.tree.TariffModuleTreeSet tariffTreeSet) Получение дат смены тарифа (набор dateFrom и dateTo из contract_tariff).static URLgetUrl(Device<?, ?> tvDevice, ParameterMap config, String paramName, String paramName2, String defaultHost, int defaultPort) Получение URL для подключения к MW по http/https.static StringmacAddressToString(byte[] macAddress) static DatemoveSecond(Date time, int amount, Calendar utilCalendar) static byte[]parseMacAddress(String macAddress) static longperiodAmountToUnit(int periodMode, int periodAmount, TimeUnit unit) static longsecondsFrom(Date time) static longstatic CalendartoCalendar(long millis) static CalendartoCalendarFrom(Date time) static CalendartoCalendarTo(Date time) static DatetoDate(long millis)  
- 
Constructor Details
- 
TvUtils
public TvUtils() 
 - 
 - 
Method Details
- 
secondsFrom
 - 
secondsTo
 - 
dateFrom
 - 
dateTo
 - 
toCalendar
 - 
toCalendarFrom
 - 
toCalendarTo
 - 
toDate
 - 
moveSecond
 - 
periodAmountToUnit
 - 
parseMacAddress
 - 
macAddressToString
 - 
createServiceCostList
public static List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> createServiceCostList(ProductSpecRuntimeMap productSpecRuntimeMap, List<ProductManager.Entry> entryList) throws ru.bitel.bgbilling.common.BGException - Throws:
 ru.bitel.bgbilling.common.BGException
 - 
createServiceCostListForRecalculate
public static List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> createServiceCostListForRecalculate(ProductSpecRuntimeMap productSpecRuntimeMap, List<ProductManager.Entry> entryList) throws ru.bitel.bgbilling.common.BGException - Throws:
 ru.bitel.bgbilling.common.BGException
 - 
createServiceCostList
public static List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> createServiceCostList(ProductSpecRuntimeMap productSpecRuntimeMap, TvAccountRuntime tvAccountRuntime, long millis) throws ru.bitel.bgbilling.common.BGException Список TvServiceCost для текущих активных периодов. Для выяснении стоимости.- Parameters:
 productSpecRuntimeMap-tvAccountRuntime-millis-- Returns:
 - Throws:
 ru.bitel.bgbilling.common.BGException
 - 
getProductOfferingMap
public static Map<Pair<Integer,Integer>, getProductOfferingMapPair<ProductOffering, ProductOfferingActivationMode>> (List<ProductOffering> productOfferingList)  - 
filterServiceCostList
public static void filterServiceCostList(List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> serviceCostList, Calendar tariffPeriodStart, Calendar tariffPeriodStop, List<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> workingServiceCostList, Set<ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost> processedSet) Отфильтровывание по началу нового тарифа- Parameters:
 tariffPeriod-serviceCostList-workingServiceCostList-processedSet-
 - 
getTariffPeriods
public static Set<Calendar> getTariffPeriods(Date begin, ru.bitel.bgbilling.kernel.tariff.server.tree.TariffModuleTreeSet tariffTreeSet) Получение дат смены тарифа (набор dateFrom и dateTo из contract_tariff). При этом это всегда 23:59:59.999 (даже для dateFrom - для него отнимается 1мс).- Parameters:
 tariffTreeSet-- Returns:
 
 - 
getUrl
public static URL getUrl(Device<?, ?> tvDevice, ParameterMap config, String paramName, String paramName2, String defaultHost, int defaultPort) throws MalformedURLExceptionПолучение URL для подключения к MW по http/https.- Parameters:
 tvDevice- устройство.config- конфиг устройства.paramName- параметр конфигурации, где может быть указан URL.paramName2- дополнительный параметр конфигурации, где может быть указан URL.defaultHost- хост по умолчанию.defaultPort- порт по умолчанию.- Returns:
 - Throws:
 MalformedURLException
 - 
checkIncompatible
public static boolean checkIncompatible(ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntime contractRuntime, TvAccountRuntimeRoot tvAccountRuntime, int accountId, Calendar requestTime, Set<Integer> prolongatedProductSpecId, ProductSpec productSpec) throws ru.bitel.bgbilling.common.BGException Проверка на то, что есть активные несовместимые.- Parameters:
 contractRuntime-tvAccountRuntime- может быть null, если вызван не из аккаунтингаaccountId-requestTime-prolongatedProductSpecId-serviceCost-- Returns:
 - false, если продукт зависимый и не может быть продлен. true, если иначе.
 - Throws:
 ru.bitel.bgbilling.common.BGException
 - 
checkDependent
public static boolean checkDependent(ru.bitel.bgbilling.kernel.contract.runtime.ContractRuntime contractRuntime, TvAccountRuntimeRoot tvAccountRuntime, int accountId, Calendar tariffRequestTime, Set<Integer> prolongatedProductSpecId, ru.bitel.bgbilling.modules.tv.server.tariff.TvServiceCost serviceCost) throws ru.bitel.bgbilling.common.BGException Проверка на то, что продукт зависимы и может ли быть он продлен.- Parameters:
 contractRuntime-tvAccountRuntime-accountId-tariffRequestTime-prolongatedProductSpecId-serviceCost-- Returns:
 - false, если продукт зависимый и не может быть продлен. true, если иначе.
 - Throws:
 ru.bitel.bgbilling.common.BGException
 
 -