Do a remote command (Override this with your code).
@param strCommand The command to execute
@param properties The properties
@return Boolean.FALSE if the command was not handled, anything else if it was.
176748
public Object doRemoteCommand(String strCommand, Map<String, Object> properties)
    {
    	return Boolean.FALSE;   // Override this to handle this command
    }
1325319
public static String runShellCommand( Session session, String command ) throws JSchException, IOException {
        String remoteResponseStr = launchACommand(session, command);
        return remoteResponseStr;
    }
493770
public int commandToDocType(String strCommand)
    {
        if (MessageLog.MESSAGE_SCREEN.equalsIgnoreCase(strCommand))
            return MessageLog.MESSAGE_SCREEN_MODE;
        if (MessageLog.SOURCE_SCREEN.equalsIgnoreCase(strCommand))
            return MessageLog.SOURCE_SCREEN_MODE;
        return super.commandToDocType(strCommand);
    }
254514
public static String runDemonShellCommand( Session session, String command ) throws JSchException, IOException {
        String remoteResponseStr = launchACommandAndExit(session, command);
        return remoteResponseStr;
    }
1295701
public static void runShellCommand(String[] cmd,
                                     StringBuilder outputLines,
                                     StringBuilder errorLines)
    throws IOException {
    Process p = Runtime.getRuntime().exec(cmd);
    if (outputLines != null) {
      BufferedReader in =
        new BufferedReader(new InputStreamReader(p.getInputStream()));
      String line;
      while ((line = in.readLine()) != null) {
        outputLines.append(line);
      }
    }
    if (errorLines != null) {
      BufferedReader err =
        new BufferedReader(new InputStreamReader(p.getErrorStream()));
      String line;
      while ((line = err.readLine()) != null) {
        errorLines.append(line);
      }
    }
  }
182945
public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
        throws RemoteException
    {
        String strCommand = this.getProperty(REMOTE_COMMAND, properties);
        if (SEND_MESSAGE.equals(strCommand))
        {
            BaseMessage message = (BaseMessage)this.getNextObjectParam(in, MESSAGE, properties);
            ((RemoteSendQueue)m_remoteObject).sendMessage(message);
        }
        else
            super.doProcess(in, out, properties);
    }
341080
public RemoteTask createRemoteTask(Map<String, Object> properties) throws RemoteException
    {
        Utility.getLogger().info("createRemoteTask()");
        RemoteTask remoteTask = this.getNewRemoteTask(properties);
        return remoteTask;
    }
726059
private void initRemoteCommands()
   {
      // register commands
      suspend = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.query.SearchManager-suspend-" + wsId + "-"
               + (parentSearchManager == null);
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            suspendLocally();
            return null;
         }
      });

      resume = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.query.SearchManager-resume-" + wsId + "-"
               + (parentSearchManager == null);
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            resumeLocally();
            return null;
         }
      });

      requestForResponsibleForResuming = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.query.SearchManager-requestForResponsibilityForResuming-"
               + wsId + "-" + (parentSearchManager == null);
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            return isResponsibleForResuming.get();
         }
      });

      changeIndexState = rpcService.registerCommand(new RemoteCommand()
      {
         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.query.SearchManager-changeIndexerState-" + wsId + "-"
               + (parentSearchManager == null);
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            boolean isOnline = (Boolean)args[0];
            boolean allowQuery = (args.length == 2) ? (Boolean)args[1] : false;
            SearchManager.this.setOnline(isOnline, allowQuery, true);
            return null;
         }
      });

   }
866368
public function executeRemotely(Garp_Shell_RemoteSession $session) {
        $commandString  = $this->renderThrottledCommandIfNecessary($session);
        return $this->_executeStringRemotely($commandString, $session);
    }
