2021-11-12 16:41:25 +01:00
|
|
|
package org.gcube.application.geoportal.service.engine.mongo;
|
|
|
|
|
2021-12-01 11:13:34 +01:00
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import org.bson.Document;
|
2021-12-07 16:42:39 +01:00
|
|
|
import org.gcube.application.cms.plugins.faults.StepException;
|
2021-11-12 16:41:25 +01:00
|
|
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
2021-12-01 11:13:34 +01:00
|
|
|
import org.gcube.application.geoportal.service.model.internal.faults.DeletionException;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
2021-11-12 16:41:25 +01:00
|
|
|
|
|
|
|
public interface MongoManagerI<T> {
|
|
|
|
|
|
|
|
|
|
|
|
// create
|
|
|
|
|
2021-12-07 16:42:39 +01:00
|
|
|
public T registerNew(Document toRegister) throws IOException, StepException;
|
2021-11-12 16:41:25 +01:00
|
|
|
|
|
|
|
// update
|
2021-12-07 16:42:39 +01:00
|
|
|
public T update(String id,T toSet) throws IOException, StepException;
|
2021-11-12 16:41:25 +01:00
|
|
|
|
|
|
|
// delete
|
|
|
|
|
2021-12-01 11:13:34 +01:00
|
|
|
public void delete(String id,boolean force) throws DeletionException;
|
2021-11-12 16:41:25 +01:00
|
|
|
|
|
|
|
// get By ID
|
|
|
|
|
2021-12-01 11:13:34 +01:00
|
|
|
public T getByID(String id) throws IOException;
|
2021-11-12 16:41:25 +01:00
|
|
|
|
|
|
|
// query
|
|
|
|
|
2021-12-07 11:16:26 +01:00
|
|
|
public Iterable<Document> query(QueryRequest request);
|
|
|
|
public Iterable<T> filter(QueryRequest request);
|
2021-11-12 16:41:25 +01:00
|
|
|
|
|
|
|
// materialize
|
|
|
|
|
|
|
|
public T materialize(String id);
|
|
|
|
|
|
|
|
// dematerialize
|
|
|
|
|
|
|
|
public T dematerialize(String id);
|
|
|
|
// index
|
|
|
|
|
|
|
|
public T index(String id);
|
|
|
|
|
|
|
|
// deIndex
|
|
|
|
public T deIndex(String id);
|
2021-12-01 11:13:34 +01:00
|
|
|
|
|
|
|
public T performStep(String id, String step, Document options);
|
2021-11-12 16:41:25 +01:00
|
|
|
}
|