Skip to content

Commit

Permalink
fix: disallow servers to read environmental data
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelger committed Sep 30, 2024
1 parent 5a6068a commit 52514db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public final void cleanPastEnvironmentEvents() {
}

@Override
public final int getStateOfEnvironmentSensor(SensorType type) {
public int getStateOfEnvironmentSensor(SensorType type) {
EnvironmentEvent event = environmentEvents.get(type);
// If an event of this type in the map yet?
if (event != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.mosaic.fed.application.ambassador.simulation.navigation.IRoutingModule;
import org.eclipse.mosaic.fed.application.ambassador.simulation.navigation.NavigationModule;
import org.eclipse.mosaic.fed.application.app.api.os.ServerOperatingSystem;
import org.eclipse.mosaic.lib.enums.SensorType;
import org.eclipse.mosaic.lib.objects.mapping.ServerMapping;
import org.eclipse.mosaic.lib.util.scheduling.Event;

Expand Down Expand Up @@ -53,10 +54,15 @@ public ServerUnit(String unitName) {
}

@Override
public CamBuilder assembleCamMessage(CamBuilder camBuilder) {
public final CamBuilder assembleCamMessage(CamBuilder camBuilder) {
throw new UnsupportedOperationException("Servers can't send CAMs.");
}

@Override
public final int getStateOfEnvironmentSensor(SensorType type) {
throw new UnsupportedOperationException("Servers can't access Environment functionality.");
}

@Override
public IRoutingModule getRoutingModule() {
return routingModule;
Expand Down

0 comments on commit 52514db

Please sign in to comment.