public static NodeHeartbeatResponse NewNodeHeartbeatResponse(int responseId, NodeAction action, IList <ContainerId> containersToCleanUp, IList <ApplicationId> applicationsToCleanUp , MasterKey containerTokenMasterKey, MasterKey nmTokenMasterKey, long nextHeartbeatInterval ) { NodeHeartbeatResponse response = recordFactory.NewRecordInstance <NodeHeartbeatResponse >(); response.SetResponseId(responseId); response.SetNodeAction(action); response.SetContainerTokenMasterKey(containerTokenMasterKey); response.SetNMTokenMasterKey(nmTokenMasterKey); response.SetNextHeartBeatInterval(nextHeartbeatInterval); if (containersToCleanUp != null) { response.AddAllContainersToCleanup(containersToCleanUp); } if (applicationsToCleanUp != null) { response.AddAllApplicationsToCleanup(applicationsToCleanUp); } return(response); }