ru.bitel.oss.systems.inventory.resource.server.bean

## Class IpResourceSubscriptionDao

- java.lang.Object
- - ru.bitel.common.dao.AbstarctDaoConstant
  - - ru.bitel.common.dao.AbstractDao<B>
    - - ru.bitel.common.dao.AbstractIdDao<IpResourceSubscription>
      - - ru.bitel.oss.systems.inventory.resource.server.bean.IpResourceSubscriptionDao

- All Implemented Interfaces:
    java.lang.AutoCloseable

      public class IpResourceSubscriptionDao
      extends ru.bitel.common.dao.AbstractIdDao<IpResourceSubscription>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao

      `ru.bitel.common.dao.AbstractDao.ResultSetIterator`

  - ### Field Summary

    - ### Fields inherited from class ru.bitel.common.dao.AbstractDao

      `cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, mid, moduleId, orderByPattern, tableName`

    - ### Fields inherited from class ru.bitel.common.dao.AbstarctDaoConstant

      `ERROR, 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

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `IpResourceSubscriptionDao(java.sql.Connection con, int mid)`
    `protected` | `IpResourceSubscriptionDao(java.sql.Connection con, int mid, java.lang.String tableName)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `deleteBySubsciberId(int subscriberId)`
    `java.lang.Object[]` | `findFree(java.util.Collection<java.lang.Integer> ipResourceCategoryIds, int ipResourceId, byte[] addressFrom, byte[] addressTo, java.util.Date dateFrom, java.util.Date dateTo, int subscriberId)`
    `IpResourceSubscription` | `findSubscribed(int subscriberId)`
    `java.lang.Object[]` | `findSubscribed(java.util.Set<java.lang.Integer> ipResourceCategoryIds, int ipResourceId, byte[] addressFrom, byte[] addressTo, java.util.Date dateFrom, java.util.Date dateTo, int subscriberId)`
    `protected IpResourceSubscription` | `getFromRS(java.sql.ResultSet rs)`
    `protected static IpResourceSubscription` | `getSubscriptionFromRS(java.sql.ResultSet rs)`
    `java.util.List<IpResourceSubscription>` | `list(int ipResourceId, java.util.Date dateFrom, java.util.Date dateTo)` Возвращает список подписок, которые пересекаются с указанным периодом.
    `Result<IpResourceSubscription>` | `list(int ipResourceId, java.util.Date dateFrom, java.util.Date dateTo, Page page)`
    `java.util.List<IpResourceSubscriptionRuntime>` | `listRuntime(int ipResourceId, java.util.Date dateFrom, java.util.Date dateTo)` Возвращает список подписок, которые пересекаются с указанным периодом.
    `protected void` | `updateImpl(IpResourceSubscription b)`

    - ### Methods inherited from class ru.bitel.common.dao.AbstractIdDao

      `delete, get, getAndDelete, getAndUpdate`

    - ### Methods inherited from class ru.bitel.common.dao.AbstractDao

      `close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, processException, recycle, setStatementParam, update`

    - ### Methods inherited from class ru.bitel.common.dao.AbstarctDaoConstant

      `getSQLOrder`

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

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

- - ### Constructor Detail

    - #### IpResourceSubscriptionDao

          public IpResourceSubscriptionDao(java.sql.Connection con,
                                           int mid)

    - #### IpResourceSubscriptionDao

          protected IpResourceSubscriptionDao(java.sql.Connection con,
                                              int mid,
                                              java.lang.String tableName)

  - ### Method Detail

    - #### getFromRS

          protected IpResourceSubscription getFromRS(java.sql.ResultSet rs)
                                              throws java.sql.SQLException

      Specified by:
        `getFromRS` in class `ru.bitel.common.dao.AbstractDao<IpResourceSubscription>`
      Throws:
        `java.sql.SQLException`

    - #### list

          public java.util.List<IpResourceSubscription> list(int ipResourceId,
                                                             java.util.Date dateFrom,
                                                             java.util.Date dateTo)
                                                      throws ru.bitel.bgbilling.common.BGException

      Возвращает список подписок, которые пересекаются с указанным периодом.
      Parameters:
        `ipResourceId` -
        `dateFrom` -
        `dateTo` -
      Returns:
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### listRuntime

          public java.util.List<IpResourceSubscriptionRuntime> listRuntime(int ipResourceId,
                                                                           java.util.Date dateFrom,
                                                                           java.util.Date dateTo)
                                                                    throws ru.bitel.bgbilling.common.BGException

      Возвращает список подписок, которые пересекаются с указанным периодом.
      Parameters:
        `ipResourceId` -
        `dateFrom` -
        `dateTo` -
      Returns:
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### list

          public Result<IpResourceSubscription> list(int ipResourceId,
                                                     java.util.Date dateFrom,
                                                     java.util.Date dateTo,
                                                     Page page)
                                              throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### updateImpl

          protected void updateImpl(IpResourceSubscription b)
                             throws ru.bitel.bgbilling.common.BGException,
                                    java.sql.SQLException

      Specified by:
        `updateImpl` in class `ru.bitel.common.dao.AbstractDao<IpResourceSubscription>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.sql.SQLException`

    - #### deleteBySubsciberId

          public int deleteBySubsciberId(int subscriberId)
                                  throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### findSubscribed

          public IpResourceSubscription findSubscribed(int subscriberId)
                                                throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### findFree

          public java.lang.Object[] findFree(java.util.Collection<java.lang.Integer> ipResourceCategoryIds,
                                             int ipResourceId,
                                             byte[] addressFrom,
                                             byte[] addressTo,
                                             java.util.Date dateFrom,
                                             java.util.Date dateTo,
                                             int subscriberId)
                                      throws ru.bitel.bgbilling.common.BGException

      Parameters:
        `ipResourceCategoryIds` -
        `ipResourceId` -
        `addressFrom` -
        `addressTo` -
        `dateFrom` -
        `dateTo` -
        `subscriberId` -
      Returns:
      Throws:
        `ru.bitel.bgbilling.common.BGException` - если данный ip пересекается с другим подписчиком и подходящих ресурсов нет

    - #### findSubscribed

          public java.lang.Object[] findSubscribed(java.util.Set<java.lang.Integer> ipResourceCategoryIds,
                                                   int ipResourceId,
                                                   byte[] addressFrom,
                                                   byte[] addressTo,
                                                   java.util.Date dateFrom,
                                                   java.util.Date dateTo,
                                                   int subscriberId)
                                            throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### getSubscriptionFromRS

          protected static IpResourceSubscription getSubscriptionFromRS(java.sql.ResultSet rs)
                                                                 throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`