예제 #1
0
  public void save(Facility newFacility) {
    newFacility.validate();

    Facility storedFacility = facilityRepository.getById(newFacility.getId());

    facilityRepository.save(newFacility);

    if (!newFacility.equals(storedFacility)) {
      notify(asList(newFacility));
      if (canUpdateVirtualFacilities(newFacility, storedFacility)) {
        updateAndNotifyForVirtualFacilities(newFacility);
      }
    }
  }
예제 #2
0
 @Transactional
 public void updateEnabledAndActiveFor(Facility facility) {
   facility = facilityRepository.updateEnabledAndActiveFor(facility);
   notify(asList(facility));
 }
예제 #3
0
 public void updateAndNotifyForVirtualFacilities(Facility parentFacility) {
   facilityRepository.updateVirtualFacilities(parentFacility);
   notify(getChildFacilities(parentFacility));
 }