2015-12-01 14:37:23 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.accounting.datamodel.backwardcompatibility;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
import org.gcube.accounting.datamodel.basetypes.AbstractTaskUsageRecord;
|
2015-12-18 17:09:05 +01:00
|
|
|
import org.gcube.documentstore.exception.InvalidValueException;
|
2015-12-21 11:50:09 +01:00
|
|
|
import org.gcube.documentstore.records.Record;
|
|
|
|
import org.gcube.documentstore.records.implementation.FieldAction;
|
2015-12-01 14:37:23 +01:00
|
|
|
|
|
|
|
/**
|
2016-10-12 14:15:28 +02:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2015-12-01 14:37:23 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class MoveToTaskEndTimeAction implements FieldAction {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritDoc}
|
|
|
|
*/
|
|
|
|
@Override
|
2016-01-28 18:29:11 +01:00
|
|
|
public Serializable validate(String key,
|
|
|
|
Serializable value, Record record)
|
2015-12-01 14:37:23 +01:00
|
|
|
throws InvalidValueException {
|
2015-12-21 11:50:09 +01:00
|
|
|
record.setResourceProperty(AbstractTaskUsageRecord.TASK_END_TIME, value);
|
2016-04-13 16:44:22 +02:00
|
|
|
return null; //Returning null the initial key is removed from Record
|
2015-12-01 14:37:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|