Package de.willuhn.util

Examples of de.willuhn.util.ApplicationException


      // (z.Bsp. vom Payment-Server) automatisch beantwortet werden kann.
      QueryMessage msg = new QueryMessage(passport);
      Application.getMessagingFactory().getMessagingQueue("hibiscus.passport.rdh.hbciversion").sendSyncMessage(msg);
      Object data = msg.getData();
      if (data == null || !(data instanceof String))
        throw new ApplicationException(i18n.tr("HBCI-Version nicht ermittelbar"));
     
      String version = (String)msg.getData();
      Logger.info("using hbci version: " + version);
     
      handler = new HBCIHandler(version,passport);
      handler.close();
      handler = null;
      Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Schl�ssel erfolgreich erstellt"), StatusBarMessage.TYPE_SUCCESS));
      return key;
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (OperationCanceledException oce)
    {
      throw oce;
    }
    catch (Exception e)
    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;
       
      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
        throw ae;

      NeedKeyAckException ack = (NeedKeyAckException) HBCIProperties.getCause(e,NeedKeyAckException.class);
      if (ack != null)
      {
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Schl�ssel erfolgreich erstellt"), StatusBarMessage.TYPE_SUCCESS));
        String msg = i18n.tr("Bitte senden Sie den INI-Brief an Ihre Bank\nund warten Sie auf die Freischaltung durch die Bank.");
        try
        {
          Application.getCallback().notifyUser(msg);
        }
        catch (Exception e2)
        {
          Logger.error("unable to notify user",e2);
          Application.getMessagingFactory().sendMessage(new StatusBarMessage(msg, StatusBarMessage.TYPE_SUCCESS));
        }
        return key;
      }
     
      Logger.error("unable to create key " + file.getAbsolutePath(),e);
      throw new ApplicationException(i18n.tr("Fehler beim Erstellen des Schl�ssels: {0}",e.getMessage()));
    }
    finally
    {
      try
      {
View Full Code Here


    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;

      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
        throw ae;

      NeedKeyAckException ack = (NeedKeyAckException) HBCIProperties.getCause(e,NeedKeyAckException.class);
      if (ack != null)
      {
        String text = i18n.tr("Bitte senden Sie den INI-Brief an Ihre Bank und warten Sie auf die Freischaltung durch die Bank.");
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(text,StatusBarMessage.TYPE_ERROR));
        throw new ApplicationException(text);
      }
     
      InvalidPassphraseException ipe = (InvalidPassphraseException) HBCIProperties.getCause(e,InvalidPassphraseException.class);
      if (ipe != null)
      {
        Logger.write(Level.TRACE,"password for key file seems to be wrong",e);
        String text = i18n.tr("Das Passwort f�r die Schl�sseldatei ist falsch.");
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(text,StatusBarMessage.TYPE_ERROR));
        throw new ApplicationException(text);
      }
     
      // Keine brauchbare Exception gefunden
      Logger.error("unable to load " + getPassportType() + " key",e);
      throw new ApplicationException(i18n.tr("Fehler beim Laden des Schl�ssels: {0}",e.getMessage()),e);
    }
    finally
    {
      if (callback != null && (callback instanceof HBCICallbackSWT))
        ((HBCICallbackSWT)callback).setCurrentHandle(null);
View Full Code Here

  public void handleAction(Object context) throws ApplicationException
  {
    final I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();

    if (!(context instanceof SepaSammelTransfer))
      throw new ApplicationException(i18n.tr("Bitte geben Sie einen SEPA-Sammelauftrag an"));

    try
    {
      final SepaSammelTransfer u = (SepaSammelTransfer) context;
     
      if (u.ausgefuehrt())
        throw new ApplicationException(i18n.tr("SEPA-Sammelauftrag wurde bereits ausgef�hrt"));

      if (u.getBuchungen().size() == 0)
        throw new ApplicationException(i18n.tr("SEPA-Sammelauftrag enth�lt keine Buchungen"));
     
      if (u.isNewObject())
        u.store(); // wir speichern bei Bedarf selbst.

      SepaSammelTransferDialog d = new SepaSammelTransferDialog(u,SepaSammelTransferDialog.POSITION_CENTER);
View Full Code Here

   * @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object)
   */
  public void handleAction(Object context) throws ApplicationException
  {
    if (context == null || !(context instanceof EinnahmeAusgabe[]))
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie die zu exportierenden Daten aus"));

    try
    {
      ExportDialog d = new ExportDialog((EinnahmeAusgabe[]) context,EinnahmeAusgabe.class);
      d.open();
View Full Code Here

   */
  public static synchronized RDHKey findByKonto(Konto konto) throws RemoteException, ApplicationException, OperationCanceledException
  {
    GenericIterator i = getKeys();
    if (!i.hasNext())
      throw new ApplicationException(i18n.tr("Bitte erstellen Sie zuerst eine Schl�sseldiskette"));

    RDHKey key = null;
   

    ArrayList keys = new ArrayList();
    while (i.hasNext())
    {
      key = (RDHKey) i.next();
      if (!key.isEnabled())
        continue;

      // BUGZILLA 173
      Konto[] verdrahtet = key.getKonten();
      if (konto != null && verdrahtet != null && verdrahtet.length > 0)
      {
        for (int j=0;j<verdrahtet.length;++j)
        {
          Konto k = verdrahtet[j];
          if (konto.equals(k))
          {
            Logger.info("found config via account. url: " + key.getFilename());
            return key;
          }
        }
      }
     
      keys.add(key);
    }
   
    // Wir haben nur einen in Frage kommenden Schluessel
    if (keys.size() == 1)
      return (RDHKey) keys.get(0);

    if (Application.inServerMode())
      throw new ApplicationException(i18n.tr("Zu verwendende Schl�sseldiskette nicht eindeutig ermittelbar. Bitte fest verkn�pfen"));

    // Nicht eindeutig
    SelectKeyDialog d = new SelectKeyDialog(SelectKeyDialog.POSITION_CENTER);
    try
    {
      return (RDHKey) d.open();
    }
    catch (OperationCanceledException oce)
    {
      throw oce;
    }
    catch (Exception e)
    {
      Logger.error("error while choosing key",e);
      throw new ApplicationException(i18n.tr("Fehler bei der Auswahl der Schl�sseldiskette"));
    }
  }
View Full Code Here

   * @throws ApplicationException
   */
  public static void removeKey(RDHKey key) throws ApplicationException
  {
    if (key == null)
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie eine Schl�sseldatei aus"));

    try
    {
      Logger.warn("removing key " + key.getFilename() + " from key registry");
      String[] existing = settings.getList("key",new String[0]);
      ArrayList newList = new ArrayList();
     
      if (existing.length == 0)
        return; // Nichts zu entfernen

      File file = new File(key.getFilename());
      for (int i=0;i<existing.length;++i)
      {
        File f = new File(existing[i]);
        if (file.equals(f))
        {
          Logger.info("removing key " + f.getAbsolutePath() + " from list");
          continue;
        }
        newList.add(f.getAbsolutePath());
       
      }
      settings.setAttribute("key",(String[]) newList.toArray(new String[newList.size()]));
    }
    catch (RemoteException re)
    {
      Logger.error("unable to remove key",re);
      throw new ApplicationException(i18n.tr("L�schen fehlgeschlagen: {0}",re.getMessage()));
    }
  }
View Full Code Here

  public void handleAction(final Object context) throws ApplicationException
  {
    final I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();

    if (context == null || (!(context instanceof Passport) && !(context instanceof PassportHandle)))
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie ein Sicherheits-Medium aus."));

    BackgroundTask task = new BackgroundTask() {
      public void run(final ProgressMonitor monitor) throws ApplicationException
      {
        HBCIHandler handler = null;
View Full Code Here

    // 1. Checken, ob wir ueberhaupt ein Script haben, welches diesen Job beherrscht
    String function = this.getFunction(type,konto);
    if (function == null)
    {
      Logger.warn("job type " + type.getSimpleName() + " not supported by " + this.getName());
      throw new ApplicationException(i18n.tr("Der Gesch�ftsvorfall wird nicht via {0} unterst�tzt",this.getName()));
    }

    SynchronizeJob instance = super.create(type,konto);
    instance.setContext(CTX_JS_FUNCTION,function); // Funktion noch drin speichern
    return (T) instance;
View Full Code Here

      // Wir checken extra noch, ob es wirklich alles Offline-Konten sind oder ob bei denen das Scripting ausgewaehlt wurde
      for (SynchronizeJob job:jobs)
      {
        Konto konto = job.getKonto();
        if (!this.supports(konto))
          throw new ApplicationException(i18n.tr("Das Konto ist kein Offline-Konto oder das Zugangsverfahren {0} wurde nicht ausgew�hlt: {1}",this.getName(),konto.getLongName()));
      }
    }
    catch (RemoteException re)
    {
      Logger.error("error while performing synchronization",re);
      throw new ApplicationException(i18n.tr("Synchronisierung fehlgeschlagen: {0}",re.getMessage()));
    }

    return super.execute(jobs);
  }
View Full Code Here

        {
          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);
View Full Code Here

TOP

Related Classes of de.willuhn.util.ApplicationException

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.