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 TypeMethodDescriptionvoidaddReceiver(String receiverID, TNCEventReceiverIfc receiver) Adds a receiver without subscribing to any tests This method adds a receiver to the sender.voidaddReceiver(String receiverID, TNCEventReceiverIfc receiver, boolean subForAllTests) Adds a receiver with optional subscription to events.voidbulkEvents(String receiverID, List<BaseEventIfc> events) Sends bulk events to the specified receiver identified by recieverID.voidclear()voidfreeUpTestResources(String testId, boolean removeTestListeners) Frees up resources associated with a test identified by the given test ID.booleanhasHistoricEvents(String testId) Checks whether there are historic events associated with the specified test ID.booleanisReceiverValid(String receiverId) This method checks if the receiver still exists with Admin Servervoidvoidvoidvoidprotected voidnewTestSubscriberAdded(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.voidnodeOutputFileAvailable(NodeOutputFileAvailableEvent nodeOutputFileAvailable) Sends an event when there are output files available for a node to the associated receivers.voidnodeStatisticsChange(List<NodeUpdateEvent> nodeData) Notifies the receivers about changes in node statistics based on the given list of NodeUpdateEvent instances.voidnodeStatusChange(NodeStatusUpdateEventIfc nodeStatus) Sends node status changes to the associated receivers.booleanremoveReceiver(String receiverID) Removes a receiver identified by the given receiver ID.protected voidremoveTestListener(String testId) voidsubscribeForTest(String receiverID, String testID) Subscribes a receiver to receive events for a specific test.voidNotifies that a test is about to timeout to the associated receivers.voidtestStatusChange(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:
addReceiverin 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:
addReceiverin 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:
subscribeForTestin 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:
nodeStatisticsChangein interfaceTNCEventSenderIfc- Parameters:
nodeData- A list of NodeUpdateEvent instances representing the updated node statistics.
-
nodeStatusChange
Description copied from interface:TNCEventSenderIfcSends node status changes to the associated receivers.- Specified by:
nodeStatusChangein interfaceTNCEventSenderIfc- Parameters:
nodeStatus- The NodeStatusUpdateEventIfc object representing the updated node status.
-
testStatusChange
Description copied from interface:TNCEventSenderIfcSends test status changes to the associated receivers.- Specified by:
testStatusChangein interfaceTNCEventSenderIfc- Parameters:
testStatus- The TestStatusChangeEventIfc object representing the updated test status.
-
nodeOutputFileAvailable
Description copied from interface:TNCEventSenderIfcSends an event when there are output files available for a node to the associated receivers.- Specified by:
nodeOutputFileAvailablein interfaceTNCEventSenderIfc- Parameters:
nodeOutputFileAvailable- The NodeOutputFileAvailableEvent object representing the output file data
-
testAboutToTimeout
Description copied from interface:TNCEventSenderIfcNotifies that a test is about to timeout to the associated receivers.- Specified by:
testAboutToTimeoutin interfaceTNCEventSenderIfc- Parameters:
event- The TestTimeoutReminderEvent containing information about the test about to timeout.
-
bulkEvents
Description copied from interface:TNCEventSenderIfcSends bulk events to the specified receiver identified by recieverID.- Specified by:
bulkEventsin 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:TNCEventSenderIfcFrees up resources associated with a test identified by the given test ID.- Specified by:
freeUpTestResourcesin 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:TNCEventSenderIfcChecks whether there are historic events associated with the specified test ID.- Specified by:
hasHistoricEventsin interfaceTNCEventSenderIfc- Parameters:
testId- The unique identifier of the test to check for historic events.- Returns:
trueif there are historic events for the given test ID;falseotherwise.
-
clear
public void clear() -
logInfo
-
logInfo
-
logDebug
-
logDebug
-