Request generating instantiation.
@param command
@return
961124
public static KubernetesMessage request(KubernetesCommand<?> command) {
        KubernetesRequest request = new KubernetesRequest();
        request.setCommand(command.getName());

        for (Map.Entry<String, Object> entry : command.getParameters().entrySet()) {
            if (entry.getKey().equals(KubernetesMessageHeaders.NAME)) {
                request.setName(entry.getValue().toString());
            }

            if (entry.getKey().equals(KubernetesMessageHeaders.NAMESPACE)) {
                request.setNamespace(entry.getValue().toString());
            }

            if (entry.getKey().equals(KubernetesMessageHeaders.LABEL)) {
                request.setLabel(entry.getValue().toString());
            }
        }

        return new KubernetesMessage(request);
    }
965025
public ParallelTaskBuilder prepareUdp(String command) {
        reinitIfClosed();
        ParallelTaskBuilder cb = new ParallelTaskBuilder();
        cb.setProtocol(RequestProtocol.UDP);
        cb.getUdpMeta().setCommand(command);
        return cb;
    }
36312
public String requestCommandMessage(CommandType type) {
        VehicleMessage message = request(new Command(type));
        String value = null;
        if(message != null) {
            // Because we use the same key and value for commands and command
            // responses, if for some reason a Command is echoed back to the
            // device instead of a CommandResponse, you could get a casting
            // exception when trying to cast this message here. If we got a
            // Command, just ignore it and assume no response - I wasn't able to
            // reproduce it but we did have a few Bugsnag reports about it.
            try {
                CommandResponse response = message.asCommandResponse();
                if(response.getStatus()) {
                    value = response.getMessage();
                }
            } catch(ClassCastException e) {
                Log.w(TAG, "Expected a command response but got " + message +
                        " -- ignoring, assuming no response");
            }
        }
        return value;
    }
515633
public DevCmdInfo_2 command_query_2(final String command) throws DevFailed, SystemException {
	Util.out4.println("Device_2Impl.command_query_2(" + command + ") arrived");

	// Retrieve number of command and allocate memory to send back info
	final int nb_cmd = device_class.get_command_list().size();
	Util.out4.println(nb_cmd + " command(s) for device");
	DevCmdInfo_2 back = null;
	for (int i = 0; i < nb_cmd; i++) {
	    final Command cmd = (Command) device_class.get_command_list().elementAt(i);
	    if (cmd.get_name().toLowerCase().equals(command.toLowerCase())) {
		final DevCmdInfo_2 tmp = new DevCmdInfo_2();
		tmp.cmd_name = cmd.get_name();
		tmp.cmd_tag = cmd.get_tag();
		tmp.level = cmd.get_disp_level();
		tmp.in_type = cmd.get_in_type();
		tmp.out_type = cmd.get_out_type();
		final String str_in = cmd.get_in_type_desc();
		if (str_in.length() != 0) {
		    tmp.in_type_desc = str_in;
		} else {
		    tmp.in_type_desc = Tango_DescNotSet;
		}
		final String str_out = cmd.get_out_type_desc();
		if (str_out.length() != 0) {
		    tmp.out_type_desc = str_out;
		} else {
		    tmp.out_type_desc = Tango_DescNotSet;
		}
		back = tmp;
	    }
	}

	// throw an exception to client if command not found
	if (back == null) {
	    Except.throw_exception("API_CommandNotFound", "Command " + command + " not found",
		    "Device_2Impl.command_query_2");
	}

	// Record operation request in black box
	blackbox.insert_op(Op_Command_list_2);

	Util.out4.println("Device_2Impl.command_list_query_2 exiting");
	return back;

    }
885368
public List<Command> receive(final Command command) {

        Assert.requireNonNull(command, "command");
        LOG.trace("Received command of type {}", command.getClass().getSimpleName());
        List<Command> response = new LinkedList();// collecting parameter pattern

        if (!(command instanceof InterruptLongPollCommand)) {// signal commands must not update thread-confined state
            for (DolphinServerAction it : dolphinServerActions) {
                it.setDolphinResponse(response);// todo: can be deleted as soon as all action refer to the SMS
            }

            serverModelStore.setCurrentResponse(response);
        }


        List<CommandHandler> actions = registry.getActionsFor(command.getClass());
        if (actions.isEmpty()) {
            LOG.warn("There is no server action registered for received command type {}, known commands types are {}", command.getClass().getSimpleName(), registry.getActions().keySet());
            return response;
        }

        // copying the list of actions allows an Action to unregister itself
        // avoiding ConcurrentModificationException to be thrown by the loop
        List<CommandHandler> actionsCopy = new ArrayList<CommandHandler>();
        actionsCopy.addAll(actions);
        try {
            for (CommandHandler action : actionsCopy) {
                action.handleCommand(command, response);
            }

        } catch (Exception exception) {
            throw exception;
        }

        return response;
    }