506916
@Override
    protected void executeImpl(CommandLine cmd) {
        try {
            List<PropertyDefinition> defintions =
                new PropertyDefinitionListBuilder().addMillDb()
                                                   .build();
            PropertyVerifier verifier = new PropertyVerifier(defintions);
            verifier.verify(System.getProperties());
            ApplicationContext context =
                new AnnotationConfigApplicationContext("org.duracloud.mill.db",
                                                       "org.duracloud.mill.manifest.builder");
            log.info("context initialized");

            boolean dryRun = Boolean.valueOf(cmd.hasOption("d"));
            boolean clean = Boolean.valueOf(cmd.hasOption("C"));
            String host = cmd.getOptionValue("host");
            String port = cmd.getOptionValue("port", "443");
            String username = cmd.getOptionValue("u");
            String password = cmd.getOptionValue("p");
            List<String> spaceList = new LinkedList<>();
            if (cmd.hasOption("s")) {
                String spaces = cmd.getOptionValue("s", "");
                if (!StringUtils.isEmpty(spaces)) {
                    spaceList = Arrays.asList(spaces.split("[,]"));
                }
            }

            List<String> storeList = new LinkedList<>();

            if (cmd.hasOption("t")) {
                String stores = cmd.getOptionValue("t", "");
                if (!StringUtils.isEmpty(stores)) {
                    storeList = Arrays.asList(stores.split("[,]"));
                }
            }

            int threads = 0;
            if (cmd.hasOption("T")) {
                threads = Integer.parseInt(cmd.getOptionValue("T", "10"));
            }

            String account = host.split("[.]")[0];
            ContentStoreManager storeManager = new ContentStoreManagerImpl(host, port);
            storeManager.login(new Credential(username, password));
            Map<String, ContentStore> contentStoreMap = storeManager.getContentStores();
            List<ContentStore> contentStores = new LinkedList<>();
            for (String storeId : contentStoreMap.keySet()) {
                if (storeList.isEmpty() || storeList.contains(storeId)) {
                    ContentStore contentStore = contentStoreMap.get(storeId);
                    contentStores.add(contentStore);
                }
            }

            ManifestBuilder builder = (ManifestBuilder) context.getBean(ManifestBuilder.class);
            builder.init(account, contentStores, spaceList, clean, dryRun, threads);
            builder.execute();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        } finally {
            log.info("exiting...");
        }
    }
214858
public static String exec(final String cmd, final long timeout) {
        final StringTokenizer st = new StringTokenizer(cmd);
        final String[] cmds = new String[st.countTokens()];
        for (int i = 0; st.hasMoreTokens(); i++) {
            cmds[i] = st.nextToken();
        }

        return exec(cmds, timeout);
    }
825348
public String getFakeRemoteProperty(String strProperty)
    {
        if (SQLParams.EDIT_DB_PROPERTY.equalsIgnoreCase(strProperty))
            return SQLParams.DB_EDIT_NOT_SUPPORTED;     // By default, remote locks are not supported natively by the database
        return null;
    }
