Introduced Profiled Document Interface
parent
98391f8e29
commit
1912bcc1a6
@ -0,0 +1,39 @@
|
||||
package org.gcube.application.cms.concessioni.plugins;
|
||||
|
||||
import org.gcube.application.cms.plugins.LifecycleManager;
|
||||
import org.gcube.application.cms.plugins.faults.InitializationException;
|
||||
import org.gcube.application.cms.plugins.faults.ShutDownException;
|
||||
import org.gcube.application.cms.plugins.faults.StepException;
|
||||
import org.gcube.application.cms.plugins.model.PluginDescriptor;
|
||||
import org.gcube.application.cms.plugins.reports.ExecutionReport;
|
||||
import org.gcube.application.cms.plugins.reports.InitializationReport;
|
||||
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
||||
|
||||
public class ConcessioniLifeCycleManager implements LifecycleManager {
|
||||
|
||||
|
||||
@Override
|
||||
public InitializationReport initInContext() throws InitializationException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InitializationReport init() throws InitializationException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() throws ShutDownException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecutionReport performStep(StepExecutionRequest request) throws StepException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginDescriptor getDescriptor() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package org.gcube.application.geoportal.client;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
|
||||
import org.gcube.application.geoportal.common.model.rest.Configuration;
|
||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class DefaultProfiledConcessioni implements MongoConcessioni {
|
||||
|
||||
|
||||
@Override
|
||||
public Concessione createNew(Concessione c) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id, Boolean force) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Concessione getById(String id) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Concessione> getList() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Concessione publish(String id) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Concessione registerFileSet(String id, AddSectionToConcessioneRequest request) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Concessione cleanFileSet(String id, String path) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Concessione update(String id, String jsonUpdate) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Concessione replace(Concessione replacement) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unPublish(String id) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Configuration getCurrentConfiguration() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Concessione> search(String filter) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Concessione> query(QueryRequest request) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryForJSON(QueryRequest request) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Iterator<T> queryForType(QueryRequest request, Class<T> clazz) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.gcube.application.geoportal.client;
|
||||
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.bson.Document;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.rest.Configuration;
|
||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||
import org.gcube.application.geoportal.common.rest.ProfiledDocumentsI;
|
||||
import org.gcube.common.clients.delegates.ProxyDelegate;
|
||||
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.Iterator;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class DefaultProfiledDocuments implements ProfiledDocumentsI<ProfiledDocument> {
|
||||
|
||||
@NonNull
|
||||
private final ProxyDelegate<WebTarget> delegate;
|
||||
|
||||
@Override
|
||||
public ProfiledDocument createNew(Document toCreate) throws RemoteException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id, Boolean force) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfiledDocument getById(String id) throws RemoteException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Configuration getConfiguration() throws RemoteException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ProfiledDocument> query(QueryRequest request) throws RemoteException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String querForJSON(QueryRequest request) throws RemoteException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfiledDocument performStep(String id, String step, Document request) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package org.gcube.application.geoportal.client;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.project.Project;
|
||||
import org.gcube.application.geoportal.common.rest.ProjectsI;
|
||||
import org.gcube.common.clients.Call;
|
||||
import org.gcube.common.clients.delegates.ProxyDelegate;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class DefaultProjects implements ProjectsI{
|
||||
|
||||
@NonNull
|
||||
private final ProxyDelegate<WebTarget> delegate;
|
||||
|
||||
@Override
|
||||
public void deleteById(String profileId, String projectId) throws RemoteException {
|
||||
deleteById(profileId,projectId,false);
|
||||
}
|
||||
@Override
|
||||
public void deleteById(String profileId, String projectId,Boolean force) throws RemoteException {
|
||||
// Call<WebTarget,String> call= new Call<WebTarget, String>() {
|
||||
//
|
||||
// @Override
|
||||
// public String call(WebTarget endpoint) throws Exception {
|
||||
// endpoint.path(profileId).path(projectId).request(MediaType.APPLICATION_JSON).delete();
|
||||
// }
|
||||
// };
|
||||
// try{
|
||||
// delegate.make(call);
|
||||
// }catch(Exception e) {
|
||||
//// throw new RemoteException(e);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Project> getAll() throws RemoteException {
|
||||
Call<WebTarget,Iterator<Project>> call=new Call<WebTarget,Iterator<Project>>(){
|
||||
@Override
|
||||
public Iterator<Project> call(WebTarget endpoint) throws Exception {
|
||||
throw new Exception("Client method not ready");
|
||||
}
|
||||
};
|
||||
try{
|
||||
return delegate.make(call);
|
||||
}catch(Exception e) {
|
||||
throw new RemoteException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Project> getByFilter(String filter) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Project> getByFilter(String filter, String profileId) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Project getById(String profileId, String id) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Project> getByProfile(String profileId) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Project registrNew(String profileId, String jsonDocument) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Project update(String profileId, String projectId, String jsonDocument) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package org.gcube.application.geoportal.common.model.project;
|
||||
|
||||
public class Centroid {
|
||||
|
||||
private Double x;
|
||||
private Double y;
|
||||
private Double z;
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package org.gcube.application.geoportal.common.model.project;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.BasicJSONObject;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
public class Project {
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package org.gcube.application.geoportal.common.model.project;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PublicationDetails {
|
||||
|
||||
public static enum Policy{
|
||||
OPEN,RESTRICTED,EMBARGOED;
|
||||
}
|
||||
|
||||
private LocalDateTime creation_time;
|
||||
private String creation_user;
|
||||
private LocalDateTime last_update_time;
|
||||
private String last_update_user;
|
||||
private String version;
|
||||
private String license;
|
||||
private String policy;
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package org.gcube.application.geoportal.common.model.project;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Status {
|
||||
|
||||
|
||||
private StatusPhase phase;
|
||||
private List<String> messages;
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package org.gcube.application.geoportal.common.model.project;
|
||||
|
||||
public enum StatusPhase {
|
||||
|
||||
DRAFT,
|
||||
UNDER_VALIDATION,
|
||||
INVALID,
|
||||
VALID,
|
||||
UNDER_PUBLICATION,
|
||||
PUBLICATION_ERROR,
|
||||
PUBLISHED
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.application.geoportal.common.rest;
|
||||
|
||||
import org.bson.Document;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.rest.Configuration;
|
||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.Iterator;
|
||||
|
||||
public interface ProfiledDocumentsI<P extends ProfiledDocument> {
|
||||
|
||||
// CRUD
|
||||
public P createNew(Document toCreate)throws RemoteException;
|
||||
public void deleteById(String id) throws RemoteException;
|
||||
public void deleteById(String id,Boolean force) throws RemoteException;
|
||||
public P getById(String id) throws RemoteException;
|
||||
|
||||
// CONFIG
|
||||
public Configuration getConfiguration() throws RemoteException;
|
||||
|
||||
// QUERY
|
||||
public Iterator<P> query (QueryRequest request) throws RemoteException;
|
||||
public String querForJSON(QueryRequest request)throws RemoteException;
|
||||
|
||||
//Execution
|
||||
public P performStep(String id, String step, Document request);
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package org.gcube.application.geoportal.common.rest;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.project.Project;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public interface ProjectsI {
|
||||
|
||||
|
||||
public Iterator<Project> getAll() throws Exception;
|
||||
public Iterator<Project> getByProfile(String profileId) throws Exception;
|
||||
public Project getById(String profileId,String id) throws Exception;
|
||||
public Iterator<Project> getByFilter(String filter)throws Exception;
|
||||
public Iterator<Project> getByFilter(String filter, String profileId)throws Exception;
|
||||
public Project registrNew(String profileId, String jsonDocument)throws Exception;
|
||||
public Project update(String profileId, String projectId,String jsonDocument) throws Exception;
|
||||
public void deleteById(String profileId, String projectId)throws Exception;
|
||||
public void deleteById(String profileId, String projectId, Boolean force)throws Exception;
|
||||
}
|
Loading…
Reference in New Issue