ru.bitel.bgbilling.kernel.network.radius

## Class RadiusClient

- java.lang.Object
- - ru.bitel.bgbilling.kernel.network.radius.RadiusClient

- Direct Known Subclasses:
    PodSupport

      public class RadiusClient
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RadiusClient.ResponseFuture<V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RadiusClient(java.net.InetAddress host, int port, byte[] secret)`
    `RadiusClient(java.net.InetAddress host, int port, byte[] secret, Setup setup, ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger, boolean logCoA, boolean logPoD)`
    `RadiusClient(int sourcePort, java.net.InetAddress host, int port, byte[] secret)` Deprecated.
    `RadiusClient(int sourcePort, java.net.InetAddress host, int port, byte[] secret, Setup setup, ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger, boolean logCoA, boolean logPoD)` Deprecated.
    `RadiusClient(java.lang.String sourceHost, int sourcePort, java.net.InetAddress host, int port, byte[] secret)`
    `RadiusClient(java.lang.String sourceHost, int sourcePort, java.net.InetAddress host, int port, byte[] secret, Setup setup, ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger, boolean logCoA, boolean logPoD)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `beforeReceive(java.nio.ByteBuffer bb)`
    `RadiusPacket` | `createAccountingRequest()`
    `RadiusPacket` | `createDisconnectRequest()`
    `RadiusPacket` | `createModifyRequest()`
    `RadiusPacket` | `createRequest(byte code)`
    `void` | `destroy()`
    `protected void` | `finalize()`
    `RadiusPacket` | `request(RadiusPacket packet)`
    `RadiusPacket` | `request(RadiusPacket packet, long timeout, java.util.concurrent.TimeUnit unit)`
    `boolean` | `send(RadiusPacket packet)`
    `boolean` | `send(RadiusPacket packet, long timeout, java.util.concurrent.TimeUnit unit)`
    `java.util.concurrent.Future<java.lang.Boolean>` | `sendAsync(RadiusPacket packet)`
    `void` | `setConnectionId(long connectionId)`
    `void` | `setNas(Idable nas)`
    `void` | `setReuseAddress(boolean reuseAddress)`
    `protected int` | `writeRequestLog(RadiusPacket packet, java.nio.ByteBuffer data, java.util.Date time)`
    `protected void` | `writeResponseLog(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, RadiusPacket packet, java.nio.ByteBuffer data, java.util.Date time, int deviceId, int connectionLogEntryId)`

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

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

- - ### Constructor Detail

    - #### RadiusClient

          public RadiusClient(java.net.InetAddress host,
                              int port,
                              byte[] secret)

    - #### RadiusClient

          @Deprecated
          public RadiusClient(int sourcePort,
                                          java.net.InetAddress host,
                                          int port,
                                          byte[] secret)

      Deprecated.

    - #### RadiusClient

          public RadiusClient(java.lang.String sourceHost,
                              int sourcePort,
                              java.net.InetAddress host,
                              int port,
                              byte[] secret)

    - #### RadiusClient

          public RadiusClient(java.net.InetAddress host,
                              int port,
                              byte[] secret,
                              Setup setup,
                              ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger,
                              boolean logCoA,
                              boolean logPoD)

    - #### RadiusClient

          @Deprecated
          public RadiusClient(int sourcePort,
                                          java.net.InetAddress host,
                                          int port,
                                          byte[] secret,
                                          Setup setup,
                                          ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger,
                                          boolean logCoA,
                                          boolean logPoD)

      Deprecated.

    - #### RadiusClient

          public RadiusClient(java.lang.String sourceHost,
                              int sourcePort,
                              java.net.InetAddress host,
                              int port,
                              byte[] secret,
                              Setup setup,
                              ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger,
                              boolean logCoA,
                              boolean logPoD)

  - ### Method Detail

    - #### setReuseAddress

          public void setReuseAddress(boolean reuseAddress)

    - #### createRequest

          public RadiusPacket createRequest(byte code)

    - #### createAccountingRequest

          public RadiusPacket createAccountingRequest()

    - #### createModifyRequest

          public RadiusPacket createModifyRequest()

    - #### createDisconnectRequest

          public RadiusPacket createDisconnectRequest()

    - #### send

          public boolean send(RadiusPacket packet)
                       throws java.security.InvalidKeyException,
                              java.net.SocketException,
                              java.security.NoSuchAlgorithmException,
                              java.lang.InterruptedException,
                              java.util.concurrent.ExecutionException,
                              java.util.concurrent.TimeoutException

      Throws:
        `java.security.InvalidKeyException`
        `java.net.SocketException`
        `java.security.NoSuchAlgorithmException`
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.util.concurrent.TimeoutException`

    - #### send

          public boolean send(RadiusPacket packet,
                              long timeout,
                              java.util.concurrent.TimeUnit unit)
                       throws java.security.InvalidKeyException,
                              java.net.SocketException,
                              java.security.NoSuchAlgorithmException,
                              java.lang.InterruptedException,
                              java.util.concurrent.ExecutionException,
                              java.util.concurrent.TimeoutException

      Throws:
        `java.security.InvalidKeyException`
        `java.net.SocketException`
        `java.security.NoSuchAlgorithmException`
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.util.concurrent.TimeoutException`

    - #### sendAsync

          public java.util.concurrent.Future<java.lang.Boolean> sendAsync(RadiusPacket packet)
                                                                   throws java.security.InvalidKeyException,
                                                                          java.net.SocketException,
                                                                          java.security.NoSuchAlgorithmException

      Throws:
        `java.security.InvalidKeyException`
        `java.net.SocketException`
        `java.security.NoSuchAlgorithmException`

    - #### request

          public RadiusPacket request(RadiusPacket packet)
                               throws java.security.InvalidKeyException,
                                      java.net.SocketException,
                                      java.security.NoSuchAlgorithmException,
                                      java.lang.InterruptedException,
                                      java.util.concurrent.ExecutionException,
                                      java.util.concurrent.TimeoutException

      Throws:
        `java.security.InvalidKeyException`
        `java.net.SocketException`
        `java.security.NoSuchAlgorithmException`
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.util.concurrent.TimeoutException`

    - #### request

          public RadiusPacket request(RadiusPacket packet,
                                      long timeout,
                                      java.util.concurrent.TimeUnit unit)
                               throws java.security.InvalidKeyException,
                                      java.net.SocketException,
                                      java.security.NoSuchAlgorithmException,
                                      java.lang.InterruptedException,
                                      java.util.concurrent.ExecutionException,
                                      java.util.concurrent.TimeoutException

      Throws:
        `java.security.InvalidKeyException`
        `java.net.SocketException`
        `java.security.NoSuchAlgorithmException`
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.util.concurrent.TimeoutException`

    - #### setNas

          public void setNas(Idable nas)

    - #### setConnectionId

          public void setConnectionId(long connectionId)

    - #### writeRequestLog

          protected int writeRequestLog(RadiusPacket packet,
                                        java.nio.ByteBuffer data,
                                        java.util.Date time)

    - #### writeResponseLog

          protected void writeResponseLog(ru.bitel.bgbilling.kernel.container.managed.ServerContext context,
                                          RadiusPacket packet,
                                          java.nio.ByteBuffer data,
                                          java.util.Date time,
                                          int deviceId,
                                          int connectionLogEntryId)

    - #### beforeReceive

          protected void beforeReceive(java.nio.ByteBuffer bb)

    - #### destroy

          public void destroy()

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `java.lang.Throwable`