diff --git a/src/fr/devinsy/sikevadb/core/Archiver.java b/src/fr/devinsy/sikevadb/core/Archiver.java index dd68e10..eb00c99 100644 --- a/src/fr/devinsy/sikevadb/core/Archiver.java +++ b/src/fr/devinsy/sikevadb/core/Archiver.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2017 Christian Pierre MOMON + * Copyright (C) 2013-2024 Christian Pierre MOMON * * This file is part of SikevaDB, simple key value database. * @@ -20,8 +20,6 @@ package fr.devinsy.sikevadb.core; /** * The Interface Archiver. - * - * @author Christian Pierre MOMON */ public interface Archiver { @@ -31,17 +29,50 @@ public interface Archiver SUSPENDED } + /** + * Activate. + */ void activate(); + /** + * Archive. + * + * @param element + * the element + * @throws SikevaDBException + * the sikeva DB exception + */ void archive(Element element) throws SikevaDBException; + /** + * Clear. + * + * @throws SikevaDBException + * the sikeva DB exception + */ void clear() throws SikevaDBException; + /** + * Close. + */ void close(); + /** + * Checks if is activated. + * + * @return true, if is activated + */ boolean isActivated(); + /** + * Checks if is suspended. + * + * @return true, if is suspended + */ boolean isSuspended(); + /** + * Suspend. + */ void suspend(); } diff --git a/src/fr/devinsy/sikevadb/core/ClosedDatabaseException.java b/src/fr/devinsy/sikevadb/core/ClosedDatabaseException.java index 5f6d085..6a504c1 100644 --- a/src/fr/devinsy/sikevadb/core/ClosedDatabaseException.java +++ b/src/fr/devinsy/sikevadb/core/ClosedDatabaseException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Christian Pierre MOMON + * Copyright (C) 2018-2024 Christian Pierre MOMON * * This file is part of SikevaDB, simple key value database. * @@ -19,15 +19,14 @@ package fr.devinsy.sikevadb.core; /** - * - * @author Christian Pierre MOMON (christian.momon@devinsy.fr) + * The Class ClosedDatabaseException. */ public class ClosedDatabaseException extends SikevaDBException { private static final long serialVersionUID = 8364599416669077052L; /** - * + * Instantiates a new closed database exception. */ public ClosedDatabaseException() { @@ -35,8 +34,10 @@ public class ClosedDatabaseException extends SikevaDBException } /** - * + * Instantiates a new closed database exception. + * * @param message + * the message */ public ClosedDatabaseException(final String message) { @@ -44,9 +45,12 @@ public class ClosedDatabaseException extends SikevaDBException } /** - * + * Instantiates a new closed database exception. + * * @param message + * the message * @param cause + * the cause */ public ClosedDatabaseException(final String message, final Throwable cause) { @@ -54,8 +58,10 @@ public class ClosedDatabaseException extends SikevaDBException } /** - * + * Instantiates a new closed database exception. + * * @param cause + * the cause */ public ClosedDatabaseException(final Throwable cause) { diff --git a/src/fr/devinsy/sikevadb/core/OpenedDatabaseException.java b/src/fr/devinsy/sikevadb/core/OpenedDatabaseException.java index 685deaa..7256b01 100644 --- a/src/fr/devinsy/sikevadb/core/OpenedDatabaseException.java +++ b/src/fr/devinsy/sikevadb/core/OpenedDatabaseException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Christian Pierre MOMON + * Copyright (C) 2018-2024 Christian Pierre MOMON * * This file is part of SikevaDB, simple key value database. * @@ -19,15 +19,14 @@ package fr.devinsy.sikevadb.core; /** - * - * @author Christian Pierre MOMON (christian.momon@devinsy.fr) + * The Class OpenedDatabaseException. */ public class OpenedDatabaseException extends SikevaDBException { private static final long serialVersionUID = 8364599416669077052L; /** - * + * Instantiates a new opened database exception. */ public OpenedDatabaseException() { @@ -35,8 +34,10 @@ public class OpenedDatabaseException extends SikevaDBException } /** - * + * Instantiates a new opened database exception. + * * @param message + * the message */ public OpenedDatabaseException(final String message) { @@ -44,9 +45,12 @@ public class OpenedDatabaseException extends SikevaDBException } /** - * + * Instantiates a new opened database exception. + * * @param message + * the message * @param cause + * the cause */ public OpenedDatabaseException(final String message, final Throwable cause) { @@ -54,8 +58,10 @@ public class OpenedDatabaseException extends SikevaDBException } /** - * + * Instantiates a new opened database exception. + * * @param cause + * the cause */ public OpenedDatabaseException(final Throwable cause) { diff --git a/src/fr/devinsy/sikevadb/core/SikevaDB.java b/src/fr/devinsy/sikevadb/core/SikevaDB.java index 52b0ca6..79d0123 100644 --- a/src/fr/devinsy/sikevadb/core/SikevaDB.java +++ b/src/fr/devinsy/sikevadb/core/SikevaDB.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Christian Pierre MOMON + * Copyright (C) 2013-2024 Christian Pierre MOMON * * This file is part of SikevaDB, simple key value database. * @@ -284,18 +284,28 @@ public interface SikevaDB public String getValue(String key, String subkey) throws SikevaDBException; /** - * Gets the values of a key. + * Gets the values. * * @param key * the key * @return the values * @throws SikevaDBException - * the SikevaDB exception + * the sikeva DB exception */ public StringList getValues(String key) throws SikevaDBException; + /** + * Checks if is archive activated. + * + * @return true, if is archive activated + */ boolean isArchiveActivated(); + /** + * Checks if is archive suspended. + * + * @return true, if is archive suspended + */ boolean isArchiveSuspended(); /** diff --git a/src/fr/devinsy/sikevadb/core/XMLSikevaDB.java b/src/fr/devinsy/sikevadb/core/XMLSikevaDB.java index cba78ed..199ac87 100644 --- a/src/fr/devinsy/sikevadb/core/XMLSikevaDB.java +++ b/src/fr/devinsy/sikevadb/core/XMLSikevaDB.java @@ -41,22 +41,20 @@ import fr.devinsy.xml.XMLZipWriter; /** * The Class XMLSikevaDB represents a XML persister. - * - * @author Christian Pierre MOMON (christian.momon@devinsy.fr) */ public class XMLSikevaDB { private static final Logger logger = LoggerFactory.getLogger(XMLSikevaDB.class); /** - * Export in XML a database in a file. + * Export. * * @param out * the out * @param source * the source * @throws SikevaDBException - * the SikevaDB exception + * the sikeva DB exception * @throws FileNotFoundException * the file not found exception */ @@ -147,14 +145,11 @@ public class XMLSikevaDB /** * Import data. - * + * * @param database * the database * @param file * the file - * - * @throws Exception - * the exception */ public static void importData(final SikevaDB database, final File file) { @@ -173,11 +168,12 @@ public class XMLSikevaDB /** * Read element. - * + * * @param in * the in * @return the element * @throws SikevaDBException + * the sikeva DB exception */ public static Element readElement(final XMLReader in) throws SikevaDBException { @@ -243,17 +239,13 @@ public class XMLSikevaDB /** * Read elements. - * + * * @param target * the target * @param in * the in - * @throws XMLBadFormatException - * @throws XMLStreamException * @throws SikevaDBException - * - * @throws Exception - * the exception + * the sikeva DB exception */ public static void readElements(final SikevaDB target, final XMLReader in) throws SikevaDBException { @@ -344,15 +336,13 @@ public class XMLSikevaDB /** * Write in an XML writer the elements of a database, sorting by keys and * sub keys. - * + * * @param out * the out * @param source * the source * @throws SikevaDBException - * - * @throws Exception - * the exception + * the sikeva DB exception */ public static void write(final XMLWriter out, final SikevaDB source) throws SikevaDBException { diff --git a/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java b/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java index b627908..87483e9 100644 --- a/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java +++ b/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java @@ -131,8 +131,9 @@ public class SQLSikevaDB implements SikevaDB /** * Activate archiver. - * + * * @throws ClosedDatabaseException + * the closed database exception */ public void activateArchiver() throws ClosedDatabaseException {