summaryrefslogtreecommitdiffstats
path: root/Master/Daten- und Systemintegration/Praktikum/Projekte/DSI-Praktikum-1/ausgang/DSI-ejb/src/java/beans/lieferant/LieferantBean.java
blob: 2dbc76a2beb3b1d5037c1631743f705728309900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beans.lieferant;

import beans.*;
import beans.lager.LagerRemote;
import beans.artikelManager.ArtikelManagerRemote;
import beans.adressen.AdressenRemote;
import exceptions.IllegalerWertException;
import exceptions.UnbekanntesEntityException;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 *
 * @author jmueller
 */
@WebService
@Stateless(mappedName="LieferantBean")
public class LieferantBean implements LieferantRemote {
    @EJB
    private ArtikelManagerRemote artikelManagerBean;
    @EJB
    private LagerRemote lagerBean;
    @EJB
    private AdressenRemote adressenBean;

    
    
    /**
     * bestellt eine bestimmte Anzahl von Artikeln nach
     * @param id        die Id des Artikels
     * @param anzahl    die Anzahl
     */
    // TODO: Session Bean erstellen die die Adresse des Lieferanten für bestimmte 
    // Artikel heraussucht
    @WebMethod
    public void bestelleNach(
            @WebParam(name="artikelId") long id,
            @WebParam(name="anzahl") long anzahl) throws  UnbekanntesEntityException, IllegalerWertException{
        System.out.println("Lieferant: bestelleNach("+id+","+anzahl+")");        
        lagerBean.bucheArtikelEin(id, anzahl);
        
        System.out.println("Bestellung erfolgt bei: " + adressenBean.getLieferantenAdresseFuerArtikel(id) );
    }
    
    
    
}