Examples of ActionReporter


Examples of com.sun.enterprise.v3.common.ActionReporter

    public JSONObject processState(AdminCommandState state) throws JSONException {
        JSONObject result = new JSONObject();
        result.put("state", state.getState().name());
        result.put("id", state.getId());
        result.put("empty-payload", state.isOutboundPayloadEmpty());
        ActionReporter ar = (ActionReporter) state.getActionReport();
        if (ar != null) {
            result.put("action-report", actionReportJsonProvider.processReport((ActionReporter) state.getActionReport()));
        }
        return result;
    }
View Full Code Here

Examples of com.sun.enterprise.v3.common.ActionReporter

        }
        //Check command model
        CommandModel model = getCommandModel(commandName);
        checkCommandModelETag(model, modelETag);
        //Execute it
        ActionReporter ar = new PropsFileActionReporter(); //new RestActionReporter(); //Must use PropsFileActionReporter because some commands react diferently on it :-(
        final RestPayloadImpl.Outbound outbound = new RestPayloadImpl.Outbound(false);
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(), commandName.getName(), ar);
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(outbound)
                .parameters(params)
                .subject(getSubject())
                .execute();
        ar = (ActionReporter) commandInvocation.report();
        fixActionReporterSpecialCases(ar);
        ActionReport.ExitCode exitCode = ar.getActionExitCode();
        int status = HttpURLConnection.HTTP_OK; /*200 - ok*/
        if (exitCode == ActionReport.ExitCode.FAILURE) {
            status = HttpURLConnection.HTTP_INTERNAL_ERROR;
        }
        ResponseBuilder rb = Response.status(status);
View Full Code Here

Examples of com.sun.enterprise.v3.common.ActionReporter

        super(ActionReportResult.class, MediaType.APPLICATION_XML_TYPE);
    }

    @Override
    public String getContent(ActionReportResult proxy) {
        ActionReporter ar = (ActionReporter)proxy.getActionReport();
        ActionReportXmlProvider provider = new ActionReportXmlProvider();
        return provider.getContent(ar);
    }
View Full Code Here

Examples of com.sun.enterprise.v3.common.ActionReporter

    @Param(optional=true, defaultValue=SystemPropertyConstants.DAS_SERVER_NAME)
    String target = SystemPropertyConstants.DAS_SERVER_NAME;

    @Override
    public void execute(AdminCommandContext context) {
        ActionReporter report = (ActionReporter) context.getActionReport();
        PropertyResolver resolver = new PropertyResolver(domain, target);
       
        String sep = "";
        String eol = System.getProperty("line.separator");
        StringBuilder output = new StringBuilder();
        Map<String, String> values = new TreeMap<String, String>();
        Properties properties = new Properties();
        properties.put("tokens", values);
       
        for (String token : tokens) {
            String value = resolver.getPropertyValue(token);
            if ((value == null) && (checkSystemProperties)) {
                value = System.getProperty(token);
            }
            output.append(sep).append(token).append(" = ").append(value);
            sep = eol;
            values.put(token, value);
        }

        report.setMessage(output.toString());
        report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
        report.setExtraProperties(properties);
       
        return;
    }
View Full Code Here

Examples of com.sun.enterprise.v3.common.ActionReporter

            if (cluster != null) {
                config = domain.getConfigNamed(cluster.getConfigRef());
            }
        }

        ActionReporter report = (ActionReporter) context.getActionReport();
        try {
            String[] list = getGroupNames(realmName, userName);
            List<String> ret = Arrays.asList(list);
            report.setActionExitCode(ExitCode.SUCCESS);
            Properties props = new Properties();
            props.put("groups", ret);
            report.setExtraProperties(props);
            report.setMessage("" + ret);
        } catch (NoSuchRealmException ex) {
            report.setFailureCause(ex);
            report.setActionExitCode(ExitCode.FAILURE);
        } catch (BadRealmException ex) {
            report.setFailureCause(ex);
            report.setActionExitCode(ExitCode.FAILURE);
        } catch (InvalidOperationException ex) {
            report.setFailureCause(ex);
            report.setActionExitCode(ExitCode.FAILURE);
        } catch (NoSuchUserException ex) {
            report.setFailureCause(ex);
            report.setActionExitCode(ExitCode.FAILURE);
        }
      
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.