Examples of CommandResponse


Examples of org.geomajas.command.CommandResponse

public class LogCommand implements Command<LogRequest, CommandResponse> {

  private final Logger log = LoggerFactory.getLogger(LogCommand.class);

  public CommandResponse getEmptyCommandResponse() {
    return new CommandResponse();
  }
View Full Code Here

Examples of org.geomajas.command.CommandResponse

   * Execute a GWT RPC command request, and return the response. These request come from the client, and the response
   * is sent back to the client. We use a {@link CommandDispatcher} to actually execute the command.
   */
  public CommandResponse execute(GwtCommand request) {
    if (request != null) {
      CommandResponse result = null;
      result = commandDispatcher.execute(request.getCommandName(), request.getCommandRequest(), request
          .getUserToken(), request.getLocale());
      return result;
    }
    return null;
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.CommandResponse

                PanelSecurity.PanelSecurityEntry entry = (PanelSecurity.PanelSecurityEntry) it.next();
                checkMethodSecurity(entry.getMethodName(), entry.getPermissionClass(), entry.getAction(), panel);
            }
        }
        // Invoke the panel's action method.
        CommandResponse res = null;
        if (!isSystemAction(action)) res = fireBeforeInvokeAction(panel, req);
        if (res == null) res = (CommandResponse) method.invoke(this, args);
        if (!isSystemAction(action)) res = fireAfterInvokeAction(panel, req, res);

        // If no AJAX then return the response get from panel invocation.
        String ajaxParam = req.getParameter(Parameters.AJAX_ACTION);
        if (ajaxParam == null || !Boolean.valueOf(ajaxParam).booleanValue()) return res;

        // Despite the request was AJAX the panel has decided refreshing the full screen.
        if (res != null && res.getClass().equals(ShowCurrentScreenResponse.class)) return res;

        // Else return the response wrapped as AJAX.
        PanelAjaxResponse response = PanelAjaxResponse.getEquivalentAjaxResponse(panel, res);
        if (response == null) log.error("Cannot convert response with " + res.getClass() + " to PanelAjaxResponse.");
        return response;
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.CommandResponse

    /**
     * Action that dispatches to a factory component.
     */
    public CommandResponse panelActionFactory(final Panel panel, CommandRequest request) throws Exception {
        FactoryRequestHandler requestHandler = (FactoryRequestHandler) Factory.lookup("org.jboss.dashboard.ui.components.FactoryRequestHandler");
        CommandResponse factoryResponse = requestHandler.handleRequest(request);
        String action = request.getRequestObject().getParameter(FactoryURL.PARAMETER_PROPERTY);
        String componentName = request.getRequestObject().getParameter(FactoryURL.PARAMETER_BEAN);
        if (action != null) {
            HandlerFactoryElement handler = (HandlerFactoryElement)Factory.lookup(componentName);
            if (handler != null) action = handler.getActionForShortcut(action);
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.CommandResponse

        final boolean useBlanks = BooleanParameter.value(panel.getParameterValue(PARAM_USE_BLANKS), false);
        final ExportResult exportResult = getSessionInfo().getExportResult();

        super.fireAfterRenderPanel(panel,request.getRequestObject(), null);

        return new CommandResponse() {
            public boolean execute(CommandRequest cmdReq) throws Exception {
                HttpServletResponse response = cmdReq.getResponseObject();
                response.setHeader("Content-Disposition", disposition);
                response.setContentType(contentType != null ? contentType : "application/force-download");
                ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.CommandResponse

        final boolean useBlanks = BooleanParameter.value(panel.getParameterValue(PARAM_USE_BLANKS), false);
        final ExportResult exportResult = getSessionInfo().getExportResult();

        super.fireAfterRenderPanel(panel,request.getRequestObject(), null);

        return new CommandResponse() {
            public boolean execute(CommandRequest cmdReq) throws Exception {
                HttpServletResponse response = cmdReq.getResponseObject();
                response.setHeader("Content-Disposition", disposition);
                response.setContentType(contentType != null ? contentType : "application/force-download");
                ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.CommandResponse

                PanelSecurity.PanelSecurityEntry entry = (PanelSecurity.PanelSecurityEntry) it.next();
                checkMethodSecurity(entry.getMethodName(), entry.getPermissionClass(), entry.getAction(), panel);
            }
        }
        // Invoke the panel's action method.
        CommandResponse res = null;
        if (!isSystemAction(action)) res = fireBeforeInvokeAction(panel, req);
        if (res == null) res = (CommandResponse) method.invoke(this, args);
        if (!isSystemAction(action)) res = fireAfterInvokeAction(panel, req, res);

        // If no AJAX then return the response get from panel invocation.
        String ajaxParam = req.getParameter(Parameters.AJAX_ACTION);
        if (ajaxParam == null || !Boolean.valueOf(ajaxParam).booleanValue()) return res;

        // Despite the request was AJAX the panel has decided refreshing the full screen.
        if (res != null && res.getClass().equals(ShowCurrentScreenResponse.class)) return res;

        // Else return the response wrapped as AJAX.
        PanelAjaxResponse response = PanelAjaxResponse.getEquivalentAjaxResponse(panel, res);
        if (response == null) log.error("Cannot convert response with " + res.getClass() + " to PanelAjaxResponse.");
        return response;
    }
View Full Code Here

Examples of org.locationtech.geogig.web.api.CommandResponse

        }
        final Remote remote;
        try {
            remote = geogig.command(RemoteAddOp.class).setName(remoteName).setURL(remoteURL)
                    .setUserName(username).setPassword(password).call();
            context.setResponseContent(new CommandResponse() {
                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    out.writeElement("name", remote.getName());
                    out.finish();
View Full Code Here

Examples of org.rhq.enterprise.communications.command.CommandResponse

            CmdlineClient client = new CmdlineClient();
            Command command = client.buildCommand(remoteCmdArgs);

            agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.SERVER_SENDING));

            CommandResponse response = agent.getClientCommandSender().sendSynch(command);

            agent.getOut().println(response);
        } catch (Exception e) {
            throw new RuntimeException(MSG.getMsg(AgentI18NResourceKeys.SERVER_FAILURE), e);
        }
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.