ru.bitel.bgbilling.kernel.network.radius

## Class RadiusListenerWorker<N extends ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?>>

- java.lang.Object
- - ru.bitel.common.worker.WorkerTask<C>
  - - ru.bitel.bgbilling.kernel.network.processor.ProcessorRequest<RadiusListenerWorkerContext>
    - - ru.bitel.bgbilling.kernel.network.radius.RadiusListenerWorker<N>

- Type Parameters:
    `N` -
  All Implemented Interfaces:
    java.lang.Runnable
  Direct Known Subclasses:
    InetRadiusListenerWorker

      public class RadiusListenerWorker<N extends ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?>>
      extends ru.bitel.bgbilling.kernel.network.processor.ProcessorRequest<RadiusListenerWorkerContext>

  Когда-нибудь он будет сохранять радиус запросы в лог-файлы, по крайней мере аккаунтинг запросы...
  Чтобы их можно было переобработать. UPD(stark): он уже сохраняет логи по факту, только этот код не в одном модуле не используется. inet делает это сам (переопределил этот код), а другие модули (dialup/voiceip) не сохраняют
  Author:
    amir

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `accessCode`
    `protected java.lang.Object` | `agentDevice`
    `protected int` | `agentDeviceId`
    `protected byte[]` | `ipAddress`
    `protected int` | `ipResourceId`
    `protected static org.apache.log4j.Logger` | `logger`
    `protected static org.apache.log4j.Logger` | `loggerUpdate`
    `protected N` | `nas`
    `protected int` | `overloadLevel`
    `protected RadiusProcessor<?,N,?>` | `processor`
    `protected RadiusSession<N,?>` | `radiusSession`
    `protected RadiusPacket` | `request`
    `protected RadiusPacket` | `response`
    `protected static java.lang.ThreadLocal<RadiusListenerWorker<?>>` | `worker`

    - ### Fields inherited from class ru.bitel.bgbilling.kernel.network.processor.ProcessorRequest

      `clientAddress, connectionId, data, millis`

    - ### Fields inherited from class ru.bitel.common.worker.WorkerTask

      `context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RadiusListenerWorker(RadiusListener<N> listener, java.net.SocketAddress clientAddress, long millis, java.nio.ByteBuffer data, int overloadLevel)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `accessRequest(N nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet, java.util.Date time)`
    `protected void` | `accessRequest0(N nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet, java.util.Date time)`
    `protected void` | `accountingRequest(N nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet, java.util.Date time)`
    `java.lang.Object` | `getAgentDevice()`
    `int` | `getAgentDeviceId()`
    `java.lang.Object` | `getCircuitId()`
    `ru.bitel.bgbilling.kernel.container.managed.ServerContext` | `getConext()`
    `int` | `getContractId()`
    `byte[]` | `getIpAddress()`
    `int` | `getIpResourceId()`
    `RadiusSession<N,?>` | `getRadiusSession()`
    `RadiusPacket` | `getRequest()`
    `RadiusPacket` | `getResponse()`
    `boolean` | `isConnectionModified()` Было ли соединение начато/остановлено при обработке данного `request`.
    `boolean` | `isSkip()`
    `void` | `runImpl()`
    `protected java.nio.ByteBuffer` | `sendReponse(N nas, RadiusPacket response)`
    `void` | `setAgentDevice(java.lang.Object agentDevice)`
    `void` | `setAgentDeviceId(int agentDeviceId)`
    `void` | `setCircuitId(java.lang.Object circuitId)`
    `void` | `setConnectionModified(boolean connectionModified)` Было ли соединение начато/остановлено при обработке данного `request`.
    `void` | `setContractId(int contractId)`
    `void` | `setIpAddress(byte[] ipAddress)`
    `void` | `setIpResourceId(int ipResourceId)`
    `void` | `setSkip(boolean dismiss)`

    - ### Methods inherited from class ru.bitel.bgbilling.kernel.network.processor.ProcessorRequest

      `send`

    - ### Methods inherited from class ru.bitel.common.worker.WorkerTask

      `newBlockingFixedThreadPool, newFixedThreadPool, newFixedThreadPool, newScheduledThreadPool, run, runSync, runSync, setContext`

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

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

    - ### Methods inherited from interface java.lang.Runnable

      `run`

- - ### Field Detail

    - #### logger

          protected static final org.apache.log4j.Logger logger

    - #### loggerUpdate

          protected static final org.apache.log4j.Logger loggerUpdate

    - #### processor

          protected final RadiusProcessor<?,N extends ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?>,?> processor

    - #### overloadLevel

          protected final int overloadLevel

    - #### request

          protected RadiusPacket request

    - #### radiusSession

          protected RadiusSession<N extends ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?>,?> radiusSession

    - #### nas

          protected N extends ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?> nas

    - #### agentDeviceId

          protected int agentDeviceId

    - #### agentDevice

          protected java.lang.Object agentDevice

    - #### accessCode

          protected int accessCode

    - #### ipAddress

          protected byte[] ipAddress

    - #### ipResourceId

          protected int ipResourceId

    - #### response

          protected RadiusPacket response

    - #### worker

          protected static final java.lang.ThreadLocal<RadiusListenerWorker<?>> worker

  - ### Constructor Detail

    - #### RadiusListenerWorker

          public RadiusListenerWorker(RadiusListener<N> listener,
                                      java.net.SocketAddress clientAddress,
                                      long millis,
                                      java.nio.ByteBuffer data,
                                      int overloadLevel)

  - ### Method Detail

    - #### getAgentDeviceId

          public int getAgentDeviceId()

    - #### setAgentDeviceId

          public void setAgentDeviceId(int agentDeviceId)

    - #### getAgentDevice

          public java.lang.Object getAgentDevice()

    - #### setAgentDevice

          public void setAgentDevice(java.lang.Object agentDevice)

    - #### isConnectionModified

          public boolean isConnectionModified()

      Было ли соединение начато/остановлено при обработке данного `request`.

    - #### setConnectionModified

          public void setConnectionModified(boolean connectionModified)

      Было ли соединение начато/остановлено при обработке данного `request`.

    - #### getIpAddress

          public byte[] getIpAddress()

    - #### setIpAddress

          public void setIpAddress(byte[] ipAddress)

    - #### getIpResourceId

          public int getIpResourceId()

    - #### setIpResourceId

          public void setIpResourceId(int ipResourceId)

    - #### getCircuitId

          public java.lang.Object getCircuitId()

    - #### setCircuitId

          public void setCircuitId(java.lang.Object circuitId)

    - #### runImpl

          public void runImpl()

      Specified by:
        `runImpl` in class `ru.bitel.common.worker.WorkerTask<RadiusListenerWorkerContext>`

    - #### accessRequest0

          protected void accessRequest0(N nas,
                                        RadiusPacket request,
                                        RadiusPacket response,
                                        ConnectionSet connectionSet,
                                        java.util.Date time)
                                 throws ru.bitel.bgbilling.common.BGException,
                                        java.security.InvalidKeyException,
                                        java.security.NoSuchAlgorithmException,
                                        java.io.IOException

      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.security.InvalidKeyException`
        `java.security.NoSuchAlgorithmException`
        `java.io.IOException`

    - #### accessRequest

          protected void accessRequest(N nas,
                                       RadiusPacket request,
                                       RadiusPacket response,
                                       ConnectionSet connectionSet,
                                       java.util.Date time)
                                throws ru.bitel.bgbilling.common.BGException,
                                       java.security.InvalidKeyException,
                                       java.security.NoSuchAlgorithmException,
                                       java.io.IOException

      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.security.InvalidKeyException`
        `java.security.NoSuchAlgorithmException`
        `java.io.IOException`

    - #### accountingRequest

          protected void accountingRequest(N nas,
                                           RadiusPacket request,
                                           RadiusPacket response,
                                           ConnectionSet connectionSet,
                                           java.util.Date time)
                                    throws ru.bitel.bgbilling.common.BGException,
                                           java.security.InvalidKeyException,
                                           java.security.NoSuchAlgorithmException,
                                           java.io.IOException

      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.security.InvalidKeyException`
        `java.security.NoSuchAlgorithmException`
        `java.io.IOException`

    - #### sendReponse

          protected java.nio.ByteBuffer sendReponse(N nas,
                                                    RadiusPacket response)
                                             throws java.security.InvalidKeyException,
                                                    java.security.NoSuchAlgorithmException,
                                                    java.io.IOException

      Throws:
        `java.security.InvalidKeyException`
        `java.security.NoSuchAlgorithmException`
        `java.io.IOException`

    - #### getConext

          public ru.bitel.bgbilling.kernel.container.managed.ServerContext getConext()

    - #### getRadiusSession

          public RadiusSession<N,?> getRadiusSession()

    - #### getRequest

          public RadiusPacket getRequest()

    - #### getResponse

          public RadiusPacket getResponse()

    - #### setContractId

          public void setContractId(int contractId)

    - #### getContractId

          public int getContractId()

    - #### isSkip

          public boolean isSkip()

    - #### setSkip

          public void setSkip(boolean dismiss)