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.
|
* This file is part of SikevaDB, simple key value database.
|
||||||
*
|
*
|
||||||
|
@ -20,8 +20,6 @@ package fr.devinsy.sikevadb.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Interface Archiver.
|
* The Interface Archiver.
|
||||||
*
|
|
||||||
* @author Christian Pierre MOMON
|
|
||||||
*/
|
*/
|
||||||
public interface Archiver
|
public interface Archiver
|
||||||
{
|
{
|
||||||
|
@ -31,17 +29,50 @@ public interface Archiver
|
||||||
SUSPENDED
|
SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activate.
|
||||||
|
*/
|
||||||
void activate();
|
void activate();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Archive.
|
||||||
|
*
|
||||||
|
* @param element
|
||||||
|
* the element
|
||||||
|
* @throws SikevaDBException
|
||||||
|
* the sikeva DB exception
|
||||||
|
*/
|
||||||
void archive(Element element) throws SikevaDBException;
|
void archive(Element element) throws SikevaDBException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear.
|
||||||
|
*
|
||||||
|
* @throws SikevaDBException
|
||||||
|
* the sikeva DB exception
|
||||||
|
*/
|
||||||
void clear() throws SikevaDBException;
|
void clear() throws SikevaDBException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close.
|
||||||
|
*/
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is activated.
|
||||||
|
*
|
||||||
|
* @return true, if is activated
|
||||||
|
*/
|
||||||
boolean isActivated();
|
boolean isActivated();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is suspended.
|
||||||
|
*
|
||||||
|
* @return true, if is suspended
|
||||||
|
*/
|
||||||
boolean isSuspended();
|
boolean isSuspended();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suspend.
|
||||||
|
*/
|
||||||
void 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.
|
* This file is part of SikevaDB, simple key value database.
|
||||||
*
|
*
|
||||||
|
@ -19,15 +19,14 @@
|
||||||
package fr.devinsy.sikevadb.core;
|
package fr.devinsy.sikevadb.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class ClosedDatabaseException.
|
||||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
|
||||||
*/
|
*/
|
||||||
public class ClosedDatabaseException extends SikevaDBException
|
public class ClosedDatabaseException extends SikevaDBException
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 8364599416669077052L;
|
private static final long serialVersionUID = 8364599416669077052L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new closed database exception.
|
||||||
*/
|
*/
|
||||||
public ClosedDatabaseException()
|
public ClosedDatabaseException()
|
||||||
{
|
{
|
||||||
|
@ -35,8 +34,10 @@ public class ClosedDatabaseException extends SikevaDBException
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new closed database exception.
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
|
* the message
|
||||||
*/
|
*/
|
||||||
public ClosedDatabaseException(final String message)
|
public ClosedDatabaseException(final String message)
|
||||||
{
|
{
|
||||||
|
@ -44,9 +45,12 @@ public class ClosedDatabaseException extends SikevaDBException
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new closed database exception.
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
|
* the message
|
||||||
* @param cause
|
* @param cause
|
||||||
|
* the cause
|
||||||
*/
|
*/
|
||||||
public ClosedDatabaseException(final String message, final Throwable 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
|
* @param cause
|
||||||
|
* the cause
|
||||||
*/
|
*/
|
||||||
public ClosedDatabaseException(final Throwable 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.
|
* This file is part of SikevaDB, simple key value database.
|
||||||
*
|
*
|
||||||
|
@ -19,15 +19,14 @@
|
||||||
package fr.devinsy.sikevadb.core;
|
package fr.devinsy.sikevadb.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class OpenedDatabaseException.
|
||||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
|
||||||
*/
|
*/
|
||||||
public class OpenedDatabaseException extends SikevaDBException
|
public class OpenedDatabaseException extends SikevaDBException
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 8364599416669077052L;
|
private static final long serialVersionUID = 8364599416669077052L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new opened database exception.
|
||||||
*/
|
*/
|
||||||
public OpenedDatabaseException()
|
public OpenedDatabaseException()
|
||||||
{
|
{
|
||||||
|
@ -35,8 +34,10 @@ public class OpenedDatabaseException extends SikevaDBException
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new opened database exception.
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
|
* the message
|
||||||
*/
|
*/
|
||||||
public OpenedDatabaseException(final String message)
|
public OpenedDatabaseException(final String message)
|
||||||
{
|
{
|
||||||
|
@ -44,9 +45,12 @@ public class OpenedDatabaseException extends SikevaDBException
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new opened database exception.
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
|
* the message
|
||||||
* @param cause
|
* @param cause
|
||||||
|
* the cause
|
||||||
*/
|
*/
|
||||||
public OpenedDatabaseException(final String message, final Throwable 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
|
* @param cause
|
||||||
|
* the cause
|
||||||
*/
|
*/
|
||||||
public OpenedDatabaseException(final Throwable 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.
|
* 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;
|
public String getValue(String key, String subkey) throws SikevaDBException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the values of a key.
|
* Gets the values.
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
* the key
|
* the key
|
||||||
* @return the values
|
* @return the values
|
||||||
* @throws SikevaDBException
|
* @throws SikevaDBException
|
||||||
* the SikevaDB exception
|
* the sikeva DB exception
|
||||||
*/
|
*/
|
||||||
public StringList getValues(String key) throws SikevaDBException;
|
public StringList getValues(String key) throws SikevaDBException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is archive activated.
|
||||||
|
*
|
||||||
|
* @return true, if is archive activated
|
||||||
|
*/
|
||||||
boolean isArchiveActivated();
|
boolean isArchiveActivated();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is archive suspended.
|
||||||
|
*
|
||||||
|
* @return true, if is archive suspended
|
||||||
|
*/
|
||||||
boolean isArchiveSuspended();
|
boolean isArchiveSuspended();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -41,22 +41,20 @@ import fr.devinsy.xml.XMLZipWriter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class XMLSikevaDB represents a XML persister.
|
* The Class XMLSikevaDB represents a XML persister.
|
||||||
*
|
|
||||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
|
||||||
*/
|
*/
|
||||||
public class XMLSikevaDB
|
public class XMLSikevaDB
|
||||||
{
|
{
|
||||||
private static final Logger logger = LoggerFactory.getLogger(XMLSikevaDB.class);
|
private static final Logger logger = LoggerFactory.getLogger(XMLSikevaDB.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export in XML a database in a file.
|
* Export.
|
||||||
*
|
*
|
||||||
* @param out
|
* @param out
|
||||||
* the out
|
* the out
|
||||||
* @param source
|
* @param source
|
||||||
* the source
|
* the source
|
||||||
* @throws SikevaDBException
|
* @throws SikevaDBException
|
||||||
* the SikevaDB exception
|
* the sikeva DB exception
|
||||||
* @throws FileNotFoundException
|
* @throws FileNotFoundException
|
||||||
* the file not found exception
|
* the file not found exception
|
||||||
*/
|
*/
|
||||||
|
@ -147,14 +145,11 @@ public class XMLSikevaDB
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import data.
|
* Import data.
|
||||||
*
|
*
|
||||||
* @param database
|
* @param database
|
||||||
* the database
|
* the database
|
||||||
* @param file
|
* @param file
|
||||||
* the file
|
* the file
|
||||||
*
|
|
||||||
* @throws Exception
|
|
||||||
* the exception
|
|
||||||
*/
|
*/
|
||||||
public static void importData(final SikevaDB database, final File file)
|
public static void importData(final SikevaDB database, final File file)
|
||||||
{
|
{
|
||||||
|
@ -173,11 +168,12 @@ public class XMLSikevaDB
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read element.
|
* Read element.
|
||||||
*
|
*
|
||||||
* @param in
|
* @param in
|
||||||
* the in
|
* the in
|
||||||
* @return the element
|
* @return the element
|
||||||
* @throws SikevaDBException
|
* @throws SikevaDBException
|
||||||
|
* the sikeva DB exception
|
||||||
*/
|
*/
|
||||||
public static Element readElement(final XMLReader in) throws SikevaDBException
|
public static Element readElement(final XMLReader in) throws SikevaDBException
|
||||||
{
|
{
|
||||||
|
@ -243,17 +239,13 @@ public class XMLSikevaDB
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read elements.
|
* Read elements.
|
||||||
*
|
*
|
||||||
* @param target
|
* @param target
|
||||||
* the target
|
* the target
|
||||||
* @param in
|
* @param in
|
||||||
* the in
|
* the in
|
||||||
* @throws XMLBadFormatException
|
|
||||||
* @throws XMLStreamException
|
|
||||||
* @throws SikevaDBException
|
* @throws SikevaDBException
|
||||||
*
|
* the sikeva DB exception
|
||||||
* @throws Exception
|
|
||||||
* the exception
|
|
||||||
*/
|
*/
|
||||||
public static void readElements(final SikevaDB target, final XMLReader in) throws SikevaDBException
|
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
|
* Write in an XML writer the elements of a database, sorting by keys and
|
||||||
* sub keys.
|
* sub keys.
|
||||||
*
|
*
|
||||||
* @param out
|
* @param out
|
||||||
* the out
|
* the out
|
||||||
* @param source
|
* @param source
|
||||||
* the source
|
* the source
|
||||||
* @throws SikevaDBException
|
* @throws SikevaDBException
|
||||||
*
|
* the sikeva DB exception
|
||||||
* @throws Exception
|
|
||||||
* the exception
|
|
||||||
*/
|
*/
|
||||||
public static void write(final XMLWriter out, final SikevaDB source) throws SikevaDBException
|
public static void write(final XMLWriter out, final SikevaDB source) throws SikevaDBException
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,8 +131,9 @@ public class SQLSikevaDB implements SikevaDB
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate archiver.
|
* Activate archiver.
|
||||||
*
|
*
|
||||||
* @throws ClosedDatabaseException
|
* @throws ClosedDatabaseException
|
||||||
|
* the closed database exception
|
||||||
*/
|
*/
|
||||||
public void activateArchiver() throws ClosedDatabaseException
|
public void activateArchiver() throws ClosedDatabaseException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue