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 18, 2024
1 parent 0730e78 commit b4ab417
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,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 @@ -21,6 +21,7 @@
import org.eclipse.mosaic.fed.application.ambassador.simulation.communication.AdHocModule;
import org.eclipse.mosaic.fed.application.ambassador.simulation.communication.CamBuilder;
import org.eclipse.mosaic.fed.application.app.api.os.ServerOperatingSystem;
import org.eclipse.mosaic.lib.enums.SensorType;
import org.eclipse.mosaic.lib.geo.GeoPoint;
import org.eclipse.mosaic.lib.objects.mapping.ServerMapping;
import org.eclipse.mosaic.lib.util.scheduling.Event;
Expand Down Expand Up @@ -55,20 +56,25 @@ public ServerUnit(String unitName) {
}

@Override
public GeoPoint getPosition() {
public final GeoPoint getPosition() {
throw new UnsupportedOperationException("Servers aren't mapped to a location.");
}

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

@Override
public AdHocModule getAdHocModule() {
public final AdHocModule getAdHocModule() {
throw new UnsupportedOperationException("Servers can't access AdHoc functionality.");
}

@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 b4ab417

Please sign in to comment.