1247750
static Action create(Runnable command)
    {
        Objects.requireNonNull(command, "The command may not be null");
        return new AbstractAction()
        {
            /**
             * Serial UID
             */
            private static final long serialVersionUID = 8693271079128413874L;

            @Override
            public void actionPerformed(ActionEvent e)
            {
                command.run();
            }
        };
    }
228348
protected function prepareRequest(
        CommandInterface $command,
        RequestInterface $request
    ) {
        $visitedLocations = [];
        $operation = $this->description->getOperation($command->getName());

        // Visit each actual parameter
        foreach ($operation->getParams() as $name => $param) {
            /* @var Parameter $param */
            $location = $param->getLocation();
            // Skip parameters that have not been set or are URI location
            if ($location == 'uri' || !$command->hasParam($name)) {
                continue;
            }
            if (!isset($this->locations[$location])) {
                throw new \RuntimeException("No location registered for $name");
            }
            $visitedLocations[$location] = true;
            $request = $this->locations[$location]->visit($command, $request, $param);
        }

        // Ensure that the after() method is invoked for additionalParameters
        /** @var Parameter $additional */
        if ($additional = $operation->getAdditionalParameters()) {
            $visitedLocations[$additional->getLocation()] = true;
        }

        // Call the after() method for each visited location
        foreach (array_keys($visitedLocations) as $location) {
            $request = $this->locations[$location]->after($command, $request, $operation);
        }

        return $request;
    }
762286
public List<ModelServiceInstance> queryService(List<StringCommand> commands){

        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.QueryService);

        List<QueryCommand> cs = new ArrayList<QueryCommand>();
        for(StringCommand c : commands){
            cs.add(c.getStringCommand());
        }

        QueryServiceProtocol p = new QueryServiceProtocol(cs);
        QueryServiceResponse resp ;
        resp = (QueryServiceResponse) connection.submitRequest(header, p,  null);
        return resp.getInstances();
    }
1079329
public synchronized Response doCommandFullResponse(String command) throws CommandFormatException, IOException {
        ModelNode request = cmdCtx.buildRequest(command);
        boolean replacedBytes = replaceFilePathsWithBytes(request);
        OperationResponse response = execute(request, isSlowCommand(command) || replacedBytes);
        return new Response(command, request, response);
    }
14149
private void processCommand(List<String> command) throws Exception {
        processBuilder.command(command);
        Process p = processBuilder.start();
        checkReturnCode(p, processBuilder.command().toString(), 0);
    }
1198975
function Request(args) {
  if (false === (this instanceof Request)) throw new Error('new operator required');
  if (typeof args == 'string') {
    var quickType = args;
    args = {};
    args.type = quickType;
  }
  args = args || {};
  this.type = args.type || null;
  if (args.value) // todo spec as optional param
    this.value = args.value;
  if (!this.type || typeof this.type != 'string') throw new Error('Request type required');
  switch (this.type) {
    case 'Command':
      this.command = args.command || null;
      if (!(this.command instanceof Command)) throw new Error('command object required');
      break;
  }
}
149072
@CommandHandler
    public void handle(RequestStartTransactionRejectedCommand command) {
        apply(new RequestStartTransactionRejectedEvent(command.getChargingStationId(), command.getEvseId(), command.getIdentifyingToken(), command.getIdentityContext()));
    }
1125079
@Override
    public ModelNode buildRequestWithoutHeaders(CommandContext ctx) throws CommandFormatException {

        final ParsedCommandLine parsedCmd = ctx.getParsedCommandLine();
        final String name = this.name.getValue(parsedCmd);
        if(name == null || name.isEmpty()) {
            final OperationRequestAddress address = getAddress(ctx);
            final ModelNode request = Util.buildRequest(ctx, address, Util.READ_OPERATION_NAMES);
            if(ctx.getConfig().isAccessControl()) {
                request.get(Util.ACCESS_CONTROL).set(true);
            }
            return request;
        }

        final OperationRequestAddress address = getAddress(ctx);
        ModelNode req = Util.buildRequest(ctx, address, Util.READ_OPERATION_DESCRIPTION);
        req.get(Util.NAME).set(name);
        return req;
    }
777388
public static void exec_command(String command) throws IOException {
        launchProcess(command, new HashMap<String, String>(), false);
    }
1106444
@Programmatic
    @Override
    public Command create() {
        CommandJdo command = factoryService.instantiate(CommandJdo.class);
        command.setExecutor(Executor.OTHER);
        command.setPersistence(Persistence.IF_HINTED);
        return command;
    }
491342
public static Execed rootUtility(Iterable<String> command) throws IOException
	{
		Exec e = new Exec(command);
		e.runAsSuperuser();
		e.setRedirectError(true);

		return e.start();
	}
1273280
public ProcessExecutor command(String... command) {
    builder.command(fixArguments(Arrays.asList(command)));
    return this;
  }