Made javadoc review.
This commit is contained in:
parent
5aaf1bf9f4
commit
4018f2cc15
6 changed files with 84 additions and 40 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
* Copyright (C) 2013-2024 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* 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();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
* Copyright (C) 2018-2024 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
* Copyright (C) 2018-2024 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2018 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
* Copyright (C) 2013-2024 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* 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();
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -131,8 +131,9 @@ public class SQLSikevaDB implements SikevaDB
|
|||
|
||||
/**
|
||||
* Activate archiver.
|
||||
*
|
||||
*
|
||||
* @throws ClosedDatabaseException
|
||||
* the closed database exception
|
||||
*/
|
||||
public void activateArchiver() throws ClosedDatabaseException
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue