use of kutch.biff.marvin.utility.FrameworkNode in project Board-Instrumentation-Framework by intel.
the class TaskManager method BuildRemoteMarvinTaskItem.
private RemoteMarvinTask BuildRemoteMarvinTaskItem(String taskID, FrameworkNode taskNode) {
/**
* * Example Task
* <TaskItem Type="MarvinAdmin">
* <Task ID="TabChange"/>
* </TaskItem>
*/
String RemoteTaskID, RemoteMarvinID;
RemoteTaskID = "";
RemoteMarvinID = "";
for (FrameworkNode node : taskNode.getChildNodes()) {
if (node.getNodeName().equalsIgnoreCase("Task")) {
Utility.ValidateAttributes(new String[] { "ID" }, node);
if (node.hasAttribute("ID")) {
RemoteTaskID = node.getAttribute("ID");
} else {
LOGGER.severe("Invalid MarvinAdminTask with Task ID: " + taskID + " - no ID specified.");
return null;
}
}
if (node.getNodeName().equalsIgnoreCase("MarvinID")) {
RemoteMarvinID = node.getTextContent();
}
}
RemoteMarvinTask objTask = new RemoteMarvinTask(RemoteMarvinID, RemoteTaskID);
return objTask;
}
use of kutch.biff.marvin.utility.FrameworkNode in project Board-Instrumentation-Framework by intel.
the class TaskManager method BuildPulseTaskItem.
private PulseTask BuildPulseTaskItem(String taskID, FrameworkNode taskNode) {
/**
* * Example Task
* <TaskItem Type="Pulse">
* <MarvinDataPoint ID="Text" Namespace="PK Laptop"/>
* </TaskItem>
*/
boolean errorLogged = false;
PulseTask objPulseTask = new PulseTask();
for (FrameworkNode node : taskNode.getChildNodes()) {
if (node.getNodeName().equalsIgnoreCase("MarvinDataPoint")) {
Utility.ValidateAttributes(new String[] { "Namespace", "ID" }, node);
if (node.hasAttribute("Namespace") && node.hasAttribute("ID")) {
objPulseTask.SetNamespaceAndID(node.getAttribute("Namespace"), node.getAttribute("ID"));
} else {
LOGGER.severe("Task with ID: " + taskID + " contains an invalid Pulse Task - no Namespace and ID defined in MarvinDataPoint");
errorLogged = true;
}
}
}
if (!objPulseTask.isValid()) {
objPulseTask = null;
if (!errorLogged) {
LOGGER.severe("Task with ID: " + taskID + " contains an invalid Pulse Task - no MarvinDataPoint defined");
}
}
return objPulseTask;
}
use of kutch.biff.marvin.utility.FrameworkNode in project Board-Instrumentation-Framework by intel.
the class TaskManager method BuildMinionTaskItem.
/**
* Read the parameters from the xml file for a Minion task
*
* @param taskID ID of the task
* @param taskNode XML node
* @return A MinionTask object
*/
private MinionTask BuildMinionTaskItem(String taskID, FrameworkNode taskNode) {
/**
* * Example Task
* <TaskItem Type="Minion">
* <Actor Namespace="fubar" ID="EnableRSS"/>
* <Param>16</Param>
*/
MinionTask objMinionTask = new MinionTask();
objMinionTask.setParams(GetParameters(taskNode));
if (objMinionTask.getParams() != null && objMinionTask.getParams().size() == 0) {
// means had problem loading params.
return null;
}
for (FrameworkNode node : taskNode.getChildNodes()) {
if (node.getNodeName().equalsIgnoreCase("Actor")) {
Utility.ValidateAttributes(new String[] { "Namespace", "ID" }, node);
if (node.hasAttribute("Namespace") && node.hasAttribute("ID")) {
objMinionTask.setID(node.getAttribute("ID"));
objMinionTask.setNamespace(node.getAttribute("Namespace"));
} else {
LOGGER.severe("Task with ID: " + taskID + " contains an invalid Minion Task");
return null;
}
}
}
return objMinionTask;
}
use of kutch.biff.marvin.utility.FrameworkNode in project Board-Instrumentation-Framework by intel.
the class TaskManager method BuildMarvinAdminTaskItem.
private MarvinAdminTask BuildMarvinAdminTaskItem(String taskID, FrameworkNode taskNode) {
/**
* * Example Task
* <TaskItem Type="MarvinAdmin">
* <Task ID="TabChange" Data="DemoTab-Indicators"/>
* </TaskItem>
*/
String ID, Data;
ID = "";
Data = "";
boolean TaskFound = false;
for (FrameworkNode node : taskNode.getChildNodes()) {
if (node.getNodeName().equalsIgnoreCase("Task")) {
TaskFound = true;
Utility.ValidateAttributes(new String[] { "Data", "ID" }, node);
if (node.hasAttribute("ID")) {
ID = node.getAttribute("ID");
} else {
LOGGER.severe("Invalid MarvinAdminTask with Task ID: " + taskID + " - no ID specified.");
return null;
}
if (node.hasAttribute("Data")) {
Data = node.getAttribute("Data");
} else {
Data = "";
}
}
}
if (!TaskFound) {
LOGGER.severe("Invalid MarvinAdminTask with Task ID: " + taskID + " - no Task specified.");
return null;
}
MarvinAdminTask objTask = new MarvinAdminTask(taskID, ID, Data);
return objTask;
}
use of kutch.biff.marvin.utility.FrameworkNode in project Board-Instrumentation-Framework by intel.
the class TaskManager method BuildOscarTaskItem.
/**
* Read the parameters from the xml file for a Oscar task
*
* @param taskID ID of the task
* @param taskNode XML node
* @return A OscarTask object
*/
private OscarTask BuildOscarTaskItem(String taskID, FrameworkNode taskNode) {
/**
* * Example Task
* <TaskItem Type="Oscar">
* <Task OscarID="Fubar">Load File</Task>
* <Param>mysave.glk</Param>
* </TaskItem>
*/
OscarTask objOscarTask = new OscarTask();
objOscarTask.setParams(GetParameters(taskNode));
if (objOscarTask.getParams() != null && objOscarTask.getParams().size() == 0) {
// means had problem loading params.
return null;
}
for (FrameworkNode node : taskNode.getChildNodes()) {
if (node.getNodeName().equalsIgnoreCase("Task")) {
Utility.ValidateAttributes(new String[] { "OscarID" }, node);
if (node.hasAttribute("OscarID")) {
objOscarTask.setOscarID(node.getAttribute("OscarID"));
objOscarTask.setTaskID(node.getTextContent());
} else {
LOGGER.severe("Task with ID: " + taskID + " contains an invalid Oscar Task");
return null;
}
}
}
return objOscarTask;
}
Aggregations