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

# Class InetConnectionDao

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

    public class InetConnectionDao
    extends java.lang.Object

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `InetConnectionDao​(java.sql.Connection con, int moduleId)` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `boolean` | `closeConnection​(int deviceId, long id, java.util.Date sessionStop, int type)` |
  `boolean` | `delete​(long connectionId)` |
  `static Pair<InetServ,​InetConnection>` | `find​(java.sql.Connection con, int moduleId, java.util.Set<java.lang.Integer> servIds, java.lang.String acctSessionId, java.lang.String address, java.lang.String login, java.lang.String callingStationId)` | Поиск сервиса [0] и соединения [1] по указанным параметрам
  `static Pair<InetServ,​InetConnection>` | `find​(java.sql.Connection con, int moduleId, java.util.Set<java.lang.Integer> servIds, java.lang.String acctSessionId, java.lang.String address, java.lang.String login, java.lang.String callingStationId, java.lang.String calledStationId)` |
  `static Pair<InetServ,​InetConnection>` | `find​(java.sql.Connection con, int moduleId, java.util.Set<java.lang.Integer> deviceIds, java.util.Set<java.lang.Integer> servIds, java.lang.String acctSessionId, java.lang.String address, java.lang.String login, java.lang.String callingStationId, java.lang.String calledStationId)` | Поиск сервиса [0] и соединения [1] по указанным параметрам
  `InetConnection` | `get​(int deviceId, long connectionId)` |
  `InetConnection` | `get​(long connectionId)` |
  `static InetConnection` | `getConnectionFromRS​(java.sql.ResultSet rs)` |
  `protected InetConnection` | `getFromRS​(java.sql.ResultSet rs)` |
  `long` | `getNextConnectionId()` |
  `void` | `insert​(InetConnection b)` |
  `java.util.List<InetConnection>` | `list​(int inetServId)` |
  `java.util.List<InetConnection>` | `list​(java.util.Set<java.lang.Integer> deviceIds, boolean checkSession)` |
  `static void` | `main​(java.lang.String[] args)` |
  `void` | `recycle()` |
  `void` | `update​(InetConnection b)` |
  `void` | `updateDeviceStateAndOptions​(int deviceId, long id, int state, java.util.Set<java.lang.Integer> inetOptions, int accessCode)` |
  `boolean` | `updateInetAddress​(int deviceId, long id, byte[] ipAddress, int ipResourceId)` | Метод обновляет ipAddress для соединения, если он еще не установлен.
  `void` | `updateIpNets​(long connectionId, java.util.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​(java.sql.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 java.sql.SQLException
    Throws:
      `java.sql.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, java.util.Set<java.lang.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 java.util.List<InetConnection> list​(java.util.Set<java.lang.Integer> deviceIds, boolean checkSession) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getFromRS

    protected InetConnection getFromRS​(java.sql.ResultSet rs) throws java.sql.SQLException
    Throws:
      `java.sql.SQLException`

  - ### getConnectionFromRS

    public static InetConnection getConnectionFromRS​(java.sql.ResultSet rs) throws java.sql.SQLException
    Throws:
      `java.sql.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, java.util.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 java.util.List<InetConnection> list​(int inetServId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### main

    public static void main​(java.lang.String[] args)

  - ### recycle

    public void recycle()

  - ### updateIpNets

    public void updateIpNets​(long connectionId, java.util.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​(java.sql.Connection con, int moduleId, java.util.Set<java.lang.Integer> servIds, java.lang.String acctSessionId, java.lang.String address, java.lang.String login, java.lang.String callingStationId) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException, java.net.UnknownHostException
    Поиск сервиса [0] и соединения [1] по указанным параметрам
    Parameters:
      `con` -
      `moduleId` -
      `servId` - ID сервиса или 0
      `acctSessionId` - идентификатор соединения (Acct-Session-Id) или null
      `address` - IP-адрес
      `login` -
    Returns:
      массив [ inetServ, inetConnection ] или null, если соединение не найдено
    Throws:
      `java.sql.SQLException`
      `ru.bitel.bgbilling.common.BGException`
      `java.net.UnknownHostException`

  - ### find

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

  - ### find

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