/* (non-Javadoc)
@see com.tvd12.ezyfox.core.command.BaseCommand#execute()
970488
@SuppressWarnings("unchecked")
    @Override
    public Boolean execute() {
        User sfsSender = CommandUtil.getSfsUser(sender, api);
        Room sfsRoom = CommandUtil.getSfsRoom(room, extension);
        if(sfsSender == null || sfsRoom == null)
            return Boolean.FALSE;
        message = (message == null) ? "" : message;
        ISFSObject sfsParams = null;
        if(params != null) {
            MessageParamsClass clazz = context.getMessageParamsClass(params.getClass());
            if(clazz != null) 
                sfsParams = new ResponseParamSerializer().object2params(clazz.getUnwrapper(), params);
        }
        if(sfsParams == null) sfsParams = new SFSObject();
        api.sendPublicMessage(sfsRoom, sfsSender, message, sfsParams);
        return Boolean.TRUE;
    }
490089
private void executeCommand(String command, List<String> arguments) {

        try {
            CmsShellCommandResult result = m_remoteShell.executeCommand(command, arguments);
            m_out.print(result.getOutput());
            updateState(result);
            if (m_exitCalled) {
                exit(0);
            } else if (m_hasError && (m_errorCode != -1)) {
                exit(m_errorCode);
            }
        } catch (RemoteException r) {
            r.printStackTrace(System.err);
            exit(1);
        }
    }
1122184
@Override
	protected boolean execute() {
		// Disabled triggers are always false
		if ((trigger instanceof Disableable) && ((Disableable) trigger).isDisabled()
				&& !(trigger instanceof Input && ((Input) trigger).isReadOnly())) {
			return false;
		}

		final Object triggerValue = getTriggerValue(null);
		final Object compareValue = getCompareValue();

		return executeCompare(triggerValue, compareValue);
	}
1359430
@SuppressWarnings("unchecked")
    @Override
    public Boolean execute() {
        User sfsSender = CommandUtil.getSfsUser(sender, api);
        User sfsRecipient = CommandUtil.getSfsUser(recipient, api);
        if(sfsSender == null || sfsRecipient == null)
            return Boolean.FALSE;
        message = (message == null) ? "" : message;
        ISFSObject sfsParams = null;
        if(params != null) {
            MessageParamsClass clazz = context.getMessageParamsClass(params.getClass());
            if(clazz != null) 
                sfsParams = new ResponseParamSerializer().object2params(clazz.getUnwrapper(), params);
        }
        if(sfsParams == null) sfsParams = new SFSObject();
        try {
            api.sendBuddyMessage(sfsSender, sfsRecipient, message, sfsParams);
        } catch (SFSBuddyListException e) {
            throw new IllegalStateException(e);
        }
        return Boolean.TRUE;
    }
716001
def execute(self, *args):
        """"""
        command, kwargs = self.parse(*args)
        return self._commands.execute(command, **kwargs)
854140
@SuppressWarnings("unchecked")
    @Override
    public Boolean execute() {
        try {
            api.changeRoomCapacity(CommandUtil.getSfsUser(owner, api),
                    CommandUtil.getSfsRoom(targetRoom, extension), 
                    maxUsers, maxSpectators);
        } catch (SFSRoomException e) {
            throw new IllegalStateException(e);
        }
        return Boolean.TRUE;
    }
777388
public static void exec_command(String command) throws IOException {
        launchProcess(command, new HashMap<String, String>(), false);
    }
1131979
@Override
	public void execute() {
		if (this.batches.isEmpty())
			return;
		
		// Reset the collection before making the call to eliminate callback chatter when
		// the batches call back to the master.
		List<Batch> old = this.batches;
		
		// Reset our batches
		this.batches = new ArrayList<Batch>();
		this.queryBatch = null;
		
		for (Batch batch: old) {
			batch.execute();
		}
	}
283879
public void execute() throws BuildException {
        if (getHost() == null) {
            throw new BuildException("Host is required.");
        }
        if (getUserInfo().getName() == null) {
            throw new BuildException("Username is required.");
        }
        if (getUserInfo().getKeyfile() == null
            && getUserInfo().getPassword() == null
            && getSshKeyData() == null) {
            throw new BuildException("Password or Keyfile is required.");
        }
        if (command == null && commandResource == null) {
            throw new BuildException("Command or commandResource is required.");
        }

        if (inputFile != null && inputProperty != null) {
            throw new BuildException("You can't specify both inputFile and"
                                     + " inputProperty.");
        }
        if (inputFile != null && !inputFile.exists()) {
            throw new BuildException("The input file "
                                     + inputFile.getAbsolutePath()
                                     + " does not exist.");
        }

        Session session = null;
        StringBuffer output = new StringBuffer();
        try {
            session = openSession();

            if(null!=getDisconnectHolder()){
                final Session sub=session;
                getDisconnectHolder().setDisconnectable(new Disconnectable() {
                    public void disconnect() {
                        sub.disconnect();
                    }
                });
            }

            /* called once */
            if (command != null) {
                executeCommand(session, command, output);
            } else { // read command resource and execute for each command
                try {
                    BufferedReader br = new BufferedReader(
                            new InputStreamReader(commandResource.getInputStream()));
                    String cmd;
                    while ((cmd = br.readLine()) != null) {
                        executeCommand(session, cmd, output);
                        output.append("\n");
                    }
                    FileUtils.close(br);
                } catch (IOException e) {
                    if (getFailonerror()) {
                        throw new BuildException(e);
                    } else {
                        log("Caught exception: " + e.getMessage(),
                            Project.MSG_ERR);
                    }
                }
            }
        } catch (JSchException e) {
            if (getFailonerror()) {
                throw new BuildException(e);
            } else {
                log("Caught exception: " + e.getMessage(), Project.MSG_ERR);
            }
        } finally {
            try {
                if (null != this.sshAgentProcess) {
                    this.sshAgentProcess.stopAgent();
                }
            } catch (IOException e) {
                log( "Caught exception: " + e.getMessage(), Project.MSG_ERR);
            }
            if (outputProperty != null) {
                getProject().setNewProperty(outputProperty, output.toString());
            }
            if (session != null && session.isConnected()) {
                session.disconnect();
            }
        }
    }
