bitel.billing.server.admin.resource.bean

## Class ResourceManager<T extends Resource>

- java.lang.Object
- - bitel.billing.server.admin.resource.bean.ResourceManager<T>

- Direct Known Subclasses:
    bitel.billing.server.admin.resource.bean.ip.IPResourceRangeManager, NumberResourceManager

      public abstract class ResourceManager<T extends Resource>
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.sql.Connection` | `con`
    `protected int` | `mid`
    `protected java.lang.String` | `tableName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceManager(java.sql.Connection con, int mid)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changeResourceCategory(java.lang.String ids, int categoryId)`
    `void` | `deleteResource(java.lang.String id)`
    `int` | `getResourceCount(int categoryId)`
    `protected abstract T` | `getResourceFromRs(java.sql.ResultSet rs)`
    `protected abstract java.lang.String` | `getTableName()`
    `protected void` | `loadStandartResourceFromRs(java.sql.ResultSet rs, Resource res)`
    `static ResourceManager<?>` | `newResourceManager(java.lang.String module, java.sql.Connection con, int mid)`
    `void` | `syncResourceUse()`
    `abstract void` | `updateResource(T res)`

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

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

- - ### Field Detail

    - #### con

          protected java.sql.Connection con

    - #### mid

          protected int mid

    - #### tableName

          protected java.lang.String tableName

  - ### Constructor Detail

    - #### ResourceManager

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

  - ### Method Detail

    - #### changeResourceCategory

          public void changeResourceCategory(java.lang.String ids,
                                             int categoryId)

    - #### getResourceCount

          public int getResourceCount(int categoryId)

    - #### deleteResource

          public void deleteResource(java.lang.String id)

    - #### loadStandartResourceFromRs

          protected void loadStandartResourceFromRs(java.sql.ResultSet rs,
                                                    Resource res)
                                             throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### updateResource

          public abstract void updateResource(T res)
                                       throws ru.bitel.bgbilling.common.BGException

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

    - #### getResourceFromRs

          protected abstract T getResourceFromRs(java.sql.ResultSet rs)
                                          throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### getTableName

          protected abstract java.lang.String getTableName()

    - #### newResourceManager

          public static ResourceManager<?> newResourceManager(java.lang.String module,
                                                              java.sql.Connection con,
                                                              int mid)
                                                       throws ru.bitel.bgbilling.common.BGException

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

    - #### syncResourceUse

          public void syncResourceUse()
                               throws ru.bitel.bgbilling.common.BGException

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