bitel.billing.server.ipn

## Class GateWorker

- java.lang.Object
- - java.lang.Thread
  - - bitel.billing.server.ipn.GateWorker

- All Implemented Interfaces:
    java.lang.Runnable

      public abstract class GateWorker
      extends java.lang.Thread

  Объект, управляющий шлюзом

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.sql.Connection` | `con`
    `protected Gate` | `gate`
    `protected java.lang.StringBuilder` | `gateErrors`
    `protected GateType` | `gateType`
    `protected java.util.Map<java.lang.Integer,GateType>` | `gateTypeMap`
    `protected org.apache.log4j.Logger` | `log`
    `protected int` | `mid`
    `protected java.util.Map<java.lang.Integer,RuleType>` | `ruleTypeMap`
    `protected java.util.List<UserStatus>` | `statusList`

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GateWorker()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addUserStatus(int contractId, int status, RuleType ruleType, GateType gateType, UserGateRule rule, int mid)`
    `void` | `doParentSync()`
    `protected abstract void` | `doSync()`
    `Gate` | `getGate()`
    `java.lang.String` | `getGateErrors()`
    `void` | `init(Gate gate, java.util.Map<java.lang.Integer,RuleType> ruleTypeMap, java.util.Map<java.lang.Integer,GateType> gateTypeMap, int mid)`
    `boolean` | `isWorking()`
    `void` | `parentSync(Gate child, GateWorker childWorker)`
    `void` | `run()`
    `protected void` | `runSync()`
    `void` | `setGateErrors(java.lang.StringBuilder gateErrors)`

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

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

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

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

- - ### Field Detail

    - #### mid

          protected int mid

    - #### gate

          protected Gate gate

    - #### log

          protected final org.apache.log4j.Logger log

    - #### con

          protected java.sql.Connection con

    - #### gateErrors

          protected java.lang.StringBuilder gateErrors

    - #### statusList

          protected java.util.List<UserStatus> statusList

    - #### ruleTypeMap

          protected java.util.Map<java.lang.Integer,RuleType> ruleTypeMap

    - #### gateTypeMap

          protected java.util.Map<java.lang.Integer,GateType> gateTypeMap

    - #### gateType

          protected GateType gateType

  - ### Constructor Detail

    - #### GateWorker

          public GateWorker()

  - ### Method Detail

    - #### init

          public void init(Gate gate,
                           java.util.Map<java.lang.Integer,RuleType> ruleTypeMap,
                           java.util.Map<java.lang.Integer,GateType> gateTypeMap,
                           int mid)

    - #### addUserStatus

          public void addUserStatus(int contractId,
                                    int status,
                                    RuleType ruleType,
                                    GateType gateType,
                                    UserGateRule rule,
                                    int mid)

    - #### getGateErrors

          public java.lang.String getGateErrors()

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `java.lang.Thread`

    - #### runSync

          protected void runSync()
                          throws bsh.EvalError,
                                 java.io.IOException

      Throws:
        `bsh.EvalError`
        `java.io.IOException`

    - #### isWorking

          public boolean isWorking()

    - #### doSync

          protected abstract void doSync()

    - #### getGate

          public Gate getGate()

    - #### doParentSync

          public void doParentSync()
                            throws java.lang.ClassNotFoundException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException,
                                   bsh.EvalError,
                                   java.io.IOException

      Throws:
        `java.lang.ClassNotFoundException`
        `java.lang.InstantiationException`
        `java.lang.IllegalAccessException`
        `bsh.EvalError`
        `java.io.IOException`

    - #### parentSync

          public void parentSync(Gate child,
                                 GateWorker childWorker)

    - #### setGateErrors

          public void setGateErrors(java.lang.StringBuilder gateErrors)