From 00486a471000d92fc1276de279eeb129e6137976 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 9 May 2023 15:01:06 +0200 Subject: [PATCH] Reviewed Javadoc. --- build-appjar.xml | 2 +- .../statoolinfos/core/Configuration.java | 6 ++- .../statoolinfos/core/DatabaseConfig.java | 35 ++++++++++++- .../statoolinfos/core/StatoolInfos.java | 13 ++--- .../statoolinfos/crawl/CrawlCache.java | 16 ++++-- .../statoolinfos/htmlize/BreadcrumbTrail.java | 3 +- .../statoolinfos/htmlize/CategoriesPage.java | 6 ++- .../statoolinfos/htmlize/ExportsPage.java | 5 -- .../htmlize/FederationHeaderView.java | 9 ++-- .../statoolinfos/htmlize/charts/BarChart.java | 28 +++++++++- .../htmlize/charts/BarChartData.java | 35 ++++++++++++- .../htmlize/charts/BarChartDataset.java | 24 ++++++++- .../htmlize/charts/DateCount.java | 25 ++++++++- src/fr/devinsy/statoolinfos/io/CSVFile.java | 3 +- src/fr/devinsy/statoolinfos/io/CSVWriter.java | 8 ++- .../metrics/minetest/MinetestLogAnalyzer.java | 2 - .../metrics/mumble/MumbleLogAnalyzer.java | 4 +- .../metrics/util/DatafilesProber.java | 11 ++-- .../stats/categories/CategoryStat.java | 51 ++++++++++++++++++- 19 files changed, 231 insertions(+), 55 deletions(-) diff --git a/build-appjar.xml b/build-appjar.xml index 9a33972..a26f195 100644 --- a/build-appjar.xml +++ b/build-appjar.xml @@ -127,7 +127,7 @@ - + diff --git a/src/fr/devinsy/statoolinfos/core/Configuration.java b/src/fr/devinsy/statoolinfos/core/Configuration.java index e9bebde..e3ff853 100644 --- a/src/fr/devinsy/statoolinfos/core/Configuration.java +++ b/src/fr/devinsy/statoolinfos/core/Configuration.java @@ -143,6 +143,7 @@ public class Configuration extends PathPropertyList * * @return the category file * @throws StatoolInfosException + * the statool infos exception */ public File getCategoryFile() throws StatoolInfosException { @@ -337,10 +338,11 @@ public class Configuration extends PathPropertyList } /** - * Gets the htmlize input path. + * Gets the htmlize input URL. * - * @return the htmlize input path + * @return the htmlize input URL * @throws MalformedURLException + * the malformed URL exception */ public URL getHtmlizeInputURL() throws MalformedURLException { diff --git a/src/fr/devinsy/statoolinfos/core/DatabaseConfig.java b/src/fr/devinsy/statoolinfos/core/DatabaseConfig.java index 6276611..a90ea34 100644 --- a/src/fr/devinsy/statoolinfos/core/DatabaseConfig.java +++ b/src/fr/devinsy/statoolinfos/core/DatabaseConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Christian Pierre MOMON + * Copyright (C) 2021-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -39,16 +39,31 @@ public class DatabaseConfig this.password = null; } + /** + * Gets the password. + * + * @return the password + */ public String getPassword() { return this.password; } + /** + * Gets the url. + * + * @return the url + */ public String getUrl() { return this.url; } + /** + * Gets the user. + * + * @return the user + */ public String getUser() { return this.user; @@ -76,16 +91,34 @@ public class DatabaseConfig return result; } + /** + * Sets the password. + * + * @param password + * the new password + */ public void setPassword(final String password) { this.password = password; } + /** + * Sets the url. + * + * @param url + * the new url + */ public void setUrl(final String url) { this.url = url; } + /** + * Sets the user. + * + * @param user + * the new user + */ public void setUser(final String user) { this.user = user; diff --git a/src/fr/devinsy/statoolinfos/core/StatoolInfos.java b/src/fr/devinsy/statoolinfos/core/StatoolInfos.java index 7ef0dde..542fe78 100644 --- a/src/fr/devinsy/statoolinfos/core/StatoolInfos.java +++ b/src/fr/devinsy/statoolinfos/core/StatoolInfos.java @@ -164,12 +164,10 @@ public class StatoolInfos } /** - * Test http access log files. + * List files. * * @param configurationFile * the configuration file - * @throws IOException - * @throws StatoolInfosException */ public static void listFiles(final File configurationFile) { @@ -206,14 +204,10 @@ public class StatoolInfos } /** - * List http access log files. + * List files. * * @param files * the files - * @throws StatoolInfosException - * the statool infos exception - * @throws IOException - * Signals that an I/O exception has occurred. */ public static void listFiles(final Files files) { @@ -234,7 +228,8 @@ public class StatoolInfos * * @param source * the source - * @throws IOException + * @param filter + * the filter */ public static void listIps(final Files source, final BotFilter filter) { diff --git a/src/fr/devinsy/statoolinfos/crawl/CrawlCache.java b/src/fr/devinsy/statoolinfos/crawl/CrawlCache.java index 5cf8b11..69072bb 100644 --- a/src/fr/devinsy/statoolinfos/crawl/CrawlCache.java +++ b/src/fr/devinsy/statoolinfos/crawl/CrawlCache.java @@ -147,8 +147,11 @@ public class CrawlCache } /** - * @return + * Restore crawl journal. + * + * @return the crawl journal * @throws IOException + * Signals that an I/O exception has occurred. */ public CrawlJournal restoreCrawlJournal() throws IOException { @@ -261,9 +264,13 @@ public class CrawlCache } /** + * Restore to properties. + * * @param url - * @return + * the url + * @return the path properties * @throws IOException + * Signals that an I/O exception has occurred. */ public PathProperties restoreToProperties(final URL url) throws IOException { @@ -446,10 +453,11 @@ public class CrawlCache } /** - * Gets the journal URL. + * Gets the crawl journal URL. * - * @return the journal URL + * @return the crawl journal URL * @throws MalformedURLException + * the malformed URL exception */ public static URL getCrawlJournalURL() throws MalformedURLException { diff --git a/src/fr/devinsy/statoolinfos/htmlize/BreadcrumbTrail.java b/src/fr/devinsy/statoolinfos/htmlize/BreadcrumbTrail.java index a136ae2..93605e8 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/BreadcrumbTrail.java +++ b/src/fr/devinsy/statoolinfos/htmlize/BreadcrumbTrail.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -80,6 +80,7 @@ public class BreadcrumbTrail extends ArrayList * the label * @param link * the link + * @return the breadcrumb trail */ public BreadcrumbTrail add(final String label, final String link) { diff --git a/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java b/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java index 90d69c2..721931e 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -47,9 +47,11 @@ public class CategoriesPage /** * Builds the. - * + * * @throws StatoolInfosException + * the statool infos exception * @throws IOException + * Signals that an I/O exception has occurred. */ public static void build() throws StatoolInfosException, IOException { diff --git a/src/fr/devinsy/statoolinfos/htmlize/ExportsPage.java b/src/fr/devinsy/statoolinfos/htmlize/ExportsPage.java index 9a29b40..aa4bc0f 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ExportsPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ExportsPage.java @@ -46,11 +46,6 @@ public class ExportsPage /** * Builds the. - * - * @throws StatoolInfosException - * the statool infos exception - * @throws IOException - * Signals that an I/O exception has occurred. */ public static void build() { diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationHeaderView.java b/src/fr/devinsy/statoolinfos/htmlize/FederationHeaderView.java index 85c9238..8bef194 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationHeaderView.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationHeaderView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -18,8 +18,6 @@ */ package fr.devinsy.statoolinfos.htmlize; -import java.io.IOException; - import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,14 +40,13 @@ public class FederationHeaderView private static Logger logger = LoggerFactory.getLogger(FederationHeaderView.class); /** - * Builds the. + * Htmlize. * * @param federation - * the organization + * the federation * @return the string * @throws StatoolInfosException * the statool infos exception - * @throws IOException */ public static String htmlize(final Federation federation) throws StatoolInfosException { diff --git a/src/fr/devinsy/statoolinfos/htmlize/charts/BarChart.java b/src/fr/devinsy/statoolinfos/htmlize/charts/BarChart.java index d4f63b3..46d2ba2 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/charts/BarChart.java +++ b/src/fr/devinsy/statoolinfos/htmlize/charts/BarChart.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -135,6 +135,11 @@ public class BarChart return result; } + /** + * Gets the datasets. + * + * @return the datasets + */ public BarChartDatasets getDatasets() { return this.datasets; @@ -165,21 +170,42 @@ public class BarChart return this.title; } + /** + * Checks if is animated. + * + * @return true, if is animated + */ public boolean isAnimated() { return this.animated; } + /** + * Checks if is display title. + * + * @return true, if is display title + */ public boolean isDisplayTitle() { return this.displayTitle; } + /** + * Checks if is stacked. + * + * @return true, if is stacked + */ public boolean isStacked() { return this.stacked; } + /** + * Sets the animated. + * + * @param animated + * the new animated + */ public void setAnimated(final boolean animated) { this.animated = animated; diff --git a/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartData.java b/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartData.java index 7984de4..4bc2f6e 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartData.java +++ b/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartData.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -49,31 +49,64 @@ public class BarChartData this.color = color; } + /** + * Gets the color. + * + * @return the color + */ public ChartColor getColor() { return this.color; } + /** + * Gets the label. + * + * @return the label + */ public String getLabel() { return this.label; } + /** + * Gets the value. + * + * @return the value + */ public double getValue() { return this.value; } + /** + * Sets the color. + * + * @param color + * the new color + */ public void setColor(final ChartColor color) { this.color = color; } + /** + * Sets the label. + * + * @param label + * the new label + */ public void setLabel(final String label) { this.label = label; } + /** + * Sets the value. + * + * @param value + * the new value + */ public void setValue(final double value) { this.value = value; diff --git a/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartDataset.java b/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartDataset.java index 28b460d..b9579a9 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartDataset.java +++ b/src/fr/devinsy/statoolinfos/htmlize/charts/BarChartDataset.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -47,6 +47,11 @@ public class BarChartDataset extends ArrayList this.borderWidth = 1; } + /** + * Gets the border width. + * + * @return the border width + */ public int getBorderWidth() { return this.borderWidth; @@ -72,6 +77,11 @@ public class BarChartDataset extends ArrayList return result; } + /** + * Gets the name. + * + * @return the name + */ public String getName() { return this.name; @@ -99,11 +109,23 @@ public class BarChartDataset extends ArrayList return result; } + /** + * Sets the border width. + * + * @param borderWidth + * the new border width + */ public void setBorderWidth(final int borderWidth) { this.borderWidth = borderWidth; } + /** + * Sets the name. + * + * @param name + * the new name + */ public void setName(final String name) { this.name = name; diff --git a/src/fr/devinsy/statoolinfos/htmlize/charts/DateCount.java b/src/fr/devinsy/statoolinfos/htmlize/charts/DateCount.java index e2209ce..c558ddb 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/charts/DateCount.java +++ b/src/fr/devinsy/statoolinfos/htmlize/charts/DateCount.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -42,21 +42,43 @@ public class DateCount this.count = count; } + /** + * Gets the count. + * + * @return the count + */ public long getCount() { return this.count; } + /** + * Gets the date. + * + * @return the date + */ public String getDate() { return this.date; } + /** + * Sets the count. + * + * @param count + * the new count + */ public void setCount(final long count) { this.count = count; } + /** + * Sets the date. + * + * @param date + * the new date + */ public void setDate(final String date) { if (StringUtils.isBlank(date)) @@ -68,5 +90,4 @@ public class DateCount this.date = date; } } - } diff --git a/src/fr/devinsy/statoolinfos/io/CSVFile.java b/src/fr/devinsy/statoolinfos/io/CSVFile.java index 0eb9af6..6d7090f 100644 --- a/src/fr/devinsy/statoolinfos/io/CSVFile.java +++ b/src/fr/devinsy/statoolinfos/io/CSVFile.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Christian Pierre MOMON + * Copyright (C) 2021-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -53,6 +53,7 @@ public class CSVFile * @param source * the source * @throws IOException + * Signals that an I/O exception has occurred. */ public static void save(final File file, final Organizations source) throws IOException { diff --git a/src/fr/devinsy/statoolinfos/io/CSVWriter.java b/src/fr/devinsy/statoolinfos/io/CSVWriter.java index 89f1db3..c66e03f 100644 --- a/src/fr/devinsy/statoolinfos/io/CSVWriter.java +++ b/src/fr/devinsy/statoolinfos/io/CSVWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Christian Pierre MOMON + * Copyright (C) 2021-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -64,9 +64,9 @@ public class CSVWriter implements SpreadsheetWriter /** * Close. - * - * @throws FileNotFoundException * + * @throws FileNotFoundException + * the file not found exception * @throws IOException * Signals that an I/O exception has occurred. */ @@ -138,8 +138,6 @@ public class CSVWriter implements SpreadsheetWriter /** * Write end row. - * - * @throws IOException */ @Override public void writeEndRow() diff --git a/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java index 8f7c0a5..29165d2 100644 --- a/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java @@ -99,8 +99,6 @@ public class MinetestLogAnalyzer * the file * @throws IOException * Signals that an I/O exception has occurred. - * @throws StatoolInfosException - * the statool infos exception */ public void probe(final File file) throws IOException { diff --git a/src/fr/devinsy/statoolinfos/metrics/mumble/MumbleLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/mumble/MumbleLogAnalyzer.java index 8fbb2ff..34bfc49 100644 --- a/src/fr/devinsy/statoolinfos/metrics/mumble/MumbleLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/mumble/MumbleLogAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Christian Pierre MOMON + * Copyright (C) 2021-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -105,8 +105,6 @@ public class MumbleLogAnalyzer * the file * @throws IOException * Signals that an I/O exception has occurred. - * @throws StatoolInfosException - * the statool infos exception */ public void probe(final File file) throws IOException { diff --git a/src/fr/devinsy/statoolinfos/metrics/util/DatafilesProber.java b/src/fr/devinsy/statoolinfos/metrics/util/DatafilesProber.java index 61c790b..3215e11 100644 --- a/src/fr/devinsy/statoolinfos/metrics/util/DatafilesProber.java +++ b/src/fr/devinsy/statoolinfos/metrics/util/DatafilesProber.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Christian Pierre MOMON + * Copyright (C) 2021-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -25,7 +25,6 @@ import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.util.FilesUtils; import fr.devinsy.strings.StringList; @@ -52,8 +51,6 @@ public class DatafilesProber * @return the path counters * @throws IOException * Signals that an I/O exception has occurred. - * @throws StatoolInfosException - * the statool infos exception */ public static PathCounters probe(final File directory) throws IOException { @@ -69,12 +66,12 @@ public class DatafilesProber * Probe. * * @param directory - * the data directory + * the directory + * @param prefix + * the prefix * @return the path counters * @throws IOException * Signals that an I/O exception has occurred. - * @throws StatoolInfosException - * the statool infos exception */ public static PathCounters probe(final File directory, final String prefix) throws IOException { diff --git a/src/fr/devinsy/statoolinfos/stats/categories/CategoryStat.java b/src/fr/devinsy/statoolinfos/stats/categories/CategoryStat.java index 66c9925..2c288c0 100644 --- a/src/fr/devinsy/statoolinfos/stats/categories/CategoryStat.java +++ b/src/fr/devinsy/statoolinfos/stats/categories/CategoryStat.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Christian Pierre MOMON + * Copyright (C) 2020-2023 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -46,26 +46,51 @@ public class CategoryStat this.visitCount = 0; } + /** + * Gets the category. + * + * @return the category + */ public Category getCategory() { return this.category; } + /** + * Gets the organization count. + * + * @return the organization count + */ public int getOrganizationCount() { return this.organizationCount; } + /** + * Gets the service count. + * + * @return the service count + */ public int getServiceCount() { return this.serviceCount; } + /** + * Gets the user count. + * + * @return the user count + */ public int getUserCount() { return this.userCount; } + /** + * Gets the visit count. + * + * @return the visit count + */ public int getVisitCount() { return this.visitCount; @@ -125,21 +150,45 @@ public class CategoryStat this.visitCount += value; } + /** + * Sets the organization count. + * + * @param organizationCount + * the new organization count + */ public void setOrganizationCount(final int organizationCount) { this.organizationCount = organizationCount; } + /** + * Sets the service count. + * + * @param serviceCount + * the new service count + */ public void setServiceCount(final int serviceCount) { this.serviceCount = serviceCount; } + /** + * Sets the user count. + * + * @param userCount + * the new user count + */ public void setUserCount(final int userCount) { this.userCount = userCount; } + /** + * Sets the visit count. + * + * @param visitCount + * the new visit count + */ public void setVisitCount(final int visitCount) { this.visitCount = visitCount;