Merge pull request 'feature_24985' (#15) from feature_24985 into master

Reviewed-on: #15
This commit is contained in:
Francesco Mangiacrapa 2023-05-11 14:19:36 +02:00
commit a449b98bc0
119 changed files with 3768 additions and 2115 deletions

View File

@ -1,5 +1,9 @@
# Changelog for org.gcube.application.cms.ckan-plugin
## [v1.2.1-SNAPSHOT]
- Improved some logs
## [v1.2.0]
- Integrated the field 'geov_link' (Geoportal GisViewer link) in the centroid layer [#24859]

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>default-lc-managers</artifactId>
<version>1.2.0</version>
<version>1.2.1-SNAPSHOT</version>
<name>gCube CMS - Default LC Managers</name>

View File

@ -210,7 +210,8 @@ public abstract class AbstractLifeCycleManager extends AbstractPlugin implements
@Override
public EventExecutionReport onEvent(EventExecutionRequest request) throws EventException, InvalidPluginRequestException {
log.info("Executing Event {}",request);
log.info("Executing Event {}, Parameters: {}, Context: {}",request.getEvent(), request.getCallParameters(), request.getContext());
log.info("Event fired on ProjectID {} with ProfileID: {}",request.getDocument().getId(), request.getDocument().getProfileID());
EventExecutionReport report=new EventExecutionReport(request);
report.getToSetLifecycleInformation().addEventReport(new TriggeredEvents());
TriggeredEvents info = report.getToSetLifecycleInformation().getLastEvent();

View File

@ -1,5 +1,9 @@
# Changelog for org.gcube.application.geoportal-client
## [v1.2.0-SNAPSHOT] - 2023-04-26
- Added PATCH method [#24985]
- Integrated `ingnore_errors` in the deleteFileSet
## [v1.1.2] - 2023-01-10
- Pom updates

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-client</artifactId>
<version>1.1.2</version>
<version>1.2.0-SNAPSHOT</version>
<name>Geoportal Client</name>

View File

@ -1,8 +1,14 @@
package org.gcube.application.geoportal.client;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.rmi.RemoteException;
import java.util.Iterator;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.bson.Document;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
@ -10,385 +16,572 @@ import org.gcube.application.geoportal.common.model.configuration.Configuration;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.model.document.access.Access;
import org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject;
import org.gcube.application.geoportal.common.model.rest.*;
import org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest;
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.rest.Projects;
import org.gcube.common.clients.Call;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.glassfish.jersey.client.HttpUrlConnectorProvider;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
import java.rmi.RemoteException;
import java.util.Iterator;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* Instantiates a new default documents client.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* May 2, 2023
* @param <T> the generic type
*/
/**
* Instantiates a new default documents client.
*
* @param delegate the delegate
* @param profileID the profile ID
* @param managedClass the managed class
*/
@RequiredArgsConstructor
@Slf4j
public class DefaultDocumentsClient<T extends Project> implements Projects<T> {
@NonNull
protected final ProxyDelegate<WebTarget> delegate;
@NonNull
protected final String profileID;
@NonNull
protected final Class<T> managedClass;
@NonNull
protected final ProxyDelegate<WebTarget> delegate;
@NonNull
protected final String profileID;
@NonNull
protected final Class<T> managedClass;
/**
* Gets the managed class.
*
* @return the managed class
*/
public Class<T> getManagedClass() {
return managedClass;
}
public Class<T> getManagedClass() {
return managedClass;
}
/**
* Creates the new.
*
* @param toCreate the to create
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T createNew(Document toCreate) throws RemoteException {
try {
log.debug("Creating Profiled Document (class {}, useCaseDescriptor {}) with content {} ", getManagedClass(),
profileID, toCreate);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).request(MediaType.APPLICATION_JSON)
.post(Entity.entity(toCreate, MediaType.APPLICATION_JSON)), getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Registered {} profiled {} ", toReturn.getId(), profileID);
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T createNew(Document toCreate) throws RemoteException {
try {
log.debug("Creating Profiled Document (class {}, useCaseDescriptor {}) with content {} ",
getManagedClass(),profileID, toCreate);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).request(MediaType.APPLICATION_JSON).
post(Entity.entity(toCreate, MediaType.APPLICATION_JSON)),getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Registered {} profiled {} ",toReturn.getId(),profileID);
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Delete by id.
*
* @param id the id
* @throws RemoteException the remote exception
*/
@Override
public void deleteById(String id) throws RemoteException {
deleteById(id, false);
}
@Override
public void deleteById(String id) throws RemoteException {
deleteById(id,false);
}
/**
* Delete by id.
*
* @param id the id
* @param force the force
* @throws RemoteException the remote exception
*/
@Override
public void deleteById(String id, Boolean force) throws RemoteException {
try {
log.debug("Deleting ID {}  useCaseDescriptor {}  force {} ", id, profileID, force);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons
.check(endpoint.path(profileID).path(id).queryParam(InterfaceConstants.Parameters.FORCE, force)
.request(MediaType.APPLICATION_JSON).delete(), null);
};
delegate.make(call);
log.info("Deleted ID {}  useCaseDescriptor {}  force {} ", id, profileID, force);
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public void deleteById(String id, Boolean force) throws RemoteException {
try {
log.debug("Deleting ID {}  useCaseDescriptor {}  force {} ", id, profileID, force);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(id).
queryParam(InterfaceConstants.Parameters.FORCE,force).
request(MediaType.APPLICATION_JSON).delete(),null);
};
delegate.make(call);
log.info("Deleted ID {}  useCaseDescriptor {}  force {} ", id, profileID, force);
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Gets the by id.
*
* @param id the id
* @return the by id
* @throws RemoteException the remote exception
*/
@Override
public T getById(String id) throws RemoteException {
try {
log.info("Loading Document ID {} (class {}, useCaseDescriptor {})", id, getManagedClass(), profileID);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(
endpoint.path(profileID).path(id).request(MediaType.APPLICATION_JSON).get(), getManagedClass());
};
return delegate.make(call);
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T getById(String id) throws RemoteException {
try {
log.info("Loading Document ID {} (class {}, useCaseDescriptor {})",
id, getManagedClass(),profileID);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(id).
request(MediaType.APPLICATION_JSON).get(), getManagedClass());
};
return delegate.make(call);
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Gets the configuration.
*
* @return the configuration
* @throws RemoteException the remote exception
*/
@Override
public Configuration getConfiguration() throws RemoteException {
try {
log.info("Loading Configuration for useCaseDescriptor {}", profileID);
Call<WebTarget, Configuration> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID)
.path(InterfaceConstants.Methods.CONFIGURATION_PATH).request(MediaType.APPLICATION_JSON).get(),
Configuration.class);
};
return delegate.make(call);
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public Configuration getConfiguration() throws RemoteException {
try {
log.info("Loading Configuration for useCaseDescriptor {}", profileID);
Call<WebTarget, Configuration> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.CONFIGURATION_PATH).
request(MediaType.APPLICATION_JSON).get(), Configuration.class);
};
return delegate.make(call);
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Query.
*
* @param request the request
* @return the iterator
* @throws RemoteException the remote exception
*/
@Override
public Iterator<T> query(QueryRequest request) throws RemoteException {
return queryForClass(request, getManagedClass());
}
@Override
public Iterator<T> query(QueryRequest request) throws RemoteException {
return queryForClass(request,getManagedClass());
}
/**
* Query for class.
*
* @param <C> the generic type
* @param request the request
* @param clazz the clazz
* @return the iterator
* @throws RemoteException the remote exception
*/
@Override
public <C> Iterator<C> queryForClass(QueryRequest request, Class<C> clazz) throws RemoteException {
String jsonString = queryForJSON(request);
log.debug("Deserializing query Result as {} ", clazz);
try {
return Serialization.readCollection(jsonString, clazz);
} catch (IOException e) {
log.error("Unable to deserialize result as " + clazz, e);
log.debug("Query request was {} ", request);
log.debug("Query result was {} ", jsonString);
throw new RemoteException("Invalid format for submitted query");
}
}
@Override
public <C> Iterator<C> queryForClass(QueryRequest request,Class<C> clazz) throws RemoteException {
String jsonString=queryForJSON(request);
log.debug("Deserializing query Result as {} ",clazz);
try {
return Serialization.readCollection(jsonString,clazz);
} catch (IOException e) {
log.error("Unable to deserialize result as "+clazz,e);
log.debug("Query request was {} ",request);
log.debug("Query result was {} ",jsonString);
throw new RemoteException("Invalid format for submitted query");
}
}
/**
* Query for JSON.
*
* @param request the request
* @return the string
* @throws RemoteException the remote exception
*/
@Override
public String queryForJSON(QueryRequest request) throws RemoteException {
try {
log.debug("Querying useCaseDescriptor {}  for {}", profileID, request);
Call<WebTarget, String> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.QUERY_PATH)
.request(MediaType.APPLICATION_JSON).post(Entity.entity(request, MediaType.APPLICATION_JSON)),
String.class);
};
return delegate.make(call);
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public String queryForJSON(QueryRequest request) throws RemoteException {
try {
log.debug("Querying useCaseDescriptor {}  for {}",profileID,request);
Call<WebTarget, String> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.QUERY_PATH).
request(MediaType.APPLICATION_JSON).post(Entity.entity(request,MediaType.APPLICATION_JSON)), String.class);
};
return delegate.make(call);
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Perform step.
*
* @param id the id
* @param request the request
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T performStep(String id, StepExecutionRequest request) throws RemoteException {
try {
log.debug("Executing step on {} (class {}, useCaseDescriptor {}) with request {} ", id, getManagedClass(),
profileID, request);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.STEP).path(id)
.request(MediaType.APPLICATION_JSON).post(Entity.entity(request, MediaType.APPLICATION_JSON)),
getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Executed STEP {} on {} [useCaseDescriptor {}, class {}] ", request.getStepID(), id, profileID,
getManagedClass());
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T performStep(String id, StepExecutionRequest request) throws RemoteException{
try {
log.debug("Executing step on {} (class {}, useCaseDescriptor {}) with request {} ",
id, getManagedClass(),profileID, request);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.STEP)
.path(id).request(MediaType.APPLICATION_JSON).
post(Entity.entity(request, MediaType.APPLICATION_JSON)),getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Executed STEP {} on {} [useCaseDescriptor {}, class {}] ",request.getStepID(),
id,profileID,getManagedClass());
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Register file set.
*
* @param id the id
* @param req the req
* @return the t
* @throws RemoteException the remote exception
* @throws InvalidRequestException the invalid request exception
*/
@Override
public T registerFileSet(String id, RegisterFileSetRequest req) throws RemoteException, InvalidRequestException {
try {
log.debug("Registering FileSet on {} (class {}, useCaseDescriptor {}) with request {} ", id,
getManagedClass(), profileID, req);
req.validate();
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID)
.path(InterfaceConstants.Methods.REGISTER_FILES_PATH).path(id)
.request(MediaType.APPLICATION_JSON).post(Entity.entity(req, MediaType.APPLICATION_JSON)),
getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Registered FileSet on {} [useCaseDescriptor {}, class {}]  with {}", id, profileID,
getManagedClass(), req);
return toReturn;
} catch (InvalidRequestException e) {
log.error("Invalid Request ", e);
throw e;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T registerFileSet(String id, RegisterFileSetRequest req) throws RemoteException, InvalidRequestException {
try {
log.debug("Registering FileSet on {} (class {}, useCaseDescriptor {}) with request {} ",
id, getManagedClass(), profileID, req);
req.validate();
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.REGISTER_FILES_PATH)
.path(id).request(MediaType.APPLICATION_JSON).
post(Entity.entity(req, MediaType.APPLICATION_JSON)), getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Registered FileSet on {} [useCaseDescriptor {}, class {}]  with {}",
id, profileID, getManagedClass(), req);
return toReturn;
}catch (InvalidRequestException e){
log.error("Invalid Request ",e);
throw e;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Delete file set.
*
* @param id the id
* @param path the path
* @param force the force
* @param ignoreErrors the ignore errors
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T deleteFileSet(String id, String path, Boolean force, Boolean ignoreErrors) throws RemoteException {
try {
log.debug(
"Deleting Fileset for ID {}  [useCaseDescriptor {}  , class {}] at {} (force {} ) (ignoreErrors {} )",
id, profileID, getManagedClass(), path, force, ignoreErrors);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.DELETE_FILES_PATH)
.path(id).queryParam(InterfaceConstants.Parameters.FORCE, force)
.queryParam(InterfaceConstants.Parameters.IGNORE_ERRORS, ignoreErrors)
.request(MediaType.APPLICATION_JSON).post(Entity.entity(path, MediaType.APPLICATION_JSON)),
getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Deleted ID {}  useCaseDescriptor {}  force {} ", id, profileID, force);
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T deleteFileSet(String id, String path, Boolean force) throws RemoteException {
try {
log.debug("Deleting Fileset for ID {}  [useCaseDescriptor {}  , class {}] at {} (force {} )",
id, profileID,getManagedClass(),path, force);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.DELETE_FILES_PATH).
path(id).queryParam(InterfaceConstants.Parameters.FORCE,force).
request(MediaType.APPLICATION_JSON).
post(Entity.entity(path, MediaType.APPLICATION_JSON)),getManagedClass());
};
T toReturn=delegate.make(call);
log.info("Deleted ID {}  useCaseDescriptor {}  force {} ", id, profileID, force);
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Force unlock.
*
* @param id the id
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T forceUnlock(String id) throws RemoteException {
try {
log.warn("Force Unlock of {} [useCaseDescriptor {} , class {}]", id, profileID, getManagedClass());
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.FORCE_UNLOCK)
.path(id).request(MediaType.APPLICATION_JSON).put(Entity.json("")), getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Unlocked ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T forceUnlock(String id) throws RemoteException {
try {
log.warn("Force Unlock of {} [useCaseDescriptor {} , class {}]",
id, profileID,getManagedClass());
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.FORCE_UNLOCK).path(id).
request(MediaType.APPLICATION_JSON).
put(Entity.json("")),getManagedClass());
};
T toReturn=delegate.make(call);
log.info("Unlocked ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Sets the access policy.
*
* @param id the id
* @param toSet the to set
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T setAccessPolicy(String id, Access toSet) throws RemoteException {
try {
log.info("Setting Access of {} [useCaseDescriptor {} , class {}] as {}", id, profileID, getManagedClass(),
toSet);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(
endpoint.path(profileID).path(InterfaceConstants.Methods.SET_PROJECT_ACCESS_POLICY).path(id)
.request(MediaType.APPLICATION_JSON).put(Entity.json(toSet)),
getManagedClass());
};
T toReturn = delegate.make(call);
log.debug("Updated Access of ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T setAccessPolicy(String id, Access toSet) throws RemoteException {
try {
log.info("Setting Access of {} [useCaseDescriptor {} , class {}] as {}",
id, profileID,getManagedClass(),toSet);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.SET_PROJECT_ACCESS_POLICY).path(id).
request(MediaType.APPLICATION_JSON).
put(Entity.json(toSet)),getManagedClass());
};
T toReturn=delegate.make(call);
log.debug("Updated Access of ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Update document.
*
* @param id the id
* @param updatedDocument the updated document
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T updateDocument(String id, Document updatedDocument) throws RemoteException {
try {
log.debug("Updating {} [useCaseDescriptor {} , class {}] with ", id, profileID, getManagedClass(),
updatedDocument);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(id).request(MediaType.APPLICATION_JSON)
.put(Entity.entity(updatedDocument, MediaType.APPLICATION_JSON)), getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Updated ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public T updateDocument(String id, Document updatedDocument) throws RemoteException {
try {
log.debug("Updating {} [useCaseDescriptor {} , class {}] with ",
id, profileID,getManagedClass(),updatedDocument);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(id).
request(MediaType.APPLICATION_JSON).
put(Entity.entity(updatedDocument, MediaType.APPLICATION_JSON)),getManagedClass());
};
T toReturn=delegate.make(call);
log.info("Updated ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Patch document. Added by Francesco Mangiacrapa
*
* @param id the id
* @param path the path
* @param updatedDocument the updated document
* @return the t
* @throws RemoteException the remote exception
*/
@Override
public T patchDocument(String id, String path, Document updatedDocument) throws RemoteException {
try {
log.debug("Patching {} [useCaseDescriptor {} , class {}] with ", id, profileID, getManagedClass(),
updatedDocument);
Call<WebTarget, T> call = endpoint -> {
@Override
public Project setRelation(CreateRelationshipRequest request) throws RemoteException {
try {
log.debug("Setting relationship {}:{} --{}--> {}:{}",
profileID, request.getProjectId(), request.getRelationshipId(),
request.getTargetUCD(),request.getTargetId());
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).
path(InterfaceConstants.Methods.RELATIONSHIP).
path(request.getProjectId()).
path(request.getRelationshipId()).
queryParam(InterfaceConstants.Parameters.TARGET_ID,request.getTargetId()).
queryParam(InterfaceConstants.Parameters.TARGET_UCD,request.getTargetUCD()).
request(MediaType.APPLICATION_JSON).
put(Entity.json("")),getManagedClass());
};
T toReturn=delegate.make(call);
log.info("Set relationship {}:{} --{}--> {}:{}",
profileID, request.getProjectId(), request.getRelationshipId(),
request.getTargetUCD(),request.getTargetId());
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
WebTarget webTarget = endpoint.path(profileID).path(id);
webTarget.queryParam(InterfaceConstants.Parameters.PATH, path);
webTarget.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
Response response = webTarget.request(MediaType.APPLICATION_JSON).method("PATCH",
Entity.entity(updatedDocument, MediaType.APPLICATION_JSON));
return ResponseCommons.check(response, getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Updated ID {} useCaseDescriptor {}", id, profileID);
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public Project deleteRelation(DeleteRelationshipRequest request) throws RemoteException {
try {
log.debug("Deleting relationship {}:{} --{}--> {}:{}",
profileID, request.getProjectId(), request.getRelationshipId(),
request.getTargetUCD(),request.getTargetId());
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).
path(InterfaceConstants.Methods.RELATIONSHIP).
path(request.getProjectId()).
path(request.getRelationshipId()).
queryParam(InterfaceConstants.Parameters.TARGET_ID,request.getTargetId()).
queryParam(InterfaceConstants.Parameters.TARGET_UCD,request.getTargetUCD()).
request(MediaType.APPLICATION_JSON).
delete(),getManagedClass());
};
T toReturn=delegate.make(call);
log.info("Deleted relationship {}:{} --{}--> {}:{}",
profileID, request.getProjectId(), request.getRelationshipId(),
request.getTargetUCD(),request.getTargetId());
return toReturn;
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
/**
* Sets the relation.
*
* @param request the request
* @return the project
* @throws RemoteException the remote exception
*/
@Override
public Project setRelation(CreateRelationshipRequest request) throws RemoteException {
try {
log.debug("Setting relationship {}:{} --{}--> {}:{}", profileID, request.getProjectId(),
request.getRelationshipId(), request.getTargetUCD(), request.getTargetId());
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.RELATIONSHIP)
.path(request.getProjectId()).path(request.getRelationshipId())
.queryParam(InterfaceConstants.Parameters.TARGET_ID, request.getTargetId())
.queryParam(InterfaceConstants.Parameters.TARGET_UCD, request.getTargetUCD())
.request(MediaType.APPLICATION_JSON).put(Entity.json("")), getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Set relationship {}:{} --{}--> {}:{}", profileID, request.getProjectId(),
request.getRelationshipId(), request.getTargetUCD(), request.getTargetId());
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public Iterator<RelationshipNavigationObject> getRelationshipChain(String id, String relationId) throws RemoteException {
return getRelationshipChain(id,relationId,null);
}
/**
* Delete relation.
*
* @param request the request
* @return the project
* @throws RemoteException the remote exception
*/
@Override
public Project deleteRelation(DeleteRelationshipRequest request) throws RemoteException {
try {
log.debug("Deleting relationship {}:{} --{}--> {}:{}", profileID, request.getProjectId(),
request.getRelationshipId(), request.getTargetUCD(), request.getTargetId());
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.RELATIONSHIP)
.path(request.getProjectId()).path(request.getRelationshipId())
.queryParam(InterfaceConstants.Parameters.TARGET_ID, request.getTargetId())
.queryParam(InterfaceConstants.Parameters.TARGET_UCD, request.getTargetUCD())
.request(MediaType.APPLICATION_JSON).delete(), getManagedClass());
};
T toReturn = delegate.make(call);
log.info("Deleted relationship {}:{} --{}--> {}:{}", profileID, request.getProjectId(),
request.getRelationshipId(), request.getTargetUCD(), request.getTargetId());
return toReturn;
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
@Override
public Iterator<RelationshipNavigationObject> getRelationshipChain(String id, String relationId, Boolean deep) throws RemoteException {
try {
log.debug("Get relationship chain ID {} for {} [useCaseDescriptor {} , class {}]",
relationId, id, profileID,getManagedClass());
Call<WebTarget, Iterator<RelationshipNavigationObject>> call = endpoint -> {
/**
* Gets the relationship chain.
*
* @param id the id
* @param relationId the relation id
* @return the relationship chain
* @throws RemoteException the remote exception
*/
@Override
public Iterator<RelationshipNavigationObject> getRelationshipChain(String id, String relationId)
throws RemoteException {
return getRelationshipChain(id, relationId, null);
}
WebTarget target = endpoint.path(profileID).
path(InterfaceConstants.Methods.RELATIONSHIP).
path(id).
path(relationId);
/**
* Gets the relationship chain.
*
* @param id the id
* @param relationId the relation id
* @param deep the deep
* @return the relationship chain
* @throws RemoteException the remote exception
*/
@Override
public Iterator<RelationshipNavigationObject> getRelationshipChain(String id, String relationId, Boolean deep)
throws RemoteException {
try {
log.debug("Get relationship chain ID {} for {} [useCaseDescriptor {} , class {}]", relationId, id,
profileID, getManagedClass());
Call<WebTarget, Iterator<RelationshipNavigationObject>> call = endpoint -> {
if(deep!=null) target = target.queryParam(InterfaceConstants.Parameters.DEEP,deep);
WebTarget target = endpoint.path(profileID).path(InterfaceConstants.Methods.RELATIONSHIP).path(id)
.path(relationId);
String jsonChain = ResponseCommons.check(target.request(MediaType.APPLICATION_JSON).
get(),String.class);
if (deep != null)
target = target.queryParam(InterfaceConstants.Parameters.DEEP, deep);
return Serialization.readCollection(jsonChain,RelationshipNavigationObject.class);
};
return delegate.make(call);
}catch(RemoteException e){
log.error("Unexpected error ",e);
throw e;
}catch(Exception e){
log.error("Unexpected error ",e);
throw new RemoteException("Unexpected Error", e);
}
}
String jsonChain = ResponseCommons.check(target.request(MediaType.APPLICATION_JSON).get(),
String.class);
return Serialization.readCollection(jsonChain, RelationshipNavigationObject.class);
};
return delegate.make(call);
} catch (RemoteException e) {
log.error("Unexpected error ", e);
throw e;
} catch (Exception e) {
log.error("Unexpected error ", e);
throw new RemoteException("Unexpected Error", e);
}
}
}

View File

@ -1,9 +1,15 @@
package org.gcube.application.geoportal.client;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.Iterator;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.configuration.Configuration;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
@ -14,14 +20,11 @@ import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.common.clients.Call;
import org.gcube.common.clients.delegates.ProxyDelegate;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.Iterator;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@RequiredArgsConstructor
@Slf4j

View File

@ -1,13 +1,13 @@
package org.gcube.application.geoportal.client;
import java.util.Iterator;
import org.gcube.application.geoportal.common.model.configuration.Configuration;
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.QueryRequest;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import java.util.Iterator;
public class DefaultProfiledConcessioni implements MongoConcessioni {

View File

@ -1,9 +1,10 @@
package org.gcube.application.geoportal.client;
import lombok.extern.slf4j.Slf4j;
import javax.ws.rs.core.Response;
import org.gcube.application.geoportal.client.utils.Serialization;
import javax.ws.rs.core.Response;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ResponseCommons {

View File

@ -1,8 +1,12 @@
package org.gcube.application.geoportal.client;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.rmi.RemoteException;
import java.util.Iterator;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.bson.Document;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
@ -11,11 +15,9 @@ import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.rest.UseCaseDescriptorsI;
import org.gcube.common.clients.delegates.ProxyDelegate;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import java.rmi.RemoteException;
import java.util.Iterator;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@RequiredArgsConstructor
@Slf4j

View File

@ -1,5 +1,14 @@
package org.gcube.application.geoportal.client.legacy;
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.concessioni;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
@ -7,15 +16,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.concessioni;
@Slf4j
public class ConcessioniManager{

View File

@ -1,6 +1,11 @@
package org.gcube.application.geoportal.client.legacy;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.legacy.AbstractRelazione;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
import org.gcube.application.geoportal.common.model.rest.TempFile;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;

View File

@ -1,5 +1,10 @@
package org.gcube.application.geoportal.client.legacy;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
import org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
@ -9,11 +14,6 @@ import org.gcube.common.clients.config.ProxyConfig;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.w3c.dom.Node;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
public class ConcessioniPlugin extends GeoportalAbstractPlugin<WebTarget, ConcessioniI>{

View File

@ -1,15 +1,16 @@
package org.gcube.application.geoportal.client.legacy;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import org.gcube.common.clients.Call;
import org.gcube.common.clients.delegates.ProxyDelegate;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import org.gcube.common.clients.Call;
import org.gcube.common.clients.delegates.ProxyDelegate;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class DefaultConcessioni implements ConcessioniI{

View File

@ -1,5 +1,10 @@
package org.gcube.application.geoportal.client.legacy;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
import org.gcube.application.geoportal.client.DefaultMongoConcessioni;
import org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
@ -10,11 +15,6 @@ import org.gcube.common.clients.config.ProxyConfig;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.w3c.dom.Node;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
public class MongoConcessioniPlugin extends GeoportalAbstractPlugin<WebTarget, MongoConcessioni>{

View File

@ -1,19 +1,26 @@
package org.gcube.application.geoportal.client.legacy;
import lombok.Getter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import javax.ws.rs.client.WebTarget;
import org.gcube.application.geoportal.client.DefaultMongoConcessioni;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.legacy.AbstractRelazione;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
import org.gcube.application.geoportal.common.model.rest.TempFile;
import org.gcube.application.geoportal.common.utils.FileSets;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.gcube.common.clients.delegates.ProxyDelegate;
import javax.ws.rs.client.WebTarget;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import lombok.Getter;
public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements ConcessioniManagerI{

View File

@ -1,5 +1,10 @@
package org.gcube.application.geoportal.client.legacy;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
import org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.common.calls.jaxrs.GcubeService;
@ -8,11 +13,6 @@ import org.gcube.common.clients.config.ProxyConfig;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.w3c.dom.Node;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
public class StatefulMongoConcessioniPlugin extends GeoportalAbstractPlugin<WebTarget, ConcessioniManagerI>{

View File

@ -1,18 +1,23 @@
package org.gcube.application.geoportal.client.plugins;
import lombok.AllArgsConstructor;
import javax.ws.rs.client.WebTarget;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.legacy.ConcessioniPlugin;
import org.gcube.application.geoportal.client.legacy.MongoConcessioniPlugin;
import org.gcube.application.geoportal.client.legacy.StatefulMongoConcessioniPlugin;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.rest.*;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportal.common.rest.Projects;
import org.gcube.application.geoportal.common.rest.UseCaseDescriptorsI;
import org.gcube.common.clients.Plugin;
import org.gcube.common.clients.ProxyBuilder;
import org.gcube.common.clients.ProxyBuilderImpl;
import org.gcube.common.clients.config.ProxyConfig;
import javax.ws.rs.client.WebTarget;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public abstract class GeoportalAbstractPlugin <S, P> implements Plugin<S, P>{

View File

@ -1,11 +1,10 @@
package org.gcube.application.geoportal.client.plugins;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
import org.gcube.application.geoportal.client.DefaultDocumentsClient;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.document.Project;
@ -17,10 +16,13 @@ import org.gcube.common.clients.config.ProxyConfig;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.w3c.dom.Node;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor

View File

@ -1,5 +1,10 @@
package org.gcube.application.geoportal.client.plugins;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
import org.gcube.application.geoportal.client.UseCaseDescriptors;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.rest.UseCaseDescriptorsI;
@ -9,11 +14,6 @@ import org.gcube.common.clients.config.ProxyConfig;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.w3c.dom.Node;
import javax.ws.rs.client.WebTarget;
import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.EndpointReference;
public class UCDPlugin extends GeoportalAbstractPlugin<WebTarget, UseCaseDescriptorsI>{
@Override

View File

@ -1,15 +1,22 @@
package org.gcube.application.geoportal.client.utils;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import org.gcube.application.geoportal.common.model.legacy.AbstractRelazione;
import org.gcube.application.geoportal.common.model.legacy.AssociatedContent;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.model.legacy.PersistedContent;
import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ConcessioniUtils {

View File

@ -1,15 +1,15 @@
package org.gcube.application.geoportal.client.utils;
import org.apache.commons.io.IOUtils;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.utils.Files;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import org.apache.commons.io.IOUtils;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.utils.Files;
public class Queries {

View File

@ -1,20 +1,27 @@
package org.gcube.application.geoportal.client.utils;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.vdurmont.semver4j.Semver;
import org.bson.Document;
import org.bson.types.ObjectId;
import java.io.IOException;
import java.io.InputStream;
import java.time.format.DateTimeFormatter;
import java.util.Iterator;
import org.bson.Document;
import org.bson.types.ObjectId;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.vdurmont.semver4j.Semver;
public class Serialization {
public static final DateTimeFormatter FULL_FORMATTER=DateTimeFormatter.ofPattern("uuuuMMdd_HH-mm-ss");

View File

@ -1,5 +1,8 @@
# Changelog for org.gcube.application.geoportal-common
## [v1.0.12-SNAPSHOT] - 2023-04-18
- Integrated the PATCH method [#24985]
## [v1.0.11] - 2023-01-10
- Pom updates

View File

@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>geoportal-common</artifactId>
<version>1.0.11</version>
<version>1.0.12-SNAPSHOT</version>
<name>Geoportal Common</name>

View File

@ -1,19 +1,25 @@
package org.gcube.application.geoportal.common.model;
import com.jayway.jsonpath.*;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.JSONSerializationProvider;
import org.reflections.Reflections;
import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.gcube.application.geoportal.common.JSONSerializationProvider;
import org.reflections.Reflections;
import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder;
import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.Option;
import com.jayway.jsonpath.TypeRef;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class JSONPathWrapper {

View File

@ -1,8 +1,9 @@
package org.gcube.application.geoportal.common.model.configuration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Archive extends Document {
public static final String TYPE = "_type";

View File

@ -1,16 +1,18 @@
package org.gcube.application.geoportal.common.model.configuration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.xml.bind.annotation.XmlRootElement;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@XmlRootElement
@Data
@AllArgsConstructor

View File

@ -1,8 +1,9 @@
package org.gcube.application.geoportal.common.model.configuration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Index extends Document {
public static class KnownTypes{

View File

@ -1,10 +1,10 @@
package org.gcube.application.geoportal.common.model.configuration;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class MongoConnection {

View File

@ -1,9 +1,15 @@
package org.gcube.application.geoportal.common.model.document;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import org.gcube.application.geoportal.common.model.document.accounting.AccountingInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor
@Getter

View File

@ -1,21 +1,27 @@
package org.gcube.application.geoportal.common.model.document;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.vdurmont.semver4j.Semver;
import lombok.*;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.accounting.PublicationInfo;
import org.gcube.application.geoportal.common.model.document.identification.IdentificationReference;
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
import org.gcube.application.geoportal.common.model.document.relationships.Relationship;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.accounting.PublicationInfo;
import org.gcube.application.geoportal.common.model.document.identification.IdentificationReference;
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
import org.gcube.application.geoportal.common.model.document.relationships.Relationship;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.vdurmont.semver4j.Semver;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,7 +1,12 @@
package org.gcube.application.geoportal.common.model.document.access;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,10 +1,15 @@
package org.gcube.application.geoportal.common.model.document.accounting;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor
@Getter

View File

@ -1,7 +1,12 @@
package org.gcube.application.geoportal.common.model.document.accounting;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,9 +1,15 @@
package org.gcube.application.geoportal.common.model.document.accounting;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import org.gcube.application.geoportal.common.model.document.access.Access;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor
@Getter

View File

@ -1,12 +1,17 @@
package org.gcube.application.geoportal.common.model.document.accounting;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor
@Getter

View File

@ -1,9 +1,11 @@
package org.gcube.application.geoportal.common.model.document.filesets;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.ToString;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.ToString;
@ToString (callSuper = true)
public class Materialization extends Document {

View File

@ -1,6 +1,7 @@
package org.gcube.application.geoportal.common.model.document.filesets;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data

View File

@ -1,10 +1,12 @@
package org.gcube.application.geoportal.common.model.document.filesets;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.ToString;
import java.util.List;
import org.bson.Document;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.ToString;
@ToString (callSuper = true)

View File

@ -1,14 +1,16 @@
package org.gcube.application.geoportal.common.model.document.filesets.sdi;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.filesets.Materialization;
import java.util.List;
import java.util.Map;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.filesets.Materialization;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
public class GCubeSDILayer extends Materialization {
@Data

View File

@ -1,10 +1,10 @@
package org.gcube.application.geoportal.common.model.document.filesets.sdi;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class GeoServerPlatform extends PlatformInfo{

View File

@ -1,8 +1,9 @@
package org.gcube.application.geoportal.common.model.document.filesets.sdi;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class PlatformInfo extends Document {

View File

@ -1,9 +1,11 @@
package org.gcube.application.geoportal.common.model.document.identification;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.bson.Document;
@ToString(callSuper = true)
@NoArgsConstructor

View File

@ -1,6 +1,7 @@
package org.gcube.application.geoportal.common.model.document.identification;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.NoArgsConstructor;
import lombok.ToString;

View File

@ -1,12 +1,13 @@
package org.gcube.application.geoportal.common.model.document.lifecycle;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class LifecycleInformation {

View File

@ -1,10 +1,10 @@
package org.gcube.application.geoportal.common.model.document.lifecycle;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class TriggeredEvents {

View File

@ -1,7 +1,12 @@
package org.gcube.application.geoportal.common.model.document.relationships;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,10 +1,17 @@
package org.gcube.application.geoportal.common.model.document.relationships;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.util.List;
import org.gcube.application.geoportal.common.model.document.Project;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,16 +1,18 @@
package org.gcube.application.geoportal.common.model.legacy;
import lombok.Getter;
import lombok.Setter;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter

View File

@ -1,9 +1,14 @@
package org.gcube.application.geoportal.common.model.legacy;
import lombok.*;
import java.io.Serializable;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
@RequiredArgsConstructor
@Getter
@NoArgsConstructor

View File

@ -1,8 +1,12 @@
package org.gcube.application.geoportal.common.model.legacy;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
import org.gcube.application.geoportal.common.model.legacy.report.Check;
import org.gcube.application.geoportal.common.model.legacy.report.ConstraintCheck;
@ -10,11 +14,9 @@ import org.gcube.application.geoportal.common.model.legacy.report.ValidationRepo
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import javax.xml.bind.annotation.XmlRootElement;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter

View File

@ -1,13 +1,13 @@
package org.gcube.application.geoportal.common.model.legacy;
import java.util.ArrayList;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@ToString(callSuper=true)

View File

@ -1,12 +1,12 @@
package org.gcube.application.geoportal.common.model.legacy;
import java.io.InputStream;
import lombok.Data;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import java.io.InputStream;
@Data
@Getter
@Setter

View File

@ -1,11 +1,12 @@
package org.gcube.application.geoportal.common.model.legacy;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter

View File

@ -3,6 +3,7 @@ package org.gcube.application.geoportal.common.model.legacy;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

View File

@ -1,13 +1,14 @@
package org.gcube.application.geoportal.common.model.legacy;
import java.time.LocalDateTime;
import org.gcube.application.geoportal.common.model.legacy.report.ConstraintCheck;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.gcube.application.geoportal.common.model.legacy.report.ConstraintCheck;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import java.time.LocalDateTime;
@Getter
@Setter

View File

@ -1,12 +1,13 @@
package org.gcube.application.geoportal.common.model.legacy;
import java.util.List;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import java.util.List;
@Getter
@Setter

View File

@ -1,11 +1,12 @@
package org.gcube.application.geoportal.common.model.legacy;
import java.util.List;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
import java.util.List;
@Getter
@Setter

View File

@ -1,13 +1,13 @@
package org.gcube.application.geoportal.common.model.legacy.report;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@Getter
@Setter
@Slf4j

View File

@ -1,12 +1,14 @@
package org.gcube.application.geoportal.common.model.legacy.report;
import lombok.Getter;
import lombok.Setter;
import org.gcube.application.geoportal.common.model.legacy.Record;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import java.io.Serializable;
import org.gcube.application.geoportal.common.model.legacy.Record;
import lombok.Getter;
import lombok.Setter;
@XmlAccessorType(XmlAccessType.NONE)
public class PublicationReport extends ValidationReport implements Serializable{

View File

@ -1,12 +1,12 @@
package org.gcube.application.geoportal.common.model.legacy.report;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class ValidationReport implements Serializable{

View File

@ -1,13 +1,14 @@
package org.gcube.application.geoportal.common.model.plugins;
import java.util.Map;
import javax.xml.bind.annotation.XmlRootElement;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Map;
@Data
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,13 +1,15 @@
package org.gcube.application.geoportal.common.model.plugins;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlRootElement;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import java.util.Map;
@Data

View File

@ -1,12 +1,13 @@
package org.gcube.application.geoportal.common.model.plugins;
import javax.xml.bind.annotation.XmlRootElement;
import com.vdurmont.semver4j.Semver;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.xml.bind.annotation.XmlRootElement;
@Data
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,14 +1,16 @@
package org.gcube.application.geoportal.common.model.rest;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import org.bson.Document;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@XmlRootElement
@Data

View File

@ -1,9 +1,10 @@
package org.gcube.application.geoportal.common.model.rest;
import lombok.Data;
import java.util.List;
import org.bson.Document;
import java.util.List;
import lombok.Data;
@Data
public class QueryRequest {

View File

@ -1,14 +1,16 @@
package org.gcube.application.geoportal.common.model.rest;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import org.bson.Document;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
import org.gcube.application.geoportal.common.model.document.access.Access;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@XmlRootElement
@Data

View File

@ -1,11 +1,12 @@
package org.gcube.application.geoportal.common.model.rest;
import javax.xml.bind.annotation.XmlRootElement;
import org.bson.Document;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.Document;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@Data

View File

@ -1,9 +1,10 @@
package org.gcube.application.geoportal.common.model.rest;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
@Data
@NoArgsConstructor

View File

@ -1,13 +1,19 @@
package org.gcube.application.geoportal.common.model.useCaseDescriptor;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.util.List;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.model.document.accounting.User;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor

View File

@ -1,14 +1,17 @@
package org.gcube.application.geoportal.common.model.useCaseDescriptor;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.bson.Document;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
@XmlRootElement
@AllArgsConstructor

View File

@ -1,9 +1,11 @@
package org.gcube.application.geoportal.common.model.useCaseDescriptor;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.bson.Document;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class HandlerDeclaration {

View File

@ -1,11 +1,9 @@
package org.gcube.application.geoportal.common.model.useCaseDescriptor;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import javax.xml.bind.annotation.XmlRootElement;
@Data
@NoArgsConstructor

View File

@ -1,16 +1,5 @@
package org.gcube.application.geoportal.common.model.useCaseDescriptor;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.vdurmont.semver4j.Semver;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.bson.types.ObjectId;
import org.gcube.application.geoportal.common.model.document.accounting.AccountingInfo;
import org.gcube.application.geoportal.common.model.document.accounting.User;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
@ -18,6 +7,20 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.xml.bind.annotation.XmlRootElement;
import org.bson.types.ObjectId;
import org.gcube.application.geoportal.common.model.document.accounting.AccountingInfo;
import org.gcube.application.geoportal.common.model.document.accounting.User;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.vdurmont.semver4j.Semver;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Data
@NoArgsConstructor
@XmlRootElement

View File

@ -40,11 +40,14 @@ public class InterfaceConstants {
public static final String UCID ="usecase_id";
public static final String FORCE="force";
public static final String IGNORE_ERRORS="ignore_errors";
public static final String RELATIONSHIP_ID="relationship_id";
public static final String DEEP="deep";
public static final String TARGET_UCD="target_ucd";
public static final String TARGET_ID="target_id";
public static final String PATH="path";
}

View File

@ -1,12 +1,12 @@
package org.gcube.application.geoportal.common.rest;
import java.util.Iterator;
import org.gcube.application.geoportal.common.model.configuration.Configuration;
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.QueryRequest;
import java.util.Iterator;
public interface MongoConcessioni {
public Concessione createNew(Concessione c) throws Exception;

View File

@ -1,15 +1,19 @@
package org.gcube.application.geoportal.common.rest;
import java.rmi.RemoteException;
import java.util.Iterator;
import org.bson.Document;
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
import org.gcube.application.geoportal.common.model.configuration.Configuration;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.model.document.access.Access;
import org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject;
import org.gcube.application.geoportal.common.model.rest.*;
import java.rmi.RemoteException;
import java.util.Iterator;
import org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest;
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
public interface Projects<P extends Project> {
@ -21,6 +25,8 @@ public interface Projects<P extends Project> {
public P updateDocument(String id,Document updatedDocument) throws RemoteException;
public void deleteById(String id) throws RemoteException;
public void deleteById(String id,Boolean force) throws RemoteException;
public P patchDocument(String id, String path, Document updatedDocument) throws RemoteException;
@ -38,7 +44,7 @@ public interface Projects<P extends Project> {
//FileSets
public P registerFileSet(String id, RegisterFileSetRequest req) throws RemoteException, InvalidRequestException;
//FileSets
public P deleteFileSet(String id, String path, Boolean force) throws RemoteException;
public P deleteFileSet(String id, String path, Boolean force, Boolean ignore_errors) throws RemoteException;
public P forceUnlock(String id) throws RemoteException;
public P setAccessPolicy(String id, Access toSet) throws RemoteException;
@ -51,4 +57,6 @@ public interface Projects<P extends Project> {
public Iterator<RelationshipNavigationObject> getRelationshipChain(String id, String relationId, Boolean deep) throws RemoteException;
public Iterator<RelationshipNavigationObject> getRelationshipChain(String id, String relationId) throws RemoteException;
}

View File

@ -1,12 +1,12 @@
package org.gcube.application.geoportal.common.rest;
import java.rmi.RemoteException;
import java.util.Iterator;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import java.rmi.RemoteException;
import java.util.Iterator;
public interface UseCaseDescriptorsI {

View File

@ -1,11 +1,11 @@
package org.gcube.application.geoportal.common.utils;
import lombok.extern.slf4j.Slf4j;
import static org.gcube.common.authorization.client.Constants.authorizationService;
import org.gcube.common.authorization.library.AuthorizationEntry;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
import static org.gcube.common.authorization.client.Constants.authorizationService;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Deprecated

View File

@ -1,5 +1,11 @@
package org.gcube.application.geoportal.common.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collection;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.access.Access;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
@ -7,12 +13,6 @@ import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.model.rest.TempFile;
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collection;
public class FileSets {
public static class RequestBuilder {

View File

@ -1,17 +1,23 @@
package org.gcube.application.geoportal.common.utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.xml.sax.InputSource;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.CopyOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class Files {

View File

@ -1,6 +1,11 @@
package org.gcube.application.geoportal.common.utils;
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
import java.util.List;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
import org.gcube.common.encryption.encrypter.StringEncrypter;
@ -13,11 +18,6 @@ import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
import java.util.List;
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
public class ISUtils {

View File

@ -1,6 +1,14 @@
package org.gcube.application.geoportal.common.utils;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.UUID;
import org.gcube.application.geoportal.common.faults.StorageException;
import org.gcube.application.geoportal.common.model.rest.TempFile;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
@ -10,10 +18,7 @@ import org.gcube.contentmanager.storageclient.wrapper.AccessType;
import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class StorageUtils {

View File

@ -13,10 +13,10 @@ public class GCubeTest {
// InterfaceConstants.SERVICE_CLASS="Application";
// InterfaceConstants.SERVICE_NAME="GeoPortal";
testContext = "/pred4s/preprod/preVRE";
testContext = "/pred4s/preprod/preVRE_ext";
//testContext = "/pred4s/preprod/preVRE";
//testContext = "/pred4s/preprod/preVRE_ext";
// testContext = "/d4science.research-infrastructures.eu/D4OS/GNA";
// testContext= "/gcube/devsec/devVRE";
testContext= "/gcube/devsec/devVRE";
System.out.println("TEST CONTEXT = " + testContext);
return testContext;

View File

@ -1,5 +1,9 @@
# Changelog for org.gcube.application.geoportal-service
## [v1.1.0-SNAPSHOT]
- Implemented the PATCH method, see [#24985]
## [v1.0.14]
- Just integrating the new facilities, see [#24791]

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-service</artifactId>
<version>1.0.14</version>
<version>1.1.0-SNAPSHOT</version>
<name>Geoportal Service</name>
<packaging>war</packaging>
@ -19,6 +19,9 @@
<sis.version>1.0</sis.version>
<enunciate.version>2.14.0</enunciate.version>
<webappDirectory>${project.basedir}${file.separator}${project.artifactId}${file.separator}src${file.separator}main${file.separator}webapp${file.separator}WEB-INF</webappDirectory>
<!-- Enabled them for testing with JAVA 8 -->
<!-- <maven.compiler.source>1.8</maven.compiler.source> -->
<!-- <maven.compiler.target>1.8</maven.compiler.target> -->
</properties>
<scm>
@ -143,6 +146,37 @@
<scope>test</scope>
</dependency>
<!-- TEST with JDK1.8
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<scope>test</scope>
</dependency>
-->
<!-- Plugins related tests -->
<dependency>

View File

@ -1,7 +1,10 @@
package org.gcube.application.geoportal.service;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import lombok.extern.slf4j.Slf4j;
import java.util.Collections;
import java.util.Map;
import javax.ws.rs.ApplicationPath;
import org.gcube.application.cms.caches.Engine;
import org.gcube.application.cms.implementations.ImplementationProvider;
import org.gcube.application.cms.implementations.ProjectAccess;
@ -9,20 +12,23 @@ import org.gcube.application.cms.serialization.Serialization;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.gcube.application.geoportal.service.engine.mongo.UCDManagerI;
import org.gcube.application.geoportal.service.engine.providers.*;
import org.gcube.application.geoportal.service.engine.providers.ConfigurationCache;
import org.gcube.application.geoportal.service.engine.providers.MongoClientProvider;
import org.gcube.application.geoportal.service.engine.providers.PluginManager;
import org.gcube.application.geoportal.service.engine.providers.ProjectAccessProvider;
import org.gcube.application.geoportal.service.engine.providers.StorageClientProvider;
import org.gcube.application.geoportal.service.engine.providers.ucd.ProfileMap;
import org.gcube.application.geoportal.service.engine.providers.ucd.SingleISResourceUCDProvider;
import org.gcube.application.geoportal.service.engine.providers.ucd.UCDManager;
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
import org.gcube.application.geoportal.service.rest.DocsGenerator;
import org.gcube.application.geoportal.service.rest.Plugins;
import org.gcube.application.geoportal.service.rest.ProfiledDocuments;
import org.gcube.application.geoportal.service.rest.UseCaseDescriptors;
import org.glassfish.jersey.server.ResourceConfig;
import javax.ws.rs.ApplicationPath;
import java.util.Collections;
import java.util.Map;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import lombok.extern.slf4j.Slf4j;
@ApplicationPath(InterfaceConstants.APPLICATION_PATH)
@Slf4j

View File

@ -1,6 +1,14 @@
package org.gcube.application.geoportal.service;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.container.PreMatching;
import javax.ws.rs.ext.Provider;
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.authorization.utils.manager.SecretManager;
@ -9,9 +17,7 @@ import org.gcube.common.authorization.utils.secret.GCubeSecret;
import org.gcube.common.authorization.utils.secret.JWTSecret;
import org.gcube.common.authorization.utils.secret.Secret;
import javax.ws.rs.container.*;
import javax.ws.rs.ext.Provider;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
@Provider
@PreMatching

View File

@ -1,12 +1,10 @@
package org.gcube.application.geoportal.service.engine.mongo;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.FindOneAndReplaceOptions;
import com.mongodb.client.model.FindOneAndUpdateOptions;
import com.mongodb.client.model.ReturnDocument;
import lombok.extern.slf4j.Slf4j;
import static com.mongodb.client.model.Filters.eq;
import static com.mongodb.client.model.Sorts.ascending;
import static com.mongodb.client.model.Sorts.descending;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.gcube.application.cms.implementations.ImplementationProvider;
@ -14,9 +12,12 @@ import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
import static com.mongodb.client.model.Filters.eq;
import static com.mongodb.client.model.Sorts.ascending;
import static com.mongodb.client.model.Sorts.descending;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.FindOneAndReplaceOptions;
import com.mongodb.client.model.ReturnDocument;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class MongoManager {

View File

@ -1,8 +1,15 @@
package org.gcube.application.geoportal.service.engine.mongo;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import org.bson.Document;
import org.gcube.application.cms.implementations.faults.*;
import org.gcube.application.cms.implementations.faults.DeletionException;
import org.gcube.application.cms.implementations.faults.InvalidLockException;
import org.gcube.application.cms.implementations.faults.InvalidUserRoleException;
import org.gcube.application.cms.implementations.faults.ProjectLockedException;
import org.gcube.application.cms.implementations.faults.ProjectNotFoundException;
import org.gcube.application.cms.implementations.faults.RegistrationException;
import org.gcube.application.cms.implementations.faults.UnauthorizedAccess;
import org.gcube.application.cms.plugins.faults.EventException;
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
import org.gcube.application.cms.plugins.faults.StepException;
@ -14,44 +21,280 @@ import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* The Interface MongoManagerI.
*
* @author Fabio Sinibaldi
* @author maintainer: Francesco Mangiacrapa at ISTI-CNR
* francesco.mangiacrapa@isti.cnr.it
*
* Apr 18, 2023
* @param <T> the generic type
*/
public interface MongoManagerI<T> {
// create
// create
/**
* Register new.
*
* @param toRegister the to register
* @return the t
* @throws IOException Signals that an I/O exception has occurred.
* @throws StepException the step exception
* @throws EventException the event exception
* @throws InvalidUserRoleException the invalid user role exception
*/
public T registerNew(Document toRegister)
throws IOException, StepException, EventException, InvalidUserRoleException;
public T registerNew(Document toRegister) throws IOException, StepException, EventException, InvalidUserRoleException;
/**
* Update.
*
* @param id the id
* @param toSetDocument the to set document
* @return the t
* @throws IOException Signals that an I/O exception has occurred.
* @throws StepException the step exception
* @throws EventException the event exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
*/
// update
public T update(String id, Document toSetDocument)
throws IOException, StepException, EventException, ProjectLockedException, ProjectNotFoundException,
InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
// update
public T update(String id,Document toSetDocument) throws IOException, StepException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
/**
* Patch.
*
* @param id the id
* @param toSet the to set
* @return the t
* @throws IOException Signals that an I/O exception has occurred.
* @throws EventException the event exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
*/
// patch
public T patch(String id, Document toSet) throws IOException, EventException, ProjectLockedException,
ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
public T setRelation(String id,String relation, String targetUCD, String targetId) throws IOException, StepException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess, RegistrationException, ConfigurationException;
public T deleteRelation(String id,String relation, String targetUCD, String targetId) throws IOException, StepException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess, RegistrationException, ConfigurationException;
/**
* Sets the relation.
*
* @param id the id
* @param relation the relation
* @param targetUCD the target UCD
* @param targetId the target id
* @return the t
* @throws IOException Signals that an I/O exception has occurred.
* @throws StepException the step exception
* @throws EventException the event exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
* @throws RegistrationException the registration exception
* @throws ConfigurationException the configuration exception
*/
public T setRelation(String id, String relation, String targetUCD, String targetId) throws IOException,
StepException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException,
InvalidUserRoleException, UnauthorizedAccess, RegistrationException, ConfigurationException;
/**
* Delete relation.
*
* @param id the id
* @param relation the relation
* @param targetUCD the target UCD
* @param targetId the target id
* @return the t
* @throws IOException Signals that an I/O exception has occurred.
* @throws StepException the step exception
* @throws EventException the event exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
* @throws RegistrationException the registration exception
* @throws ConfigurationException the configuration exception
*/
public T deleteRelation(String id, String relation, String targetUCD, String targetId) throws IOException,
StepException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException,
InvalidUserRoleException, UnauthorizedAccess, RegistrationException, ConfigurationException;
// delete
// delete
/**
* Delete.
*
* @param id the id
* @param force the force
* @throws DeletionException the deletion exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws UnauthorizedAccess the unauthorized access
* @throws JsonProcessingException the json processing exception
* @throws InvalidLockException the invalid lock exception
*/
public void delete(String id, boolean force)
throws DeletionException, InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException,
UnauthorizedAccess, JsonProcessingException, InvalidLockException;
public void delete(String id,boolean force) throws DeletionException, InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException, UnauthorizedAccess, JsonProcessingException, InvalidLockException;
// get By ID
// get By ID
/**
* Gets the by ID.
*
* @param id the id
* @return the by ID
* @throws IOException Signals that an I/O exception has occurred.
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
*/
public T getByID(String id)
throws IOException, ProjectNotFoundException, InvalidUserRoleException, UnauthorizedAccess;
public T getByID(String id) throws IOException, ProjectNotFoundException, InvalidUserRoleException, UnauthorizedAccess;
// query
// query
/**
* Query.
*
* @param request the request
* @return the iterable
* @throws InvalidUserRoleException the invalid user role exception
*/
public Iterable<Document> query(QueryRequest request) throws InvalidUserRoleException;
public Iterable<Document> query(QueryRequest request) throws InvalidUserRoleException;
public Iterable<T> filter(QueryRequest request) throws InvalidUserRoleException;
/**
* Filter.
*
* @param request the request
* @return the iterable
* @throws InvalidUserRoleException the invalid user role exception
*/
public Iterable<T> filter(QueryRequest request) throws InvalidUserRoleException;
public T performStep(String id, String step, Document options) throws IOException, StepException, ProjectLockedException, ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess, ConfigurationException, InsufficientPrivileges;
/**
* Perform step.
*
* @param id the id
* @param step the step
* @param options the options
* @return the t
* @throws IOException Signals that an I/O exception has occurred.
* @throws StepException the step exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
* @throws ConfigurationException the configuration exception
* @throws InsufficientPrivileges the insufficient privileges
*/
public T performStep(String id, String step, Document options)
throws IOException, StepException, ProjectLockedException, ProjectNotFoundException, InvalidLockException,
InvalidUserRoleException, UnauthorizedAccess, ConfigurationException, InsufficientPrivileges;
public T registerFileSet(String id, RegisterFileSetRequest request) throws ConfigurationException, StorageHubException, StorageException, StepException, JsonProcessingException, DeletionException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
public T deleteFileSet(String id, String destination, Boolean force) throws ConfigurationException, StorageHubException, StorageException, StepException, JsonProcessingException, DeletionException, EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
/**
* Register file set.
*
* @param id the id
* @param request the request
* @return the t
* @throws ConfigurationException the configuration exception
* @throws StorageHubException the storage hub exception
* @throws StorageException the storage exception
* @throws StepException the step exception
* @throws JsonProcessingException the json processing exception
* @throws DeletionException the deletion exception
* @throws EventException the event exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
*/
public T registerFileSet(String id, RegisterFileSetRequest request)
throws ConfigurationException, StorageHubException, StorageException, StepException,
JsonProcessingException, DeletionException, EventException, ProjectLockedException,
ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
public T forceUnlock(String id) throws InvalidUserRoleException, ProjectNotFoundException, UnauthorizedAccess, JsonProcessingException, InvalidLockException;
public T setAccessPolicy(String id, Access access) throws InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException, UnauthorizedAccess, JsonProcessingException, InvalidLockException, EventException;
/**
* Delete file set.
*
* @param id the id
* @param destination the destination
* @param force the force
* @param ignore_errors the ignore errors
* @return the t
* @throws ConfigurationException the configuration exception
* @throws StorageHubException the storage hub exception
* @throws StorageException the storage exception
* @throws StepException the step exception
* @throws JsonProcessingException the json processing exception
* @throws DeletionException the deletion exception
* @throws EventException the event exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws InvalidLockException the invalid lock exception
* @throws InvalidUserRoleException the invalid user role exception
* @throws UnauthorizedAccess the unauthorized access
*/
public T deleteFileSet(String id, String path, Boolean force, Boolean ignore_errors) throws ConfigurationException,
StorageHubException, JsonProcessingException, DeletionException, EventException, ProjectLockedException,
ProjectNotFoundException, InvalidLockException, InvalidUserRoleException, UnauthorizedAccess;
/**
* Force unlock.
*
* @param id the id
* @return the t
* @throws InvalidUserRoleException the invalid user role exception
* @throws ProjectNotFoundException the project not found exception
* @throws UnauthorizedAccess the unauthorized access
* @throws JsonProcessingException the json processing exception
* @throws InvalidLockException the invalid lock exception
*/
public T forceUnlock(String id) throws InvalidUserRoleException, ProjectNotFoundException, UnauthorizedAccess,
JsonProcessingException, InvalidLockException;
/**
* Sets the access policy.
*
* @param id the id
* @param access the access
* @return the t
* @throws InvalidUserRoleException the invalid user role exception
* @throws ProjectLockedException the project locked exception
* @throws ProjectNotFoundException the project not found exception
* @throws UnauthorizedAccess the unauthorized access
* @throws JsonProcessingException the json processing exception
* @throws InvalidLockException the invalid lock exception
* @throws EventException the event exception
*/
public T setAccessPolicy(String id, Access access) throws InvalidUserRoleException, ProjectLockedException,
ProjectNotFoundException, UnauthorizedAccess, JsonProcessingException, InvalidLockException, EventException;
/**
* Gets the configuration.
*
* @return the configuration
* @throws ConfigurationException the configuration exception
*/
public Configuration getConfiguration() throws ConfigurationException;
public Configuration getConfiguration()throws ConfigurationException;
}

View File

@ -1,9 +1,9 @@
package org.gcube.application.geoportal.service.engine.mongo;
import org.gcube.application.cms.implementations.faults.RegistrationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import org.gcube.application.cms.implementations.faults.RegistrationException;
public interface UCDManagerI {

View File

@ -1,24 +1,26 @@
package org.gcube.application.geoportal.service.engine.mongo;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.mongodb.client.FindIterable;
import com.mongodb.client.model.FindOneAndReplaceOptions;
import com.mongodb.client.model.ReturnDocument;
import lombok.extern.slf4j.Slf4j;
import java.util.NoSuchElementException;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Consumer;
import javax.ws.rs.WebApplicationException;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.gcube.application.cms.implementations.faults.RegistrationException;
import org.gcube.application.cms.implementations.utils.UserUtils;
import org.gcube.application.cms.serialization.Serialization;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import org.gcube.application.geoportal.common.utils.ContextUtils;
import org.gcube.application.cms.implementations.faults.RegistrationException;
import javax.ws.rs.WebApplicationException;
import java.util.NoSuchElementException;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Consumer;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.mongodb.client.FindIterable;
import com.mongodb.client.model.FindOneAndReplaceOptions;
import com.mongodb.client.model.ReturnDocument;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class UCDMongoManager extends MongoManager implements UCDManagerI{

View File

@ -1,7 +1,9 @@
package org.gcube.application.geoportal.service.engine.providers;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAmount;
import org.gcube.application.cms.caches.AbstractScopedMap;
import org.gcube.application.cms.caches.TimedMap;
import org.gcube.application.cms.implementations.utils.UserUtils;
@ -9,10 +11,8 @@ import org.gcube.application.geoportal.common.model.configuration.Configuration;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.service.engine.mongo.ProfiledMongoManager;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAmount;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ConfigurationCache extends AbstractScopedMap<ConfigurationCache.ConfigurationMap> {

View File

@ -1,6 +1,8 @@
package org.gcube.application.geoportal.service.engine.providers;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.Map;
import org.gcube.application.cms.caches.AbstractScopedMap;
import org.gcube.application.cms.implementations.ISInterface;
import org.gcube.application.cms.implementations.ImplementationProvider;
@ -10,8 +12,7 @@ import org.gcube.application.geoportal.service.ServiceConstants;
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
import org.gcube.common.resources.gcore.ServiceEndpoint;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class MongoClientProvider extends AbstractScopedMap<Mongo> {

View File

@ -1,16 +1,21 @@
package org.gcube.application.geoportal.service.engine.providers;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.Map;
import org.gcube.application.cms.caches.AbstractScopedMap;
import org.gcube.application.cms.plugins.*;
import org.gcube.application.cms.plugins.InitializablePlugin;
import org.gcube.application.cms.plugins.LifecycleManager;
import org.gcube.application.cms.plugins.Plugin;
import org.gcube.application.cms.plugins.PluginManagerInterface;
import org.gcube.application.cms.plugins.PluginsReflections;
import org.gcube.application.cms.plugins.faults.InitializationException;
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
import org.gcube.application.cms.plugins.faults.ShutDownException;
import org.gcube.application.cms.plugins.reports.InitializationReport;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PluginManager extends AbstractScopedMap<PluginManager.PluginMap> implements PluginManagerInterface {

View File

@ -1,6 +1,8 @@
package org.gcube.application.geoportal.service.engine.providers;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
import org.bson.Document;
import org.gcube.application.cms.implementations.ProjectAccess;
import org.gcube.application.cms.implementations.faults.InvalidUserRoleException;
@ -14,8 +16,7 @@ import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.service.engine.mongo.ProfiledMongoManager;
import java.util.ArrayList;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ProjectAccessImpl implements ProjectAccess {

View File

@ -1,10 +1,11 @@
package org.gcube.application.geoportal.service.engine.providers;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.cms.caches.AbstractScopedMap;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class StorageClientProvider extends AbstractScopedMap<StorageUtils> {

View File

@ -1,16 +1,18 @@
package org.gcube.application.geoportal.service.engine.providers.ucd;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import org.gcube.application.cms.caches.AbstractScopedMap;
import org.gcube.application.cms.serialization.Serialization;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import org.gcube.application.geoportal.common.utils.Files;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class LocalFolderProfileMapCache extends AbstractScopedMap<ProfileMap> {

Some files were not shown because too many files have changed in this diff Show More