Class InetUtils
java.lang.Object
ru.bitel.bgbilling.modules.inet.server.InetUtils
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanawaitTermination(ScheduledExecutorService scheduledExecutorService, String name, long seconds) static booleancheckAccountingRootDeviceId(Setup setup, int moduleId) Проверка что в moduleSetup указаны типы устройств - аккаунтингstatic booleancheckAliveAndType(InetConnection connection, boolean checkDeviceState, int type) Возвращает true если сессия жива и тип подходящий.static BooleancheckIdentifier(InetServ inetServ, String identifier) static BooleancheckMacAddress(InetServ inetServ, byte[] macAddress) Возвращает true, если в сервисе не назначен MAC-адрес, или один из назначенных адресов совпадает с указанным.static <A> booleancheckSessionCountLimit(List<A> connectionList, Function<A, InetConnection> converter, boolean alive, int sessionCountLimit) static longstatic longstatic longstatic longstatic intgetAccountingRootDeviceId(int moduleId, Set<Integer> accountingDeviceTypeIds, int deviceId) static intgetAccountingRootDeviceId(Setup setup, int moduleId, int deviceId) static InetConnectiongetConnection(Connection con, int moduleId, long connectionId, Date connectionStart) static Object[]getConnectionAndLastSessionLog(Connection con, int moduleId, long connectionId, Date connectionStart) static intgetConnectionType(InetConnection connection) TODO-XXXstatic Map<Integer, AccountingTrafficAmount> getCounterTraffics(ru.bitel.bgbilling.apps.inet.accounting.InetConnectionCallRuntime connectionCallRuntime, RadiusPacket request) static Map<Integer, AccountingTrafficAmount> getCounterTraffics(ru.bitel.bgbilling.modules.inet.server.runtime.InetServRuntime inetServRuntime, ru.bitel.bgbilling.apps.inet.accounting.InetConnectionCallRuntime parentConnectionCallRuntime, InetConnection connection, RadiusPacket request) static Map<Integer, AccountingTrafficAmount> getCounterTraffics(ru.bitel.bgbilling.modules.inet.server.runtime.TrafficTypeLinkRuntime link, RadiusPacket packet, String realm, String acctService) static final LonggetHour(long millis) static final longgetInputOctets(RadiusPacket packet) static final longgetOutputOctets(RadiusPacket packet) static Stringstatic intgetSessionCountLimit(InetServType inetServType, InetServ inetServ) static StringinternRealm(String realm) static StringinternServiceName(String realm) static longmacAddressToLong(byte[] mac) static longmacAddressToLong(String macAddress) static StringmacAddressToString(byte[] macAddress) static RadiusAttributeSetRealmMapnewRadiusAttributeSetRealmMap(int moduleId, ParameterMap deviceConfig, String prefix) Набор атрибутов по релмам и опциям, с добавлением атрибутов, прописанных в опциях и атрибутов, прописанных шаблоном radius.inetOption.1.template=Speed=$speedstatic RadiusAttributeSetRealmMapnewRadiusAttributeSetRealmMap(ConnectionSet connectionSet, int moduleId, ParameterMap deviceConfig, String prefix) Набор атрибутов по релмам и опциям, с добавлением атрибутов, прописанных в опциях и атрибутов, прописанных шаблоном radius.inetOption.1.template=Speed=$speedstatic intparseInt(byte[] data, int pos, int length) Преобразует 1-4 байта в intstatic byte[]parseMacAddress(String macAddress) static int[][]parseSearchModes(String value) static longroundToSeconds(long millis) 
- 
Constructor Details- 
InetUtilspublic InetUtils()
 
- 
- 
Method Details- 
dateFrom
- 
dateTo
- 
dateFrom
- 
dateTo
- 
getHour
- 
awaitTerminationpublic static boolean awaitTermination(ScheduledExecutorService scheduledExecutorService, String name, long seconds) throws InterruptedException - Throws:
- InterruptedException
 
