Changed classes signature
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/document-store-lib@133101 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9d941b2578
commit
5533c697aa
|
@ -1,5 +1,8 @@
|
||||||
package org.gcube.documentstore.exception;
|
package org.gcube.documentstore.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class InvalidValueException extends Exception {
|
public class InvalidValueException extends Exception {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
package org.gcube.documentstore.exception;
|
package org.gcube.documentstore.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class NotAggregatableRecordsExceptions extends Exception {
|
public class NotAggregatableRecordsExceptions extends Exception {
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ package org.gcube.documentstore.persistence;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DefaultPersitenceExecutor implements PersistenceExecutor {
|
class DefaultPersitenceExecutor implements PersistenceExecutor {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.io.PrintWriter;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class FallbackPersistenceBackend extends PersistenceBackend {
|
public class FallbackPersistenceBackend extends PersistenceBackend {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public abstract class PersistenceBackend {
|
public abstract class PersistenceBackend {
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public abstract class PersistenceBackendConfiguration {
|
public abstract class PersistenceBackendConfiguration {
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class PersistenceBackendFactory {
|
public abstract class PersistenceBackendFactory {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
class PersistenceBackendMonitor implements Runnable {
|
class PersistenceBackendMonitor implements Runnable {
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PersistenceBackendRediscover implements Runnable {
|
class PersistenceBackendRediscover implements Runnable {
|
||||||
|
|
|
@ -6,7 +6,7 @@ package org.gcube.documentstore.persistence;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface PersistenceExecutor {
|
public interface PersistenceExecutor {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.documentstore.records.implementation.RequiredField;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public interface AggregatedRecord<A extends AggregatedRecord<A,R>, R extends Record> extends Record {
|
public interface AggregatedRecord<A extends AggregatedRecord<A,R>, R extends Record> extends Record {
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.implementation.RequiredField;
|
import org.gcube.documentstore.records.implementation.RequiredField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface Record extends Comparable<Record>, Serializable {
|
public interface Record extends Comparable<Record>, Serializable {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class RecordUtility {
|
public class RecordUtility {
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class AggregationScheduler implements Runnable {
|
public abstract class AggregationScheduler implements Runnable {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class AggregationUtility<T extends AggregatedRecord<T,?>> {
|
public class AggregationUtility<T extends AggregatedRecord<T,?>> {
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Calendar;
|
||||||
import org.gcube.documentstore.persistence.PersistenceExecutor;
|
import org.gcube.documentstore.persistence.PersistenceExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
* This class implements a Simple Buffer with timeout strategy.
|
* This class implements a Simple Buffer with timeout strategy.
|
||||||
* It buffer a predefined number of Records before invoking a persistence.
|
* It buffer a predefined number of Records before invoking a persistence.
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractRecord implements Record {
|
public abstract class AbstractRecord implements Record {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This annotations indicates that the field is related to an aggregation
|
* This annotations indicates that the field is related to an aggregation
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.lang.annotation.Target;
|
||||||
/**
|
/**
|
||||||
* This annotations indicates that the field is calculated using the
|
* This annotations indicates that the field is calculated using the
|
||||||
* value of other field in the instance
|
* value of other field in the instance
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
|
|
@ -9,7 +9,7 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public interface FieldAction {
|
public interface FieldAction {
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.ANNOTATION_TYPE)
|
@Target(ElementType.ANNOTATION_TYPE)
|
||||||
|
|
|
@ -5,6 +5,9 @@ import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface RequiredField {
|
public @interface RequiredField {
|
||||||
|
|
|
@ -8,6 +8,9 @@ import java.lang.annotation.Target;
|
||||||
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
||||||
import org.gcube.documentstore.records.implementation.validations.validators.NotEmptyValidator;
|
import org.gcube.documentstore.records.implementation.validations.validators.NotEmptyValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@FieldDecorator(action=NotEmptyValidator.class)
|
@FieldDecorator(action=NotEmptyValidator.class)
|
||||||
|
|
|
@ -8,6 +8,9 @@ import java.lang.annotation.Target;
|
||||||
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
||||||
import org.gcube.documentstore.records.implementation.validations.validators.NotEmptyIfNotNullValidator;
|
import org.gcube.documentstore.records.implementation.validations.validators.NotEmptyIfNotNullValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@FieldDecorator(action=NotEmptyIfNotNullValidator.class)
|
@FieldDecorator(action=NotEmptyIfNotNullValidator.class)
|
||||||
|
|
|
@ -8,6 +8,9 @@ import java.lang.annotation.Target;
|
||||||
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
||||||
import org.gcube.documentstore.records.implementation.validations.validators.NotNullValidator;
|
import org.gcube.documentstore.records.implementation.validations.validators.NotNullValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@FieldDecorator(action=NotNullValidator.class)
|
@FieldDecorator(action=NotNullValidator.class)
|
||||||
|
|
|
@ -8,6 +8,9 @@ import java.lang.annotation.Target;
|
||||||
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
||||||
import org.gcube.documentstore.records.implementation.validations.validators.ValidBooleanValidator;
|
import org.gcube.documentstore.records.implementation.validations.validators.ValidBooleanValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@FieldDecorator(action=ValidBooleanValidator.class)
|
@FieldDecorator(action=ValidBooleanValidator.class)
|
||||||
|
|
|
@ -8,6 +8,9 @@ import java.lang.annotation.Target;
|
||||||
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
||||||
import org.gcube.documentstore.records.implementation.validations.validators.ValidIntegerValidator;
|
import org.gcube.documentstore.records.implementation.validations.validators.ValidIntegerValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@FieldDecorator(action=ValidIntegerValidator.class)
|
@FieldDecorator(action=ValidIntegerValidator.class)
|
||||||
|
|
|
@ -8,6 +8,9 @@ import java.lang.annotation.Target;
|
||||||
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
import org.gcube.documentstore.records.implementation.FieldDecorator;
|
||||||
import org.gcube.documentstore.records.implementation.validations.validators.ValidLongValidator;
|
import org.gcube.documentstore.records.implementation.validations.validators.ValidLongValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@FieldDecorator(action=ValidLongValidator.class)
|
@FieldDecorator(action=ValidLongValidator.class)
|
||||||
|
|
|
@ -3,6 +3,9 @@ package org.gcube.documentstore.records.implementation.validations.validators;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class NotEmptyIfNotNullValidator extends NotEmptyValidator {
|
public class NotEmptyIfNotNullValidator extends NotEmptyValidator {
|
||||||
|
|
||||||
protected boolean isValid(Serializable toValidate) {
|
protected boolean isValid(Serializable toValidate) {
|
||||||
|
|
|
@ -7,6 +7,9 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
import org.gcube.documentstore.records.implementation.FieldAction;
|
import org.gcube.documentstore.records.implementation.FieldAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class NotEmptyValidator implements FieldAction {
|
public class NotEmptyValidator implements FieldAction {
|
||||||
|
|
||||||
private static final String ERROR = "Is Empty";
|
private static final String ERROR = "Is Empty";
|
||||||
|
|
|
@ -6,6 +6,9 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
import org.gcube.documentstore.records.implementation.FieldAction;
|
import org.gcube.documentstore.records.implementation.FieldAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class NotNullValidator implements FieldAction {
|
public class NotNullValidator implements FieldAction {
|
||||||
|
|
||||||
private static final String ERROR = "Is Null";
|
private static final String ERROR = "Is Null";
|
||||||
|
|
|
@ -6,7 +6,9 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
import org.gcube.documentstore.records.implementation.FieldAction;
|
import org.gcube.documentstore.records.implementation.FieldAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class ValidBooleanValidator implements FieldAction {
|
public class ValidBooleanValidator implements FieldAction {
|
||||||
|
|
||||||
private static final String ERROR = String.format("Not Instance of %s", Boolean.class.getSimpleName());
|
private static final String ERROR = String.format("Not Instance of %s", Boolean.class.getSimpleName());
|
||||||
|
|
|
@ -6,7 +6,9 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
import org.gcube.documentstore.records.implementation.FieldAction;
|
import org.gcube.documentstore.records.implementation.FieldAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class ValidIntegerValidator implements FieldAction {
|
public class ValidIntegerValidator implements FieldAction {
|
||||||
|
|
||||||
private static final String ERROR = String.format("Not Instance of %s", Integer.class.getSimpleName());
|
private static final String ERROR = String.format("Not Instance of %s", Integer.class.getSimpleName());
|
||||||
|
|
|
@ -6,7 +6,9 @@ import org.gcube.documentstore.exception.InvalidValueException;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
import org.gcube.documentstore.records.implementation.FieldAction;
|
import org.gcube.documentstore.records.implementation.FieldAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public class ValidLongValidator implements FieldAction {
|
public class ValidLongValidator implements FieldAction {
|
||||||
|
|
||||||
private static final String ERROR = String.format("Not Instance of %s", Integer.class.getSimpleName());
|
private static final String ERROR = String.format("Not Instance of %s", Integer.class.getSimpleName());
|
||||||
|
|
Loading…
Reference in New Issue