1289596
public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
        throws RemoteException
    {
        String strCommand = this.getProperty(REMOTE_COMMAND, properties);
        try {
            if (OPEN.equals(strCommand))
            {
                String strKeyArea = this.getNextStringParam(in, KEY, properties);
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                boolean bDirection = this.getNextBooleanParam(in, DIRECTION, properties);
                String strFields = this.getNextStringParam(in, FIELDS, properties);
                Object objInitialKey = this.getNextObjectParam(in, INITIAL_KEY, properties);
                Object objEndKey = this.getNextObjectParam(in, END_KEY, properties);
                byte[] byBehaviorData = (byte[])this.getNextObjectParam(in, BEHAVIOR_DATA, properties);
                ((RemoteTable)m_remoteObject).open(strKeyArea, iOpenMode, bDirection, strFields, objInitialKey, objEndKey, byBehaviorData);
            }
            else if (ADD.equals(strCommand))
            {
                Object objData = this.getNextObjectParam(in, DATA, properties);
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).add(objData, iOpenMode);
                this.setReturnObject(out, objReturn);
            }
            else if (EDIT.equals(strCommand))
            {
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                int iErrorCode = ((RemoteTable)m_remoteObject).edit(iOpenMode);
                this.setReturnObject(out, new Integer(iErrorCode));
            }
            else if (SET.equals(strCommand))
            {
                Object objData = this.getNextObjectParam(in, DATA, properties);
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                ((RemoteTable)m_remoteObject).set(objData, iOpenMode);
            }
            else if (REMOVE.equals(strCommand))
            {
                Object objData = this.getNextObjectParam(in, DATA, properties);
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                ((RemoteTable)m_remoteObject).remove(objData, iOpenMode);
            }
            else if (DO_MOVE.equals(strCommand))
            {
                int iRelPosition = this.getNextIntParam(in, POSITION, properties);
                int iCount = this.getNextIntParam(in, COUNT, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).doMove(iRelPosition, iCount);
                this.setReturnObject(out, objReturn);
            }
            else if (SEEK.equals(strCommand))
            {
                String strSeekSign = this.getNextStringParam(in, SIGN, properties);
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                String strKeyArea = this.getNextStringParam(in, KEY, properties);
                String strFields = this.getNextStringParam(in, FIELDS, properties);
                Object objKeyData = this.getNextObjectParam(in, KEY_DATA, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).seek(strSeekSign, iOpenMode, strKeyArea, strFields, objKeyData);
                this.setReturnObject(out, objReturn);
            }
            else if (DO_SET_HANDLE.equals(strCommand))
            {
                Object bookmark = this.getNextObjectParam(in, BOOKMARK, properties);
                int iOpenMode = this.getNextIntParam(in, OPEN_MODE, properties);
                String strFields = this.getNextStringParam(in, FIELDS, properties);
                int iHandleType = this.getNextIntParam(in, TYPE, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).doSetHandle(bookmark, iOpenMode, strFields, iHandleType);
                this.setReturnObject(out, objReturn);
            }
            else if (GET_LAST_MODIFIED.equals(strCommand))
            {
                int iHandleType = this.getNextIntParam(in, TYPE, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).getLastModified(iHandleType);
                this.setReturnObject(out, objReturn);
            }
            else if (GET.equals(strCommand))
            {
                int iRowIndex = this.getNextIntParam(in, INDEX, properties);
                int iRowCount = this.getNextIntParam(in, COUNT, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).get(iRowIndex, iRowCount);
                this.setReturnObject(out, objReturn);
            }
            else if (SET_REMOTE_PROPERTY.equals(strCommand))
            {
                String strProperty = this.getNextStringParam(in, KEY, properties);
                String strValue = this.getNextStringParam(in, VALUE, properties);
                ((RemoteTable)m_remoteObject).setRemoteProperty(strProperty, strValue);
            }
            else if (MAKE_FIELD_LIST.equals(strCommand))
            {
                String strFieldsToInclude = this.getNextStringParam(in, FIELDS, properties);
                Object objReturn = ((RemoteTable)m_remoteObject).makeFieldList(strFieldsToInclude);
                this.setReturnObject(out, objReturn);
            }
            else if (GET_REMOTE_DATABASE.equals(strCommand))
            {
                Map<String,Object> propIn = this.getNextPropertiesParam(in, PROPERTIES, properties);
                if (propIn != null)
                    properties.putAll(propIn);
                RemoteDatabase remoteDatabase = ((RemoteTable)m_remoteObject).getRemoteDatabase(properties);
                // First, see if this is in my list already?
                String strDBID = this.find(remoteDatabase);
                if (strDBID == null)
                {
                    strDBID = this.add(new DatabaseHolder((TaskHolder)this.getParentHolder(), remoteDatabase));
                }
                this.setReturnString(out, strDBID);
            }
            else
                super.doProcess(in, out, properties);
        } catch (DBException ex)    {
            this.setReturnObject(out, ex);
        } catch (Exception ex)    {
            this.setReturnObject(out, ex);
        }
    }
584818
private void executeMvnCommand(final String... args)
            throws CommandLineException, MojoFailureException {
        executeCommand(cmdMvn, true, argLine, args);
    }
837922
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = AdminToolUtils.copyArrayCutFirst(args);
        if(subCmd.equals("add")) {
            SubCommandStoreAdd.executeCommand(args);
        } else if(subCmd.equals("update")) {
            SubCommandStoreUpdate.executeCommand(args);
        } else if(subCmd.equals("delete")) {
            SubCommandStoreDelete.executeCommand(args);
        } else if(subCmd.equals("rollback-ro")) {
            SubCommandStoreRollbackReadOnly.executeCommand(args);
        } else if(subCmd.equals("truncate-partition")) {
            SubCommandStoreTruncatePartition.executeCommand(args);
        } else if(subCmd.equals("truncate-store")) {
            SubCommandStoreTruncateStore.executeCommand(args);
        } else {
            printHelp(System.out);
        }
    }
327952
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = AdminToolUtils.copyArrayCutFirst(args);
        if(subCmd.equals("native-backup")) {
            SubCommandNativeBackup.executeCommand(args);
        } else if(subCmd.equals("restore-from-replica")) {
            SubCommandRestoreFromReplica.executeCommand(args);
        } else {
            AdminCommand.printHelp(System.out);
        }
    }
422452
public static StringBuffer runCommand(String[] cmd) {
    StringBuffer retval = new StringBuffer(MAX_OUTPUT_LENGTH);
    Process p;
    try {
      p = Runtime.getRuntime().exec(cmd);
      InputStream tmp = p.getInputStream();
      p.waitFor();
      int c;
      while ((c = tmp.read()) != -1)
        retval.append((char) c);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    return retval;
  }