code: protected boolean isCommandAvailable(String command) throws Throwable
     {
        Socket socket = null;
        try
        {
           socket = new Socket(host, port);
  
           ObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());
           output.writeUTF("getcommand");
           output.writeInt(1);
           output.writeUTF(command);
  
           output.flush();
  
           ObjectInputStream input = new ObjectInputStream(socket.getInputStream());
  
           Serializable result = (Serializable)input.readObject();
  
           if (result == null || !(result instanceof Throwable))
              return true;
  
           return false;
        }
        finally
        {
           if (socket != null)
           {
              try
              {
                 socket.close();
              }
              catch (IOException ioe)
              {
                 // Ignore
              }
           }
        }
     }
docs: Is a command available
  @param command The command name
  @return True if available; otherwise false
  @exception Throwable If an error occurs