Package de.willuhn.util

Examples of de.willuhn.util.ProgressMonitor


    // Warnungen ausgeben, falls vorhanden - BUGZILLA 899
    HBCIRetVal[] warnings = status.getWarnings();
    if (warnings != null && warnings.length > 0)
    {
      // Loggen
      ProgressMonitor monitor = session.getProgressMonitor();
      monitor.log(" ");
      for (HBCIRetVal val:warnings)
        monitor.log("  " + val.code + ": " + val.text);
      monitor.log(" ");
     
      // Auftrag informieren
      hasWarnings(warnings);
    }
    ////////////////////////////////////////////////////////////////////////////
View Full Code Here


   * @see de.willuhn.jameica.hbci.rmi.HBCIDBService#install()
   */
  public void install() throws RemoteException
  {
    I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();
    ProgressMonitor monitor = Application.getCallback().getStartupMonitor();
    monitor.setStatusText(i18n.tr("Installiere Hibiscus"));
    this.driver.install();
   
    Manifest mf = Application.getPluginLoader().getPlugin(HBCI.class).getManifest();
    File file = new File(mf.getPluginDir() + File.separator + "sql","create.sql");
    this.driver.execute(getConnection(),file);
View Full Code Here

     */
    protected void sync() throws Exception
    {
      ////////////////////////////////////////////////////////////////////
      // lokale Variablen
      ProgressMonitor monitor = worker.getMonitor();
      String kn               = this.getKonto().getLongName();
     
      int step = 100 / worker.getSynchronization().size();
      ////////////////////////////////////////////////////////////////////
     
      // boolean haveError = false;

      try
      {
        this.checkInterrupted();

        monitor.log(" ");
        monitor.log(i18n.tr("Synchronisiere Konto: {0}",kn));

        Logger.info("processing jobs");
        for (SynchronizeJob job:this.jobs)
        {
          this.checkInterrupted();

          String function = (String) job.getContext(CTX_JS_FUNCTION);
          if (StringUtils.isEmpty(function))
            throw new ApplicationException(i18n.tr("Kein g�ltiger Scripting-Auftrag: {0}",job.getName()));
         
          Logger.info("executing javascript function " + function);
          QueryMessage msg = new QueryMessage("function." + function,new Object[]{job,getCurrentSession()}); // Direkt-Aufruf - ohne Event-Mapping
          Application.getMessagingFactory().getMessagingQueue("jameica.scripting").sendSyncMessage(msg);
          monitor.addPercentComplete(step);
         
          // Checken, ob der Rueckgabewert eine Exception ist
          Object data = msg.getData();
          List list = (data instanceof List) ? ((List)data) : Arrays.asList(data);
          for (Object o:list)
View Full Code Here

        Logger.warn(msg);
    }
   
    if (log && session != null)
    {
      ProgressMonitor monitor = session.getProgressMonitor();
      if (type != null)
        monitor.log("[" + type + "] " + msg);
      else
        monitor.log(msg);
    }
  }
View Full Code Here

    BeanService service = Application.getBootLoader().getBootable(BeanService.class);
    SynchronizeSession session = service.get(HBCISynchronizeBackend.class).getCurrentSession();

    if (session != null)
    {
      ProgressMonitor monitor = session.getProgressMonitor();
      monitor.log(text + "\n");
    }
  }
View Full Code Here

     */
    protected void sync() throws Exception
    {
      ////////////////////////////////////////////////////////////////////
      // lokale Variablen
      ProgressMonitor monitor = HBCISynchronizeBackend.this.worker.getMonitor();
     
      Application.getMessagingFactory().getMessagingQueue(HBCI_TRACE).sendMessage(new HBCITraceMessage(HBCITraceMessage.Type.ID,this.getKonto().getID()));
      Application.getMessagingFactory().getMessagingQueue(HBCI_TRACE).sendMessage(new HBCITraceMessage(HBCITraceMessage.Type.INFO,"\n\n" + i18n.tr("{0} Synchronisiere Konto: {1}",HBCI.LONGDATEFORMAT.format(new Date()),this.getKonto().getLongName())));

      // Wir ermitteln anhand der Gesamt-Anzahl von Jobs, wieviel Fortschritt
      // pro Job gemacht wird, addieren das fuer unsere Gruppe, ziehen noch
      // einen Teil fuer Passport-Initialisierung ab (3%) sowie 3% fuer die Job-Auswertung
      // und geben den Rest den Jobs in unserer Gruppe. Wir rechnen am Anfang erstmal mit Double,
      // um die Rundungsdifferenzen etwas kleiner zu halten
      double chunk = 100d / ((double) HBCISynchronizeBackend.this.worker.getSynchronization().size()) * ((double)this.jobs.size());
      int step     = (int) ((chunk - 6) / this.jobs.size());
      ////////////////////////////////////////////////////////////////////

      boolean haveError = false;
      boolean inCatch   = false;

      try
      {
        this.checkInterrupted();

        monitor.log(" ");
        monitor.log(i18n.tr("Synchronisiere Konto: {0}",this.getKonto().getLongName()));

        Passport passport     = new TaskPassportInit().execute();
        this.handle           = new TaskHandleInit(passport).execute();
        this.handler          = new TaskHandleOpen(handle).execute();
        new TaskSepaInfo(handler).execute();

        Logger.info("processing jobs");
        for (SynchronizeJob job:this.jobs)
        {
          this.checkInterrupted();
          AbstractHBCIJob[] list = ((HBCISynchronizeJob)job).createHBCIJobs();
          for (AbstractHBCIJob hbciJob:list)
          {
            this.checkInterrupted();

            monitor.setStatusText(i18n.tr("Aktiviere HBCI-Job: \"{0}\"",job.getName()));
            Logger.info("adding job " + hbciJob.getIdentifier() + " to queue");

            HBCIJob j = handler.newJob(hbciJob.getIdentifier());
            this.dumpJob(j);
            hbciJob.setJob(j);
            j.addToQueue();
            this.hbciJobs.add(hbciJob);
            if (hbciJob.isExclusive())
            {
              Logger.info("job will be executed in seperate hbci message");
              handler.newMsg();
            }
          }
          monitor.addPercentComplete(step);
        }

        ////////////////////////////////////////////////////////////////////////
        // Jobs ausfuehren
        Logger.info("executing jobs");
        monitor.setStatusText(i18n.tr("F�hre HBCI-Jobs aus"));
        this.handler.execute();
        monitor.setStatusText(i18n.tr("HBCI-Jobs ausgef�hrt"));
        //
        ////////////////////////////////////////////////////////////////////////
      }
      catch (Exception e)
      {
        haveError = true;
        inCatch = true;
        throw e;
      }
      finally
      {
        try
        {
          String name = null;

          // Waehrend der Ergebnis-Auswertung findet KEIN "checkInterrupted" Check statt,
          // da sonst Job-Ergebnisse verloren gehen wuerden.

          // //////////////////////////////////////////////////////////////////////
          // Job-Ergebnisse auswerten.
          // checkInterrupted wird hier nicht aufgerufen, um sicherzustellen, dass
          // dieser Vorgang nicht abgebrochen wird.
          for (AbstractHBCIJob hbciJob:this.hbciJobs)
          {
            try
            {
              name = hbciJob.getName();
              monitor.setStatusText(i18n.tr("Werte Ergebnis von HBCI-Job \"{0}\" aus",name));
              Logger.info("executing check for job " + hbciJob.getIdentifier());
              hbciJob.handleResult();
            }
            catch (Throwable t)
            {
              haveError = true;

              // Nur loggen, wenn wir nicht abgebrochen wurden. Waeren sonst nur Folgefehler
              if (!HBCISynchronizeBackend.this.worker.isInterrupted())
              {
                if (t instanceof ApplicationException)
                {
                  monitor.setStatusText(t.getMessage());
                }
                else
                {
                  monitor.setStatusText(i18n.tr("Fehler beim Auswerten des HBCI-Auftrages {0}", name));
                  Logger.error("error while processing job result",t);
                  monitor.log(t.getMessage());
                }
              }
            }
          }

          monitor.addPercentComplete(3);

          if (haveError || HBCISynchronizeBackend.this.worker.isInterrupted())
          {
            Logger.warn("found errors or synchronization cancelled, clear PIN cache");
            DialogFactory.clearPINCache(this.handler != null ? this.handler.getPassport() : null);
View Full Code Here

      {
        checkInterrupted();

        ////////////////////////////////////////////////////////////////////
        // lokale Variablen
        ProgressMonitor monitor = HBCISynchronizeBackend.this.worker.getMonitor();
        Konto konto             = getKonto();
        ////////////////////////////////////////////////////////////////////

        try
        {
          Passport passport = PassportRegistry.findByClass(konto.getPassportClass());
          if (passport == null)
            throw new ApplicationException(i18n.tr("Kein HBCI-Sicherheitsmedium f�r das Konto gefunden"));

          monitor.setStatusText(i18n.tr("Initialisiere HBCI-Sicherheitsmedium"));
          passport.init(konto);
          monitor.addPercentComplete(1);

          return passport;
        }
        catch (Exception e)
        {
View Full Code Here

      {
        checkInterrupted();

        ////////////////////////////////////////////////////////////////////
        // lokale Variablen
        ProgressMonitor monitor = HBCISynchronizeBackend.this.worker.getMonitor();
        ////////////////////////////////////////////////////////////////////

        monitor.setStatusText(i18n.tr("Erzeuge HBCI-Handle"));
        PassportHandle handle = this.passport.getHandle();

        if (handle == null)
          throw new ApplicationException(i18n.tr("Fehler beim Erzeugen der HBCI-Verbindung"));

        monitor.addPercentComplete(1);
        return handle;
      }
View Full Code Here

      {
        checkInterrupted();

        ////////////////////////////////////////////////////////////////////
        // lokale Variablen
        ProgressMonitor monitor = HBCISynchronizeBackend.this.worker.getMonitor();
        ////////////////////////////////////////////////////////////////////

        try
        {
          monitor.setStatusText(i18n.tr("�ffne HBCI-Verbindung"));
          HBCIHandler handler = this.handle.open();

          if (handler == null)
            throw new ApplicationException(i18n.tr("Fehler beim �ffnen der HBCI-Verbindung"));

          monitor.addPercentComplete(1);
          return handler;
        }
        catch (Exception e)
        {
          throw HBCIProperties.getCause(e);
View Full Code Here

TOP

Related Classes of de.willuhn.util.ProgressMonitor

Copyright © 2018 www.massapicom. 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.