- 
getRealm
- 
internRealm
- 
internServiceName
- 
getCounterTrafficspublic static Map<Integer,AccountingTrafficAmount> getCounterTraffics(ru.bitel.bgbilling.modules.inet.server.runtime.InetServRuntime inetServRuntime, ru.bitel.bgbilling.apps.inet.accounting.InetConnectionCallRuntime parentConnectionCallRuntime, InetConnection connection, RadiusPacket request) 
- 
getCounterTrafficspublic static Map<Integer,AccountingTrafficAmount> getCounterTraffics(ru.bitel.bgbilling.apps.inet.accounting.InetConnectionCallRuntime connectionCallRuntime, RadiusPacket request) 
- 
getCounterTrafficspublic static Map<Integer,AccountingTrafficAmount> getCounterTraffics(ru.bitel.bgbilling.modules.inet.server.runtime.TrafficTypeLinkRuntime link, RadiusPacket packet, String realm, String acctService) 
- 
getInputOctets
- 
getOutputOctets
- 
getSessionCountLimit
- 
checkSessionCountLimitpublic static <A> boolean checkSessionCountLimit(List<A> connectionList, Function<A, InetConnection> converter, boolean alive, int sessionCountLimit) - Parameters:
- connectionList-
- sessionCountLimit-
- active- проверяем ли активную сессию, т.е. в списке текущих она уже есть
- Returns:
 
- 
getConnectionpublic static InetConnection getConnection(Connection con, int moduleId, long connectionId, Date connectionStart) throws ru.bitel.bgbilling.common.BGException - Throws:
- ru.bitel.bgbilling.common.BGException
 
- 
getConnectionAndLastSessionLogpublic static Object[] getConnectionAndLastSessionLog(Connection con, int moduleId, long connectionId, Date connectionStart) throws ru.bitel.bgbilling.common.BGException - Throws:
- ru.bitel.bgbilling.common.BGException
 
- 
roundToSecondspublic static long roundToSeconds(long millis) 
- 
parseIntpublic static int parseInt(byte[] data, int pos, int length) Преобразует 1-4 байта в int- Parameters:
- data-
- pos-
- length-
- Returns:
 
- 
checkMacAddressВозвращает true, если в сервисе не назначен MAC-адрес, или один из назначенных адресов совпадает с указанным.- Parameters:
- inetServ-
- macAddress-
- trueIfEmpty- нужно ли возвращать true, если ни один MAC-адрес на сервисе не задан.
- Returns:
 
- 
checkIdentifier
- 
newRadiusAttributeSetRealmMappublic static RadiusAttributeSetRealmMap newRadiusAttributeSetRealmMap(ConnectionSet connectionSet, int moduleId, ParameterMap deviceConfig, String prefix) throws Exception Набор атрибутов по релмам и опциям, с добавлением атрибутов, прописанных в опциях и атрибутов, прописанных шаблоном radius.inetOption.1.template=Speed=$speed- Parameters:
- connectionSet-
- moduleId-
- deviceConfig-
- prefix-
- Returns:
- Throws:
- ru.bitel.bgbilling.common.BGException
- Exception
 
- 
newRadiusAttributeSetRealmMappublic static RadiusAttributeSetRealmMap newRadiusAttributeSetRealmMap(int moduleId, ParameterMap deviceConfig, String prefix) throws Exception Набор атрибутов по релмам и опциям, с добавлением атрибутов, прописанных в опциях и атрибутов, прописанных шаблоном radius.inetOption.1.template=Speed=$speed- Parameters:
- deviceConfig-
- prefix-
- Returns:
- Throws:
- ru.bitel.bgbilling.common.BGException
- Exception
 
- 
parseSearchModes
- 
getAccountingRootDeviceIdpublic static int getAccountingRootDeviceId(int moduleId, Set<Integer> accountingDeviceTypeIds, int deviceId) throws Exception - Throws:
- Exception
 
- 
getAccountingRootDeviceIdpublic static int getAccountingRootDeviceId(Setup setup, int moduleId, int deviceId) throws Exception - Throws:
- Exception
 
- 
checkAccountingRootDeviceIdПроверка что в moduleSetup указаны типы устройств - аккаунтинг- Parameters:
- setup-
- moduleId-
- Returns:
 
- 
getConnectionTypeTODO-XXX- Parameters:
- connection-
- Returns:
 
- 
checkAliveAndTypepublic static boolean checkAliveAndType(InetConnection connection, boolean checkDeviceState, int type) Возвращает true если сессия жива и тип подходящий.- Parameters:
- connection-
- type-
- Returns:
- See Also:
 
- 
macAddressToLongpublic static long macAddressToLong(byte[] mac) 
- 
macAddressToLong
- 
parseMacAddress
- 
macAddressToString
 
-