use of com.centurylink.mdw.service.ActionRequestDocument.ActionRequest in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method stubServer.
public MDWStatusMessageDocument stubServer(String host, int port, boolean on, boolean oldFormat) throws DataAccessException, RemoteException, XmlException {
ActionRequestDocument actionRequestDoc = ActionRequestDocument.Factory.newInstance();
ActionRequest actionRequest = actionRequestDoc.addNewActionRequest();
Action action = actionRequest.addNewAction();
action.setName("RegressionTest");
Parameter param = action.addNewParameter();
param.setName("Maintenance");
param.setStringValue("Stubbing");
param = action.addNewParameter();
param.setName("Server");
param.setStringValue(host + ":" + port);
param = action.addNewParameter();
param.setName("Mode");
param.setStringValue(on ? "on" : "off");
String request;
if (oldFormat)
request = DesignerCompatibility.getInstance().getOldActionRequest(actionRequestDoc);
else
request = actionRequestDoc.xmlText(getXmlOptions());
return invokeService(request);
}
use of com.centurylink.mdw.service.ActionRequestDocument.ActionRequest in project mdw-designer by CenturyLinkCloud.
the class LogSubscriberSocket method notifyServer.
private void notifyServer(boolean on) throws Exception {
ActionRequestDocument msgdoc = ActionRequestDocument.Factory.newInstance();
ActionRequest actionRequest = msgdoc.addNewActionRequest();
Action action = actionRequest.addNewAction();
action.setName("RegressionTest");
Parameter param = action.addNewParameter();
param.setName("Maintenance");
param.setStringValue("Watching");
param = action.addNewParameter();
param.setName("Server");
InetAddress ownIP = InetAddress.getLocalHost();
param.setStringValue(ownIP.getHostAddress() + ":" + LoggerUtil.getStandardLogger().getDefaultPort());
param = action.addNewParameter();
param.setName("Mode");
param.setStringValue(on ? "on" : "off");
String request;
if (oldNamespaces)
request = DesignerCompatibility.getInstance().getOldActionRequest(msgdoc);
else
request = msgdoc.xmlText();
dao.engineCall(request);
}
use of com.centurylink.mdw.service.ActionRequestDocument.ActionRequest in project mdw-designer by CenturyLinkCloud.
the class WorkflowLaunchConfiguration method notifyProcess.
public void notifyProcess(WorkflowProject workflowProject, String eventName, String message, Map<String, String> headers) {
try {
ActionRequestDocument msgdoc = ActionRequestDocument.Factory.newInstance();
ActionRequest actionRequest = msgdoc.addNewActionRequest();
com.centurylink.mdw.service.Action act = actionRequest.addNewAction();
act.setName("RegressionTest");
Parameter param = act.addNewParameter();
param.setName("SubAction");
param.setStringValue("NotifyProcess");
param = act.addNewParameter();
param.setName("EventName");
param.setStringValue(eventName);
param = act.addNewParameter();
param.setName("Message");
param.setStringValue(message);
String request;
if (workflowProject.isOldNamespaces())
request = DesignerCompatibility.getInstance().getOldActionRequest(msgdoc);
else
request = msgdoc.xmlText();
String response = workflowProject.getDesignerProxy().notifyProcess(request, headers);
if (writeToConsole)
writeToConsole("Notify Process Response", response + "\n");
} catch (Exception ex) {
showError(ex, "Send External Event", workflowProject);
}
}
Aggregations