gFeed/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/PersistenceManager.java

33 lines
1.3 KiB
Java

package org.gcube.data.publishing.gCatFeeder.service.engine;
import java.util.Collection;
import org.gcube.data.publishing.gCatFeeder.service.model.ExecutionDescriptor;
import org.gcube.data.publishing.gCatFeeder.service.model.ExecutionDescriptorFilter;
import org.gcube.data.publishing.gCatFeeder.service.model.ExecutionRequest;
import org.gcube.data.publishing.gCatFeeder.service.model.fault.ElementNotFound;
import org.gcube.data.publishing.gCatFeeder.service.model.fault.InvalidRequest;
import org.gcube.data.publishing.gCatFeeder.service.model.fault.PersistenceError;
public interface PersistenceManager {
public ExecutionDescriptor create(ExecutionRequest request) throws PersistenceError,InvalidRequest;
public ExecutionDescriptor getById(String id)throws PersistenceError,ElementNotFound,InvalidRequest;
public Collection<ExecutionDescriptor> get(ExecutionDescriptorFilter filter)throws PersistenceError,InvalidRequest;
// DIRECT QUERIES
public boolean update(ExecutionDescriptor toUpdate)throws PersistenceError,ElementNotFound;
/**
* Updates status only if current status value is PENDING
*
* @param id
* @return
* @throws PersistenceError
* @throws ElementNotFound
*/
public boolean acquire(String id)throws PersistenceError,ElementNotFound;
}