2015-06-08 18:20:02 +02:00
/ * *
*
* /
2015-12-01 14:37:23 +01:00
package org.gcube.accounting.datamodel.deprecationmanagement ;
2015-06-08 18:20:02 +02:00
import java.io.Serializable ;
import org.gcube.accounting.datamodel.UsageRecord ;
2015-06-09 17:36:38 +02:00
import org.gcube.accounting.datamodel.decorators.FieldAction ;
2015-12-18 17:09:05 +01:00
import org.gcube.documentstore.exception.InvalidValueException ;
2015-06-08 18:20:02 +02:00
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
/ * *
* @author Luca Frosini ( ISTI - CNR ) http : //www.lucafrosini.com/
*
* /
2015-06-09 17:36:38 +02:00
public class DeprecatedWarningAction implements FieldAction {
2015-06-08 18:20:02 +02:00
2015-06-09 17:36:38 +02:00
private static Logger logger = LoggerFactory . getLogger ( DeprecatedWarningAction . class ) ;
2015-06-08 18:20:02 +02:00
/ * *
* { @inheritDoc }
* /
@Override
2015-11-30 17:49:18 +01:00
public Comparable < ? extends Serializable > validate ( String key , Comparable < ? extends Serializable > value , UsageRecord usageRecord ) throws InvalidValueException {
2015-12-01 14:37:23 +01:00
logger . trace ( " The field {} is deprecated for {}. Anyway the field will be included in the SingleUsageRecord. The field can be lost during aggregation. " ,
2015-06-08 18:20:02 +02:00
key , usageRecord . getClass ( ) . getSimpleName ( ) ) ;
return value ;
}
}