1281962
@SuppressWarnings("unchecked")
    @Override
    public Boolean execute() {
        validateCommand();
        List<User> users = new ArrayList<>();
        for(String username : usernames) {
            User sfsUser = CommandUtil.getSfsUser(username, api);
            if(sfsUser != null) users.add(sfsUser);
        }
        ISFSObject params = createResponseParams();
        extension.send(command, params, users, useUDP);
        logResponse(params);
        return Boolean.TRUE;
    }
268815
public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            String url = null;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);

            // load parameters
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doMetaCheckVersion(adminClient);
        }
1172871
@SuppressWarnings("unchecked")
    @Override
    public <T> T execute() {
        Room sfsRoom = CommandUtil.getSfsRoom(room, extension);
        User sfsUser = null;
        if(username != null)
            sfsUser = sfsRoom.getUserByName(username);
        else
            sfsUser = sfsRoom.getUserById(userId);
        return (sfsUser != null) ? (T)sfsUser.getProperty(APIKey.USER) : null;
        
    }
733812
public <T> T execute(final Object[] args, final Class<T> clazz) {
        return execute(args, clazz, true);
    }
133865
void executeCommand() throws CertificateException {
        String exceptionMessage;
        Throwable cause = null;

        try {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Executing keytool command: " + this.toString());
            }
            Process proc = Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()]));

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Waiting for keytool command process to complete...");
            }
            int exitCode = proc.waitFor();
            if (exitCode == 0) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("keytool command process completed successfully");
                }
                return;
            } else {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("keytool command process failed to complete successfully (exit code: " + exitCode + ")");
                }
                exceptionMessage = getProcErrorOutput(proc);
            }
        } catch (IOException e) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("keytool command process execution resulted in IOException: " + e.getMessage());
            }
            exceptionMessage = e.getLocalizedMessage();
            cause = e;
        } catch (InterruptedException e) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("InterruptedException while waiting for keytool command process result: " + e.getMessage());
            }
            exceptionMessage = e.getLocalizedMessage();
            cause = e;
        }

        if (cause != null) {
            throw new CertificateException(exceptionMessage, cause);
        } else {
            throw new CertificateException(exceptionMessage);
        }
    }
938223
@SuppressWarnings("unchecked")
    @Override
    public String execute() {
        User sfsUser = CommandUtil.getSfsUser(userToKick, api);
        User sfsMod = (modUser != null)
                ? CommandUtil.getSfsUser(modUser, api) : null;
        api.kickUser(sfsUser, sfsMod, kickMessage, delaySeconds);
        return userToKick;
    }
743603
@Override
    public int executeCommand(final IndexCommand command) throws IndexingException {
        LOGGER.trace("executeCommand() called...");

        // Execute and return the result...
        return executeCommand(serverDetails, command);
    }
217184
protected void execute(EntityManagerCommand command) {
        try {
            getEntityManagerCommandExecutor().execute(command);
        } catch (javax.persistence.PersistenceException e) {
            throw new PersistenceException(e);
        }
    }