diff --git a/sensorhub-service-consys/src/main/java/org/sensorhub/impl/service/consys/obs/ObsHandler.java b/sensorhub-service-consys/src/main/java/org/sensorhub/impl/service/consys/obs/ObsHandler.java index 7be1c044f..e1c9a79fe 100644 --- a/sensorhub-service-consys/src/main/java/org/sensorhub/impl/service/consys/obs/ObsHandler.java +++ b/sensorhub-service-consys/src/main/java/org/sensorhub/impl/service/consys/obs/ObsHandler.java @@ -527,8 +527,24 @@ protected BigId addEntry(RequestContext ctx, IObsData res) throws DataStoreExcep throw new DataStoreException("Invalid FOI ID"); } } - - + + @Override + protected boolean updateEntry(RequestContext ctx, BigId key, IObsData res) throws DataStoreException { + // Don't allow insertion with PUT + if(db.getObservationStore().get(key) == null) + return false; + + try + { + db.getObservationStore().put(key, res); + return true; + } + catch (IllegalArgumentException e) + { + throw new DataStoreException(e.getMessage()); + } + } + @Override protected boolean deleteEntry(final RequestContext ctx, final BigId key) throws DataStoreException {