Examples of CommandType


Examples of com.cloud.api.BaseCmd.CommandType

    @SuppressWarnings({ "unchecked", "rawtypes" })
    private static void setFieldValue(Field field, BaseCmd cmdObj, Object paramObj, Parameter annotation, IdentityMapper identityMapper) throws IllegalArgumentException, ParseException {
        try {
            field.setAccessible(true);
            CommandType fieldType = annotation.type();
            switch (fieldType) {
            case BOOLEAN:
                field.set(cmdObj, Boolean.valueOf(paramObj.toString()));
                break;
            case DATE:
                // This piece of code is for maintaining backward compatibility and support both the date formats(Bug
// 9724)
                // Do the date massaging for ListEventsCmd only
                if (cmdObj instanceof ListEventsCmd) {
                    boolean isObjInNewDateFormat = isObjInNewDateFormat(paramObj.toString());
                    if (isObjInNewDateFormat) {
                        DateFormat newFormat = BaseCmd.NEW_INPUT_FORMAT;
                        synchronized (newFormat) {
                            field.set(cmdObj, newFormat.parse(paramObj.toString()));
                        }
                    } else {
                        DateFormat format = BaseCmd.INPUT_FORMAT;
                        synchronized (format) {
                            Date date = format.parse(paramObj.toString());
                            if (field.getName().equals("startDate")) {
                                date = massageDate(date, 0, 0, 0);
                            } else if (field.getName().equals("endDate")) {
                                date = massageDate(date, 23, 59, 59);
                            }
                            field.set(cmdObj, date);
                        }
                    }
                } else {
                    DateFormat format = BaseCmd.INPUT_FORMAT;
                    format.setLenient(false);
                    synchronized (format) {
                        field.set(cmdObj, format.parse(paramObj.toString()));
                    }
                }
                break;
            case FLOAT:
                field.set(cmdObj, Float.valueOf(paramObj.toString()));
                break;
            case INTEGER:
                field.set(cmdObj, Integer.valueOf(paramObj.toString()));
                break;
            case LIST:
                List listParam = new ArrayList();
                StringTokenizer st = new StringTokenizer(paramObj.toString(), ",");
                while (st.hasMoreTokens()) {
                    String token = st.nextToken();
                    CommandType listType = annotation.collectionType();
                    switch (listType) {
                    case INTEGER:
                        listParam.add(Integer.valueOf(token));
                        break;
                    case LONG: {
View Full Code Here

Examples of com.forgeessentials.playerlogger.types.CommandType

    {
      if (exempt((EntityPlayer) e.sender))
      {
        return;
      }
      new CommandType(e.sender.getCommandSenderName(), getCommand(e));
      return;
    }
    if (logCommands_Block && !e.isCanceled() && e.sender instanceof TileEntityCommandBlock && side.isServer())
    {
      new CommandType(e.sender.getCommandSenderName(), getCommand(e));
      return;
    }
    if (logCommands_rest && !e.isCanceled() && side.isServer())
    {
      new CommandType(e.sender.getCommandSenderName(), getCommand(e));
      return;
    }
  }
View Full Code Here

Examples of com.lambdaworks.redis.protocol.CommandType

  public Object execute(String command, CommandOutput commandOutputTypeHint, byte[]... args) {

    Assert.hasText(command, "a valid command needs to be specified");
    try {
      String name = command.trim().toUpperCase();
      CommandType cmd = CommandType.valueOf(name);

      validateCommandIfRunningInTransactionMode(cmd, args);

      CommandArgs<byte[], byte[]> cmdArg = new CommandArgs<byte[], byte[]>(CODEC);
      if (!ObjectUtils.isEmpty(args)) {
View Full Code Here

Examples of com.lambdaworks.redis.protocol.CommandType

  public Object execute(String command, CommandOutput commandOutputTypeHint, byte[]... args) {

    Assert.hasText(command, "a valid command needs to be specified");
    try {
      String name = command.trim().toUpperCase();
      CommandType cmd = CommandType.valueOf(name);

      validateCommandIfRunningInTransactionMode(cmd, args);

      CommandArgs<byte[], byte[]> cmdArg = new CommandArgs<byte[], byte[]>(CODEC);
      if (!ObjectUtils.isEmpty(args)) {
View Full Code Here

Examples of com.sk89q.craftbook.mechanics.items.CommandItemDefinition.CommandType

                ItemStack stack = (ItemStack) context.getSessionData("item");
                List<ItemStack> consumables = (List<ItemStack>) context.getSessionData("consumables");

                List<String> commands = (List<String>) context.getSessionData("commands");
                String permNode = (String) context.getSessionData("permission-node");
                CommandType type = (CommandType) context.getSessionData("run-as");
                ClickType clickType = (ClickType) context.getSessionData("click-type");
                int delay = (Integer) context.getSessionData("delay");
                List<String> delayedCommands = new ArrayList<String>();
                if(delay > 0)
                    delayedCommands = (List<String>) context.getSessionData("delayed-commands");
View Full Code Here

Examples of javax.enterprise.deploy.shared.CommandType

     * Deploy the module on each given target
     */
    public void run() {
        ROOT_LOGGER.tracef("Begin run");
        try {
            CommandType cmdType = progress.getDeploymentStatus().getCommand();
            TargetModuleID[] modules = progress.getResultTargetModuleIDs();
            for (int i = 0; i < modules.length; i++) {
                TargetModuleID moduleid = modules[i];
                JBossTarget target = (JBossTarget) moduleid.getTarget();
                try {
View Full Code Here

Examples of javax.enterprise.deploy.shared.CommandType

   
    public void run() {
        ConnectionSource dasConnection= (ConnectionSource) args[0];
        SunTarget[] targetList = (SunTarget[]) args[1];
        String moduleID = (String) args[2];
        CommandType cmd = (CommandType) args[3];
        Map deployOptions = (Map) args[4];
           
        String action = (CommandType.DISTRIBUTE.equals(cmd)) ? "Creation" : "Removal";
        try {
            // Handle app-ref-creation/app-ref-removal for life-cycle-module as a special case
View Full Code Here

Examples of javax.enterprise.deploy.shared.CommandType

     *
     * @return Deployment status.
     */
    public DeploymentStatus getDeploymentStatus() {
        StringBuffer message = new StringBuffer();
        CommandType commandType = null;
        ActionType actionType = null;
        boolean completed = true;
        boolean failed = false;
        for (Iterator iter = progressObjects.iterator(); iter.hasNext();) {
            ProgressObject progress = (ProgressObject) iter.next();
            DeploymentStatus status = progress.getDeploymentStatus();
            CommandType curCommandType = status.getCommand();
            ActionType curActionType = status.getAction();
            if ( null == commandType ) {
                commandType = curCommandType;
                actionType = curActionType;
            } else if ( commandType != curCommandType ) {
View Full Code Here

Examples of javax.enterprise.deploy.shared.CommandType

    /**
     * Deploy the module on each given target
     */
    public void run() {
        log.trace("Begin run");
        CommandType cmdType = progress.getDeploymentStatus().getCommand();
        TargetModuleID[] modules = progress.getResultTargetModuleIDs();
        for (int i = 0; i < modules.length; i++) {
            TargetModuleID moduleid = modules[i];
            JBossTarget target = (JBossTarget) moduleid.getTarget();
            try {
View Full Code Here

Examples of javax.enterprise.deploy.shared.CommandType

     *
     * @return Deployment status.
     */
    public DeploymentStatus getDeploymentStatus() {
        StringBuffer message = new StringBuffer();
        CommandType commandType = null;
        ActionType actionType = null;
        boolean completed = true;
        boolean failed = false;
        for (Iterator iter = progressObjects.iterator(); iter.hasNext();) {
            ProgressObject progress = (ProgressObject) iter.next();
            DeploymentStatus status = progress.getDeploymentStatus();
            CommandType curCommandType = status.getCommand();
            ActionType curActionType = status.getAction();
            if ( null == commandType ) {
                commandType = curCommandType;
                actionType = curActionType;
            } else if ( commandType != curCommandType ) {
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.