Package org.kapott.hbci.GV

Examples of org.kapott.hbci.GV.HBCIJobImpl


                    kernel.rawNewMsg("CustomMsg");
                   
                    // durch alle jobs loopen, die eigentlich in der aktuellen
                    // nachricht abgearbeitet werden m�ssten
                    for (Iterator<HBCIJobImpl> i=tasks.iterator();i.hasNext();) {
                        HBCIJobImpl task=i.next();
                       
                        // wenn der Task entweder noch gar nicht ausgef�hrt wurde
                        // oder in der letzten Antwortnachricht ein entsprechendes
                        // Offset angegeben wurde
                        if (task.needsContinue(loop)) {
                            task.setContinueOffset(loop);
                           
                            Properties p=task.getLowlevelParams();
                            String header=HBCIUtilsInternal.withCounter("GV",taskNum);
                           
                            String taskName=task.getName();
                            HBCIUtils.log("adding task "+taskName,HBCIUtils.LOG_DEBUG);
                            HBCIUtilsInternal.getCallback().status(mainPassport,HBCICallback.STATUS_SEND_TASK,task);
                            task.setIdx(taskNum);
                           
                            // Daten f�r den Task festlegen
                            for (Enumeration e=p.keys();e.hasMoreElements();) {
                                String key=(String)(e.nextElement());
                                kernel.rawSet(header+"."+key,p.getProperty(key));
                            }
                           
                            // additional passports f�r diesen task ermitteln
                            // und zu den passports f�r die aktuelle nachricht
                            // hinzuf�gen;
                            // doppelg�nger werden schon von
                            // HBCIPassportList.addPassport() herausgefiltert
                            msgPassports.addAll(task.getSignaturePassports());
                           
                            taskNum++;
                        }
                    }
                   
                    // wenn keine jobs f�r die aktuelle message existieren
                    if (taskNum==0) {
                        HBCIUtils.log(
                                "loop "+(loop+1)+" aborted, because there are no more tasks to be executed",
                                HBCIUtils.LOG_DEBUG);
                        addMsgStatus=false;
                        break;
                    }
                   
                    kernel.rawSet("MsgHead.dialogid", dialogid);
                    kernel.rawSet("MsgHead.msgnum", getMsgNum());
                    kernel.rawSet("MsgTail.msgnum", getMsgNum());
                    nextMsgNum();
                   
                    // nachrichtenaustausch durchf�hren
                    msgstatus=kernel.rawDoIt(msgPassports,HBCIKernelImpl.SIGNIT,HBCIKernelImpl.CRYPTIT,HBCIKernelImpl.NEED_SIG,HBCIKernelImpl.NEED_CRYPT);
                    Properties result=msgstatus.getData();
                   
                    // searching for first segment number that belongs to the custom_msg
                    // we look for entries like {"1","CustomMsg.MsgHead"} and so
                    // on (this data is inserted from the HBCIKernelImpl.rawDoIt() method),
                    // until we find the first segment containing a task
                    int offset=0;   // this specifies, how many segments precede the first task segment
                    for (offset=1;true;offset++) {
                        String path=result.getProperty(Integer.toString(offset));
                        if (path==null || path.startsWith("CustomMsg.GV")) {
                            if (path==null) { // wenn kein entsprechendes Segment gefunden, dann offset auf 0 setzen
                                offset=0;
                            }
                            break;
                        }
                    }
                   
                    if (offset!=0) {          
                        // f�r jeden Task die entsprechenden R�ckgabedaten-Klassen f�llen
                        // in fillOutStore wird auch "executed" fuer den jeweiligen Task auf true gesetzt.
                        for (Iterator<HBCIJobImpl> i=tasks.iterator();i.hasNext();) {
                            HBCIJobImpl task=i.next();
                            if (task.needsContinue(loop)) {
                                // nur wenn der auftrag auch tatsaechlich gesendet werden musste
                                try {
                                    task.fillJobResult(msgstatus,offset);
                                    HBCIUtilsInternal.getCallback().status(mainPassport,HBCICallback.STATUS_SEND_TASK_DONE,task);
                                } catch (Exception e) {
                                    msgstatus.addException(e);
                                }
                            }
View Full Code Here


        HBCIUtils.log("creating new job "+jobname,HBCIUtils.LOG_DEBUG);
       
        if (jobname==null || jobname.length()==0)
            throw new InvalidArgumentException(HBCIUtilsInternal.getLocMsg("EXCMSG_EMPTY_JOBNAME"));
       
        HBCIJobImpl ret=null;
        String      className="org.kapott.hbci.GV.GV"+jobname;

        try {
            Class cl=Class.forName(className);
            Constructor cons=cl.getConstructor(new Class[] {HBCIHandler.class});
View Full Code Here

        HBCIUtils.log("generating new lowlevel-job "+gvname,HBCIUtils.LOG_DEBUG);

        if (gvname==null || gvname.length()==0)
            throw new InvalidArgumentException(HBCIUtilsInternal.getLocMsg("EXCMSG_EMPTY_JOBNAME"));

        HBCIJobImpl ret=new GVTemplate(gvname,this);
        return ret;
    }
View Full Code Here

               
                ArrayList<HBCIJobImpl> additional_msg_tasks=null;
               
                // jeden task einer nachricht ansehen
                for (Iterator<HBCIJobImpl> j=msg_tasks.iterator();j.hasNext();) {
                    HBCIJobImpl task= j.next();
                    String      segcode=task.getHBCICode();

                    if (getPinTanInfo(segcode).equals("J")) {
                        // es handelt sich um einen tan-pflichtigen task
                        HBCIUtils.log("found task that requires a TAN: "+segcode+" - have to patch message queue",HBCIUtils.LOG_DEBUG);
                       
                        if (process.equals("1")) {
                            // prozessvariante 1
                            HBCIUtils.log("process #1: adding new message with HKTAN(p=1,hash=...) before current message",HBCIUtils.LOG_DEBUG);
                           
                            // neue msg erzeugen
                            additional_msg_tasks=new ArrayList<HBCIJobImpl>();

                            GVTAN2Step hktan = (GVTAN2Step) handler.newJob("TAN2Step");
                           
                            // muessen wir explizit setzen, damit wir das HKTAN in der gleichen Version
                            // schicken, in der das HITANS kam.
                            hktan.setSegVersion(segversion);
                           
                            hktan.setParam("process",process);
                            hktan.setParam("notlasttan","N");
                           
                            // willuhn 2011-05-16
                            // Siehe FinTS_3.0_Security_Sicherheitsverfahren_PINTAN_Rel_20101027_final_version.pdf, Seite 58
                            int hktanVersion = Integer.parseInt(hktan.getSegVersion());
                            if (hktanVersion >= 5)
                            {
                              // Bis HKTAN4/hhd1.3 wurde das noch als Challenge-Parameter uebermittelt. Jetzt hat es einen
                              // eigenen Platz in den Job-Parametern
                              hktan.setParam("ordersegcode",task.getHBCICode());

                              // Zitat aus HITANS5: Diese Funktion erm�glicht das Sicherstellen einer g�ltigen Kontoverbindung
                              // z. B. f�r die Abrechnung von SMS-Kosten bereits vor Erzeugen und Versenden einer
                              // (ggf. kostenpflichtigen!) TAN.
                              //  0: Auftraggeberkonto darf nicht angegeben werden
                              //  2: Auftraggeberkonto muss angegeben werden, wenn im Gesch�ftsvorfall enthalten
                              String noa = secmechInfo.getProperty("needorderaccount","");
                              HBCIUtils.log("needorderaccount=" + noa,HBCIUtils.LOG_INFO);
                              if (noa.equals("2"))
                              {
                                Konto k = task.getOrderAccount();
                                if (k != null)
                                {
                                    HBCIUtils.log("applying orderaccount to HKTAN for " + task.getHBCICode(),HBCIUtils.LOG_INFO);
                                    hktan.setParam("orderaccount",k);
                                }
                                else
                                {
                                    HBCIUtils.log("orderaccount needed, but not found in " + task.getHBCICode(),HBCIUtils.LOG_WARN);
                                }
                              }
                            }
                           
                            // TODO: das f�r mehrfachsignaturen
                            // hktan.setParam("notlasttan","J");
                           
                            // orderhash ermitteln
                            try {
                                // TODO: hier wird jetzt *immer* segnum=3 angenommen,
                                // kann in Einzelf�llen evtl. auch anders sein (?)
                                SEG seg=task.createJobSegment(3);
                                seg.validate();
                                String segdata=seg.toString(0);
                                HBCIUtils.log("calculating hash for jobsegment: "+segdata,HBCIUtils.LOG_DEBUG2);
                               
                                // zu verwendenden Hash-Algorithmus von dem Wert "orderhashmode" aus den BPD abh�ngig machen
View Full Code Here

    }
   
    public HBCIPassport getPassport()
    {
        HBCIPassport passport=null;
        HBCIJobImpl  job=(HBCIJobImpl)getParentJob();
        if (job!=null) {
            passport=job.getMainPassport();
        }
        return passport;
    }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void test001() throws Exception
  {
    HBCIJobImpl job = (HBCIJobImpl) handler.newJob("Ueb");
   
    // wir nehmen einfach das erste verfuegbare Konto
    job.setParam("src",passport.getAccounts()[0]);
    job.setParam("dst",passport.getAccounts()[0]);
    job.setParam("btg",new Value(1L,"EUR"));
    job.setParam("usage","test");
    job.setParam("name","test");
    job.setParam("key","51");
   
    job.addToQueue();
  
    SEG seg = job.createJobSegment(0);
    seg.validate();
    String msg = seg.toString(0);
    Assert.assertEquals("HKUEB:0:5+0001956434:EUR:280:30060601+0001956434:EUR:280:30060601+TEST++0,01:EUR+51++TEST'",msg);
  }
View Full Code Here

TOP

Related Classes of org.kapott.hbci.GV.HBCIJobImpl

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.