Examples of Command


Examples of redis.netty4.Command

        } else {
          throw new IOException("Unexpected character");
        }
      }
      try {
        out.add(new Command(bytes));
      } finally {
        bytes = null;
        arguments = 0;
      }
    } else if (in.readByte() == '*') {
      long l = readLong(in);
      if (l > Integer.MAX_VALUE) {
        throw new IllegalArgumentException("Java only supports arrays up to " + Integer.MAX_VALUE + " in size");
      }
      int numArgs = (int) l;
      if (numArgs < 0) {
        throw new RedisException("Invalid size: " + numArgs);
      }
      bytes = new byte[numArgs][];
      checkpoint();
      decode(ctx, in, out);
    } else {
      // Go backwards one
      in.readerIndex(in.readerIndex() - 1);
      // Read command -- can't be interupted
      byte[][] b = new byte[1][];
      b[0] = in.readBytes(in.bytesBefore((byte) '\r')).array();
      in.skipBytes(2);
      out.add(new Command(b, true));
    }
  }
View Full Code Here

Examples of robobeans.command.Command

     * to the new state.
     * The better approach would to not send any commands to the server and to give control right away to the new state
     * which could also send null command and a new state
     */
    private Command handleDecision() {
        Command com = null;
        FSMState newstate = null;
        while (true) {
            Decision dec = myState.onNewCycle();
            logger.fine(time + " " + myState.getClass().getSimpleName() + " " + dec);
            com = dec.getCommand();
View Full Code Here

Examples of ru.tehkode.permissions.commands.Command

    for (int i = base; i < base + count; i++) {
      if (i >= commands.size()) {
        break;
      }

      Command command = commands.get(i).getMethodAnnotation();
      String commandName = String.format("/%s %s", command.name(), command.syntax()).replace("<", ChatColor.BOLD.toString() + ChatColor.RED + "<").replace(">", ">" + ChatColor.RESET + ChatColor.GOLD.toString()).replace("[", ChatColor.BOLD.toString() + ChatColor.BLUE + "[").replace("]", "]" + ChatColor.RESET + ChatColor.GOLD.toString());


      sender.sendMessage(ChatColor.GOLD + commandName);
      sender.sendMessage(ChatColor.AQUA + "    " + command.description());
    }
  }
View Full Code Here

Examples of siia.booking.domain.Command

    @Test
    public void splitterShouldSplitIntoSubcommands() {
        CreateTripCommand tripCommand = mock(CreateTripCommand.class);
        Message<CreateTripCommand> tripCommandMessage = MessageBuilder.withPayload(tripCommand).build();
        final Command carCommand = mock(Command.class);
        final Command flightCommand = mock(Command.class);
        final Command hotelCommand = mock(Command.class);
        given(tripCommand.getSubCommands()).willReturn(Arrays.asList(carCommand, flightCommand, hotelCommand));

        tripCommands.send(tripCommandMessage);
        List<Message<? extends Object>> received =
                Arrays.asList(javaLegQuoteCommands.receive(100), javaLegQuoteCommands.receive(100), javaLegQuoteCommands.receive(100));
View Full Code Here

Examples of sonia.jdf.cmd.Command

   */
  private static int executeCommand(ApplicationDescriptor application,
                                    String commandName, String[] args)
  {
    int result = ResultCode.OK;
    Command c = CommandFactory.getInstance().getCommand(commandName);

    if (c != null)
    {
      result = c.execute(application, args);
    }
    else
    {
      System.err.append("command ").append(commandName).append(" not found");
      result = ResultCode.COMMAND_NOTFOUND;
View Full Code Here

Examples of spark.api.Command

    try {
      reader.close();
    } catch (XMLStreamException e) {
      throw new SparqlException("Error closing stream", e);
    } finally {
      Command c = getCommand();
      // Need this check because command can be null when testing the parser...
      if (c != null && c instanceof ProtocolCommand) {
        ((ProtocolCommand)c).release();
      }
    }
View Full Code Here

Examples of tachyon.thrift.Command

        MasterWorkerInfo tWorkerInfo = mWorkers.get(workerId);

        if (tWorkerInfo == null) {
          LOG.info("worker_heartbeat(): Does not contain worker with ID " + workerId
              + " . Send command to let it re-register.");
          return new Command(CommandType.Register, new ArrayList<Long>());
        }

        tWorkerInfo.updateUsedBytes(usedBytes);
        tWorkerInfo.updateBlocks(false, removedBlockIds);
        tWorkerInfo.updateToRemovedBlocks(false, removedBlockIds);
        tWorkerInfo.updateLastUpdatedTimeMs();

        for (long blockId : removedBlockIds) {
          int fileId = BlockInfo.computeInodeId(blockId);
          int blockIndex = BlockInfo.computeBlockIndex(blockId);
          Inode inode = mFileIdToInodes.get(fileId);
          if (inode == null) {
            LOG.error("File " + fileId + " does not exist");
          } else if (inode.isFile()) {
            ((InodeFile) inode).removeLocation(blockIndex, workerId);
            LOG.debug("File {} with block {} was evicted from worker {} ", fileId, blockIndex,
                workerId);
          }
        }

        List<Long> toRemovedBlocks = tWorkerInfo.getToRemovedBlocks();
        if (toRemovedBlocks.size() != 0) {
          return new Command(CommandType.Free, toRemovedBlocks);
        }
      }
    }

    return new Command(CommandType.Nothing, new ArrayList<Long>());
  }
View Full Code Here

Examples of talkfeed.command.Command

    }
   
    task = task.replace("/", "");
   
    //retrieve command instance
    Command cmd = CommandFactory.get(task);
   
    cmd.execute(map);
   

  }
View Full Code Here

Examples of uk.co.thomasc.scrapbanktf.command.Command

          } else {
            final String[] args = callback.getMessage().split(" ");
            final String text = Util.removeArg0(callback.getMessage());
            final String[] pArgs = text.split(" ");

            Command cmd = Commands.getCommand(args[0]);
            if (cmd != Commands.unknown) {
              response = cmd.call(Bot.this, callback.getChatterID(), pArgs, text);
            }
          }
          steamFriends.sendChatRoomMessage(callback.getChatRoomID(), EChatEntryType.ChatMsg, response);
        }
      }
View Full Code Here

Examples of x10.Command

        boolean isOff = _hasTrueInput(off);
        boolean isOn = _hasTrueInput(on);

        if ((brightLevel >= 0) && (brightLevel <= 100)) {
            _transmit(new Command((_destination), x10.Command.BRIGHT,
                    brightLevel));
        }

        if ((dimLevel >= 0) && (dimLevel <= 100)) {
            _transmit(new Command((_destination), x10.Command.DIM, dimLevel));
        }

        if (isOn) {
            _transmit(new Command((_destination), x10.Command.ON));
        }

        if (isOff) {
            _transmit(new Command((_destination), x10.Command.OFF));
        }
    }
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.