[Minor] Major clean up of JavaDocs in utils
This commit is contained in:
parent
5abef93324
commit
8abbbab049
|
@ -18,7 +18,7 @@ package li.strolch.communication;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class CommandKey {
|
||||
private final String key1;
|
||||
|
@ -27,7 +27,9 @@ public class CommandKey {
|
|||
|
||||
/**
|
||||
* @param key1
|
||||
* key1
|
||||
* @param key2
|
||||
* key2
|
||||
*/
|
||||
public CommandKey(String key1, String key2) {
|
||||
this.key1 = key1;
|
||||
|
|
|
@ -31,7 +31,7 @@ import li.strolch.utils.dbc.DBC;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class CommunicationConnection implements Runnable {
|
||||
|
||||
|
@ -244,7 +244,7 @@ public class CommunicationConnection implements Runnable {
|
|||
/**
|
||||
* Called by the underlying endpoint when a new message has been received and parsed
|
||||
*
|
||||
* @param message
|
||||
* @param message the message to handle
|
||||
*/
|
||||
public void handleNewMessage(IoMessage message) {
|
||||
ConnectionMessages.assertConfigured(this, "Can not be notified of new message yet!"); //$NON-NLS-1$
|
||||
|
@ -335,7 +335,7 @@ public class CommunicationConnection implements Runnable {
|
|||
* Called when an outgoing message has been handled. This method logs the message state and then notifies all
|
||||
* observers
|
||||
*
|
||||
* @param message
|
||||
* @param message the message which is done
|
||||
*/
|
||||
public void done(IoMessage message) {
|
||||
ConnectionMessages.assertConfigured(this, "Can not notify observers yet!"); //$NON-NLS-1$
|
||||
|
@ -390,7 +390,7 @@ public class CommunicationConnection implements Runnable {
|
|||
* Send the message using the underlying endpoint. Do not change the state of the message, this will be done by the
|
||||
* caller
|
||||
*
|
||||
* @param message
|
||||
* @param message the message to send
|
||||
*/
|
||||
public void send(IoMessage message) {
|
||||
ConnectionMessages.assertConfigured(this, "Can not send yet"); //$NON-NLS-1$
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package li.strolch.communication;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public interface CommunicationEndpoint {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.communication;
|
|||
/**
|
||||
* Base Exception for exceptions thrown by the communication classes
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ConnectionException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.xml.bind.annotation.XmlAttribute;
|
|||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
@XmlRootElement(name = "ConnectionInfo")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -27,7 +27,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
/**
|
||||
* Helper class to thrown connection messages
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ConnectionMessages {
|
||||
|
||||
|
@ -44,9 +44,11 @@ public class ConnectionMessages {
|
|||
* Convenience method to throw an exception when an illegal {@link ConnectionState} change occurs
|
||||
*
|
||||
* @param current
|
||||
* the current state
|
||||
* @param change
|
||||
* the new state
|
||||
*
|
||||
* @return
|
||||
* @return the exception
|
||||
*/
|
||||
public static ConnectionException throwIllegalConnectionState(ConnectionState current, ConnectionState change) {
|
||||
String msg = "The connection with state {0} cannot be changed to {1}"; //$NON-NLS-1$
|
||||
|
@ -59,12 +61,16 @@ public class ConnectionMessages {
|
|||
* Convenience method to throw an exception when an invalid parameter is set in the configuration
|
||||
*
|
||||
* @param clazz
|
||||
* clazz type
|
||||
* @param parameterName
|
||||
* the name of the parameter
|
||||
* @param parameterValue
|
||||
* the value of the parameter
|
||||
*
|
||||
* @return
|
||||
* @return the exception
|
||||
*/
|
||||
public static ConnectionException throwInvalidParameter(Class<?> clazz, String parameterName, String parameterValue) {
|
||||
public static ConnectionException throwInvalidParameter(Class<?> clazz, String parameterName,
|
||||
String parameterValue) {
|
||||
String value;
|
||||
if (parameterValue != null && !parameterValue.isEmpty())
|
||||
value = parameterValue;
|
||||
|
@ -81,10 +87,13 @@ public class ConnectionMessages {
|
|||
* Convenience method to throw an exception when an two conflicting parameters are activated
|
||||
*
|
||||
* @param clazz
|
||||
* clazz type
|
||||
* @param parameter1
|
||||
* parameter 1
|
||||
* @param parameter2
|
||||
* parameter 2
|
||||
*
|
||||
* @return
|
||||
* @return the exception
|
||||
*/
|
||||
public static ConnectionException throwConflictingParameters(Class<?> clazz, String parameter1, String parameter2) {
|
||||
String msg = "{0} : The parameters {1} and {2} can not be both activated as they conflict"; //$NON-NLS-1$
|
||||
|
@ -97,8 +106,11 @@ public class ConnectionMessages {
|
|||
* Convenience method to log a warning when a parameter is not set in the configuration
|
||||
*
|
||||
* @param clazz
|
||||
* the clazz of the warning
|
||||
* @param parameterName
|
||||
* the parameter name
|
||||
* @param defValue
|
||||
* the default value to be used
|
||||
*/
|
||||
public static void warnUnsetParameter(Class<?> clazz, String parameterName, String defValue) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -113,7 +125,9 @@ public class ConnectionMessages {
|
|||
* Convenience method to throw an exception when the connection is not yet configured
|
||||
*
|
||||
* @param connection
|
||||
* the connection
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public static void assertConfigured(CommunicationConnection connection, String message) {
|
||||
if (connection.getState() == ConnectionState.CREATED) {
|
||||
|
@ -127,9 +141,11 @@ public class ConnectionMessages {
|
|||
* Convenience method to throw an exception when the connection is not connected
|
||||
*
|
||||
* @param connection
|
||||
* the connection
|
||||
* @param message
|
||||
* the message
|
||||
*
|
||||
* @return
|
||||
* @return the exception
|
||||
*/
|
||||
public static ConnectionException throwNotConnected(CommunicationConnection connection, String message) {
|
||||
String msg = "{0} : Not connected: {1}"; //$NON-NLS-1$
|
||||
|
@ -142,9 +158,11 @@ public class ConnectionMessages {
|
|||
* Convenience method to throw an exception when the connection is not connected
|
||||
*
|
||||
* @param connection
|
||||
* the connection
|
||||
* @param message
|
||||
* the message
|
||||
*
|
||||
* @return
|
||||
* @return the exception
|
||||
*/
|
||||
public static ConnectionException throwNotConnected(CommunicationConnection connection, IoMessage message) {
|
||||
String msg = "{0} : Not connected, can not send message with id {1}"; //$NON-NLS-1$
|
||||
|
@ -157,8 +175,8 @@ public class ConnectionMessages {
|
|||
Class<? extends IoMessageVisitor> expectedVisitor, IoMessageVisitor actualVisitor) {
|
||||
if (!(expectedVisitor.isAssignableFrom(actualVisitor.getClass()))) {
|
||||
String msg = "{0} requires {1} but has received illegal type {2}"; //$NON-NLS-1$
|
||||
msg = MessageFormat.format(msg, endpoint.getName(), expectedVisitor.getName(), actualVisitor.getClass()
|
||||
.getName());
|
||||
msg = MessageFormat.format(msg, endpoint.getName(), expectedVisitor.getName(),
|
||||
actualVisitor.getClass().getName());
|
||||
throw new ConnectionException(msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.io.IOException;
|
|||
* <li>SIMULATION - the same as ON, with the difference that the connection should silently drop any work</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public enum ConnectionMode {
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package li.strolch.communication;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public interface ConnectionObserver {
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ package li.strolch.communication;
|
|||
* <li>DISCONNECTED - the connection has been disconnected</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public enum ConnectionState {
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import li.strolch.utils.iso8601.ISO8601FormatFactory;
|
|||
* This class also contains a {@link Map} to store transient meta data to the actual payload
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class IoMessage {
|
||||
|
||||
|
@ -47,8 +47,11 @@ public class IoMessage {
|
|||
|
||||
/**
|
||||
* @param id
|
||||
* the id
|
||||
* @param key
|
||||
* the key
|
||||
* @param connectionId
|
||||
* the connection
|
||||
*/
|
||||
public IoMessage(String id, CommandKey key, String connectionId) {
|
||||
this.id = id;
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.communication;
|
|||
import li.strolch.communication.IoMessage.State;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class IoMessageStateObserver implements ConnectionObserver {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import li.strolch.communication.console.ConsoleMessageVisitor;
|
|||
* Concrete implementations must be thread safe!
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public abstract class IoMessageVisitor {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.OutputStream;
|
|||
* Concrete implementations must be thread safe!
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public abstract class StreamMessageVisitor extends IoMessageVisitor {
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import li.strolch.communication.IoMessage;
|
|||
import li.strolch.communication.IoMessageVisitor;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ConsoleEndpoint implements CommunicationEndpoint {
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
/**
|
||||
* An {@link CommunicationEndpoint} which writes and/or reads from a designated file
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FileEndpoint implements CommunicationEndpoint, Runnable {
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
* remote server
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ClientSocketEndpoint implements CommunicationEndpoint {
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
* @see ServerSocketEndpoint#configure(CommunicationConnection, IoMessageVisitor) for details on configuring the end
|
||||
* point
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ServerSocketEndpoint implements CommunicationEndpoint, Runnable {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.communication.tcpip;
|
|||
/**
|
||||
* Constants used in the communication classes
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class SocketEndpointConstants {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import li.strolch.communication.IoMessageVisitor;
|
|||
/**
|
||||
* This {@link IoMessageVisitor} implements and endpoint connecting to a {@link Socket}.
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public abstract class SocketMessageVisitor extends IoMessageVisitor {
|
||||
|
||||
|
@ -43,9 +43,12 @@ public abstract class SocketMessageVisitor extends IoMessageVisitor {
|
|||
* This method is called when a message is read from the underlying {@link Socket}
|
||||
*
|
||||
* @param inputStream
|
||||
* the input stream to read data from
|
||||
* @param outputStream
|
||||
* @return
|
||||
* the output stream to write data to
|
||||
* @return the parsed {@link IoMessage}
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*/
|
||||
public abstract IoMessage visit(DataInputStream inputStream, DataOutputStream outputStream) throws Exception;
|
||||
|
||||
|
@ -53,9 +56,13 @@ public abstract class SocketMessageVisitor extends IoMessageVisitor {
|
|||
* This method is called when a message is to be sent to the underlying connected endpoint
|
||||
*
|
||||
* @param inputStream
|
||||
* the input stream to read data from
|
||||
* @param outputStream
|
||||
* the output stream to write data to
|
||||
* @param message
|
||||
* the message to parse
|
||||
* @throws Exception
|
||||
* of something goes wrong
|
||||
*/
|
||||
public abstract void visit(DataInputStream inputStream, DataOutputStream outputStream, IoMessage message)
|
||||
throws Exception;
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DbConnectionCheck {
|
||||
|
||||
|
@ -38,15 +38,17 @@ public class DbConnectionCheck {
|
|||
|
||||
/**
|
||||
* @param dsMap
|
||||
* the data source map
|
||||
*/
|
||||
public DbConnectionCheck(Map<String, DataSource> dsMap) {
|
||||
this.dsMap = dsMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the connectivity to each of the configured {@link DbConnectionInfo}
|
||||
* Checks the connectivity to each of the configured {@link DataSource}
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public void checkConnections() throws DbException {
|
||||
Collection<DataSource> values = this.dsMap.values();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package li.strolch.db;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DbConstants {
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Properties;
|
|||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public interface DbDataSourceBuilder {
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package li.strolch.db;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DbException extends Exception {
|
||||
|
||||
|
@ -24,6 +24,7 @@ public class DbException extends Exception {
|
|||
|
||||
/**
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public DbException(String message) {
|
||||
super(message);
|
||||
|
@ -31,7 +32,9 @@ public class DbException extends Exception {
|
|||
|
||||
/**
|
||||
* @param message
|
||||
* the message
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public DbException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package li.strolch.db;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public enum DbMigrationState {
|
||||
NOTHING, CREATED, MIGRATED, DROPPED_CREATED;
|
||||
|
|
|
@ -41,7 +41,7 @@ import li.strolch.utils.dbc.DBC;
|
|||
import li.strolch.utils.helper.FileHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
@SuppressWarnings(value = "nls")
|
||||
public class DbSchemaVersionCheck {
|
||||
|
@ -56,9 +56,13 @@ public class DbSchemaVersionCheck {
|
|||
|
||||
/**
|
||||
* @param app
|
||||
* the app name
|
||||
* @param ctxClass
|
||||
* the context class
|
||||
* @param allowSchemaCreation
|
||||
* true allows creating the schema
|
||||
* @param allowSchemaDrop
|
||||
* true allows dropping the schema
|
||||
*/
|
||||
public DbSchemaVersionCheck(String app, Class<?> ctxClass, boolean allowSchemaCreation,
|
||||
boolean allowSchemaMigration, boolean allowSchemaDrop) {
|
||||
|
@ -91,16 +95,17 @@ public class DbSchemaVersionCheck {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if the schema existed or was only migrated, false if the schema was created
|
||||
* Checks the state of the realm's DB schema
|
||||
*
|
||||
* @param realm
|
||||
* the realm
|
||||
* @param ds
|
||||
* @param realm2
|
||||
* the {@link DataSource}
|
||||
*
|
||||
* @param connectionInfo
|
||||
*
|
||||
* @return true if the schema existed or was only migrated, false if the schema was created
|
||||
* @return the state
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public DbMigrationState checkSchemaVersion(String realm, DataSource ds) throws DbException {
|
||||
|
||||
|
@ -141,11 +146,14 @@ public class DbSchemaVersionCheck {
|
|||
|
||||
/**
|
||||
* @param con
|
||||
* the connection
|
||||
* @param app
|
||||
* the app for which to get the version
|
||||
*
|
||||
* @return
|
||||
* @return the version
|
||||
*
|
||||
* @throws SQLException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public static Version getCurrentVersion(Connection con, String app) throws SQLException {
|
||||
|
||||
|
@ -173,12 +181,16 @@ public class DbSchemaVersionCheck {
|
|||
|
||||
/**
|
||||
* @param realm
|
||||
* the realm
|
||||
* @param expectedDbVersion
|
||||
* the expected version
|
||||
*
|
||||
* @return
|
||||
* @return the migration state
|
||||
*
|
||||
* @throws SQLException
|
||||
* if something goes wrong
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public DbMigrationState detectMigrationState(String realm, Version expectedDbVersion, Version currentVersion)
|
||||
throws SQLException, DbException {
|
||||
|
@ -207,11 +219,14 @@ public class DbSchemaVersionCheck {
|
|||
|
||||
/**
|
||||
* @param app
|
||||
* the app
|
||||
* @param ctxClass
|
||||
* the context class
|
||||
*
|
||||
* @return
|
||||
* @return the version
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public static Version getExpectedDbVersion(String app, Class<?> ctxClass) throws DbException {
|
||||
Properties dbVersionProps = new Properties();
|
||||
|
@ -236,13 +251,18 @@ public class DbSchemaVersionCheck {
|
|||
|
||||
/**
|
||||
* @param scriptPrefix
|
||||
* @param classLoader
|
||||
* script file prefix
|
||||
* @param ctxClass
|
||||
* the class to get the class loader to use to load the resource
|
||||
* @param dbVersion
|
||||
* the version to load
|
||||
* @param type
|
||||
* the operation type
|
||||
*
|
||||
* @return
|
||||
* @return the SQL to perform
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public static String getSql(String scriptPrefix, Class<?> ctxClass, Version dbVersion, String type)
|
||||
throws DbException {
|
||||
|
@ -261,15 +281,12 @@ public class DbSchemaVersionCheck {
|
|||
/**
|
||||
*
|
||||
* @param realm
|
||||
* the realm to create the schema for (a {@link DbConnectionInfo} must exist for it)
|
||||
* the realm to create the schema for (a {@link DataSource} must exist for it)
|
||||
* @param dbVersion
|
||||
* the version to upgrade to
|
||||
* @param st
|
||||
* the open database {@link Statement} to which the SQL statements will be written
|
||||
*
|
||||
* @return true if the schema was created, false if it was not
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public void createSchema(Connection con, String realm, Version dbVersion) throws DbException {
|
||||
|
||||
|
@ -299,13 +316,12 @@ public class DbSchemaVersionCheck {
|
|||
* method drops the schema and recreates it. Real migration must still be implemented
|
||||
*
|
||||
* @param realm
|
||||
* the realm to migrate (a {@link DbConnectionInfo} must exist for it)
|
||||
* the realm to migrate (a {@link DataSource} must exist for it)
|
||||
* @param dbVersion
|
||||
* the version to upgrade to
|
||||
*
|
||||
* @return true if the schema was recreated, false if it was simply migrated
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public void migrateSchema(Connection con, String realm, Version dbVersion) throws DbException {
|
||||
|
||||
|
@ -331,13 +347,12 @@ public class DbSchemaVersionCheck {
|
|||
|
||||
/**
|
||||
* @param realm
|
||||
* the realm for which the schema must be dropped (a {@link DbConnectionInfo} must exist for it)
|
||||
* the realm for which the schema must be dropped (a {@link DataSource} must exist for it)
|
||||
* @param dbVersion
|
||||
* the version with which to to drop the schema
|
||||
* @param st
|
||||
* the open database {@link Statement} to which the SQL statements will be written
|
||||
*
|
||||
* @throws DbException
|
||||
* if something goes wrong
|
||||
*/
|
||||
public void dropSchema(Connection con, String realm, Version dbVersion) throws DbException {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.fileserver;
|
|||
import java.rmi.RemoteException;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*
|
||||
*/
|
||||
public interface FileClient {
|
||||
|
|
|
@ -29,18 +29,13 @@ import li.strolch.utils.helper.FileHelper;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*
|
||||
*/
|
||||
public class FileClientUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(FileClientUtil.class);
|
||||
|
||||
/**
|
||||
* @param rmiFileClient
|
||||
* @param origFilePart
|
||||
* @param dstFile
|
||||
*/
|
||||
public static void downloadFile(FileClient rmiFileClient, FilePart origFilePart, File dstFile) {
|
||||
|
||||
// here we don't overwrite, the caller must make sure the destination file does not exist
|
||||
|
@ -116,11 +111,6 @@ public class FileClientUtil {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rmiFileClient
|
||||
* @param srcFile
|
||||
* @param fileType
|
||||
*/
|
||||
public static void uploadFile(FileClient rmiFileClient, File srcFile, String fileType) {
|
||||
|
||||
// make sure the source file exists
|
||||
|
@ -220,11 +210,6 @@ public class FileClientUtil {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rmiFileClient
|
||||
* @param fileDeletion
|
||||
* @param dstFile
|
||||
*/
|
||||
public static void deleteFile(FileClient rmiFileClient, FileDeletion fileDeletion, File dstFile) {
|
||||
|
||||
try {
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.fileserver;
|
|||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FileDeletion implements Serializable {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
* This class handles remote requests of clients to upload or download a file. Uploading a file is done by calling
|
||||
* {@link #handleFilePart(FilePart)} and the downloading a file is done by calling {@link #requestFile(FilePart)}
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FileHandler {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.fileserver;
|
|||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FilePart implements Serializable {
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.security.SecureRandom;
|
|||
/**
|
||||
* Generates code which should be easily readable as problematic letters e.g. 0, o, O, i, I, l are left out
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class CodeGenerator {
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
|
|||
* <li>port - the SMTP port</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class SmtpMailer {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import li.strolch.utils.dbc.DBC;
|
|||
* The {@link StringMatchMode} is used to match String in different scenarios. The strings can be matched case sensitive
|
||||
* or case insensitive as well as using contains or equals.
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public enum StringMatchMode {
|
||||
EQUALS_CASE_SENSITIVE(true, true),
|
||||
|
|
|
@ -12,6 +12,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
*
|
||||
* <p>
|
||||
* Version identifiers have four components.
|
||||
* </p>
|
||||
* <ol>
|
||||
* <li>Major version. A non-negative integer.</li>
|
||||
* <li>Minor version. A non-negative integer.</li>
|
||||
|
@ -19,12 +20,15 @@ import li.strolch.utils.helper.StringHelper;
|
|||
* <li>Qualifier. A text string. See {@code Version(String)} for the format of the qualifier string.</li>
|
||||
* </ol>
|
||||
*
|
||||
* <p>
|
||||
* <b>Note:</b> The qualifier can be separated by two different styles: {@link #OSGI_QUALIFIER_SEPARATOR} or
|
||||
* {@link #MAVEN_QUALIFIER_SEPARATOR}. Thus the qualifier my also have two special values:
|
||||
* {@link #OSGI_SNAPSHOT_QUALIFIER} or {@value #MAVEN_SNAPSHOT_QUALIFIER}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* The grammar for parsing version strings is as follows:
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* version ::= major('.'minor('.'micro('.'qualifier)?)?)?
|
||||
|
@ -36,6 +40,7 @@ import li.strolch.utils.helper.StringHelper;
|
|||
* alpha ::= [a..zA..Z]
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
* <b>Note:</b> There must be no whitespace in version.
|
||||
* </p>
|
||||
*
|
||||
|
|
|
@ -21,7 +21,7 @@ import li.strolch.utils.dbc.DBC;
|
|||
import li.strolch.utils.iso8601.ISO8601FormatFactory;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DateRange {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DefaultedHashMap<K, V> extends HashMap<K, V> {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Map.Entry;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class MapOfLists<T, U> {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.Set;
|
|||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* Map<String, Map&lgt;String, MyObject>> mapOfMaps = new HashMap<>;
|
||||
* Map<String, Map<String, MyObject>> mapOfMaps = new HashMap<>;
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
|
@ -41,7 +41,7 @@ import java.util.Set;
|
|||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*
|
||||
* @param <T>
|
||||
* The key to a map with U as the key and V as the value
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Map.Entry;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class MapOfSets<T, U> {
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@ package li.strolch.utils.collections;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*
|
||||
* @param <T>
|
||||
* the type of element in the list
|
||||
*/
|
||||
public class Paging<T> {
|
||||
|
||||
|
@ -86,6 +89,9 @@ public class Paging<T> {
|
|||
* the page to return - start index is 1
|
||||
*
|
||||
* @return a {@link Paging} instance from which the selected page (list) can be retrieved
|
||||
*
|
||||
* @param <T>
|
||||
* the type of element in the list
|
||||
*/
|
||||
public static <T> Paging<T> asPage(List<T> list, int pageSize, int page) {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.collections;
|
|||
/**
|
||||
* Simple wrapper for two elements
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class Tuple {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Collection;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public enum DBC {
|
||||
|
||||
|
|
|
@ -16,22 +16,15 @@
|
|||
package li.strolch.utils.exceptions;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class XmlException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* @param message
|
||||
*/
|
||||
public XmlException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* @param cause
|
||||
*/
|
||||
public XmlException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.helper;
|
|||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ArraysHelper {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.helper;
|
|||
/**
|
||||
* ASCII constants
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class AsciiHelper {
|
||||
|
||||
|
@ -230,6 +230,8 @@ public class AsciiHelper {
|
|||
* Returns the ASCII Text of a certain bye value
|
||||
*
|
||||
* @param b
|
||||
* the byte
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getAsciiText(byte b) {
|
||||
|
@ -240,6 +242,8 @@ public class AsciiHelper {
|
|||
* Returns the ASCII Text of a certain char value
|
||||
*
|
||||
* @param c
|
||||
* the char
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.text.MessageFormat;
|
|||
* This class also implements a number of utility methods to check if given data is in a valid encoding
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class BaseEncoding {
|
||||
|
||||
|
@ -55,8 +55,8 @@ public class BaseEncoding {
|
|||
|
||||
static final byte[] BASE_16 = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
||||
|
||||
static final byte[] BASE_32 = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7' };
|
||||
static final byte[] BASE_32 = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
|
||||
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7' };
|
||||
|
||||
static final byte[] BASE_32_HEX = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
|
||||
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V' };
|
||||
|
@ -64,18 +64,18 @@ public class BaseEncoding {
|
|||
static final byte[] BASE_32_DMEDIA = { '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y' };
|
||||
|
||||
static final byte[] BASE_32_CROCKFORD = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
|
||||
'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z' };
|
||||
static final byte[] BASE_32_CROCKFORD = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
|
||||
'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z' };
|
||||
|
||||
static final byte[] BASE_64 = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
|
||||
static final byte[] BASE_64 = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
|
||||
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
|
||||
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6',
|
||||
'7', '8', '9', '+', '/' };
|
||||
|
||||
static final byte[] BASE_64_SAFE = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
|
||||
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9', '+', '/' };
|
||||
|
||||
static final byte[] BASE_64_SAFE = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
|
||||
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4',
|
||||
'5', '6', '7', '8', '9', '-', '_' };
|
||||
'6', '7', '8', '9', '-', '_' };
|
||||
|
||||
// these reverse base encoding alphabets were generated from the actual alphabet
|
||||
|
||||
|
@ -102,7 +102,8 @@ public class BaseEncoding {
|
|||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1 };
|
||||
|
||||
static final byte[] REV_BASE_32_HEX = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
|
@ -116,11 +117,11 @@ public class BaseEncoding {
|
|||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 };
|
||||
|
||||
static final byte[] REV_BASE_64_SAFE = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,
|
||||
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29,
|
||||
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 };
|
||||
static final byte[] REV_BASE_64_SAFE = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62,
|
||||
-1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30,
|
||||
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 };
|
||||
|
||||
public static byte[] toBase64(byte[] bytes) {
|
||||
return toBase64(BASE_64, bytes);
|
||||
|
@ -316,10 +317,13 @@ public class BaseEncoding {
|
|||
|
||||
/**
|
||||
* @param alphabet
|
||||
* the alphabet to use
|
||||
* @param bytes
|
||||
* the check if encoded
|
||||
* @param maxPadding
|
||||
* max padding allowed
|
||||
*
|
||||
* @return
|
||||
* @return true if encoded by alphabet
|
||||
*/
|
||||
public static boolean isEncodedByAlphabet(byte[] alphabet, byte[] bytes, int maxPadding) {
|
||||
if (bytes.length == 0)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package li.strolch.utils.helper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ByteHelper {
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.text.MessageFormat;
|
|||
/**
|
||||
* Utility class for working with {@link Class Classes}
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ClassHelper {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
|||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DomUtil {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.io.PrintWriter;
|
|||
import java.io.StringWriter;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ExceptionHelper {
|
||||
|
||||
|
@ -34,7 +34,9 @@ public class ExceptionHelper {
|
|||
* </p>
|
||||
*
|
||||
* @param t
|
||||
* @return
|
||||
* the {@link Throwable}
|
||||
*
|
||||
* @return the exception as string
|
||||
*/
|
||||
public static String getExceptionMessage(Throwable t) {
|
||||
return StringHelper.isEmpty(t.getMessage()) ? t.getClass().getName() : t.getMessage();
|
||||
|
@ -51,7 +53,9 @@ public class ExceptionHelper {
|
|||
* </p>
|
||||
*
|
||||
* @param t
|
||||
* @return
|
||||
* the {@link Throwable}
|
||||
*
|
||||
* @return the exception as string
|
||||
*/
|
||||
public static String getExceptionMessageWithCauses(Throwable t) {
|
||||
if (t.getCause() == null)
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* Helper class for dealing with files
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FileHelper {
|
||||
|
||||
|
@ -180,6 +180,8 @@ public class FileHelper {
|
|||
* @param file
|
||||
* the file to delete
|
||||
* @param log
|
||||
* true to enable logging
|
||||
*
|
||||
* @return true if all went well, and false if it did not work. The log will contain the problems encountered
|
||||
*/
|
||||
public final static boolean deleteFile(File file, boolean log) {
|
||||
|
@ -192,6 +194,8 @@ public class FileHelper {
|
|||
* @param files
|
||||
* the files to delete
|
||||
* @param log
|
||||
* true to enable logging
|
||||
*
|
||||
* @return true if all went well, and false if it did not work. The log will contain the problems encountered
|
||||
*/
|
||||
public final static boolean deleteFiles(File[] files, boolean log) {
|
||||
|
@ -298,8 +302,8 @@ public class FileHelper {
|
|||
String fromFileMD5 = StringHelper.getHexString(FileHelper.hashFileMd5(fromFile));
|
||||
String toFileMD5 = StringHelper.getHexString(FileHelper.hashFileMd5(toFile));
|
||||
if (!fromFileMD5.equals(toFileMD5)) {
|
||||
FileHelper.logger.error(MessageFormat.format(
|
||||
"Copying failed, as MD5 sums are not equal: {0} / {1}", fromFileMD5, toFileMD5)); //$NON-NLS-1$
|
||||
FileHelper.logger.error(MessageFormat.format("Copying failed, as MD5 sums are not equal: {0} / {1}", //$NON-NLS-1$
|
||||
fromFileMD5, toFileMD5));
|
||||
toFile.delete();
|
||||
|
||||
return false;
|
||||
|
@ -571,7 +575,8 @@ public class FileHelper {
|
|||
outputStream.flush();
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Could not create and append the bytes to the file " + dstFile.getAbsolutePath()); //$NON-NLS-1$
|
||||
throw new RuntimeException(
|
||||
"Could not create and append the bytes to the file " + dstFile.getAbsolutePath()); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ import java.math.RoundingMode;
|
|||
/**
|
||||
* A helper class that contains mathematical computations that can be used throughout.
|
||||
*
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Michael Gatto <michael@gatto.ch>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Michael Gatto <michael@gatto.ch>
|
||||
*/
|
||||
public class MathHelper {
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ProcessHelper {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.text.MessageFormat;
|
|||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class PropertiesHelper {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* A helper class to perform different actions on {@link String}s
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class StringHelper {
|
||||
|
||||
|
@ -65,6 +65,7 @@ public class StringHelper {
|
|||
* @return the encoded string
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* if {@link UnsupportedEncodingException} is thrown
|
||||
*/
|
||||
public static String getHexString(byte[] raw) throws RuntimeException {
|
||||
try {
|
||||
|
@ -682,6 +683,7 @@ public class StringHelper {
|
|||
* If the value parameter is empty, then a {@link #DASH} is returned, otherwise the value is returned
|
||||
*
|
||||
* @param value
|
||||
* the value
|
||||
*
|
||||
* @return the non-empty value, or a {@link #DASH}
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.helper;
|
|||
/**
|
||||
* A helper class for {@link System} methods
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class SystemHelper {
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ import li.strolch.utils.exceptions.XmlException;
|
|||
/**
|
||||
* Helper class for performing XML based tasks
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class XmlHelper {
|
||||
|
||||
|
@ -139,8 +139,6 @@ public class XmlHelper {
|
|||
* the {@link Document} to write to the file system
|
||||
* @param file
|
||||
* the {@link File} describing the path on the file system where the XML file should be written to
|
||||
* @param encoding
|
||||
* encoding to use to write the file
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* if something went wrong while creating the XML configuration, or writing the element
|
||||
|
@ -189,8 +187,6 @@ public class XmlHelper {
|
|||
*
|
||||
* @param document
|
||||
* the {@link Document} to write to the file system
|
||||
* @param outputStream
|
||||
* stream to write document to
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* if something went wrong while creating the XML configuration, or writing the element
|
||||
|
@ -210,8 +206,8 @@ public class XmlHelper {
|
|||
*
|
||||
* @param document
|
||||
* the {@link Document} to write to the file system
|
||||
* @param file
|
||||
* the {@link File} describing the path on the file system where the XML file should be written to
|
||||
* @param streamResult
|
||||
* the destination
|
||||
* @param encoding
|
||||
* encoding to use to write the file
|
||||
*
|
||||
|
|
|
@ -21,7 +21,7 @@ package li.strolch.utils.io;
|
|||
* jobs has a size which is a primitive long value e.g. the number of bytes parsed/ to be parsed in a file
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public interface FileProgressListener {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* File stream progress monitoring thread
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FileStreamProgressWatcher implements Runnable {
|
||||
|
||||
|
@ -33,11 +33,6 @@ public class FileStreamProgressWatcher implements Runnable {
|
|||
private FileProgressListener progressListener;
|
||||
private long millis;
|
||||
|
||||
/**
|
||||
* @param millis
|
||||
* @param progressListener
|
||||
* @param inputStream
|
||||
*/
|
||||
public FileStreamProgressWatcher(long millis, FileProgressListener progressListener,
|
||||
ProgressableFileInputStream inputStream) {
|
||||
this.millis = millis;
|
||||
|
|
|
@ -22,17 +22,13 @@ import org.slf4j.Logger;
|
|||
import li.strolch.utils.helper.FileHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class LoggingFileProgressListener implements FileProgressListener {
|
||||
|
||||
private final Logger logger;
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* @param logger
|
||||
* @param name
|
||||
*/
|
||||
public LoggingFileProgressListener(Logger logger, String name) {
|
||||
this.logger = logger;
|
||||
this.name = name;
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.IOException;
|
|||
* on bigger files
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ProgressableFileInputStream extends FileInputStream {
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Date;
|
|||
/**
|
||||
* Interface for date formatting
|
||||
*
|
||||
* Martin Smock <smock.martin@gmail.com>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
*/
|
||||
public interface DateFormat {
|
||||
|
||||
|
@ -28,6 +28,8 @@ public interface DateFormat {
|
|||
* format a long to string
|
||||
*
|
||||
* @param timepoint
|
||||
* the timepoint
|
||||
*
|
||||
* @return the formatted string of the long value
|
||||
*/
|
||||
public String format(long timepoint);
|
||||
|
@ -36,6 +38,8 @@ public interface DateFormat {
|
|||
* format a Date to string
|
||||
*
|
||||
* @param date
|
||||
* the date
|
||||
*
|
||||
* @return the formatted string of the long value
|
||||
*/
|
||||
public String format(Date date);
|
||||
|
@ -44,6 +48,8 @@ public interface DateFormat {
|
|||
* parse a string to long
|
||||
*
|
||||
* @param s
|
||||
* the string
|
||||
*
|
||||
* @return the value parsed
|
||||
*/
|
||||
public long parseLong(String s);
|
||||
|
@ -52,6 +58,8 @@ public interface DateFormat {
|
|||
* parse a string to Date
|
||||
*
|
||||
* @param s
|
||||
* the string
|
||||
*
|
||||
* @return the value parsed
|
||||
*/
|
||||
public Date parse(String s);
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.iso8601;
|
|||
/**
|
||||
* Interface for duration formatting
|
||||
*
|
||||
* Martin Smock <smock.martin@gmail.com>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
*/
|
||||
public interface DurationFormat {
|
||||
|
||||
|
@ -26,6 +26,8 @@ public interface DurationFormat {
|
|||
* format a long to string
|
||||
*
|
||||
* @param l
|
||||
* the long duration to format
|
||||
*
|
||||
* @return formatted string if the long argument
|
||||
*/
|
||||
public String format(long l);
|
||||
|
@ -34,6 +36,8 @@ public interface DurationFormat {
|
|||
* parse a string to long
|
||||
*
|
||||
* @param s
|
||||
* the string to parse
|
||||
*
|
||||
* @return the long value parsed
|
||||
*/
|
||||
public long parse(String s);
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.Date;
|
|||
* This interface defines methods for formatting values for UI representation and also defines factory methods for
|
||||
* formatters for parsing and formatting duration and date values
|
||||
*
|
||||
* Martin Smock <smock.martin@gmail.com>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
*/
|
||||
public interface FormatFactory {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class ISO8601 implements DateFormat {
|
||||
|
@ -40,8 +40,8 @@ public class ISO8601 implements DateFormat {
|
|||
private DecimalFormat xxxxFormat = new DecimalFormat("0000");
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
private Calendar parseToCalendar(String text) {
|
||||
|
||||
// check optional leading sign
|
||||
|
@ -175,8 +175,8 @@ public class ISO8601 implements DateFormat {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
private String format(Calendar cal) {
|
||||
|
||||
if (cal == null) {
|
||||
|
@ -236,6 +236,8 @@ public class ISO8601 implements DateFormat {
|
|||
* added by msmock convert a long to ISO8601
|
||||
*
|
||||
* @param timePoint
|
||||
* the timepoint
|
||||
*
|
||||
* @return time point as ISO8601 String
|
||||
*/
|
||||
@Override
|
||||
|
@ -269,7 +271,9 @@ public class ISO8601 implements DateFormat {
|
|||
* @param s
|
||||
* the string to parse
|
||||
* @return time point as long
|
||||
* @throws NumberFormatException
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if the string can not be parsed
|
||||
*/
|
||||
@Override
|
||||
public Date parse(String s) {
|
||||
|
|
|
@ -42,8 +42,8 @@ package li.strolch.utils.iso8601;
|
|||
* minutes and seconds
|
||||
* </p>
|
||||
*
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Michael Gatto <michael@gatto.ch> (reimplementation using enum)
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Michael Gatto <michael@gatto.ch> (reimplementation using enum)
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class ISO8601Duration implements DurationFormat {
|
||||
|
@ -234,6 +234,8 @@ public class ISO8601Duration implements DurationFormat {
|
|||
* Formats the given time duration to a pseudo ISO 8601 duration string
|
||||
*
|
||||
* @param duration
|
||||
* the duration
|
||||
*
|
||||
* @return String the duration formatted as a ISO8601 duration string
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,7 @@ import li.strolch.utils.helper.MathHelper;
|
|||
/**
|
||||
* Default factory for date formats used for serialization.
|
||||
*
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
*/
|
||||
public class ISO8601FormatFactory implements FormatFactory {
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ package li.strolch.utils.iso8601;
|
|||
* minutes and seconds
|
||||
* </p>
|
||||
*
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Michael Gatto <michael@gatto.ch> (reimplementation using enum)
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Michael Gatto <michael@gatto.ch> (reimplementation using enum)
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class ISO8601Worktime implements WorktimeFormat {
|
||||
|
@ -216,6 +216,8 @@ public class ISO8601Worktime implements WorktimeFormat {
|
|||
* Formats the given time duration to a pseudo ISO 8601 duration string
|
||||
*
|
||||
* @param duration
|
||||
* the duration
|
||||
*
|
||||
* @return String the duration formatted as a ISO8601 duration string
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.iso8601;
|
|||
/**
|
||||
* interface for the worktime format
|
||||
*
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
* @author Martin Smock <smock.martin@gmail.com>
|
||||
*/
|
||||
public interface WorktimeFormat {
|
||||
|
||||
|
@ -26,6 +26,8 @@ public interface WorktimeFormat {
|
|||
* format a long to string
|
||||
*
|
||||
* @param l
|
||||
* the work time
|
||||
*
|
||||
* @return formatted string if the long argument
|
||||
*/
|
||||
public String format(long l);
|
||||
|
@ -34,6 +36,8 @@ public interface WorktimeFormat {
|
|||
* parse a string to long
|
||||
*
|
||||
* @param s
|
||||
* the string to parse
|
||||
*
|
||||
* @return the long value parsed
|
||||
*/
|
||||
public long parse(String s);
|
||||
|
|
|
@ -25,16 +25,16 @@ import org.slf4j.LoggerFactory;
|
|||
* "deployed" in one go.
|
||||
* <p>
|
||||
* Thus, this class keeps:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>An ID of the object, such that it can be referenced externally.</li.>
|
||||
* <li>An ID of the object, such that it can be referenced externally.</li>
|
||||
* <li>A key for an object, which keeps the object's type.</li>
|
||||
* <li>A reference to the current state of the object</li>
|
||||
* <li>An identifier of the operation that needs to be performed on this</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @author Michael Gatto <michael@gatto.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Michael Gatto <michael@gatto.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ObjectCache {
|
||||
|
||||
|
@ -65,12 +65,6 @@ public class ObjectCache {
|
|||
*/
|
||||
private Object object;
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @param key
|
||||
* @param object
|
||||
* @param operation
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public ObjectCache(long id, String key, Object object, Operation operation) {
|
||||
|
||||
|
@ -97,6 +91,7 @@ public class ObjectCache {
|
|||
* Set the new object version of this cache.
|
||||
*
|
||||
* @param object
|
||||
* the object to set
|
||||
*/
|
||||
public void setObject(Object object) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -109,6 +104,7 @@ public class ObjectCache {
|
|||
* Change the operation to execute for this object.
|
||||
*
|
||||
* @param newOperation
|
||||
* the operation to set
|
||||
*/
|
||||
public void setOperation(Operation newOperation) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
|
|
@ -72,8 +72,8 @@ import org.slf4j.LoggerFactory;
|
|||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* @author Michael Gatto <michael@gatto.ch> (initial version)
|
||||
* @author Robert von Burg <eitch@eitchnet.ch> (minor modifications, refactorings)
|
||||
* @author Michael Gatto <michael@gatto.ch> (initial version)
|
||||
* @author Robert von Burg <eitch@eitchnet.ch> (minor modifications, refactorings)
|
||||
*/
|
||||
public class ObjectFilter {
|
||||
|
||||
|
@ -96,7 +96,7 @@ public class ObjectFilter {
|
|||
* Register, under the given key, the addition of the given object.
|
||||
* <p>
|
||||
* This is the single point where the updating logic is applied for the cache in case of addition. The logic is:
|
||||
* <table border="1" >
|
||||
* <table border="1" summary="Allowed operations">
|
||||
* <tr>
|
||||
* <td>Action\State in Cache</td>
|
||||
* <td>N/A</td>
|
||||
|
@ -181,7 +181,7 @@ public class ObjectFilter {
|
|||
/**
|
||||
* Register, under the given key, the update of the given object. *
|
||||
* </p>
|
||||
* <table border="1">
|
||||
* <table border="1" summary="Allowed operations">
|
||||
* <tr>
|
||||
* <td>Action \ State in Cache</td>
|
||||
* <td>N/A</td>
|
||||
|
@ -251,7 +251,7 @@ public class ObjectFilter {
|
|||
/**
|
||||
* Register, under the given key, the removal of the given object. *
|
||||
* </p>
|
||||
* <table border="1">
|
||||
* <table border="1" summary="allowed operations">
|
||||
* <tr>
|
||||
* <td>Action \ State in Cache</td>
|
||||
* <td>N/A</td>
|
||||
|
|
|
@ -18,7 +18,7 @@ package li.strolch.utils.objectfilter;
|
|||
/**
|
||||
* A discrete set of operations associated to some object / state
|
||||
*
|
||||
* @author Michael Gatto <michael@gatto.ch>
|
||||
* @author Michael Gatto <michael@gatto.ch>
|
||||
*/
|
||||
public enum Operation {
|
||||
/**
|
||||
|
|
|
@ -33,7 +33,7 @@ import li.strolch.communication.console.ConsoleEndpoint;
|
|||
import li.strolch.communication.console.ConsoleMessageVisitor;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class ConsoleEndpointTest extends AbstractEndpointTest {
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import li.strolch.communication.file.FileEndpointMode;
|
|||
import li.strolch.utils.helper.FileHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class FileEndpointTest extends AbstractEndpointTest {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import li.strolch.communication.IoMessageArchive;
|
|||
import li.strolch.communication.SimpleMessageArchive;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class SimpleMessageArchiveTest extends AbstractEndpointTest {
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import li.strolch.communication.tcpip.SocketEndpointConstants;
|
|||
import li.strolch.communication.tcpip.SocketMessageVisitor;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class SocketEndpointTest extends AbstractEndpointTest {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import li.strolch.communication.ConnectionObserver;
|
|||
import li.strolch.communication.IoMessage;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class TestConnectionObserver implements ConnectionObserver {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import li.strolch.communication.CommandKey;
|
|||
import li.strolch.communication.IoMessage;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class TestIoMessage extends IoMessage {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
|||
import li.strolch.utils.StringMatchMode;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*
|
||||
*/
|
||||
public class StringMatchModeTest {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.Test;
|
|||
import li.strolch.utils.collections.DefaultedHashMap;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class DefaultedHashMapTest {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.junit.Test;
|
|||
import li.strolch.utils.collections.Paging;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
public class PagingTest {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import li.strolch.utils.dbc.DBC.DbcException;
|
|||
* The class <code>DBCTest</code> contains tests for the class <code>{@link DBC}</code>.
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
|
@ -42,6 +42,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -60,6 +61,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -83,6 +85,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -105,6 +108,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -127,6 +131,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -148,6 +153,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -170,6 +176,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -186,6 +193,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -202,6 +210,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -218,6 +227,7 @@ public class DBCTest {
|
|||
* Run the void assertEquals(String,Object,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -240,6 +250,7 @@ public class DBCTest {
|
|||
* Run the void assertExists(String,File) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -255,6 +266,7 @@ public class DBCTest {
|
|||
* Run the void assertExists(String,File) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -278,6 +290,7 @@ public class DBCTest {
|
|||
* Run the void assertFalse(String,boolean) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -296,6 +309,7 @@ public class DBCTest {
|
|||
* Run the void assertFalse(String,boolean) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -313,6 +327,7 @@ public class DBCTest {
|
|||
* Run the void assertNotEmpty(String,String) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -331,6 +346,7 @@ public class DBCTest {
|
|||
* Run the void assertNotEmpty(String,String) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -346,6 +362,7 @@ public class DBCTest {
|
|||
* Run the void assertNotExists(String,File) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -363,6 +380,7 @@ public class DBCTest {
|
|||
* Run the void assertNotExists(String,File) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -383,6 +401,7 @@ public class DBCTest {
|
|||
* Run the void assertNotNull(String,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -404,6 +423,7 @@ public class DBCTest {
|
|||
* Run the void assertNotNull(String,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -421,6 +441,7 @@ public class DBCTest {
|
|||
* Run the void assertNull(String,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -440,6 +461,7 @@ public class DBCTest {
|
|||
* Run the void assertNull(String,Object) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -457,6 +479,7 @@ public class DBCTest {
|
|||
* Run the void assertTrue(String,boolean) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
@ -480,6 +503,7 @@ public class DBCTest {
|
|||
* Run the void assertTrue(String,boolean) method test.
|
||||
*
|
||||
* @throws Exception
|
||||
* if something goes wrong
|
||||
*
|
||||
* @generatedBy CodePro at 2/2/14 8:13 PM
|
||||
*/
|
||||
|
|
|
@ -31,7 +31,7 @@ import li.strolch.utils.helper.PropertiesHelper;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class BaseDecodingTest {
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
|
|||
import li.strolch.utils.helper.StringHelper;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class BaseEncodingTest {
|
||||
|
|
|
@ -23,7 +23,7 @@ import li.strolch.utils.helper.BaseEncoding;
|
|||
/**
|
||||
* Simple helper class to generate the reverse alphabets for {@link BaseEncoding}
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class GenerateReverseBaseEncodingAlphabets {
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.junit.Test;
|
|||
import li.strolch.utils.objectfilter.ObjectFilter;
|
||||
|
||||
/**
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class ObjectFilterTest {
|
||||
|
|
Loading…
Reference in New Issue