AXL RADIUS Server API V3

com.theorem.radserver3
Class ProxyClient

Object
  extended byProxyClient

public final class ProxyClient
extends Object

The ProxyClient class is used within the server to send additional packets from the server.

This is probably not the class you're looking for to forward packets to another server. This must not to be used for the general proxying of RADIUS packets. The server can proxy packets automatically using ProxyTarget or you can alter packet routing using ProxyImpl for rule based routing..

Normally the server will only process the single packet that's received. This class allows most implementations to send packets in addition to the one received. The new packet may be destined for the current server and need not be of the same type or have the same contents as the original packet.

Note: The ProxyClient class should NOT be used as a substitute for typical packet forwarding. This is to be used only in unusual cases as it ties up a session for the entire round trip time. It is not be used to forward packets that could be forwarded by normal server operations.

This differs from the RADIUSClient which is a stand alone client. The behavior within the server is different that of the RADIUSClient in that the packet must be returned to the server's port. The RADIUSClient will use a free port and therefore the server will never receive a packet from a RADIUSClient. The ProxyClient provides for proper encodings and the smooth flow of a new packet though the server..

An example of use might be to send redundant accounting packets to several servers. Another example might be to send packets to different servers for fail-over.

The new packet is derived from the original packet being handled by the implementation. That is to say the packet will appear to have come from the original client. This is not as restrictive as it appears since the packet is always forwarded as a proxy packet. Therefore the packet will be returned to the server that sent it and may be sent back to the original client if not captured by the ProxyImpl class.

Here's an example using a redundant accounting packet: The accounting packet arrives at the RADIUS server. AccountingImpl create a duplicate set of attributes. The packet must go to two servers - the local server and a server called DUPACCT. The AccountingImpl immediately uses the ProxyClient to forward the packet to the DUPACCT proxy target as well as performs the accounting locally.

The ProxyImpl class may have to capture the duplicate response packet from DUPACCT. This can be done by setting the Proxy-State object to something like a new Boolean(true) to indicate it's a duplicate response. The ProxyImpl class looks for a Proxy-State object, and if it exists and is a Boolean it will discard the packet.

Here's an example of the ProxyImpl extension ProxyFailover.java and it's ProxyPacketTimeout.java. This example shows how to use a list of servers to try each in succession until one answers. If an answer is received the server cancels further attempts.

Another example of ProxyClient usage is based on the ProxyFailover. In the event of a connection that results in a multi-part session (using Access-Challenge) it will send subsequent requests to the server that replied. See ProxyFailover2.java

A ProxyClient is created by PacketInfo.getProxyClient().

Since:
3.22
See Also:
ProxyInfo, ProxyImpl, AccessImpl, AccountingImpl, RADIUSClient

Method Summary
 void send(String realm)
          Send the packet to a realm.
 void send(String realm, Object proxyStateObject)
          Send a packet to a realm with a particular proxy state object.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

send

public void send(String realm)
          throws RADIUSServerException
Send the packet to a realm.

After the send is completed the original RADIUS request packet is dropped since another server is handling the response.

Parameters:
realm - Proxy realm or null. If null the User-Name attribute will be used to determine the realm. The realm may be the local server or another server's realm. The realm may also be set to the local host's realm. If there is no realm and no User-Name realm the packet is handled by the local server. The realm must be defined in a ProxyTarget object known to the server including it's own name.
Throws:
RADIUSServerException - if the realm doesn't exist or the ProxyTarget for the realm has been removed or there was an error sending the packet.
See Also:
ProxyTarget

send

public void send(String realm,
                 Object proxyStateObject)
          throws RADIUSServerException
Send a packet to a realm with a particular proxy state object.

After the send is completed the original RADIUS request packet is dropped since another server is handling the response.

Parameters:
realm - Proxy realm or null. If null the User-Name attribute will be used to determine the realm. The realm may be the local server or another server's realm. The realm may also be set to the local host's realm. If there is no realm and no User-Name realm the packet is handled by the local server. The realm must be defined in a ProxyTarget object known to the server.
proxyStateObject - The object associated with this proxy state. If an object is assigned in the send() method it will override any assigned in the method @link ProxyInfo#getProxyClient(boolean response, int radiusPacketType, AttributeList attrList, String realm, Object proxyStateObject) ProxyInfo,getProxyClient()}.
Throws:
RADIUSServerException - if the realm doesn't exist or the ProxyTarget for the realm has been removed or there was an error sending the packet. This is also thrown if the RADIUS server has run out of sessions to allocate to ProxyClient.

AXL RADIUS Server API V3

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.