Package ru.bitel.bgbilling.kernel.network.radius

# Class RadiusClient

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

All Implemented Interfaces:
  `AutoCloseable`

public class RadiusClient extends Object implements AutoCloseable

- ## Nested Class Summary

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

- ## Constructor Summary

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

- ## Method Summary

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

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

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

- ## Constructor Details

  - ### RadiusClient

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

  - ### RadiusClient

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

  - ### RadiusClient

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

  - ### RadiusClient

    public RadiusClient(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, 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(String sourceHost, int sourcePort, InetAddress host, int port, byte[] secret, Setup setup, ru.bitel.bgbilling.kernel.network.radius.datalog.hourly.RadiusHourlyDataLogger dataLogger, boolean logCoA, boolean logPoD)

- ## Method Details

  - ### 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 InvalidKeyException, SocketException, NoSuchAlgorithmException, InterruptedException, ExecutionException, TimeoutException
    Throws:
      `InvalidKeyException`
      `SocketException`
      `NoSuchAlgorithmException`
      `InterruptedException`
      `ExecutionException`
      `TimeoutException`

  - ### send

    public boolean send(RadiusPacket packet, long timeout, TimeUnit unit) throws InvalidKeyException, SocketException, NoSuchAlgorithmException, InterruptedException, ExecutionException, TimeoutException
    Throws:
      `InvalidKeyException`
      `SocketException`
      `NoSuchAlgorithmException`
      `InterruptedException`
      `ExecutionException`
      `TimeoutException`

  - ### sendAsync

    public Future<Boolean> sendAsync(RadiusPacket packet) throws InvalidKeyException, SocketException, NoSuchAlgorithmException
    Throws:
      `InvalidKeyException`
      `SocketException`
      `NoSuchAlgorithmException`

  - ### request

    public RadiusPacket request(RadiusPacket packet) throws InvalidKeyException, SocketException, NoSuchAlgorithmException, InterruptedException, ExecutionException, TimeoutException
    Throws:
      `InvalidKeyException`
      `SocketException`
      `NoSuchAlgorithmException`
      `InterruptedException`
      `ExecutionException`
      `TimeoutException`

  - ### request

    public RadiusPacket request(RadiusPacket packet, long timeout, TimeUnit unit) throws InvalidKeyException, SocketException, NoSuchAlgorithmException, InterruptedException, ExecutionException, TimeoutException
    Throws:
      `InvalidKeyException`
      `SocketException`
      `NoSuchAlgorithmException`
      `InterruptedException`
      `ExecutionException`
      `TimeoutException`

  - ### setNas

    public void setNas(Idable nas)

  - ### setConnectionId

    public void setConnectionId(long connectionId)

  - ### writeRequestLog

    protected int writeRequestLog(RadiusPacket packet, ByteBuffer data, Date time)

  - ### writeResponseLog

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

  - ### beforeReceive

    protected void beforeReceive(ByteBuffer bb)

  - ### destroy

    public void destroy()

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`