Package org.glassfish.api.ActionReport

Examples of org.glassfish.api.ActionReport.MessagePart


        final String path = (basePath.endsWith(".")) ? basePath.substring(0, basePath.length()-1) : basePath;
        RestActionReporter gr = ResourceUtil.runCommand("get", new ParameterMap() {{
            add ("DEFAULT", path);
        }}, subject);

        MessagePart top = gr.getTopMessagePart();
        for (MessagePart child : top.getChildren()) {
            String message = child.getMessage();
            if (message.contains("=")) {
                String[] parts = message.split("=");
                values.put(parts[0], (parts.length > 1) ? parts[1] : "");
            }
View Full Code Here


        final String path = (basePath.endsWith(".")) ? basePath.substring(0, basePath.length()-1) : basePath;
        RestActionReporter gr = ResourceUtil.runCommand("get", new ParameterMap() {{
            add ("DEFAULT", path);
        }}, habitat, "");

        MessagePart top = gr.getTopMessagePart();
        for (MessagePart child : top.getChildren()) {
            String message = child.getMessage();
            if (message.contains("=")) {
                String[] parts = message.split("=");
                values.put(parts[0], (parts.length > 1) ? parts[1] : "");
            }
View Full Code Here

                        + "s";


        // no linefeed at the end!!!
        boolean first = true;
        MessagePart topMsg = report.getTopMessagePart();
        Properties properties = report.getExtraProperties();
        if (properties == null) {
            properties = new Properties();
            report.setExtraProperties(properties);
        }
        properties.put("jobs", jobInfoList);
        for (JobInfo info : jobInfoList) {
            if (first)    {
                topMsg.setMessage(String.format(formattedLine, NAME, JOBID, TIME, STATE,USER ));
                first = false;
            }

            MessagePart msg = topMsg.addChild();
            msg.setMessage(String.format(formattedLine, info.jobName, info.jobId,  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate), info.exitCode,info.user));
            msg.addProperty(NAME, info.jobName);
            msg.addProperty(JOBID, info.jobId);
            msg.addProperty(TIME, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate));
            msg.addProperty(STATE, info.exitCode);
            msg.addProperty(USER, info.user);
        }

        report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
    }
View Full Code Here

                               + "s";


               // no linefeed at the end!!!
               boolean first = true;
               MessagePart topMsg = report.getTopMessagePart();
               Properties properties = report.getExtraProperties();
               if (properties == null) {
                   properties = new Properties();
                   report.setExtraProperties(properties);
               }
               Collection<Map<String, Object>> details = new ArrayList<Map<String, Object>>();
               properties.put("jobs", details);
               for (JobInfo info : jobInfoList) {
                   if (first)    {
                       topMsg.setMessage(String.format(formattedLine, TITLE_NAME, TITLE_JOBID, TITLE_TIME, TITLE_STATE,TITLE_EXITCODE,TITLE_USER ));
                       first = false;
                   }

                   MessagePart msg = topMsg.addChild();
                   msg.setMessage(String.format(formattedLine, info.jobName, info.jobId,  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate), info.state,info.exitCode,info.user));
                   Map<String, Object> detail = new HashMap<String, Object>();
                   details.add(detail);
                   detail.put(NAME, info.jobName);
                   detail.put(ID, info.jobId);
                   detail.put(DATE, new Date(info.commandExecutionDate));
View Full Code Here

            config = newConfig;
        }
        final ActionReport report = context.getActionReport();
        List<VirtualServer> list = config.getHttpService().getVirtualServer();
        for (final VirtualServer virtualServer : list) {
            final MessagePart part = report.getTopMessagePart().addChild();
            part.setMessage(virtualServer.getId());
        }
        report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
    }
View Full Code Here

        final String path = (basePath.endsWith(".")) ? basePath.substring(0, basePath.length()-1) : basePath;
        RestActionReporter gr = ResourceUtil.runCommand("get", new ParameterMap() {{
            add ("DEFAULT", path);
        }}, habitat, "");

        MessagePart top = gr.getTopMessagePart();
        for (MessagePart child : top.getChildren()) {
            String message = child.getMessage();
            if (message.contains("=")) {
                String[] parts = message.split("=");
                values.put(parts[0], (parts.length > 1) ? parts[1] : "");
            }
View Full Code Here

                        + "s";


        // no linefeed at the end!!!
        boolean first = true;
        MessagePart topMsg = report.getTopMessagePart();
        Properties properties = report.getExtraProperties();
        if (properties == null) {
            properties = new Properties();
            report.setExtraProperties(properties);
        }
        List<Properties> jobs = new ArrayList<Properties>();
        properties.put("jobs", jobs);
        for (JobInfo info : jobInfoList) {
            if (first)    {
                topMsg.setMessage(String.format(formattedLine, NAME, JOBID, TIME, STATE,USER ));
                first = false;
            }

            MessagePart msg = topMsg.addChild();
            msg.setMessage(String.format(formattedLine, info.jobName, info.jobId,  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate), info.exitCode,info.user));
            Properties p = new Properties();
            p.setProperty(NAME, info.jobName);
            p.setProperty("ID", info.jobId);
            p.setProperty(TIME, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate));
            p.setProperty(STATE, info.exitCode);
View Full Code Here

        final String path = (basePath.endsWith(".")) ? basePath.substring(0, basePath.length()-1) : basePath;
        RestActionReporter gr = ResourceUtil.runCommand("get", new ParameterMap() {{
            add ("DEFAULT", path);
        }}, habitat, "");

        MessagePart top = gr.getTopMessagePart();
        for (MessagePart child : top.getChildren()) {
            String message = child.getMessage();
            if (message.contains("=")) {
                String[] parts = message.split("=");
                values.put(parts[0], (parts.length > 1) ? parts[1] : "");
            }
View Full Code Here

        final String path = (basePath.endsWith(".")) ? basePath.substring(0, basePath.length()-1) : basePath;
        RestActionReporter gr = ResourceUtil.runCommand("get", new ParameterMap() {{
            add ("DEFAULT", path);
        }}, habitat, "");

        MessagePart top = gr.getTopMessagePart();
        for (MessagePart child : top.getChildren()) {
            String message = child.getMessage();
            if (message.contains("=")) {
                String[] parts = message.split("=");
                values.put(parts[0], (parts.length > 1) ? parts[1] : "");
            }
View Full Code Here

                               + "s";


               // no linefeed at the end!!!
               boolean first = true;
               MessagePart topMsg = report.getTopMessagePart();
               Properties properties = report.getExtraProperties();
               if (properties == null) {
                   properties = new Properties();
                   report.setExtraProperties(properties);
               }
               Collection<Map<String, Object>> details = new ArrayList<Map<String, Object>>();
               properties.put("jobs", details);
               for (JobInfo info : jobInfoList) {
                   if (first)    {
                       topMsg.setMessage(String.format(formattedLine, TITLE_NAME, TITLE_JOBID, TITLE_TIME, TITLE_STATE,TITLE_EXITCODE,TITLE_USER ));
                       first = false;
                   }

                   MessagePart msg = topMsg.addChild();
                   msg.setMessage(String.format(formattedLine, info.jobName, info.jobId,  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate), info.state,info.exitCode,info.user));
                   Map<String, Object> detail = new HashMap<String, Object>();
                   details.add(detail);
                   detail.put(NAME, info.jobName);
                   detail.put(ID, info.jobId);
                   detail.put(DATE, new Date(info.commandExecutionDate));
View Full Code Here

TOP

Related Classes of org.glassfish.api.ActionReport.MessagePart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.