Performed a Javadoc review.
This commit is contained in:
parent
b2a7877a8f
commit
3281414dd4
22 changed files with 517 additions and 157 deletions
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -30,23 +30,24 @@ import fr.devinsy.sikevadb.cli.SikevaDBCLI;
|
|||
import fr.devinsy.sikevadb.demo.SikevaDBDemo;
|
||||
|
||||
/**
|
||||
* This class <code>SikevaDB</code> is the launcher.
|
||||
*
|
||||
* The Class SikevaDBLauncher.
|
||||
*/
|
||||
public final class SikevaDBLauncher
|
||||
{
|
||||
private static Logger logger = LoggerFactory.getLogger(SikevaDBLauncher.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
* Instantiates a new SikevaDB launcher.
|
||||
*/
|
||||
private SikevaDBLauncher()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* The main method.
|
||||
*
|
||||
* @param args
|
||||
* the arguments
|
||||
*/
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -32,8 +32,8 @@ import fr.devinsy.sikevadb.core.SikevaDBException;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
* This class manage a Command Line Interface for SikevaDB.
|
||||
*
|
||||
* The Class <code>SikevaDBCLI</code> manages a Command Line Interface for
|
||||
* SikevaDB.
|
||||
*
|
||||
*/
|
||||
public final class SikevaDBCLI
|
||||
|
@ -41,8 +41,8 @@ public final class SikevaDBCLI
|
|||
private static Logger logger = LoggerFactory.getLogger(SikevaDBCLI.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
* Instantiates a new SikevaDBCLI.
|
||||
*/
|
||||
private SikevaDBCLI()
|
||||
{
|
||||
}
|
||||
|
@ -65,8 +65,10 @@ public final class SikevaDBCLI
|
|||
}
|
||||
|
||||
/**
|
||||
* The main method.
|
||||
*
|
||||
* @param args
|
||||
* the arguments
|
||||
*/
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -21,14 +21,14 @@ package fr.devinsy.sikevadb.cli;
|
|||
import fr.devinsy.sikevadb.core.SikevaDBException;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class SikevaDBCLIException.
|
||||
*/
|
||||
public class SikevaDBCLIException extends SikevaDBException
|
||||
{
|
||||
private static final long serialVersionUID = 2986878456227891377L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Instantiates a new SikevaDBCLI exception.
|
||||
*/
|
||||
public SikevaDBCLIException()
|
||||
{
|
||||
|
@ -36,8 +36,10 @@ public class SikevaDBCLIException extends SikevaDBException
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDBCLI exception.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public SikevaDBCLIException(final String message)
|
||||
{
|
||||
|
@ -45,9 +47,12 @@ public class SikevaDBCLIException extends SikevaDBException
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDBCLI exception.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public SikevaDBCLIException(final String message, final Throwable cause)
|
||||
{
|
||||
|
@ -55,8 +60,10 @@ public class SikevaDBCLIException extends SikevaDBException
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDBCLI exception.
|
||||
*
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public SikevaDBCLIException(final Throwable cause)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -19,6 +19,7 @@
|
|||
package fr.devinsy.sikevadb.core;
|
||||
|
||||
/**
|
||||
* The Interface Archiver.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -22,7 +22,7 @@ import org.apache.commons.codec.digest.DigestUtils;
|
|||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class Element.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
@ -42,9 +42,7 @@ public class Element
|
|||
private String value;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* Instantiates a new element.
|
||||
*/
|
||||
public Element()
|
||||
{
|
||||
|
@ -52,9 +50,14 @@ public class Element
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new element.
|
||||
*
|
||||
* @param key
|
||||
* the key
|
||||
* @param subkey
|
||||
* the subkey
|
||||
* @param value
|
||||
* the value
|
||||
*/
|
||||
public Element(final String key, final String subkey, final String value)
|
||||
{
|
||||
|
@ -65,106 +68,207 @@ public class Element
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Archive.
|
||||
*/
|
||||
public void archive()
|
||||
{
|
||||
this.archiveDate = DateTime.now();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the archive date.
|
||||
*
|
||||
* @return the archive date
|
||||
*/
|
||||
public DateTime getArchiveDate()
|
||||
{
|
||||
return this.archiveDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the creation date.
|
||||
*
|
||||
* @return the creation date
|
||||
*/
|
||||
public DateTime getCreationDate()
|
||||
{
|
||||
return this.creationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the digest.
|
||||
*
|
||||
* @return the digest
|
||||
*/
|
||||
public String getDigest()
|
||||
{
|
||||
return this.digest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the edition date.
|
||||
*
|
||||
* @return the edition date
|
||||
*/
|
||||
public DateTime getEditionDate()
|
||||
{
|
||||
return this.editionDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
* @return the id
|
||||
*/
|
||||
public long getId()
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the key.
|
||||
*
|
||||
* @return the key
|
||||
*/
|
||||
public String getKey()
|
||||
{
|
||||
return this.key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the size.
|
||||
*
|
||||
* @return the size
|
||||
*/
|
||||
public long getSize()
|
||||
{
|
||||
return this.size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the subkey.
|
||||
*
|
||||
* @return the subkey
|
||||
*/
|
||||
public String getSubkey()
|
||||
{
|
||||
return this.subkey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value.
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
public String getValue()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the archive date.
|
||||
*
|
||||
* @param date
|
||||
* the new archive date
|
||||
*/
|
||||
public void setArchiveDate(final DateTime date)
|
||||
{
|
||||
this.archiveDate = date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the creation date.
|
||||
*
|
||||
* @param date
|
||||
* the new creation date
|
||||
*/
|
||||
public void setCreationDate(final DateTime date)
|
||||
{
|
||||
this.creationDate = date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the digest.
|
||||
*
|
||||
* @param digest
|
||||
* the new digest
|
||||
*/
|
||||
public void setDigest(final String digest)
|
||||
{
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the edition date.
|
||||
*
|
||||
* @param date
|
||||
* the new edition date
|
||||
*/
|
||||
public void setEditionDate(final DateTime date)
|
||||
{
|
||||
this.editionDate = date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id
|
||||
* the new id
|
||||
*/
|
||||
public void setId(final long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the key.
|
||||
*
|
||||
* @param key
|
||||
* the new key
|
||||
*/
|
||||
public void setKey(final String key)
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the size.
|
||||
*
|
||||
* @param size
|
||||
* the new size
|
||||
*/
|
||||
public void setSize(final long size)
|
||||
{
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the subkey.
|
||||
*
|
||||
* @param subkey
|
||||
* the new subkey
|
||||
*/
|
||||
public void setSubkey(final String subkey)
|
||||
{
|
||||
this.subkey = subkey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value.
|
||||
*
|
||||
* @param value
|
||||
* the new value
|
||||
*/
|
||||
public void setValue(final String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update.
|
||||
*
|
||||
* @param value
|
||||
* the value
|
||||
*/
|
||||
public void update(final String value)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -21,16 +21,16 @@ package fr.devinsy.sikevadb.core;
|
|||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* The Class Elements.
|
||||
*
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
||||
*/
|
||||
public class Elements extends ArrayList<Element>
|
||||
{
|
||||
private static final long serialVersionUID = 6298920093179395791L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Instantiates a new elements.
|
||||
*/
|
||||
public Elements()
|
||||
{
|
||||
|
@ -38,7 +38,10 @@ public class Elements extends ArrayList<Element>
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new elements.
|
||||
*
|
||||
* @param initialCapacity
|
||||
* the initial capacity
|
||||
*/
|
||||
public Elements(final int initialCapacity)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -21,7 +21,7 @@ package fr.devinsy.sikevadb.core;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Interface SikevaDB.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (C) 2013-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
*
|
||||
|
@ -19,6 +19,7 @@
|
|||
package fr.devinsy.sikevadb.core;
|
||||
|
||||
/**
|
||||
* The Class SikevaDBException.
|
||||
*
|
||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
||||
*/
|
||||
|
@ -27,7 +28,7 @@ public class SikevaDBException extends Exception
|
|||
private static final long serialVersionUID = 8323299610751708972L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Instantiates a new SikevaDB exception.
|
||||
*/
|
||||
public SikevaDBException()
|
||||
{
|
||||
|
@ -35,8 +36,10 @@ public class SikevaDBException extends Exception
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDB exception.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public SikevaDBException(final String message)
|
||||
{
|
||||
|
@ -44,9 +47,12 @@ public class SikevaDBException extends Exception
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDB exception.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public SikevaDBException(final String message, final Throwable cause)
|
||||
{
|
||||
|
@ -54,8 +60,10 @@ public class SikevaDBException extends Exception
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDB exception.
|
||||
*
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public SikevaDBException(final Throwable cause)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -24,17 +24,22 @@ import fr.devinsy.sikevadb.filetree.FileTreeSikevaDB;
|
|||
import fr.devinsy.sikevadb.sql.SQLSikevaDB;
|
||||
|
||||
/**
|
||||
*
|
||||
* A factory for creating SikevaDB objects.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
public class SikevaDBFactory
|
||||
{
|
||||
/**
|
||||
* Gets a SikevaDB instance from its database home directory.
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
* the path of the database home directory
|
||||
*
|
||||
* @return a SikevaDB instance
|
||||
*
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public static SikevaDB get(final File path) throws SikevaDBException
|
||||
{
|
||||
|
@ -47,9 +52,15 @@ public class SikevaDBFactory
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets a SikevaDB instance from a context.
|
||||
*
|
||||
* @param contextName
|
||||
* @return
|
||||
* the context name
|
||||
*
|
||||
* @return a SikevaDB instance
|
||||
*
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public static SikevaDB get(final String contextName)
|
||||
{
|
||||
|
@ -62,12 +73,18 @@ public class SikevaDBFactory
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets a SikevaDB instance from dabase parameters.
|
||||
*
|
||||
* @param driverClassName
|
||||
* the driver class name
|
||||
* @param url
|
||||
* the url
|
||||
* @param login
|
||||
* the login
|
||||
* @param password
|
||||
* @return
|
||||
* the password
|
||||
*
|
||||
* @return the SikevaDB
|
||||
*/
|
||||
public static SikevaDB get(final String driverClassName, final String url, final String login, final String password)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -21,12 +21,17 @@ package fr.devinsy.sikevadb.core;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class SikevaDBUtils.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
public class SikevaDBUtils
|
||||
{
|
||||
/**
|
||||
* Gets the current time in long format.
|
||||
*
|
||||
* @return the long
|
||||
*/
|
||||
public static long now()
|
||||
{
|
||||
return new Date().getTime();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -36,9 +36,9 @@ import fr.devinsy.util.xml.XMLWriter;
|
|||
import fr.devinsy.util.xml.XMLZipWriter;
|
||||
|
||||
/**
|
||||
* This class represents a AccountManager File reader and writer.
|
||||
* The Class XMLSikevaDB represents a XML persister.
|
||||
*
|
||||
* @author TIP
|
||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
||||
*/
|
||||
public class XMLSikevaDB
|
||||
{
|
||||
|
@ -47,11 +47,13 @@ public class XMLSikevaDB
|
|||
/**
|
||||
* Saves a net in a file.
|
||||
*
|
||||
* @param file
|
||||
* Target.
|
||||
* @param out
|
||||
* the out
|
||||
* @param source
|
||||
* Source.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
public static void export(final OutputStream out, final SikevaDB source) throws Exception
|
||||
{
|
||||
|
@ -65,11 +67,15 @@ public class XMLSikevaDB
|
|||
/**
|
||||
* Saves a net in a file.
|
||||
*
|
||||
* @param file
|
||||
* Target.
|
||||
* @param out
|
||||
* the out
|
||||
* @param source
|
||||
* Source.
|
||||
* @param fileName
|
||||
* the file name
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
public static void export(final OutputStream out, final SikevaDB source, final String fileName) throws Exception
|
||||
{
|
||||
|
@ -110,9 +116,15 @@ public class XMLSikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Import data.
|
||||
*
|
||||
* @param database
|
||||
* the database
|
||||
* @param file
|
||||
* @return
|
||||
* the file
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
public static void importData(final SikevaDB database, final File file) throws Exception
|
||||
{
|
||||
|
@ -128,12 +140,16 @@ public class XMLSikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Read element.
|
||||
*
|
||||
* @param target
|
||||
* @param in
|
||||
* @throws XMLBadFormatException
|
||||
* the in
|
||||
* @return the element
|
||||
*
|
||||
* @throws XMLStreamException
|
||||
* @throws Exception
|
||||
* the XML stream exception
|
||||
* @throws XMLBadFormatException
|
||||
* the XML bad format exception
|
||||
*/
|
||||
public static Element readElement(final XMLReader in) throws XMLStreamException, XMLBadFormatException
|
||||
{
|
||||
|
@ -187,10 +203,15 @@ public class XMLSikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Read elements.
|
||||
*
|
||||
* @param target
|
||||
* the target
|
||||
* @param in
|
||||
* the in
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
public static void readElements(final SikevaDB target, final XMLReader in) throws Exception
|
||||
{
|
||||
|
@ -216,9 +237,12 @@ public class XMLSikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Write.
|
||||
*
|
||||
* @param out
|
||||
* the out
|
||||
* @param source
|
||||
* @return
|
||||
* the source
|
||||
*/
|
||||
public static void write(final XMLWriter out, final Element source)
|
||||
{
|
||||
|
@ -269,10 +293,15 @@ public class XMLSikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Write.
|
||||
*
|
||||
* @param out
|
||||
* the out
|
||||
* @param source
|
||||
* the source
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
public static void write(final XMLWriter out, final SikevaDB source) throws Exception
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -34,24 +34,24 @@ import fr.devinsy.sikevadb.core.SikevaDBFactory;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
* This class manage a Command Line Interface for SikevaDB.
|
||||
*
|
||||
*
|
||||
* The Class SikevaDBDemo is a demo for SikevaDB.
|
||||
*/
|
||||
public final class SikevaDBDemo
|
||||
{
|
||||
private static Logger logger = LoggerFactory.getLogger(SikevaDBDemo.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
* SikevaDBDemo class has to be not instanciated.
|
||||
*/
|
||||
private SikevaDBDemo()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SikevaDBException
|
||||
* Demo.
|
||||
*
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public static void demo() throws SikevaDBException
|
||||
{
|
||||
|
@ -160,8 +160,10 @@ public final class SikevaDBDemo
|
|||
}
|
||||
|
||||
/**
|
||||
* The main method.
|
||||
*
|
||||
* @param args
|
||||
* the arguments
|
||||
*/
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -21,14 +21,14 @@ package fr.devinsy.sikevadb.demo;
|
|||
import fr.devinsy.sikevadb.core.SikevaDBException;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class SikevaDBDemoException.
|
||||
*/
|
||||
public class SikevaDBDemoException extends SikevaDBException
|
||||
{
|
||||
private static final long serialVersionUID = 1162267847144476595L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Instantiates a new SikevaDB demo exception.
|
||||
*/
|
||||
public SikevaDBDemoException()
|
||||
{
|
||||
|
@ -36,8 +36,10 @@ public class SikevaDBDemoException extends SikevaDBException
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDB demo exception.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public SikevaDBDemoException(final String message)
|
||||
{
|
||||
|
@ -45,9 +47,12 @@ public class SikevaDBDemoException extends SikevaDBException
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDB demo exception.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public SikevaDBDemoException(final String message, final Throwable cause)
|
||||
{
|
||||
|
@ -55,8 +60,10 @@ public class SikevaDBDemoException extends SikevaDBException
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SikevaDB demo exception.
|
||||
*
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public SikevaDBDemoException(final Throwable cause)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -26,10 +26,11 @@ import fr.devinsy.sikevadb.core.SikevaDB;
|
|||
import fr.devinsy.sikevadb.core.SikevaDBException;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class FileTreeArchiver.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
||||
public class FileTreeArchiver implements Archiver
|
||||
{
|
||||
private static final String ARCHIVE_PATH = "archive";
|
||||
|
@ -39,9 +40,13 @@ public class FileTreeArchiver implements Archiver
|
|||
private SikevaDB database;
|
||||
|
||||
/**
|
||||
* Instantiates a new file tree archiver.
|
||||
*
|
||||
* @param source
|
||||
* the source
|
||||
*
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public FileTreeArchiver(final FileTreeSikevaDB source) throws SikevaDBException
|
||||
{
|
||||
|
@ -68,8 +73,8 @@ public class FileTreeArchiver implements Archiver
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#activate()
|
||||
*/
|
||||
@Override
|
||||
public void activate()
|
||||
|
@ -77,28 +82,26 @@ public class FileTreeArchiver implements Archiver
|
|||
this.status = Status.ACTIVATED;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#archive(fr.devinsy.sikevadb.core.Element)
|
||||
*/
|
||||
@Override
|
||||
public void archive(final Element element) throws SikevaDBException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#clear()
|
||||
*/
|
||||
@Override
|
||||
public void clear() throws SikevaDBException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#close()
|
||||
*/
|
||||
@Override
|
||||
public void close()
|
||||
|
@ -107,16 +110,17 @@ public class FileTreeArchiver implements Archiver
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the path.
|
||||
*
|
||||
* @return
|
||||
* @return the path
|
||||
*/
|
||||
public File getPath()
|
||||
{
|
||||
return this.archiveDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#isActivated()
|
||||
*/
|
||||
@Override
|
||||
public boolean isActivated()
|
||||
|
@ -136,8 +140,8 @@ public class FileTreeArchiver implements Archiver
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#isSuspended()
|
||||
*/
|
||||
@Override
|
||||
public boolean isSuspended()
|
||||
|
@ -150,8 +154,8 @@ public class FileTreeArchiver implements Archiver
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#suspend()
|
||||
*/
|
||||
@Override
|
||||
public void suspend()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -38,6 +38,8 @@ import fr.devinsy.util.ToolBox;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
* The Class FileTreeSikevaDB.
|
||||
*
|
||||
* <pre>
|
||||
* private long id; IN
|
||||
* private DateTime creationDate; IN
|
||||
|
@ -72,9 +74,16 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
private File configDirectory;
|
||||
|
||||
/**
|
||||
* Instantiates a new file tree SikevaDB.
|
||||
*
|
||||
* @param contextName
|
||||
* @param homeDirectory
|
||||
* the home directory
|
||||
* @param login
|
||||
* the login
|
||||
* @param password
|
||||
* the password
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public FileTreeSikevaDB(final File homeDirectory, final String login, final String password) throws SikevaDBException
|
||||
{
|
||||
|
@ -98,9 +107,11 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#archiver()
|
||||
*/
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public Archiver archiver() throws SikevaDBException
|
||||
|
@ -108,9 +119,8 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
return this.archiver;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws IOException
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#clear()
|
||||
*/
|
||||
@Override
|
||||
public void clear() throws SikevaDBException
|
||||
|
@ -380,8 +390,9 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the config directory.
|
||||
*
|
||||
* @return
|
||||
* @return the config directory
|
||||
*/
|
||||
public File getConfigDirectory()
|
||||
{
|
||||
|
@ -389,8 +400,9 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the data directory.
|
||||
*
|
||||
* @return
|
||||
* @return the data directory
|
||||
*/
|
||||
public File getDataDirectory()
|
||||
{
|
||||
|
@ -573,8 +585,9 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the file tree directory.
|
||||
*
|
||||
* @return
|
||||
* @return the file tree directory
|
||||
*/
|
||||
public File getFileTreeDirectory()
|
||||
{
|
||||
|
@ -626,8 +639,9 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the login.
|
||||
*
|
||||
* @return
|
||||
* @return the login
|
||||
*/
|
||||
public String getLogin()
|
||||
{
|
||||
|
@ -635,8 +649,9 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the password.
|
||||
*
|
||||
* @return
|
||||
* @return the password
|
||||
*/
|
||||
public String getPassword()
|
||||
{
|
||||
|
@ -829,8 +844,8 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#isArchiveActivated()
|
||||
*/
|
||||
@Override
|
||||
public boolean isArchiveActivated()
|
||||
|
@ -850,8 +865,8 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#isArchiveSuspended()
|
||||
*/
|
||||
@Override
|
||||
public boolean isArchiveSuspended()
|
||||
|
@ -864,9 +879,8 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#isClosed()
|
||||
*/
|
||||
@Override
|
||||
public boolean isClosed()
|
||||
|
@ -900,9 +914,8 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#isOpened()
|
||||
*/
|
||||
@Override
|
||||
public boolean isOpened()
|
||||
|
@ -1554,8 +1567,10 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the login.
|
||||
*
|
||||
* @param login
|
||||
* the new login
|
||||
*/
|
||||
public void setLogin(final String login)
|
||||
{
|
||||
|
@ -1563,8 +1578,10 @@ public class FileTreeSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the password.
|
||||
*
|
||||
* @param password
|
||||
* the new password
|
||||
*/
|
||||
public void setPassword(final String password)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -36,21 +36,23 @@ import fr.devinsy.util.xml.XMLReader;
|
|||
import fr.devinsy.util.xml.XMLWriter;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class FileTreeSikevaDBTools.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
||||
public class FileTreeSikevaDBTools
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FileTreeSikevaDBTools.class);
|
||||
|
||||
/**
|
||||
* Load element.
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
* @throws FileNotFoundException
|
||||
* @throws XMLStreamException
|
||||
* @throws XMLBadFormatException
|
||||
* the source
|
||||
* @return the element
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public static Element loadElement(final File source) throws SikevaDBException
|
||||
{
|
||||
|
@ -137,10 +139,14 @@ public class FileTreeSikevaDBTools
|
|||
}
|
||||
|
||||
/**
|
||||
* Save element.
|
||||
*
|
||||
* @param target
|
||||
* the target
|
||||
* @param source
|
||||
* the source
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public static void saveElement(final File target, final Element source) throws SikevaDBException
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -26,10 +26,11 @@ import fr.devinsy.sikevadb.core.Element;
|
|||
import fr.devinsy.sikevadb.core.SikevaDBException;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class SQLArchiver.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
||||
public class SQLArchiver implements Archiver
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(SQLArchiver.class);;
|
||||
|
@ -38,8 +39,10 @@ public class SQLArchiver implements Archiver
|
|||
private SQLSikevaDB database;
|
||||
|
||||
/**
|
||||
* Instantiates a new SQL archiver.
|
||||
*
|
||||
* @param contextName
|
||||
* @param source
|
||||
* the source
|
||||
*/
|
||||
public SQLArchiver(final SQLSikevaDB source)
|
||||
{
|
||||
|
@ -54,8 +57,8 @@ public class SQLArchiver implements Archiver
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#activate()
|
||||
*/
|
||||
@Override
|
||||
public void activate()
|
||||
|
@ -63,8 +66,8 @@ public class SQLArchiver implements Archiver
|
|||
this.status = Status.ACTIVATED;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#archive(fr.devinsy.sikevadb.core.Element)
|
||||
*/
|
||||
@Override
|
||||
public void archive(final Element element) throws SikevaDBException
|
||||
|
@ -72,8 +75,8 @@ public class SQLArchiver implements Archiver
|
|||
// TODO
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#clear()
|
||||
*/
|
||||
@Override
|
||||
public void clear() throws SikevaDBException
|
||||
|
@ -81,8 +84,8 @@ public class SQLArchiver implements Archiver
|
|||
// TODO
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#close()
|
||||
*/
|
||||
@Override
|
||||
public void close()
|
||||
|
@ -90,8 +93,8 @@ public class SQLArchiver implements Archiver
|
|||
// TODO
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#isActivated()
|
||||
*/
|
||||
@Override
|
||||
public boolean isActivated()
|
||||
|
@ -111,8 +114,8 @@ public class SQLArchiver implements Archiver
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#isSuspended()
|
||||
*/
|
||||
@Override
|
||||
public boolean isSuspended()
|
||||
|
@ -125,8 +128,8 @@ public class SQLArchiver implements Archiver
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.Archiver#suspend()
|
||||
*/
|
||||
@Override
|
||||
public void suspend()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -44,10 +44,11 @@ import fr.devinsy.sikevadb.core.SikevaDBException;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class SQLSikevaDB.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
||||
public class SQLSikevaDB implements SikevaDB
|
||||
{
|
||||
public enum Status
|
||||
|
@ -69,8 +70,10 @@ public class SQLSikevaDB implements SikevaDB
|
|||
private Archiver archiver;
|
||||
|
||||
/**
|
||||
* Instantiates a new SQL SikevaDB.
|
||||
*
|
||||
* @param contextName
|
||||
* the context name
|
||||
*/
|
||||
public SQLSikevaDB(final String contextName)
|
||||
{
|
||||
|
@ -82,10 +85,14 @@ public class SQLSikevaDB implements SikevaDB
|
|||
/**
|
||||
* This method opens a database session.
|
||||
*
|
||||
* @param host
|
||||
* @param port
|
||||
* @param driverClassName
|
||||
* the driver class name
|
||||
* @param url
|
||||
* the url
|
||||
* @param login
|
||||
* the login
|
||||
* @param password
|
||||
* the password
|
||||
*/
|
||||
public SQLSikevaDB(final String driverClassName, final String url, final String login, final String password)
|
||||
{
|
||||
|
@ -118,15 +125,15 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Activate archiver.
|
||||
*/
|
||||
public void activateArchiver()
|
||||
{
|
||||
this.archiver.activate();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* (non-Javadoc)
|
||||
* @see fr.devinsy.sikevadb.core.SikevaDB#archiver()
|
||||
*/
|
||||
@Override
|
||||
public Archiver archiver() throws SikevaDBException
|
||||
|
@ -204,10 +211,14 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Close quietly.
|
||||
*
|
||||
* @param connection
|
||||
* the connection
|
||||
* @param statement
|
||||
* the statement
|
||||
* @param resultSet
|
||||
* the result set
|
||||
*/
|
||||
private void closeQuietly(final Connection connection, final Statement statement, final ResultSet resultSet)
|
||||
{
|
||||
|
@ -500,10 +511,13 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Exists.
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
* @param element
|
||||
* the element
|
||||
* @return true, if successful
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public boolean exists(final Element element) throws SikevaDBException
|
||||
{
|
||||
|
@ -527,9 +541,11 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the connection.
|
||||
*
|
||||
* @return
|
||||
* @return the connection
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public Connection getConnection() throws SikevaDBException
|
||||
{
|
||||
|
@ -561,8 +577,9 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the context name.
|
||||
*
|
||||
* @return
|
||||
* @return the context name
|
||||
*/
|
||||
public String getContextName()
|
||||
{
|
||||
|
@ -570,8 +587,9 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the driver classname.
|
||||
*
|
||||
* @return
|
||||
* @return the driver classname
|
||||
*/
|
||||
public String getDriverClassname()
|
||||
{
|
||||
|
@ -579,10 +597,13 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the element.
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
* the id
|
||||
* @return the element
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
public Element getElement(final long id) throws SikevaDBException
|
||||
{
|
||||
|
@ -1019,8 +1040,9 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the login.
|
||||
*
|
||||
* @return
|
||||
* @return the login
|
||||
*/
|
||||
public String getLogin()
|
||||
{
|
||||
|
@ -1028,8 +1050,9 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the password.
|
||||
*
|
||||
* @return
|
||||
* @return the password
|
||||
*/
|
||||
public String getPassword()
|
||||
{
|
||||
|
@ -1095,8 +1118,9 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the url.
|
||||
*
|
||||
* @return
|
||||
* @return the url
|
||||
*/
|
||||
public String getUrl()
|
||||
{
|
||||
|
@ -2303,8 +2327,10 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the driver classname.
|
||||
*
|
||||
* @param driverClassname
|
||||
* the new driver classname
|
||||
*/
|
||||
public void setDriverClassname(final String driverClassname)
|
||||
{
|
||||
|
@ -2312,8 +2338,10 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the login.
|
||||
*
|
||||
* @param login
|
||||
* the new login
|
||||
*/
|
||||
public void setLogin(final String login)
|
||||
{
|
||||
|
@ -2321,8 +2349,10 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the password.
|
||||
*
|
||||
* @param password
|
||||
* the new password
|
||||
*/
|
||||
public void setPassword(final String password)
|
||||
{
|
||||
|
@ -2330,8 +2360,10 @@ public class SQLSikevaDB implements SikevaDB
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the url.
|
||||
*
|
||||
* @param url
|
||||
* the new url
|
||||
*/
|
||||
public void setUrl(final String url)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -33,7 +33,7 @@ import fr.devinsy.util.FileTools;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class SQLSikevaDBTools.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
@ -42,9 +42,13 @@ public class SQLSikevaDBTools
|
|||
private static final Logger logger = LoggerFactory.getLogger(SQLSikevaDBTools.class);
|
||||
|
||||
/**
|
||||
* Load SQL script.
|
||||
*
|
||||
* @param source
|
||||
* the source
|
||||
* @return the string list
|
||||
* @throws IOException
|
||||
* Signals that an I/O exception has occurred.
|
||||
*/
|
||||
public static StringList loadSQLScript(final URL source) throws IOException
|
||||
{
|
||||
|
@ -59,9 +63,13 @@ public class SQLSikevaDBTools
|
|||
}
|
||||
|
||||
/**
|
||||
* Split SQL commands.
|
||||
*
|
||||
* @param source
|
||||
* the source
|
||||
* @return the string list
|
||||
* @throws IOException
|
||||
* Signals that an I/O exception has occurred.
|
||||
*/
|
||||
public static StringList splitSQLCommands(final String source) throws IOException
|
||||
{
|
||||
|
@ -121,9 +129,11 @@ public class SQLSikevaDBTools
|
|||
}
|
||||
|
||||
/**
|
||||
* To date time.
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
* the source
|
||||
* @return the date time
|
||||
*/
|
||||
public static DateTime toDateTime(final java.sql.Timestamp source)
|
||||
{
|
||||
|
@ -143,9 +153,11 @@ public class SQLSikevaDBTools
|
|||
}
|
||||
|
||||
/**
|
||||
* To timestamp.
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
* the source
|
||||
* @return the java.sql. timestamp
|
||||
*/
|
||||
public static java.sql.Timestamp toTimestamp(final Date source)
|
||||
{
|
||||
|
@ -165,9 +177,11 @@ public class SQLSikevaDBTools
|
|||
}
|
||||
|
||||
/**
|
||||
* To timestamp.
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
* the source
|
||||
* @return the java.sql. timestamp
|
||||
*/
|
||||
public static java.sql.Timestamp toTimestamp(final DateTime source)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (C) 2013-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
*
|
||||
|
@ -27,9 +27,11 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Class BuildInformation.
|
||||
*
|
||||
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
|
||||
*/
|
||||
|
||||
public class BuildInformation
|
||||
{
|
||||
private static class SingletonHolder
|
||||
|
@ -50,8 +52,8 @@ public class BuildInformation
|
|||
private String buildAuthor;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
* Instantiates a new builds the information.
|
||||
*/
|
||||
private BuildInformation()
|
||||
{
|
||||
Properties build = new Properties();
|
||||
|
@ -92,47 +94,78 @@ public class BuildInformation
|
|||
}
|
||||
|
||||
/**
|
||||
* Builds the author.
|
||||
*
|
||||
* @return
|
||||
* @return the string
|
||||
*/
|
||||
public String buildAuthor()
|
||||
{
|
||||
return this.buildAuthor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the date.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public String buildDate()
|
||||
{
|
||||
return this.buildDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the number.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public String buildNumber()
|
||||
{
|
||||
return this.buildNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generator.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public String generator()
|
||||
{
|
||||
return this.generator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Major revision.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public String majorRevision()
|
||||
{
|
||||
return this.majorRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minor revision.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public String minorRevision()
|
||||
{
|
||||
return this.minorRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
* Product name.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public String productName()
|
||||
{
|
||||
return this.productName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@ -145,8 +178,9 @@ public class BuildInformation
|
|||
}
|
||||
|
||||
/**
|
||||
* Version.
|
||||
*
|
||||
* @return
|
||||
* @return the string
|
||||
*/
|
||||
public String version()
|
||||
{
|
||||
|
@ -159,8 +193,9 @@ public class BuildInformation
|
|||
}
|
||||
|
||||
/**
|
||||
* Instance.
|
||||
*
|
||||
* @return
|
||||
* @return the builds the information
|
||||
*/
|
||||
public static BuildInformation instance()
|
||||
{
|
||||
|
@ -168,8 +203,10 @@ public class BuildInformation
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
* Checks if is defined.
|
||||
*
|
||||
* @return true, if is defined
|
||||
*/
|
||||
public static boolean isDefined()
|
||||
{
|
||||
boolean result;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON, DEVINSY
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -37,6 +37,7 @@ import fr.devinsy.sikevadb.core.SikevaDBException;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
* The Class TreeFileSikevaDBTest.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
@ -46,7 +47,10 @@ public class TreeFileSikevaDBTest
|
|||
private static FileTreeSikevaDB database;
|
||||
|
||||
/**
|
||||
* Test get keyse 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testGetKeyse01() throws Exception
|
||||
|
@ -76,7 +80,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test get keyse 02.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testGetKeyse02() throws Exception
|
||||
|
@ -111,7 +118,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test memory size 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testMemorySize01() throws Exception
|
||||
|
@ -150,7 +160,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPut01() throws Exception
|
||||
|
@ -170,7 +183,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put 02.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPut02() throws Exception
|
||||
|
@ -191,7 +207,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put 03.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testPut03() throws Exception
|
||||
|
@ -208,7 +227,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put 04.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPut04() throws Exception
|
||||
|
@ -229,7 +251,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put 05.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPut05() throws Exception
|
||||
|
@ -260,7 +285,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put 06.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPut06() throws Exception
|
||||
|
@ -292,7 +320,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put element 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPutElement01() throws Exception
|
||||
|
@ -324,7 +355,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put element 02.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPutElement02() throws Exception
|
||||
|
@ -358,7 +392,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test put element 03.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testPutElement03() throws Exception
|
||||
|
@ -415,7 +452,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test random 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testRandom01() throws Exception
|
||||
|
@ -440,7 +480,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test remove 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testRemove01() throws Exception
|
||||
|
@ -472,7 +515,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test remove many 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testRemoveMany01() throws Exception
|
||||
|
@ -507,7 +553,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test rename key 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testRenameKey01() throws Exception
|
||||
|
@ -537,7 +586,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test size 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testSize01() throws Exception
|
||||
|
@ -585,7 +637,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test tittle 01.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
@Test
|
||||
public void testTittle01() throws Exception
|
||||
|
@ -605,8 +660,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* @throws SikevaDBException
|
||||
* After class.
|
||||
*
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
@AfterClass
|
||||
public static void afterClass() throws SikevaDBException
|
||||
|
@ -618,7 +675,10 @@ public class TreeFileSikevaDBTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Before class.
|
||||
*
|
||||
* @throws SikevaDBException
|
||||
* the SikevaDB exception
|
||||
*/
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws SikevaDBException
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Christian Pierre MOMON, DEVINSY
|
||||
*
|
||||
* This file is part of SikevaDB, simple key value database.
|
||||
|
@ -35,6 +35,7 @@ import fr.devinsy.sikevadb.core.SikevaDBException;
|
|||
import fr.devinsy.util.strings.StringList;
|
||||
|
||||
/**
|
||||
* The Class SQLSikevaDBTest.
|
||||
*
|
||||
* @author Christian Pierre MOMON
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue