Package com.nt.udc.oi.node.radius
Class RadiusOITransport
java.lang.Object
com.nt.udc.ndk.node.OITransport
com.nt.udc.oi.node.radius.RadiusOITransport
- All Implemented Interfaces:
DataReceiverIfc
,DCTransport
,FileDataReceiverIfc
,Runnable
-
Field Summary
Fields inherited from class com.nt.udc.ndk.node.OITransport
dataProvider, filedataProvider, node, pollingInterval
-
Constructor Summary
ConstructorsConstructorDescriptionRadiusOITransport
(OINode oinode, Factory factory, int port, int interval, int expire) Construct a RadiusOITransport to be used within the specified OINode. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
close()
Disconnect and close the socket.protected void
connect()
Create the socket and attempt to establish a connection.void
This method allows the transport's DataProvider to tell the transport that data is waiting to be 'picked up'.Retrieve the Factory object used to create the DatagramPacketsRetrieve the DatagramSocket object used to send/receive DatagramPacketsboolean
Indicates whether this RadiusOITransport is connected to the socketboolean
Indicates whether data is available from the transport's DataProviderboolean
This method is used to check if the transport is fully functionalboolean
Indicates whether this RadiusOITransport is currently processing databoolean
Indicates whether this RadiusOITransport is runningvoid
processData
(DCFieldContainer record) Accept anOIRecord
object to be transmitted via UDP.void
processData
(DCFieldContainer[] records) Not usedprotected void
Attempt to re-establish the connection.void
run()
This method is used when the OITransport runs within its own thread.void
setFactory
(Factory factory) Set the Factory object used to create the DatagramPacketsprotected void
setProcessingData
(boolean value) Sets the boolean indicating whether the transport is currently processing data.protected void
setRunning
(boolean run) Sets the boolean which indicates whether the transport is runningvoid
shutdown()
Stop the transport.Methods inherited from class com.nt.udc.ndk.node.OITransport
fileDataIsAvailable, getDataProvider, getFileDataProvider, getNode, getPollingInterval, getRealNarsOut, incrementOut, processEndOfFileData, processFileData, processFileData, processRejectFile, processStartOfFileData, setDataProvider, setFileDataProvider, setNode, setPollingInterval, setTransactionID
-
Constructor Details
-
RadiusOITransport
public RadiusOITransport(OINode oinode, Factory factory, int port, int interval, int expire) throws NodeStartException Construct a RadiusOITransport to be used within the specified OINode. The transport will send the packets created by the Factory and listen for incoming packets on the given port.- Parameters:
oinode
- Reference to the OINode containing the transportfactory
- The Factory object used to create DatagramPackets from the incoming OIRecords.port
- The port number on which to create the socketinterval
- The number of seconds between transmit attemptsexpire
- The number of seconds after which the request has expired and attempts to transmit should cease- Throws:
NodeStartException
-
-
Method Details
-
dataIsAvailable
public void dataIsAvailable()This method allows the transport's DataProvider to tell the transport that data is waiting to be 'picked up'. It is then the responsibility of the transport to retrieve the data via the provider'sgetData()
method and process it via the receiver'sprocessData()
method.- Specified by:
dataIsAvailable
in interfaceDataReceiverIfc
- Specified by:
dataIsAvailable
in classOITransport
-
processData
Accept anOIRecord
object to be transmitted via UDP.- Specified by:
processData
in interfaceDataReceiverIfc
- Specified by:
processData
in classOITransport
- Parameters:
record
-DCFieldContainer
object containing the data.records
- AnOIRecord
object.- Throws:
NodeProcessingException
-
processData
Not used- Throws:
NodeProcessingException
-
run
public void run()This method is used when the OITransport runs within its own thread. The method contains the logic to retrieve the data from the the transport's DataProvider and hand the OIRecord() objects to the processData() method.- Specified by:
run
in interfaceRunnable
- Specified by:
run
in classOITransport
-
shutdown
public void shutdown()Stop the transport. Do not shutdown until all queued data has been processed.- Specified by:
shutdown
in interfaceDCTransport
- Specified by:
shutdown
in classOITransport
-
isHealthy
public boolean isHealthy()This method is used to check if the transport is fully functional- Specified by:
isHealthy
in interfaceDCTransport
- Overrides:
isHealthy
in classOITransport
- Returns:
- true if the transport is healthy, false otherwise
-
setFactory
Set the Factory object used to create the DatagramPackets- Parameters:
factory
- The Factory used to create the DatagramPackets
-
getFactory
Retrieve the Factory object used to create the DatagramPackets- Returns:
- The Factory used to create the DatagramPackets
-
getSocket
Retrieve the DatagramSocket object used to send/receive DatagramPackets- Returns:
- The DatagramSocket used to send/receive DatagramPackets
-
setRunning
protected void setRunning(boolean run) Sets the boolean which indicates whether the transport is running -
isRunning
public boolean isRunning()Indicates whether this RadiusOITransport is running -
isDataAvailable
public boolean isDataAvailable()Indicates whether data is available from the transport's DataProvider -
isProcessingData
public boolean isProcessingData()Indicates whether this RadiusOITransport is currently processing data -
setProcessingData
protected void setProcessingData(boolean value) Sets the boolean indicating whether the transport is currently processing data. -
isConnected
public boolean isConnected()Indicates whether this RadiusOITransport is connected to the socket -
connect
Create the socket and attempt to establish a connection.- Throws:
IOException
-
close
protected void close()Disconnect and close the socket. -
reconnect
protected void reconnect()Attempt to re-establish the connection.
-