fr.dyade.aaa.agent
Class UDPNetwork

java.lang.Object
  extended by fr.dyade.aaa.agent.Network
      extended by fr.dyade.aaa.agent.UDPNetwork
All Implemented Interfaces:
MessageConsumer, NetworkMBean, UDPNetworkMBean

public class UDPNetwork
extends Network
implements UDPNetworkMBean


Nested Class Summary
(package private)  class UDPNetwork.DatagramOutputStream
          Class used to send messages with UDP packets.
(package private)  class UDPNetwork.MessageAndIndex
          A particular structure used to remember: the sent message.
(package private)  class UDPNetwork.MessageBuilder
          Class used to transform UDP packets into a stream, to build the messages.
(package private)  class UDPNetwork.NetServerIn
           
(package private)  class UDPNetwork.NetServerOut
           
(package private)  class UDPNetwork.NetworkInputStream
           
(package private)  class UDPNetwork.ServerInfo
          Structure storing details about a particular remote network.
static interface UDPNetwork.ServerInfoMBean
           
(package private)  class UDPNetwork.WatchDog
           
 
Nested classes/interfaces inherited from class fr.dyade.aaa.agent.Network
Network.NetworkAverageLoadTask
 
Field Summary
(package private) static int DATAGRAM_MAX_SIZE
          The maximum number of bytes of one datagram
private  UDPNetwork.NetServerIn netServerIn
          Input component
private  UDPNetwork.NetServerOut netServerOut
          Output component
private  java.util.Hashtable serversInfo
          An hashtable linking a socket address to some information about datagrams sent/received/acked
private  java.net.DatagramSocket socket
          A socket used to send and receive datagrams
private  int socketReceiveBufferSize
          Value of the SO_RCVBUF option for the DatagramSocket, that is the buffer size used by the platform for input on the DatagramSocket.
private  int socketSendBufferSize
          Value of the SO_SNDBUF option for the DatagramSocket, that is the buffer size used by the platform for output on the DatagramSocket
(package private)  UDPNetwork.WatchDog watchDog
           
 
Fields inherited from class fr.dyade.aaa.agent.Network
ALREADY_DELIVERED, averageLoadTask, bootTSFN, DELIVER, domain, idxLS, logmon, name, nbMessageIn, nbMessageOut, port, qout, servers, serversFN, sid, WDActivationPeriod, WDNbRetryLevel1, WDNbRetryLevel2, WDRetryPeriod1, WDRetryPeriod2, WDRetryPeriod3
 
Constructor Summary
UDPNetwork()
           
 
Method Summary
private  java.lang.String getMBeanName(java.lang.String socketAddress)
           
 int getSocketReceiveBufferSize()
           
 int getSocketSendBufferSize()
           
 void init(java.lang.String name, int port, short[] servers)
          Initializes a new network component.
 boolean isRunning()
          Tests if the engine is alive.
 void start()
          Causes this engine to begin execution
 void stop()
          Forces the engine to stop executing
 
Methods inherited from class fr.dyade.aaa.agent.Network
addServer, delete, deliver, delServer, getAverageLoad1, getAverageLoad15, getAverageLoad5, getBootTS, getDomainName, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getPort, getQueue, getStamp, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, index, insert, post, resetServer, restore, save, setPort, setProperties, setStamp, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, testBootTS, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.dyade.aaa.agent.NetworkMBean
getAverageLoad1, getAverageLoad15, getAverageLoad5, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, toString
 

Field Detail

DATAGRAM_MAX_SIZE

static final int DATAGRAM_MAX_SIZE
The maximum number of bytes of one datagram

See Also:
Constant Field Values

netServerIn

private UDPNetwork.NetServerIn netServerIn
Input component


netServerOut

private UDPNetwork.NetServerOut netServerOut
Output component


serversInfo

private java.util.Hashtable serversInfo
An hashtable linking a socket address to some information about datagrams sent/received/acked


watchDog

UDPNetwork.WatchDog watchDog

socket

private java.net.DatagramSocket socket
A socket used to send and receive datagrams


socketReceiveBufferSize

private int socketReceiveBufferSize
Value of the SO_RCVBUF option for the DatagramSocket, that is the buffer size used by the platform for input on the DatagramSocket.


socketSendBufferSize

private int socketSendBufferSize
Value of the SO_SNDBUF option for the DatagramSocket, that is the buffer size used by the platform for output on the DatagramSocket

Constructor Detail

UDPNetwork

public UDPNetwork()
Method Detail

isRunning

public boolean isRunning()
Description copied from interface: NetworkMBean
Tests if the engine is alive.

Specified by:
isRunning in interface MessageConsumer
Specified by:
isRunning in interface NetworkMBean
Returns:
true if this MessageConsumer is alive; false otherwise.

init

public void init(java.lang.String name,
                 int port,
                 short[] servers)
          throws java.lang.Exception
Description copied from class: Network
Initializes a new network component. This method is used in order to easily creates and configure a Network component from a class name. So we can use the Class.newInstance() method for create (without any parameter) the component, then we can initialize it with this method.
This method initializes the logical clock for the domain.

Overrides:
init in class Network
Parameters:
name - The domain name.
port - The listen port.
servers - The list of servers directly accessible from this network interface.
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Description copied from interface: NetworkMBean
Causes this engine to begin execution

Specified by:
start in interface MessageConsumer
Specified by:
start in interface NetworkMBean
Throws:
java.lang.Exception
See Also:
stop

stop

public void stop()
Description copied from interface: NetworkMBean
Forces the engine to stop executing

Specified by:
stop in interface MessageConsumer
Specified by:
stop in interface NetworkMBean
See Also:
start

getMBeanName

private java.lang.String getMBeanName(java.lang.String socketAddress)

getSocketReceiveBufferSize

public int getSocketReceiveBufferSize()
                               throws java.net.SocketException
Specified by:
getSocketReceiveBufferSize in interface UDPNetworkMBean
Throws:
java.net.SocketException

getSocketSendBufferSize

public int getSocketSendBufferSize()
                            throws java.net.SocketException
Specified by:
getSocketSendBufferSize in interface UDPNetworkMBean
Throws:
java.net.SocketException


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.