Search in sources :

Example 6 with ActionRequest

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);
}
Also used : Action(com.centurylink.mdw.service.Action) ActionRequest(com.centurylink.mdw.service.ActionRequestDocument.ActionRequest) Parameter(com.centurylink.mdw.service.Parameter) ActionRequestDocument(com.centurylink.mdw.service.ActionRequestDocument)

Example 7 with ActionRequest

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);
}
Also used : Action(com.centurylink.mdw.service.Action) ActionRequest(com.centurylink.mdw.service.ActionRequestDocument.ActionRequest) Parameter(com.centurylink.mdw.service.Parameter) InetAddress(java.net.InetAddress) ActionRequestDocument(com.centurylink.mdw.service.ActionRequestDocument)

Example 8 with ActionRequest

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);
    }
}
Also used : ActionRequest(com.centurylink.mdw.service.ActionRequestDocument.ActionRequest) Parameter(com.centurylink.mdw.service.Parameter) IOException(java.io.IOException) PartInitException(org.eclipse.ui.PartInitException) ActionRequestDocument(com.centurylink.mdw.service.ActionRequestDocument)

Aggregations

ActionRequestDocument (com.centurylink.mdw.service.ActionRequestDocument)8 ActionRequest (com.centurylink.mdw.service.ActionRequestDocument.ActionRequest)8 Parameter (com.centurylink.mdw.service.Parameter)6 Action (com.centurylink.mdw.service.Action)5 IOException (java.io.IOException)3 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)2 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)2 MbengException (com.qwest.mbeng.MbengException)2 ParseException (java.text.ParseException)2 XmlException (org.apache.xmlbeans.XmlException)2 JSONException (org.json.JSONException)2 File (java.io.File)1 InetAddress (java.net.InetAddress)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 PartInitException (org.eclipse.ui.PartInitException)1