Skip to content

Commit 74b9138

Browse files
martingrswltr
andcommitted
Remove deprecated code
Also make the following related changes: * In the implementation for version 7 of the persistence schema, ensure that null envelope keys are converted to the empty string, as null envelope keys are not allowed anymore. * Change @deprecated annotations to @ScheduleApiChange in a couple of places in the web API implementation, as we do not really deprecate the code there, just mark it to not be used in any future web API versions anymore. Co-authored-by: Stefan Walter <stefan.walter@iml.fraunhofer.de> Merged-by: Stefan Walter <stefan.walter@iml.fraunhofer.de>
1 parent 3299e23 commit 74b9138

File tree

70 files changed

+91
-3451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+91
-3451
lines changed

opentcs-api-base/src/main/java/org/opentcs/access/ModelTransitionEvent.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package org.opentcs.access;
44

55
import java.io.Serializable;
6-
import org.opentcs.util.annotations.ScheduledApiChange;
76

87
/**
98
* Emitted when the kernel loads a model.
@@ -20,10 +19,6 @@ public class ModelTransitionEvent
2019
* The new model the kernel is in transition to.
2120
*/
2221
private final String newModelName;
23-
/**
24-
* Whether the content of the model actually changed with the transition.
25-
*/
26-
private final boolean modelContentChanged;
2722
/**
2823
* Whether the transition to the entered state is finished or not.
2924
*/
@@ -41,32 +36,9 @@ public ModelTransitionEvent(
4136
String oldModelName,
4237
String newModelName,
4338
boolean transitionFinished
44-
) {
45-
this(oldModelName, newModelName, true, transitionFinished);
46-
}
47-
48-
/**
49-
* Creates a new TCSModelTransitionEvent.
50-
*
51-
* @param oldModelName The name of the previously loaded model.
52-
* @param newModelName The name of the new model.
53-
* @param modelContentChanged Whether the content of the model actually
54-
* changed with the transition.
55-
* @param transitionFinished Whether the transition to the new model is
56-
* finished, yet.
57-
* @deprecated Use {@link #ModelTransitionEvent(String, String, boolean)}, instead.
58-
*/
59-
@Deprecated
60-
@ScheduledApiChange(when = "7.0", details = "Will be removed.")
61-
public ModelTransitionEvent(
62-
String oldModelName,
63-
String newModelName,
64-
boolean modelContentChanged,
65-
boolean transitionFinished
6639
) {
6740
this.oldModelName = oldModelName;
6841
this.newModelName = newModelName;
69-
this.modelContentChanged = modelContentChanged;
7042
this.transitionFinished = transitionFinished;
7143
}
7244

@@ -88,21 +60,6 @@ public String getNewModelName() {
8860
return newModelName;
8961
}
9062

