From 65e63c8446e93cd5c149f1eee27ccbc99b969987 Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 3 Feb 2021 10:04:18 +0100 Subject: [PATCH] docu --- .../servicelayer/dao/WebserviceInfoDAO.java | 19 +++++++++++++++++++ .../config/application-dev-gui.properties | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/WebserviceInfoDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/WebserviceInfoDAO.java index b4005611..703ed87e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/WebserviceInfoDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/WebserviceInfoDAO.java @@ -8,12 +8,31 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao; +/** Data access object for webservice info data. + * This info is used to verify parallel running webservices and nominate one as master. + * It shows also the history of SEB webservice registrations that has not been correctly shot down and still remain in + * the persistent data table. */ public interface WebserviceInfoDAO { + /** Register a SEB webservice within the persistent storage + * + * @param uuid A unique identifier that was generated by the webservice on startup + * @param address the IP address of the webservice + * @return true if registration was successful */ boolean register(String uuid, String address); + /** This can periodically be called by a specific running webservice to verify whether the webservice is (still) the + * master or a slave + * + * @param uuid The unique identifier of the webservice generated on startup + * @return true if the calling webservice is (still) the master service */ boolean isMaster(String uuid); + /** When a webservice has a controlled shout down, it unregister itself within this method. + * This removes the data entry of the webservice from persistent storage. + * + * @param uuid he unique identifier of the webservice generated on startup + * @return true when the unregistering was successful */ boolean unregister(String uuid); } diff --git a/src/main/resources/config/application-dev-gui.properties b/src/main/resources/config/application-dev-gui.properties index 4aaab9d3..eb077efa 100644 --- a/src/main/resources/config/application-dev-gui.properties +++ b/src/main/resources/config/application-dev-gui.properties @@ -1,11 +1,11 @@ server.address=localhost -server.port=8080 +server.port=8081 sebserver.gui.http.external.scheme=http sebserver.gui.entrypoint=/gui sebserver.gui.webservice.protocol=http sebserver.gui.webservice.address=localhost -sebserver.gui.webservice.port=8080 +sebserver.gui.webservice.port=8081 sebserver.gui.webservice.apipath=/admin-api/v1 # defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page sebserver.gui.webservice.poll-interval=1000