Class TNCEventSender
java.lang.Object
com.nt.udc.testnodechain.callbacks.TNCEventSender
- All Implemented Interfaces:
TNCEventSenderIfc
,Serializable
- Direct Known Subclasses:
TNCCallbackHandler
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addReceiver
(String receiverID, TNCEventReceiverIfc receiver) Adds a receiver without subscribing to any tests This method adds a receiver to the sender.void
addReceiver
(String receiverID, TNCEventReceiverIfc receiver, boolean subForAllTests) Adds a receiver with optional subscription to events.void
bulkEvents
(String receiverID, List<BaseEventIfc> events) Sends bulk events to the specified receiver identified by recieverID.void
clear()
void
freeUpTestResources
(String testId, boolean removeTestListeners) Frees up resources associated with a test identified by the given test ID.boolean
hasHistoricEvents
(String testId) Checks whether there are historic events associated with the specified test ID.boolean
isReceiverValid
(String receiverId) This method checks if the receiver still exists with Admin Servervoid
void
void
void
protected void
newTestSubscriberAdded
(String receiverID, String testID) This method is called when a new test subscriber is added, providing information about the receiver ID and the associated test ID.void
nodeOutputFileAvailable
(NodeOutputFileAvailableEvent nodeOutputFileAvailable) Sends an event when there are output files available for a node to the associated receivers.void
nodeStatisticsChange
(List<NodeUpdateEvent> nodeData) Notifies the receivers about changes in node statistics based on the given list of NodeUpdateEvent instances.void
nodeStatusChange
(NodeStatusUpdateEventIfc nodeStatus) Sends node status changes to the associated receivers.boolean
removeReceiver
(String receiverID) Removes a receiver identified by the given receiver ID.protected void
removeTestListener
(String testId) void
subscribeForTest
(String receiverID, String testID) Subscribes a receiver to receive events for a specific test.void
Notifies that a test is about to timeout to the associated receivers.void
testStatusChange
(TestStatusChangeEventIfc testStatus) Sends test status changes to the associated receivers.
-
Field Details
-
logger
-
receiverManager
-
-
Constructor Details
-
TNCEventSender
-
-
Method Details
-
addReceiver
Adds a receiver without subscribing to any tests This method adds a receiver to the sender. The receiver is not subscribed to any test- Specified by:
addReceiver
in interfaceTNCEventSenderIfc
- Parameters:
receiverID
- The unique identifier for the receiver to be added.receiver
- An object implementing the TNCEventReceiverIfc interface to be added as a receiver.
-
addReceiver
Adds a receiver with optional subscription to events. This method adds a receiver to the sender, associating it with the provided receiver ID. Optionally, the receiver can be subscribed to events for all tests if the 'subForAllTests' parameter is set to true.- Specified by:
addReceiver
in interfaceTNCEventSenderIfc
- Parameters:
receiverID
- The unique identifier for the receiver to be added.receiver
- An object implementing the TNCEventReceiverIfc interface to be added as a receiver.subForAllTests
- A boolean flag indicating whether the receiver should be subscribed to events for all tests.
-
isReceiverValid
This method checks if the receiver still exists with Admin Server- Parameters:
receiverId
- Unique identifier for connection between RSM and AdminServer- Returns:
-
newTestSubscriberAdded
This method is called when a new test subscriber is added, providing information about the receiver ID and the associated test ID.- Parameters:
receiverID
- The identifier of the new test subscriber.testID
- The unique identifier of the test associated with the new subscriber.
-
subscribeForTest
Subscribes a receiver to receive events for a specific test. This method is responsible for subscribing a receiver identified by the provided receiver ID to receive events associated with the specified test identified by the given test ID.- Specified by:
subscribeForTest
in interfaceTNCEventSenderIfc
- Parameters:
receiverID
- The unique identifier of the receiver to be subscribed.testID
- The unique identifier of the test for which the receiver is subscribing.
-
nodeStatisticsChange
Notifies the receivers about changes in node statistics based on the given list of NodeUpdateEvent instances. This method broadcasts the node statistics changes to registered receivers associated with specific tests and broadcast receivers.- Specified by:
nodeStatisticsChange
in interfaceTNCEventSenderIfc
- Parameters:
nodeData
- A list of NodeUpdateEvent instances representing the updated node statistics.
-
nodeStatusChange
Description copied from interface:TNCEventSenderIfc
Sends node status changes to the associated receivers.- Specified by:
nodeStatusChange
in interfaceTNCEventSenderIfc
- Parameters:
nodeStatus
- The NodeStatusUpdateEventIfc object representing the updated node status.
-
testStatusChange
Description copied from interface:TNCEventSenderIfc
Sends test status changes to the associated receivers.- Specified by:
testStatusChange
in interfaceTNCEventSenderIfc
- Parameters:
testStatus
- The TestStatusChangeEventIfc object representing the updated test status.
-
nodeOutputFileAvailable
Description copied from interface:TNCEventSenderIfc
Sends an event when there are output files available for a node to the associated receivers.- Specified by:
nodeOutputFileAvailable
in interfaceTNCEventSenderIfc
- Parameters:
nodeOutputFileAvailable
- The NodeOutputFileAvailableEvent object representing the output file data
-
testAboutToTimeout
Description copied from interface:TNCEventSenderIfc
Notifies that a test is about to timeout to the associated receivers.- Specified by:
testAboutToTimeout
in interfaceTNCEventSenderIfc
- Parameters:
event
- The TestTimeoutReminderEvent containing information about the test about to timeout.
-
bulkEvents
Description copied from interface:TNCEventSenderIfc
Sends bulk events to the specified receiver identified by recieverID.- Specified by:
bulkEvents
in interfaceTNCEventSenderIfc
- Parameters:
receiverID
- The unique identifier of the receiver for which the bulk events are sent.events
- A List of BaseEventIfc objects representing the bulk events to be sent.
-
removeReceiver
Removes a receiver identified by the given receiver ID. This method is responsible for removing a receiver from the system based on the provided receiver ID.- Parameters:
receiverID
- The unique identifier of the receiver to be removed.
-
removeTestListener
-
freeUpTestResources
Description copied from interface:TNCEventSenderIfc
Frees up resources associated with a test identified by the given test ID.- Specified by:
freeUpTestResources
in interfaceTNCEventSenderIfc
- Parameters:
testId
- The unique identifier of the test whose resources should be freed up.removeTestListeners
- A boolean flag indicating whether to remove test listeners associated with the test. If set totrue
, the test listeners will be removed; otherwise, they will be retained.
-
hasHistoricEvents
Description copied from interface:TNCEventSenderIfc
Checks whether there are historic events associated with the specified test ID.- Specified by:
hasHistoricEvents
in interfaceTNCEventSenderIfc
- Parameters:
testId
- The unique identifier of the test to check for historic events.- Returns:
true
if there are historic events for the given test ID;false
otherwise.
-
clear
public void clear() -
logInfo
-
logInfo
-
logDebug
-
logDebug
-