Examples of ICommand


Examples of com.alexnevsky.hotel.commands.ICommand

   */
  private void processRequest(HttpServletRequest request, HttpServletResponse response) {
    String page = null;

    try {
      ICommand command = RequestHelper.getInstance().getCommand(request);
      page = command.execute(request, response);
    } finally {
      logger.info("User '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN) + "'. "
          + "Dispatching to view: " + page + ". RemoteAddr: " + request.getRemoteAddr());

      RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher(page);
View Full Code Here

Examples of com.alu.e3.installer.command.ICommand

              if(logger.isDebugEnabled()) {
                logger.debug("installing: " + config);
              }
             
              /* copy and start installer setup script. */
              ICommand cmd = Command.getCommand(localizedGatewayIP);
             
              if (!CommonTools.isLocal(localizedGatewayIP))
              {
                /* Get the ssh key. TODO: handle case without sshkey (eg. if user/password provided) */
                // return manager can not be null
                Instance manager = Utilities.getManagerByIP(CommonTools.getLocalHostname(), CommonTools.getLocalAddress(),  topology.getInstancesByType(E3Constant.E3MANAGER), logger);
                SSHKey key = manager.getSSHKey();
                if (key != null) {
                  if(logger.isDebugEnabled()) {
                    logger.debug("using key: " + key.getName());
                  }
                }
               
                /* Connect via ssh. */
                SSHCommand sshCommand = (SSHCommand) cmd;
                sshCommand.connect(key, localizedGatewayIP, 22, instance.getUser(), instance.getPassword());
               
                if (!sshCommand.isConnected())
                {
                  String errorSshMsg = "Error: ssh connection to " + localizedGatewayIP+  " failed (sshkey=";
                  errorSshMsg += (key == null) ? "not defined " : key.getName();
                  errorSshMsg += "user=" + instance.getUser() + ")";
                  throw new InstallerDeployException(errorSshMsg);
                }
               
                if(logger.isDebugEnabled()) {
                  logger.debug("command type: " + cmd.getImplementationType());
                }
               
                /* check if the destination directory already exists. */
                ShellCommandResult dirExistResult = cmd.execShellCommand("ls "+ config.getRemotePath() + "/bin/install.sh");
                if (dirExistResult.getExitStatus() != 0)
                {
                  /* Create the destination directory */
                  ShellCommandResult dirCreateResult = cmd.execShellCommand("mkdir -p -m 755 "+ config.getRemotePath());
                  if (dirCreateResult.getExitStatus() != 0)
                  {
                    throw new InstallerDeployException("Unable to create remote destination directory "+ config.getRemotePath() + ".");
                  }
               
                  /* Remote copy the package. */
                  if(logger.isDebugEnabled()) {
                    logger.debug("package url: " + config.getPackageUrl());
                  }
                  URL urlPackage = new URL(config.getPackageUrl());
                  String strFilename;
                  if (urlPackage.getProtocol().equals("file"))
                  {
                    strFilename = new File(urlPackage.getFile()).getName();
                    cmd.copy(urlPackage.getFile(), config.getRemotePath() + "/" + strFilename);
                   
                  } else {
                    /* TODO: handle HTTP package URL ? */
                    if(logger.isDebugEnabled()) {
                      logger.debug("URL type " + urlPackage.getProtocol() + " is not supported yet.");
                    }
                    continue;
                  }
               
                  /* Unzip TODO: instaler filename and install location in config */
                  ShellCommandResult cmdRes = cmd.execShellCommand("tar xfz " + strFilename, config.getRemotePath());
                  if (cmdRes.getExitStatus() != 0)
                  {
                    /* unzip has failed, display output. TODO: handle failure */
                    throw new InstallerDeployException("Unzip archive" + strFilename + " failed (returned code: "+ cmdRes + ")");
                  }
                } else{
                  // version already installed in the gateway                 
                  if(logger.isErrorEnabled()) {
                    logger.error("WARNING: " + config.getRemotePath() + " already exist on gateway " + localizedGatewayIP);
                  }
                 
                  report.append("WARNING: " + config.getRemotePath() + " already exist on gateway " + localizedGatewayIP + ". " +
                      "Be carefull this existing binary was used. Remove it first to use the new binary content !!! \n");

                }
               
                String fullyQualifiedInstallerCmd = replaceManagerIPPattern(config.getInstallerCmd(), managerIP);
                if(logger.isDebugEnabled()) {
                  logger.debug("Executing shell command '" + fullyQualifiedInstallerCmd + "'");
                }
               
                /* Launch Install. */
                ShellCommandResult cmdResInstallation = cmd.execShellCommand(fullyQualifiedInstallerCmd, config.getRemotePath());
                if (cmdResInstallation.getExitStatus() != 0)
                {
                  /* remote installation has failed, display output. */
                  throw new InstallerDeployException("Installation has failed while executing command [" + fullyQualifiedInstallerCmd + "]\ndetails:"+ cmdResInstallation);
                }
                 
                /* Launch sanity check. */
                ShellCommandResult cmdResSanityCheck = cmd.execShellCommand(config.getSanityCheckCmd(), config.getRemotePath());
                if (cmdResSanityCheck.getExitStatus() != 0)
                {
                  /* remote installation has failed, display output. TODO: handle failure */
                  throw new InstallerDeployException("Sanity check has failed  while executing command ["+ config.getSanityCheckCmd() + "] in the folder [" + config.getRemotePath() + "]\nDetails:"+ cmdResSanityCheck);
                }
              }
              else { // Local
                //if ("E3Gateway".equals(instance.getType())) {
               
                String generateNatureCmd = config.getGenerateNatureCmd();
                if (generateNatureCmd != null && !generateNatureCmd.isEmpty())
                {
               
                  String fullyQualifiedGenerateNatureCmd = replaceManagerIPPattern(generateNatureCmd, managerIP);
                  if(logger.isDebugEnabled()) {
                    logger.debug("Executing shell command '" + fullyQualifiedGenerateNatureCmd + "'");
                  }
                 
                  /* Get the ssh key. TODO: handle case without sshkey (eg. if user/password provided) */
                  SSHKey key = instance.getSSHKey();
                  if (key != null) {
                    if(logger.isDebugEnabled()) {
                      logger.debug("using key: " + key.getName());
                    }
                  }
                  /* Connect via ssh. */
                  SSHCommand sshCommand = (SSHCommand) cmd;
                  sshCommand.connect(key, localizedGatewayIP, 22, instance.getUser(), instance.getPassword());
                 
                  if (!sshCommand.isConnected())
                  {
                    String errorSshMsg = "Error: ssh connection to" + localizedGatewayIP+  " failed (sshkey=";
                    errorSshMsg += (key == null) ? "not defined " : key.getName();
                    errorSshMsg += "user=" + instance.getUser() + ")";
                    throw new InstallerDeployException(errorSshMsg);
                  }
                 
                  // And we need to update the configuration.properties file directly
                  ShellCommandResult cmdGenerateNature = cmd.execShellCommand(fullyQualifiedGenerateNatureCmd, config.getRemotePath());
                  if (cmdGenerateNature.getExitStatus() != 0)
                  {
                   
                    /* Update nature failed */
                    throw new InstallerDeployException("Update nature has failed while executing command ["+ fullyQualifiedGenerateNatureCmd + "] in the folder [" + config.getRemotePath() + "]\nDetails:"+ cmdGenerateNature);
View Full Code Here

Examples of comand.classes.ICommand

  public void mouseUp(Point p) {
    MouseButton = "UP";
    LastMousePosition = p;
   
    drawingBoard.remove(drawingBoard.getLastInsert());
    ICommand command = new PaintCommand(drawingBoard, latestItem);
    StackCommands.getInstance().addCommand(command);
        command.doExecute();
  }
View Full Code Here

Examples of edu.isi.karma.controller.command.ICommand

  protected ICommand extractPreviousCommand(ExecutionController ctrl) {

    CommandHistory commandHistory = ctrl.getWorkspace().getCommandHistory();
    List<ICommand> commands = commandHistory._getHistory();
    for(int i = commands.size() -1 ; i>=0; i--) {
      ICommand command = commands.get(i);
      if(command instanceof SubmitPythonTransformationCommand) {
        SubmitPythonTransformationCommand pyCommand = (SubmitPythonTransformationCommand)command;
        if(pyCommand.worksheetId.equals(this.worksheetId)) {
          if(pyCommand.pythonNodeId.equals(this.pythonNodeId)) {
            return command;
View Full Code Here

Examples of fr.esrf.tangoatk.core.ICommand

        }
        // System.out.println("notifyCommandListIsConnected =" + commandList.size());
        try {
            Enumeration<ICommand> enumerationCommand = commandList.elements();
            while (enumerationCommand.hasMoreElements()) {
                ICommand command = enumerationCommand.nextElement();
                if (!m_CommandList.containsKey(command.getName().toLowerCase())) {
                    m_CommandList.put(command.getName().toLowerCase(), command);
                }
            }

            Enumeration<ConnectionListener> enumeration = connectionListener.elements();
            ConnectionListener listener = null;
View Full Code Here

Examples of jp.vmi.selenium.selenese.command.ICommand

     * @param name command name.
     * @param args command arguments.
     */
    public void addCommand(ICommandFactory commandFactory, String name, String... args) {
        int i = commandList.size() + 1;
        ICommand command = commandFactory.newCommand(i, name, args);
        addCommand(command);
    }
View Full Code Here

Examples of net.minecraft.command.ICommand

        }
        else
        {
            if (astring.length > 1)
            {
                ICommand icommand = (ICommand)commandMap.get(s1);

                if (icommand != null)
                {
                    return icommand.addTabCompletionOptions(p_71558_1_, dropFirstString(astring));
                }
            }

            return null;
        }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.ICommand

      return s_stringMgr.getString("DriversListInternalFrame.windowtitle");
    }

    public ICommand getDoubleClickCommand(MouseEvent evt)
    {
      ICommand cmd = null;
      ISQLDriver driver = _driversList.getSelectedDriver();
      if (driver != null)
      {
        cmd = new ModifyDriverCommand(_app, driver);
      }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.ICommand

   private void onMouseClicked(MouseEvent evt)
   {
      if (evt.getClickCount() == 2)
      {
         ICommand cmd = _uiFactory.getDoubleClickCommand(evt);
         if (cmd != null)
         {
            try
            {
               cmd.execute();
            }
            catch (BaseException ex)
            {
                      // i18n[BaseListInternalFrame.error.execdoubleclick=Error occured executing doubleclick event]
               s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"), ex);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.ICommand

      return s_stringMgr.getString("AliasesListInternalFrame.windowtitle");
    }

    public ICommand getDoubleClickCommand(MouseEvent evt)
    {
      ICommand cmd = null;
      SQLAlias alias = _aliasesList.getSelectedAlias(evt);
      if (alias != null)
      {
        cmd = new ConnectToAliasCommand(_app, alias);
      }
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.