Class InetSessionLogDao
java.lang.Object
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 String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class ru.bitel.common.dao.AbstractDao
cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, moduleId, orderByPattern, tableName
Fields inherited from class ru.bitel.common.dao.AbstarctDaoConstant
ERROR, fields, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_LIMIT, 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 String
addWherePart
(Collection<Integer> servIds, Period period, String sql) static void
checkTables
(Connection con, int moduleId, Date date) static void
fixSequence
(Connection con, int moduleId) в mysql при перезапуске слетал auto_increment у таблиц с sequence и нужно вручную их подправить, чтобы не было дублей сессий/соединенийget
(long id) protected InetSessionLog
protected PreparedStatement
getSessionAccountReport
(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) void
getSumReportInfo
(int cid, Collection<Integer> servIds, Period period, Result<?> result) boolean
void
Удаляем за один день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) void
loadAccount
(List<InetSessionLog> sessions, Collection<Integer> serviceIds) void
loadTraffics
(List<InetSessionLog> sessions, Collection<Integer> trafficTypeIds) void
populateSessionTraffics
(List<InetSessionLog> sessions, Collection<Integer> trafficTypeIds) protected void
setParams
(int cid, Period period, Page page, PreparedStatement ps) void
setReadSessionRoute
(boolean readSessionRoute) traffic
(int contractId, Set<Integer> inetServIds, int sessionId, Set<Integer> trafficTypeIds, Period period, boolean byDay, boolean includeActive, boolean continuous) Отчет по трафикуprotected void
Methods inherited from class ru.bitel.common.dao.AbstractDao
close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getLogger, getPeriod, getQueryById, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, recycle, setStatementParam, update
Methods inherited from class ru.bitel.common.dao.AbstarctDaoConstant
getSQLOrder
-
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:
getFromRS
in classru.bitel.common.dao.AbstractDao<InetSessionLog>
- Throws:
SQLException
ru.bitel.bgbilling.common.BGException
-
checkTables
public static void checkTables(Connection con, int moduleId, Date date) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLException
ru.bitel.bgbilling.common.BGException
-
updateImpl
protected void updateImpl(InetSessionLog b) throws ru.bitel.bgbilling.common.BGException, SQLException - Specified by:
updateImpl
in classru.bitel.common.dao.AbstractDao<InetSessionLog>
- Throws:
ru.bitel.bgbilling.common.BGException
SQLException
-
killSessionsForServWithTraffic
public void killSessionsForServWithTraffic(Set<Integer> servIds, Set<Integer> deviceIds, Date day) throws ru.bitel.bgbilling.common.BGException Удаляем за один день- Parameters:
con
-servIds
-deviceIds
-day
-- 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:
con
-servIds
-deviceIds
-period
-- Throws:
ru.bitel.bgbilling.common.BGException
-
listChildren
public List<InetSessionLog> listChildren(long parentId) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLException
ru.bitel.bgbilling.common.BGException
-
listChildren
public List<InetSessionLog> listChildren(long parentId, Date date) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLException
ru.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
protected void setParams(int cid, Period period, Page page, PreparedStatement ps) throws SQLException - 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
-