public class UdpEITransport extends EITransport
DatagramPacket
objects. Each packet will be placed within a
QueuedUdpPacket
object and stored in a queue until the
transport's DataReceiver requests data via the getData()
or
getBulkData()
method. At that time, a
QueuedUdpPacket
is popped off the queue and given to the
transport's DCRecordFactoryIfc
object via the factory's
getRecords()
method. The DCFieldContainer
objects returned from the factory will then be supplied to the DataReceiver.dataReceiver, fdChecked, filedataReceiver, fileduplicateCheck, fileToProcess, inputCount, lockFile, movedFile, node, pollingInterval, processing, processingData, running
Constructor and Description |
---|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
int prt)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
int prt,
int pktSize)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
int prt,
int pktSize,
int socketBufSize)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
ResponseDatagramFactory responseFactory,
int prt,
int pktSize)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
ResponseDatagramFactory responseFactory,
java.lang.String host,
int prt,
int pktSize)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
ResponseDatagramFactory responseFactory,
java.lang.String host,
int prt,
int pktSize,
int idleRecWriteTime)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
ResponseDatagramFactory responseFactory,
java.lang.String host,
int prt,
int pktSize,
int idleRecWriteTime,
int socketBufSize)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
java.lang.String host,
int prt)
Construct a new UdpEITransport to be used within the specified EINode.
|
UdpEITransport(EINode einode,
DCRecordFactoryIfc factory,
java.lang.String host,
int prt,
int pktSize)
Construct a new UdpEITransport to be used within the specified EINode.
|
Modifier and Type | Method and Description |
---|---|
void |
beginReconfigure()
Sets this transport into a reconfiguration state.
|
void |
endReconfigure()
Ends reconfiguration state, allowing data to be accessed again.
|
DCFieldContainer[] |
getBulkData()
This method is used by the DataReceiver to fetch a set of
DCFieldContainer objects.
|
DCFieldContainer |
getData()
This method is used by the DataReceiver to fetch a single
|
protected void |
initMesManager(int idleRecWriteTime) |
boolean |
isDataAvailable()
This method is used by the DataReceiver to ask this provider if
data is available.
|
boolean |
isHealthy()
This method is used to check if the transport is fully functional.
|
boolean |
isReconfiguring()
Returns value of reconfiguring flag.
|
boolean |
isShutdownOnError()
Indicates whether transport should shutdown upon processing error
|
void |
reconfigure(DCRecordFactoryIfc factory,
ResponseDatagramFactory responseFactory,
int radius_port)
Reconfigures the record factory and queue size of this UDP transport.
|
void |
reconfigure(DCRecordFactoryIfc factory,
ResponseDatagramFactory responseFactory,
int port,
int idleRecWrTime) |
void |
resetLoggingState()
Resets state for conditionally logged messages.
|
void |
run()
This method is used when the EITransport runs within its own thread.
|
void |
send(java.net.DatagramPacket response)
This method is used to send the given datagram packet back to
the originator of the incoming data.
|
void |
setShutdownOnError(boolean flag)
Indicates whether transport should shutdown upon processing error
|
void |
shutdown()
Stop the transport.
|
getDataReceiver, getDubCheckObj, getDupCheckFlag, getFileBulkData, getFileData, getFileDataReceiver, getMovedFileStatus, getNode, getPollingInterval, handleRejectOfFile, incrementIn, incrementIn, isEndOfFile, isFileDataAvailable, isProcessing, isProcessingData, isStartOfFile, openInputFile, rejectFile, setCountsSuspect, setDataReceiver, setFileDataReceiver, setFileToProcess, setMovedFileStatus, setNode, setPollingInterval, setProcessing
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, int prt) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.prt
- The port number to listen onNodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, java.lang.String host, int prt) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.host
- The host name / IP address to listen toprt
- The port number to listen onNodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, int prt, int pktSize) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.prt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)NodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, int prt, int pktSize, int socketBufSize) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.prt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)socketBufSize
- Socket buffer size (default 65536)NodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, ResponseDatagramFactory responseFactory, int prt, int pktSize) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.prt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)NodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, java.lang.String host, int prt, int pktSize) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.host
- The host name / IP address to listen toprt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)NodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, ResponseDatagramFactory responseFactory, java.lang.String host, int prt, int pktSize) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.responseFactory
- Factory object to construct the response datagramhost
- The host name / IP address to listen toprt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)NodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, ResponseDatagramFactory responseFactory, java.lang.String host, int prt, int pktSize, int idleRecWriteTime) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.responseFactory
- Factory object to construct the response datagramhost
- The host name / IP address to listen toprt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)idleRecWriteTime
- Idle record write time is made configurable (default 10 seconds)NodeStartException
public UdpEITransport(EINode einode, DCRecordFactoryIfc factory, ResponseDatagramFactory responseFactory, java.lang.String host, int prt, int pktSize, int idleRecWriteTime, int socketBufSize) throws NodeStartException
einode
- Reference to the EINode containing the transportfactory
- DCRecordFactoryIfc() object used to generate the
desired EIRecord() objects.responseFactory
- Factory object to construct the response datagramhost
- The host name / IP address to listen toprt
- The port number to listen onpktSize
- Number of bytes in a data 'packet' (default 4096)idleRecWriteTime
- Idle record write time is made configurable (default 10 seconds)socketBufSize
- Socket buffer size (default 65536)NodeStartException
protected void initMesManager(int idleRecWriteTime)
public boolean isDataAvailable()
isDataAvailable
in interface DataProviderIfc
isDataAvailable
in class EITransport
true
, if data is availablepublic DCFieldContainer getData()
EITransport
getData
in interface DataProviderIfc
getData
in class EITransport
public DCFieldContainer[] getBulkData()
EITransport
getBulkData
in interface DataProviderIfc
getBulkData
in class EITransport
public void run()
DatagramPacket
object that is received will be
placed in a QueuedUdpPacket
object and stored in a queue
until the data is requested by the transport's DataReceiver.run
in interface java.lang.Runnable
run
in class EITransport
public void shutdown()
shutdown
in interface DCTransport
shutdown
in class EITransport
public boolean isShutdownOnError()
public void setShutdownOnError(boolean flag)
flag
- true
, if error should cause a shutdown.
Default is false
.public void send(java.net.DatagramPacket response)
response
- The datagram packet to be sentpublic void beginReconfigure()
isDataAvailable()
will always return false
and getData()
and getBulkData()
will always
return null while this transport is being reconfigured. Packets will
still be read off the line while the transport is reconfigured.public void endReconfigure()
public boolean isReconfiguring()
public void reconfigure(DCRecordFactoryIfc factory, ResponseDatagramFactory responseFactory, int radius_port)
factory
- DCRecordFactoryIfc object used to generate the
desired EI record objectsresponseFactory
- radius_port
- The Radius port numberpublic void reconfigure(DCRecordFactoryIfc factory, ResponseDatagramFactory responseFactory, int port, int idleRecWrTime)
public boolean isHealthy()
isHealthy
in interface DCTransport
isHealthy
in class EITransport
public void resetLoggingState()
clearStatus()
method.