コード例 #1
0
 @Override
 public Collection<CustomerBrokerNegotiation> getSales() throws CantGetSaleNegotiationException {
   try {
     HashSet<CustomerBrokerNegotiation> sales = new HashSet<>();
     sales.addAll(saleNegotiationManager.getNegotiationsByBroker(identity));
     return sales;
   } catch (CantGetListSaleNegotiationsException e) {
     throw new CantGetSaleNegotiationException(
         CantGetSaleNegotiationException.DEFAULT_MESSAGE, e, "", "");
   }
 }
コード例 #2
0
 @Override
 public Collection<CustomerBrokerNegotiation> getSales(final NegotiationStatus status)
     throws CantGetSaleNegotiationException {
   try {
     HashSet<CustomerBrokerNegotiation> sales = new HashSet<>();
     for (CustomerBrokerNegotiation sale :
         saleNegotiationManager.getNegotiationsByBroker(identity)) {
       if (sale.getStatus() == status) sales.add(sale);
     }
     return sales;
   } catch (CantGetListSaleNegotiationsException e) {
     throw new CantGetSaleNegotiationException(
         CantGetSaleNegotiationException.DEFAULT_MESSAGE, e, "", "");
   }
 }
コード例 #3
0
 @Override
 public CustomerBrokerNegotiation getSale(final UUID negotiationId)
     throws CantGetSaleNegotiationException {
   try {
     for (CustomerBrokerNegotiation sale :
         saleNegotiationManager.getNegotiationsByBroker(identity)) {
       if (sale.getNegotiationId().equals(negotiationId)) return sale;
     }
     throw new CantGetSaleNegotiationException(
         CantGetSaleNegotiationException.DEFAULT_MESSAGE,
         null,
         "Negotiation ID: " + negotiationId.toString(),
         "NegotiationId not Found");
   } catch (CantGetListSaleNegotiationsException e) {
     throw new CantGetSaleNegotiationException(
         CantGetSaleNegotiationException.DEFAULT_MESSAGE, e, "", "");
   }
 }