|
|
@@ -16,11 +16,13 @@ public final class BookingServiceImpl implements BookingService {
|
|
16
|
16
|
private CargoRepository cargoRepository;
|
|
17
|
17
|
private LocationRepository locationRepository;
|
|
18
|
18
|
private RoutingService routingService;
|
|
|
19
|
+ // TODO
|
|
|
20
|
+ //private LockManager lockManager;
|
|
19
|
21
|
|
|
20
|
22
|
private final Log logger = LogFactory.getLog(getClass());
|
|
21
|
23
|
|
|
22
|
24
|
@Transactional(readOnly = false)
|
|
23
|
|
- public TrackingId registerNewCargo(final UnLocode originUnLocode, final UnLocode destinationUnLocode) {
|
|
|
25
|
+ public TrackingId bookNewCargo(final UnLocode originUnLocode, final UnLocode destinationUnLocode) {
|
|
24
|
26
|
Validate.notNull(originUnLocode);
|
|
25
|
27
|
Validate.notNull(destinationUnLocode);
|
|
26
|
28
|
|
|
|
@@ -39,7 +41,9 @@ public final class BookingServiceImpl implements BookingService {
|
|
39
|
41
|
public Cargo loadCargoForRouting(final TrackingId trackingId) {
|
|
40
|
42
|
Validate.notNull(trackingId);
|
|
41
|
43
|
|
|
42
|
|
- // TODO obtain offline lock
|
|
|
44
|
+ // TODO
|
|
|
45
|
+ //CargoLock cargoLock = lockManager.lockCargo(trackingId);
|
|
|
46
|
+
|
|
43
|
47
|
final Cargo cargo = cargoRepository.find(trackingId);
|
|
44
|
48
|
|
|
45
|
49
|
return cargo;
|
|
|
@@ -68,7 +72,8 @@ public final class BookingServiceImpl implements BookingService {
|
|
68
|
72
|
|
|
69
|
73
|
logger.info("Assigned cargo " + trackingId + " to new route");
|
|
70
|
74
|
|
|
71
|
|
- // TODO release offline lock
|
|
|
75
|
+ // TODO
|
|
|
76
|
+ //lockManager.unlockCargo(cargoLock, trackingId);
|
|
72
|
77
|
}
|
|
73
|
78
|
|
|
74
|
79
|
public void setCargoRepository(final CargoRepository cargoRepository) {
|