Skip to contentMethod: SimuliereKommando(PruefErgebnis)
      1: package servicekommandos.simulation;
2: 
3: import schnittstelle.kommandoArchitektur.KommandoOhneExceptionMitResultat;
4: import schnittstelle.kommandoArchitektur.KommandoVisitor;
5: import simulation.PruefErgebnis;
6: import simulation.SimulationsErgebnis;
7: import simulation.SimulationsServiceImpl;
8: import util.exceptions.PPSException;
9: /**
10:  * Klasse, welche ein Kommando darstellt, welches die Operation simuliereProduktionsplanung aus {@link simulation.SimulationsService} kapselt.
11:  */
12: public final class SimuliereKommando extends KommandoOhneExceptionMitResultat<SimulationsErgebnis> {
13: 
14:     private final PruefErgebnis pruefErgebnis;
15: 
16:     private SimuliereKommando(final PruefErgebnis pruefErgebnis) {
17:         this.pruefErgebnis = pruefErgebnis;
18:     }
19: 
20:     /**
21:      * Erstellt das Kommando mit den entsprechenden Parametern für die Operation.
22:      * @param pruefErgebnis pruefErgebnis für simuliereProduktionsplanung.
23:      * @return das erstellte Kommando.
24:      */
25:     public static SimuliereKommando create(final PruefErgebnis pruefErgebnis) {
26:         return new SimuliereKommando(pruefErgebnis);
27:     }
28: 
29:     @Override
30:     protected SimulationsErgebnis doIt() {
31:         return new SimulationsServiceImpl()
32:                 .simuliereProduktionsplanung(this.pruefErgebnis);
33:     }
34: 
35:     @Override
36:     public void accept(final KommandoVisitor v) throws PPSException {
37:         // TODO Wenn man den Visitor dies handeln lässt, muss der Visitor aus model das Packet service kennen.
38:         // Service kennt aber schon model und wir hätten eine circular dependency
39:     }
40: }