|
|
|
@ -8,7 +8,9 @@ import org.bson.types.ObjectId;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.profile.Profile;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
|
|
|
|
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
|
|
|
|
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
|
|
|
|
|
import org.gcube.application.geoportal.service.model.internal.faults.DeletionException;
|
|
|
|
|
import org.gcube.application.geoportal.service.utils.Serialization;
|
|
|
|
@ -17,6 +19,7 @@ import javax.ws.rs.WebApplicationException;
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.security.InvalidParameterException;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
|
|
|
@ -26,16 +29,13 @@ import static org.gcube.application.geoportal.service.engine.mongo.ConcessioniMo
|
|
|
|
|
public class ProfiledMongoManager extends MongoManager implements MongoManagerI<ProfiledDocument>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String profileId;
|
|
|
|
|
Profile profile;
|
|
|
|
|
|
|
|
|
|
public ProfiledMongoManager(String profileId) throws ConfigurationException {
|
|
|
|
|
if(profileId==null) throw new InvalidParameterException("Profile ID cannot be null");
|
|
|
|
|
//check profile existance
|
|
|
|
|
//ProfileManager.get(profileId);
|
|
|
|
|
// TODO GET FROM PROFILES
|
|
|
|
|
if (!profileId.equals("profiled-concessioni")) throw new WebApplicationException("Profile "+profileId+" not registered", Response.Status.NOT_FOUND);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Profile> profiles=ImplementationProvider.get().getProfiles().getObject();
|
|
|
|
|
if(!profiles.containsKey(profileId))
|
|
|
|
|
throw new WebApplicationException("Profile "+profileId+" not registered", Response.Status.NOT_FOUND);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ProfiledDocument onUpdate(ProfiledDocument updatedDocument){
|
|
|
|
|