From b46071f0c48c4f7c4aedf2293d53c2101f142a05 Mon Sep 17 00:00:00 2001 From: Hylke van der Schaaf Date: Wed, 6 Nov 2024 21:46:47 +0100 Subject: [PATCH] Added `getService()` method to Dao interface --- CHANGELOG.md | 1 + .../de/fraunhofer/iosb/ilt/frostclient/dao/BaseDao.java | 3 ++- .../java/de/fraunhofer/iosb/ilt/frostclient/dao/Dao.java | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e6305..c1ce9ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Development Version 2.22 **Updates** +* Added `getService()` method to Dao interface. ## Release Version 2.21 diff --git a/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/BaseDao.java b/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/BaseDao.java index 9e26097..c6e342e 100644 --- a/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/BaseDao.java +++ b/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/BaseDao.java @@ -261,7 +261,8 @@ private URI buildUri(PkValue pkValues) throws NotImplementedException, URISyntax return uri; } - protected SensorThingsService getService() { + @Override + public SensorThingsService getService() { return service; } diff --git a/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/Dao.java b/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/Dao.java index 1f508b9..eeca4ec 100644 --- a/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/Dao.java +++ b/src/main/java/de/fraunhofer/iosb/ilt/frostclient/dao/Dao.java @@ -23,6 +23,7 @@ package de.fraunhofer.iosb.ilt.frostclient.dao; import com.github.fge.jsonpatch.JsonPatchOperation; +import de.fraunhofer.iosb.ilt.frostclient.SensorThingsService; import de.fraunhofer.iosb.ilt.frostclient.exception.ServiceFailureException; import de.fraunhofer.iosb.ilt.frostclient.model.Entity; import de.fraunhofer.iosb.ilt.frostclient.model.EntityType; @@ -114,4 +115,10 @@ public interface Dao { */ Query query(); + /** + * Get the service that this dao fetches data from. + * + * @return The service that backs this dao. + */ + SensorThingsService getService(); }