コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public Map<Integer, MarketBean> findAllMarkets() throws NotFoundException, TechnicalException {
    log.info("Executing operation findAllMarkets");

    Map<Integer, MarketBean> mapOfMarket = new HashMap<Integer, MarketBean>();

    try {

      List<MarcheSoap> listOfMarcheSoap = gererMarcheSoapProxy.rechercherMarches();
      for (MarcheSoap bean : listOfMarcheSoap) {
        mapOfMarket.put(bean.getId(), mapperSoap.map(bean, MarketBean.class));
      }

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheNonTrouveFault e) {
      // map to NotFoundException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }

    return mapOfMarket;
  }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  public List<MarketBean> findMarketByName(String name)
      throws NotFoundException, TechnicalException {
    log.info("Executing operation findMarketByName : " + name);

    List<MarketBean> listOfMarkets = new ArrayList<MarketBean>();

    try {

      List<MarcheSoap> listOfMarcheSoap = gererMarcheSoapProxy.rechercherMarchesParNom(name);
      for (MarcheSoap bean : listOfMarcheSoap) {
        listOfMarkets.add(mapperSoap.map(bean, MarketBean.class));
      }

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheNonTrouveFault e) {
      // map to NotFoundException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }

    return listOfMarkets;
  }
コード例 #3
0
  /** {@inheritDoc} */
  @Override
  public void deleteMarket(int id) throws InvalidMarketException, TechnicalException {
    log.info("Executing operation deleteMarket");

    try {

      gererMarcheSoapProxy.supprimerMarche(id);

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheInvalideFault e) {
      // map to InvalidMarketException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }
  }
コード例 #4
0
  /** {@inheritDoc} */
  @Override
  public void createMarket(MarketBean market) throws InvalidMarketException, TechnicalException {
    log.info("Executing operation createMarket");

    try {

      MarcheSoap marcheSoap = (MarcheSoap) mapperSoap.map(market, MarcheSoap.class);
      gererMarcheSoapProxy.creerMarche(marcheSoap);

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheInvalideFault e) {
      // map to InvalidMarketException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }
  }
コード例 #5
0
  /** {@inheritDoc} */
  @Override
  public MarketBean consultMarket(int idMarket) throws NotFoundException, TechnicalException {
    log.info("Executing operation consultMarket");

    MarketBean marketBean = null;

    try {

      MarcheSoap marcheSoap = gererMarcheSoapProxy.consulterMarche(idMarket);
      marketBean = (MarketBean) mapperSoap.map(marcheSoap, MarketBean.class);

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheNonTrouveFault e) {
      // map to NotFoundException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }

    return marketBean;
  }