示例#1
0
 public static void fireCustomerEvent(Customer customer, String type) {
   Map<String, String> properties = new HashMap<String, String>();
   properties.put("id", customer.getId());
   properties.put("name", customer.getName());
   Event event = new Event("pickupnet/customer/" + type, properties);
   sendEvent(event);
 }
示例#2
0
 public static void fireShipmentEvent(Shipment shipment, String type) {
   Map<String, Object> properties = new HashMap<String, Object>();
   properties.put("shipment", shipment);
   properties.put("id", shipment.getId());
   properties.put("status", shipment.getStatus().toString());
   Address pickUpAddress = shipment.getPickUpAddress();
   if (pickUpAddress != null) {
     properties.put("pickupAddress", pickUpAddress.getText());
   }
   Address shipToAddress = shipment.getShipToAddress();
   if (shipToAddress != null) {
     properties.put("shipToAddress", shipToAddress.getText());
   }
   Customer orderer = shipment.getOrderer();
   if (orderer != null) {
     properties.put("orderer", orderer.getName());
   }
   Event event = new Event("pickupnet/shipment/" + type, properties);
   sendEvent(event);
 }