Class InetSessionLogDao
java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.common.dao.AbstarctDaoConstant
ru.bitel.common.dao.AbstractDao<InetSessionLog>
ru.bitel.bgbilling.modules.inet.server.bean.InetSessionLogDao
- All Implemented Interfaces:
AutoCloseable
Класс считывающий
а) либо текущие сессии(inet_session) с констуктором без даты
а) либо завершенные сессии(inet_session_log) с конструктором с датой
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao
ru.bitel.common.dao.AbstractDao.ResultSetIterator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class ru.bitel.common.dao.AbstractDao
cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, moduleId, orderByPattern, tableNameFields inherited from class ru.bitel.common.dao.AbstarctDaoConstant
ERROR, fields, SQL_ALL, SQL_AND, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_JOIN, SQL_LEFT_JOIN, SQL_LIMIT, SQL_NOT_IN, SQL_ON, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE -
Constructor Summary
ConstructorsConstructorDescriptionInetSessionLogDao(Connection con, int moduleId) InetSessionLogDao(Connection con, int moduleId, Date date) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddWherePart(Collection<Integer> servIds, Period period, String sql) static voidcheckTables(Connection con, int moduleId, Date date) static voidfixSequence(Connection con, int moduleId) в mysql при перезапуске слетал auto_increment у таблиц с sequence и нужно вручную их подправить, чтобы не было дублей сессий/соединенийget(long id) protected InetSessionLogprotected PreparedStatementgetSessionAccountReport(int cid, Collection<Integer> servIds, Period period, Collection<Integer> trafficTypeIds) getSessionAccountSums(int cid, Collection<Integer> servIds, Period period, Collection<Integer> serviceIds) getSessionTrafficsReport(int cid, Collection<Integer> servIds, Period period, Collection<Integer> trafficTypeIds) voidgetSumReportInfo(int cid, Collection<Integer> servIds, Period period, Result<?> result) booleanvoidУдаляем за один деньvoidУдаляем за период в пределах месяцаlist(long connectionId) list(Set<Integer> deviceIds, Set<Integer> contractIds, String contract, Set<Integer> servIds, String login, String ip, String callingStation, Date timeFrom, Date timeTo, boolean asc, Page page) Получение отчета по сессиямlistChildren(long parentId) listChildren(long parentId, Date date) listForContracts(Set<Integer> cids, Date timeFrom, Date timeTo) voidloadAccount(List<InetSessionLog> sessions, Collection<Integer> serviceIds) voidloadTraffics(List<InetSessionLog> sessions, Collection<Integer> trafficTypeIds) voidpopulateSessionTraffics(List<InetSessionLog> sessions, Collection<Integer> trafficTypeIds) protected voidsetParams(int cid, Period period, PreparedStatement ps) voidsetReadSessionRoute(boolean readSessionRoute) traffic(int contractId, Set<Integer> inetServIds, int sessionId, Set<Integer> trafficTypeIds, Period period, boolean byDay, boolean includeActive, boolean continuous) Отчет по трафикуprotected voidMethods inherited from class ru.bitel.common.dao.AbstractDao
close, delete, deleteImpl, dropTemporaryTable, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, loadData, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, setPageRecordCount, setStatementParam, updateMethods inherited from class ru.bitel.common.dao.AbstarctDaoConstant
getSQLOrder, psSetDate, psSetInt, psSetString, sqlLimitMethods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
error, error, error, getLogger, logError, logError, warn
-
Field Details
-
TABLE_INET_SESSION
- See Also:
-
TABLE_INET_SESSION_DETAIL
- See Also:
-
TABLE_INET_SESSION_ACCOUNT
- See Also:
-
TABLE_INET_SESSION_LOG
- See Also:
-
TABLE_INET_SESSION_LOG_DETAIL
- See Also:
-
TABLE_INET_SESSION_LOG_ACCOUNT
- See Also:
-
TABLE_INET_SESSION_LOG_ROUTE
- See Also:
-
TABLE_INET_SESSION_ROUTE
- See Also:
-
TABLE_INET_CONNECTION
- See Also:
-
-
Constructor Details
-
InetSessionLogDao
public InetSessionLogDao(Connection con, int moduleId, Date date) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
InetSessionLogDao
- Throws:
ru.bitel.bgbilling.common.BGException
-
-
Method Details
-
getFromRS
protected InetSessionLog getFromRS(ResultSet rs) throws SQLException, ru.bitel.bgbilling.common.BGException - Specified by:
getFromRSin classru.bitel.common.dao.AbstractDao<InetSessionLog>- Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
checkTables
public static void checkTables(Connection con, int moduleId, Date date) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
updateImpl
protected void updateImpl(InetSessionLog b) throws ru.bitel.bgbilling.common.BGException, SQLException - Specified by:
updateImplin classru.bitel.common.dao.AbstractDao<InetSessionLog>- Throws:
ru.bitel.bgbilling.common.BGExceptionSQLException
-
killSessionsForServWithTraffic
public void killSessionsForServWithTraffic(Set<Integer> servIds, Set<Integer> deviceIds, Date day) throws ru.bitel.bgbilling.common.BGException Удаляем за один день- Parameters:
servIds-deviceIds-day-con-- Throws:
ru.bitel.bgbilling.common.BGException
-
killSessionsForServWithTraffic
public void killSessionsForServWithTraffic(Set<Integer> servIds, Set<Integer> deviceIds, Period period) throws ru.bitel.bgbilling.common.BGException Удаляем за период в пределах месяца- Parameters:
servIds-deviceIds-period-con-- Throws:
ru.bitel.bgbilling.common.BGException
-
listChildren
public List<InetSessionLog> listChildren(long parentId) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
listChildren
public List<InetSessionLog> listChildren(long parentId, Date date) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
list
public List<InetSessionLog> list(int idDivizor, int idRemainder, Date dateFrom, Date dateTo) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
listForContracts
public List<InetSessionLog> listForContracts(Set<Integer> cids, Date timeFrom, Date timeTo) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
list
public List<InetSessionLog> list(Set<Integer> deviceIds, Date timeFrom, Date timeTo) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
list
public List<InetSessionLog> list(Set<Integer> deviceIds, Set<Integer> contractIds, String contract, Set<Integer> servIds, String login, String ip, String callingStation, Date timeFrom, Date timeTo, boolean asc, Page page) throws ru.bitel.bgbilling.common.BGException Получение отчета по сессиям- Parameters:
deviceIds-contractIds-contract-servIds-login-ip-callingStation-timeFrom-timeTo-asc-page-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getPs
protected PreparedStatement getPs(int contractId, Collection<Integer> servIds, Period period, Page page, String sql) throws SQLException - Throws:
SQLException
-
setParams
- Throws:
SQLException
-
addWherePart
-
getSumReportInfo
public void getSumReportInfo(int cid, Collection<Integer> servIds, Period period, Result<?> result) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
populateSessionTraffics
public void populateSessionTraffics(List<InetSessionLog> sessions, Collection<Integer> trafficTypeIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
loadTraffics
public void loadTraffics(List<InetSessionLog> sessions, Collection<Integer> trafficTypeIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
loadAccount
public void loadAccount(List<InetSessionLog> sessions, Collection<Integer> serviceIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
getSessionTrafficsReport
public Map<Integer,Long> getSessionTrafficsReport(int cid, Collection<Integer> servIds, Period period, Collection<Integer> trafficTypeIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
getSessionAccountSums
public TrafficAccountDetail getSessionAccountSums(int cid, Collection<Integer> servIds, Period period, Collection<Integer> serviceIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
list
- Throws:
ru.bitel.bgbilling.common.BGException
-
get
- Throws:
ru.bitel.bgbilling.common.BGException
-
traffic
public List<TrafficAmount> traffic(int contractId, Set<Integer> inetServIds, int sessionId, Set<Integer> trafficTypeIds, Period period, boolean byDay, boolean includeActive, boolean continuous) throws ru.bitel.bgbilling.common.BGException Отчет по трафику- Parameters:
contractId-inetServIds-sessionId-trafficTypeIds-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
isReadSessionRoute
public boolean isReadSessionRoute() -
setReadSessionRoute
public void setReadSessionRoute(boolean readSessionRoute) -
getSessionAccountReport
public Map<Integer,Long> getSessionAccountReport(int cid, Collection<Integer> servIds, Period period, Collection<Integer> trafficTypeIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
fixSequence
в mysql при перезапуске слетал auto_increment у таблиц с sequence и нужно вручную их подправить, чтобы не было дублей сессий/соединений- Parameters:
con- соединение с бдmoduleId- код модуля- Throws:
SQLException
-
getDetailTableName
-
getSessionTableName
-