Package org.glassfish.admin.rest.model

Examples of org.glassfish.admin.rest.model.ResponseBody


        // to say that resource links should not be returned, and the resource
        // looks for that header in the request and, if present, tells
        // the ResponseBody constructor to ignore resource links.
        // Since we never return links from this filter, instead of looking
        // for the header, we can just always tell the ResponseBody to ignore links.
        ResponseBody rb = new ResponseBody(false);
        String errorMsg = (String)entity;
        rb.addFailure(errorMsg);
        resCtx.setEntity(rb, resCtx.getEntityAnnotations(), Constants.MEDIA_TYPE_JSON_TYPE);
    }
View Full Code Here


                                        final ResponseBodyBuilder builder) {
        return getCompositeUtil().executeSseCommand(subject, command, parameters, new SseCommandHelper.ActionReportProcessor() {
            @Override
            public ActionReport process(ActionReport report, EventOutput ec) {
                if (report != null) {
                    ResponseBody rb = builder.build(report);
                    Properties props = new Properties();
                    props.put("response", rb);
                    report.setExtraProperties(props);
                }
View Full Code Here

    }
    protected <T extends RestModel> RestModelResponseBody<T> restModelResponseBody(Class<T> modelIface) {
        return new RestModelResponseBody<T>(includeResourceLinks());
    }
    protected ResponseBody responseBody() {
        return new ResponseBody(includeResourceLinks());
    }
View Full Code Here

public abstract class ResponseBodyBuilderImpl implements ResponseBodyBuilder {

    public ResponseBody build(ActionReport report) {
        ExitCode exitCode = report.getActionExitCode();
        if (ExitCode.SUCCESS.equals(exitCode)) {
            ResponseBody rb = success(report);
            rb.setIncludeResourceLinks(includeResourceLinks());
            return rb;
        }
        final ResponseBody responseBody = new ResponseBody(includeResourceLinks());
        if (ExitCode.WARNING.equals(exitCode)) {
            responseBody.addWarning(report.getMessage());
        } else {
            responseBody.addFailure(report.getMessage());
        }
        return responseBody;
    }
View Full Code Here

        return getCompositeUtil().executeSseCommand(subject, command, parameters, new SseCommandHelper.ActionReportProcessor() {
            @Override
            public ActionReport process(ActionReport report, EventChannel ec) {
                if (report != null) {
                    ActionReport.ExitCode exitCode = report.getActionExitCode();
                    ResponseBody rb = Util.responseBody()
                            .add(Message.Severity.valueOf(exitCode.name()), report.getMessage());
                    if (exitCode.equals(ActionReport.ExitCode.SUCCESS)) {
                        rb.setEntity(builder.get(report));
                    }

                    OutboundEvent outEvent = new OutboundEvent.Builder()
                            .name(Status.CREATED.name())
                            .mediaType(MediaType.APPLICATION_JSON_TYPE)
View Full Code Here

   /**
     * Convenience wrapper around ResponseBodyImpl constructor to make it easier to use its fluent API
     * @return ResponseBodyImpl
     */
    public static ResponseBody responseBody() {
        return new ResponseBody();
    }
View Full Code Here

   /**
     * Convenience wrapper around ResponseBodyImpl constructor to make it easier to use its fluent API
     * @return ResponseBodyImpl
     */
    public static ResponseBody responseBody() {
        return new ResponseBody();
    }
View Full Code Here

                                        final ResponseBodyBuilder builder) {
        return getCompositeUtil().executeSseCommand(subject, command, parameters, new SseCommandHelper.ActionReportProcessor() {
            @Override
            public ActionReport process(ActionReport report, EventOutput ec) {
                if (report != null) {
                    ResponseBody rb = builder.build(report);
                    Properties props = new Properties();
                    props.put("response", rb);
                    report.setExtraProperties(props);
                }
View Full Code Here

   /**
     * Convenience wrapper around ResponseBodyImpl constructor to make it easier to use its fluent API
     * @return ResponseBodyImpl
     */
    public static ResponseBody responseBody() {
        return new ResponseBody();
    }
View Full Code Here

                                        final ResponseBodyBuilder builder) {
        return getCompositeUtil().executeSseCommand(subject, command, parameters, new SseCommandHelper.ActionReportProcessor() {
            @Override
            public ActionReport process(ActionReport report, EventOutput ec) {
                if (report != null) {
                    ResponseBody rb = builder.build(report);
                    Properties props = new Properties();
                    props.put("response", rb);
                    report.setExtraProperties(props);
                }
View Full Code Here

TOP

Related Classes of org.glassfish.admin.rest.model.ResponseBody

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.