From 9556ae302e8a49493b30fd85089ddd4dda991d1c Mon Sep 17 00:00:00 2001 From: Christoph Thelen <christoph.thelen@mni.thm.de> Date: Thu, 23 Oct 2014 23:04:49 +0200 Subject: [PATCH] Deleted unused view methods --- src/main/java/de/thm/arsnova/dao/CouchDBDao.java | 16 ---------------- .../java/de/thm/arsnova/dao/IDatabaseDao.java | 2 -- .../java/de/thm/arsnova/dao/StubDatabaseDao.java | 5 ----- 3 files changed, 23 deletions(-) diff --git a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java index ac820652..d6056693 100644 --- a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java +++ b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java @@ -722,22 +722,6 @@ public class CouchDBDao implements IDatabaseDao { return results.getJSONArray("rows").optJSONObject(0).optInt("value"); } - @Override - public final int countActiveUsers(final long since) { - try { - final View view = new View("statistic/count_active_users"); - view.setStartKey(String.valueOf(since)); - final ViewResults results = getDatabase().view(view); - if (isEmptyResults(results)) { - return 0; - } - return results.getJSONArray("rows").optJSONObject(0).getInt("value"); - } catch (final Exception e) { - LOGGER.error("Error while retrieving active users count", e); - } - return 0; - } - private boolean isEmptyResults(final ViewResults results) { return results == null || results.getResults().isEmpty() || results.getJSONArray("rows").size() == 0; } diff --git a/src/main/java/de/thm/arsnova/dao/IDatabaseDao.java b/src/main/java/de/thm/arsnova/dao/IDatabaseDao.java index 84b9e16f..7ae33cbc 100644 --- a/src/main/java/de/thm/arsnova/dao/IDatabaseDao.java +++ b/src/main/java/de/thm/arsnova/dao/IDatabaseDao.java @@ -74,8 +74,6 @@ public interface IDatabaseDao { List<Answer> getFreetextAnswers(String questionId); - int countActiveUsers(long since); - List<Answer> getMyAnswers(User me, String sessionKey); int getTotalAnswerCount(String sessionKey); diff --git a/src/test/java/de/thm/arsnova/dao/StubDatabaseDao.java b/src/test/java/de/thm/arsnova/dao/StubDatabaseDao.java index ec428ad3..b799f688 100644 --- a/src/test/java/de/thm/arsnova/dao/StubDatabaseDao.java +++ b/src/test/java/de/thm/arsnova/dao/StubDatabaseDao.java @@ -230,11 +230,6 @@ public class StubDatabaseDao implements IDatabaseDao { return null; } - @Override - public int countActiveUsers(long since) { - return stubUsers.size(); - } - @Override public List<Answer> getMyAnswers(User user, String sessionKey) { return new ArrayList<Answer>(); -- GitLab