91-
/**
92-
* Returns <code>true</code> if, and only if, the content of the model
93-
* actually changed with the transition.
94-
*
95-
* @return <code>true</code> if, and only if, the content of the model
96-
* actually changed with the transition.
97-
* @deprecated Will be removed, as this flag has not been set to anything but <code>true</code>
98-
* for quite a while.
99-
*/
100-
@Deprecated
101-
@ScheduledApiChange(when = "7.0", details = "Will be removed.")
102-
public boolean hasModelContentChanged() {
103-
return modelContentChanged;
104-
}
105-
10663
/**
10764
* Returns <code>true</code> if, and only if, the transition to the new kernel
10865
* state is finished.
@@ -120,7 +77,6 @@ public String toString() {
12077
+ '{'
12178
+ "oldModelName=" + oldModelName
12279
+ ", newModelName=" + newModelName
123-
+ ", modelContentChanged=" + modelContentChanged
12480
+ ", transitionFinished=" + transitionFinished
12581
+ '}';
12682
}

opentcs-api-base/src/main/java/org/opentcs/access/rmi/services/RemoteRouterService.java

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
import java.rmi.Remote;
66
import java.rmi.RemoteException;
77
import java.util.Map;
8-
import java.util.Optional;
98
import java.util.Set;
10-
import java.util.stream.Collectors;
119
import org.opentcs.access.rmi.ClientID;
1210
import org.opentcs.components.kernel.services.RouterService;
1311
import org.opentcs.data.TCSObjectReference;
@@ -16,7 +14,6 @@
1614
import org.opentcs.data.model.TCSResourceReference;
1715
import org.opentcs.data.model.Vehicle;
1816
import org.opentcs.data.order.Route;
19-
import org.opentcs.util.annotations.ScheduledApiChange;
2017

2118
/**
2219
* Declares the methods provided by the {@link RouterService} via RMI.
@@ -40,41 +37,14 @@ public interface RemoteRouterService
4037
public void updateRoutingTopology(ClientID clientId, Set<TCSObjectReference<Path>> refs)
4138
throws RemoteException;
4239

43-
@Deprecated
44-
public Map<TCSObjectReference<Point>, Route> computeRoutes(
45-
ClientID clientId,
46-
TCSObjectReference<Vehicle> vehicleRef,
47-
TCSObjectReference<Point> sourcePointRef,
48-
Set<TCSObjectReference<Point>> destinationPointRefs,
49-
Set<TCSResourceReference<?>> resourcesToAvoid
50-
)
51-
throws RemoteException;
52-
53-
@ScheduledApiChange(when = "7.0", details = "Default implementation will be removed.")
54-
default Map<TCSObjectReference<Point>, Set<Route>> computeRoutes(
40+
Map<TCSObjectReference<Point>, Set<Route>> computeRoutes(
5541
ClientID clientId,
5642
TCSObjectReference<Vehicle> vehicleRef,
5743
TCSObjectReference<Point> sourcePointRef,
5844
Set<TCSObjectReference<Point>> destinationPointRefs,
5945
Set<TCSResourceReference<?>> resourcesToAvoid,
6046
int maxRoutesPerDestinationPoint
6147
)
62-
throws RemoteException {
63-
return computeRoutes(
64-
clientId,
65-
vehicleRef,
66-
sourcePointRef,
67-
destinationPointRefs,
68-
resourcesToAvoid
69-
)
70-
.entrySet()
71-
.stream()
72-
.collect(
73-
Collectors.toMap(
74-
Map.Entry::getKey,
75-
entry -> Optional.ofNullable(entry.getValue()).map(Set::of).orElse(Set.of())
76-
)
77-
);
78-
}
48+
throws RemoteException;
7949
// CHECKSTYLE:ON
8050
}

opentcs-api-base/src/main/java/org/opentcs/access/rmi/services/RemoteRouterServiceProxy.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,6 @@ public void updateRoutingTopology(Set<TCSObjectReference<Path>> refs)
4343
}
4444
}
4545

46-
@Override
47-
@Deprecated
48-
public Map<TCSObjectReference<Point>, Route> computeRoutes(
49-
TCSObjectReference<Vehicle> vehicleRef,
50-
TCSObjectReference<Point> sourcePointRef,
51-
Set<TCSObjectReference<Point>> destinationPointRefs,
52-
Set<TCSResourceReference<?>> resourcesToAvoid
53-
)
54-
throws KernelRuntimeException {
55-
checkServiceAvailability();
56-
57-
try {
58-
return getRemoteService().computeRoutes(
59-
getClientId(),
60-
vehicleRef,
61-
sourcePointRef,
62-
destinationPointRefs,
63-
resourcesToAvoid
64-
);
65-
}
66-
catch (RemoteException ex) {
67-
throw findSuitableExceptionFor(ex);
68-
}
69-
}
70-
7146
@Override
7247
public Map<TCSObjectReference<Point>, Set<Route>> computeRoutes(
7348
TCSObjectReference<Vehicle> vehicleRef,

opentcs-api-base/src/main/java/org/opentcs/access/rmi/services/RemoteTCSObjectService.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,19 @@ public interface RemoteTCSObjectService
3131
Remote {
3232

3333
// CHECKSTYLE:OFF
34-
@Deprecated
35-
<T extends TCSObject<T>> T fetchObject(
36-
ClientID clientId,
37-
Class<T> clazz,
38-
TCSObjectReference<T> ref
39-
)
40-
throws RemoteException;
41-
4234
<T extends TCSObject<T>> T fetch(
4335
ClientID clientId,
4436
Class<T> clazz,
4537
TCSObjectReference<T> ref
4638
)
4739
throws RemoteException;
4840

49-
@Deprecated
50-
<T extends TCSObject<T>> T fetchObject(ClientID clientId, Class<T> clazz, String name)
51-
throws RemoteException;
52-
5341
<T extends TCSObject<T>> T fetch(ClientID clientId, Class<T> clazz, String name)
5442
throws RemoteException;
5543

56-
@Deprecated
57-
<T extends TCSObject<T>> Set<T> fetchObjects(ClientID clientId, Class<T> clazz)
58-
throws RemoteException;
59-
6044
<T extends TCSObject<T>> Set<T> fetch(ClientID clientId, Class<T> clazz)
6145
throws RemoteException;
6246

63-
@Deprecated
64-
<T extends TCSObject<T>> Set<T> fetchObjects(
65-
ClientID clientId,
66-
Class<T> clazz,
67-
Predicate<? super T> predicate
68-
)
69-
throws RemoteException;
70-
7147
<T extends TCSObject<T>> Set<T> fetch(
7248
ClientID clientId,
7349
Class<T> clazz,

opentcs-api-base/src/main/java/org/opentcs/access/rmi/services/RemoteTCSObjectServiceProxy.java

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ abstract class RemoteTCSObjectServiceProxy<R extends RemoteTCSObjectService>
2525
implements
2626
TCSObjectService {
2727

28-
@Deprecated
29-
@Override
30-
public <T extends TCSObject<T>> T fetchObject(Class<T> clazz, TCSObjectReference<T> ref)
31-
throws KernelRuntimeException {
32-
checkServiceAvailability();
33-
34-
try {
35-
return getRemoteService().fetchObject(getClientId(), clazz, ref);
36-
}
37-
catch (RemoteException ex) {
38-
throw findSuitableExceptionFor(ex);
39-
}
40-
}
41-
4228
@Override
4329
public <T extends TCSObject<T>> Optional<T> fetch(Class<T> clazz, TCSObjectReference<T> ref)
4430
throws KernelRuntimeException {
@@ -52,20 +38,6 @@ public <T extends TCSObject<T>> Optional<T> fetch(Class<T> clazz, TCSObjectRefer
5238
}
5339
}
5440

55-
@Deprecated
56-
@Override
57-
public <T extends TCSObject<T>> T fetchObject(Class<T> clazz, String name)
58-
throws KernelRuntimeException {
59-
checkServiceAvailability();
60-
61-
try {
62-
return getRemoteService().fetchObject(getClientId(), clazz, name);
63-
}
64-
catch (RemoteException ex) {
65-
throw findSuitableExceptionFor(ex);
66-
}
67-
}
68-
6941
@Override
7042
public <T extends TCSObject<T>> Optional<T> fetch(Class<T> clazz, String name)
7143
throws KernelRuntimeException {
@@ -79,20 +51,6 @@ public <T extends TCSObject<T>> Optional<T> fetch(Class<T> clazz, String name)
7951
}
8052
}
8153

82-
@Deprecated
83-
@Override
84-
public <T extends TCSObject<T>> Set<T> fetchObjects(Class<T> clazz)
85-
throws KernelRuntimeException {
86-
checkServiceAvailability();
87-
88-
try {
89-
return getRemoteService().fetchObjects(getClientId(), clazz);
90-
}
91-
catch (RemoteException ex) {
92-
throw findSuitableExceptionFor(ex);
93-
}
94-
}
95-
9654
@Override
9755
public <T extends TCSObject<T>> Set<T> fetch(Class<T> clazz)
9856
throws KernelRuntimeException {
@@ -106,23 +64,6 @@ public <T extends TCSObject<T>> Set<T> fetch(Class<T> clazz)
10664
}
10765
}
10866

109-
@Deprecated
110-
@Override
111-
public <T extends TCSObject<T>> Set<T> fetchObjects(
112-
Class<T> clazz,
113-
Predicate<? super T> predicate
114-
)
115-
throws KernelRuntimeException {
116-
checkServiceAvailability();
117-
118-
try {
119-
return getRemoteService().fetchObjects(getClientId(), clazz, predicate);
120-
}
121-
catch (RemoteException ex) {
122-
throw findSuitableExceptionFor(ex);
123-
}
124-
}
125-
12667
@Override
12768
public <T extends TCSObject<T>> Set<T> fetch(
12869
Class<T> clazz,

opentcs-api-base/src/main/java/org/opentcs/access/rmi/services/RemoteVehicleService.java

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
import org.opentcs.data.model.AcceptableOrderType;
1212
import org.opentcs.data.model.Vehicle;
1313
import org.opentcs.data.model.Vehicle.EnergyLevelThresholdSet;
14-
import org.opentcs.drivers.vehicle.AdapterCommand;
1514
import org.opentcs.drivers.vehicle.VehicleCommAdapterDescription;
1615
import org.opentcs.drivers.vehicle.VehicleCommAdapterMessage;
1716
import org.opentcs.drivers.vehicle.management.VehicleAttachmentInformation;
1817
import org.opentcs.drivers.vehicle.management.VehicleProcessModelTO;
19-
import org.opentcs.util.annotations.ScheduledApiChange;
2018

2119
/**
2220
* Declares the methods provided by the {@link VehicleService} via RMI.
@@ -59,29 +57,12 @@ VehicleAttachmentInformation fetchAttachmentInformation(
5957
VehicleProcessModelTO fetchProcessModel(ClientID clientId, TCSObjectReference<Vehicle> ref)
6058
throws RemoteException;
6159

62-
@Deprecated
63-
void sendCommAdapterCommand(
64-
ClientID clientId,
65-
TCSObjectReference<Vehicle> ref,
66-
AdapterCommand command
67-
)
68-
throws RemoteException;
69-
70-
@Deprecated
7160
void sendCommAdapterMessage(
72-
ClientID clientId,
73-
TCSObjectReference<Vehicle> vehicleRef,
74-
Object message
75-
)
76-
throws RemoteException;
77-
78-
default void sendCommAdapterMessage(
7961
ClientID clientId,
8062
TCSObjectReference<Vehicle> ref,
8163
VehicleCommAdapterMessage message
8264
)
83-
throws RemoteException {
84-
}
65+
throws RemoteException;
8566

8667
void updateVehicleIntegrationLevel(
8768
ClientID clientId,
@@ -97,33 +78,19 @@ void updateVehiclePaused(
9778
)
9879
throws RemoteException;
9980

100-
@ScheduledApiChange(when = "7.0", details = "Default implementation will be removed.")
101-
default void updateVehicleEnergyLevelThresholdSet(
81+
void updateVehicleEnergyLevelThresholdSet(
10282
ClientID clientId,
10383
TCSObjectReference<Vehicle> ref,
10484
EnergyLevelThresholdSet energyLevelThresholdSet
105-
)
106-
throws RemoteException {
107-
throw new UnsupportedOperationException("Not yet implemented.");
108-
}
109-
110-
@Deprecated
111-
@ScheduledApiChange(when = "7.0", details = "Will be removed.")
112-
void updateVehicleAllowedOrderTypes(
113-
ClientID clientId,
114-
TCSObjectReference<Vehicle> ref,
115-
Set<String> allowedOrderTypes
11685
)
11786
throws RemoteException;
11887

119-
default void updateVehicleAcceptableOrderTypes(
88+
void updateVehicleAcceptableOrderTypes(
12089
ClientID clientId,
12190
TCSObjectReference<Vehicle> ref,
12291
Set<AcceptableOrderType> acceptableOrderTypes
12392
)
124-
throws RemoteException {
125-
throw new UnsupportedOperationException("Not yet implemented.");
126-
}
93+
throws RemoteException;
12794

12895
void updateVehicleEnvelopeKey(
12996
ClientID clientId,

0 commit comments

Comments
 (0)