Package ru.bitel.bgbilling.modules.inet.server.bean

# Class InetConnectionDao

java.lang.Object
ru.bitel.bgbilling.modules.inet.server.bean.InetConnectionDao

All Implemented Interfaces:
  `AutoCloseable`

public class InetConnectionDao extends Object implements AutoCloseable

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InetConnectionDao(Connection con, int moduleId)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `boolean`
  `closeConnection(int deviceId, long id, Date sessionStop, int type)`
  `boolean`
  `delete(long connectionId)`
  `static Pair<InetServ,InetConnection>`
  `find(Connection con, int moduleId, Set<Integer> servIds, String acctSessionId, String address, String login, String callingStationId)`
  Поиск сервиса [0] и соединения [1] по указанным параметрам
  `static Pair<InetServ,InetConnection>`
  `find(Connection con, int moduleId, Set<Integer> servIds, String acctSessionId, String address, String login, String callingStationId, String calledStationId)`
  `static Pair<InetServ,InetConnection>`
  `find(Connection con, int moduleId, Set<Integer> deviceIds, Set<Integer> servIds, String acctSessionId, String address, String login, String callingStationId, String calledStationId)`
  Поиск сервиса [0] и соединения [1] по указанным параметрам
  `InetConnection`
  `get(int deviceId, long connectionId)`
  `InetConnection`
  `get(long connectionId)`
  `static InetConnection`
  `getConnectionFromRS(ResultSet rs)`
  `protected InetConnection`
  `getFromRS(ResultSet rs)`
  `long`
  `getNextConnectionId()`
  `void`
  `insert(InetConnection b)`
  `List<InetConnection>`
  `list(int inetServId)`
  `List<InetConnection>`
  `list(Set<Integer> deviceIds, boolean checkSession)`
  `void`
  `update(InetConnection b)`
  `void`
  `updateDeviceStateAndOptions(int deviceId, long id, int state, Set<Integer> inetOptions, int accessCode)`
  `boolean`
  `updateInetAddress(int deviceId, long id, byte[] ipAddress, int ipResourceId)`
  Метод обновляет ipAddress для соединения, если он еще не установлен.
  `void`
  `updateIpNets(long connectionId, List<IpNet> routeList)`
  `void`
  `updateType(int deviceId, long id, int type)`

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

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

- ## Constructor Details

  - ### InetConnectionDao

    public InetConnectionDao(Connection con, int moduleId)

- ## Method Details

  - ### insert

    public void insert(InetConnection b) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getNextConnectionId

    public long getNextConnectionId() throws SQLException
    Throws:
      `SQLException`

  - ### update

    public void update(InetConnection b) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### updateDeviceStateAndOptions

    public void updateDeviceStateAndOptions(int deviceId, long id, int state, Set<Integer> inetOptions, int accessCode) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### updateInetAddress

    public boolean updateInetAddress(int deviceId, long id, byte[] ipAddress, int ipResourceId) throws ru.bitel.bgbilling.common.BGException
    Метод обновляет ipAddress для соединения, если он еще не установлен.
    Parameters:
      `id` -
      `ipAddress` -
      `ipResourceId` -
    Returns:
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### list

    public List<InetConnection> list(Set<Integer> deviceIds, boolean checkSession) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getFromRS

    protected InetConnection getFromRS(ResultSet rs) throws SQLException
    Throws:
      `SQLException`

  - ### getConnectionFromRS

    public static InetConnection getConnectionFromRS(ResultSet rs) throws SQLException
    Throws:
      `SQLException`

  - ### get

    public InetConnection get(long connectionId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### get

    public InetConnection get(int deviceId, long connectionId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### closeConnection

    public boolean closeConnection(int deviceId, long id, Date sessionStop, int type) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### updateType

    public void updateType(int deviceId, long id, int type) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### list

    public List<InetConnection> list(int inetServId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`

  - ### updateIpNets

    public void updateIpNets(long connectionId, List<IpNet> routeList) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### delete

    public boolean delete(long connectionId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### find

    public static Pair<InetServ,InetConnection> find(Connection con, int moduleId, Set<Integer> servIds, String acctSessionId, String address, String login, String callingStationId) throws SQLException, ru.bitel.bgbilling.common.BGException, UnknownHostException
    Поиск сервиса [0] и соединения [1] по указанным параметрам
    Parameters:
      `con` -
      `moduleId` -
      `acctSessionId` - идентификатор соединения (Acct-Session-Id) или null
      `address` - IP-адрес
      `login` -
      `servId` - ID сервиса или 0
    Returns:
      массив [ inetServ, inetConnection ] или null, если соединение не найдено
    Throws:
      `SQLException`
      `ru.bitel.bgbilling.common.BGException`
      `UnknownHostException`

  - ### find

    public static Pair<InetServ,InetConnection> find(Connection con, int moduleId, Set<Integer> servIds, String acctSessionId, String address, String login, String callingStationId, String calledStationId) throws SQLException, ru.bitel.bgbilling.common.BGException, UnknownHostException
    Throws:
      `SQLException`
      `ru.bitel.bgbilling.common.BGException`
      `UnknownHostException`

  - ### find

    public static Pair<InetServ,InetConnection> find(Connection con, int moduleId, Set<Integer> deviceIds, Set<Integer> servIds, String acctSessionId, String address, String login, String callingStationId, String calledStationId) throws SQLException, ru.bitel.bgbilling.common.BGException, UnknownHostException
    Поиск сервиса [0] и соединения [1] по указанным параметрам
    Parameters:
      `con` -
      `moduleId` -
      `acctSessionId` - идентификатор соединения (Acct-Session-Id) или null
      `address` - IP-адрес
      `login` -
      `servId` - ID сервиса или 0
    Returns:
      массив [ inetServ, inetConnection ] или null, если соединение не найдено
    Throws:
      `SQLException`
      `ru.bitel.bgbilling.common.BGException`
      `UnknownHostException`