renamed StepExecutionRequest to PerformStepRequest
This commit is contained in:
parent
40fb99d477
commit
e8346fa8e3
|
@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StepExecutionRequest {
|
||||
public class PerformStepRequest {
|
||||
|
||||
private String stepID;
|
||||
@XmlAttribute(required = false)
|
|
@ -13,7 +13,7 @@ import org.gcube.application.geoportal.common.model.rest.CreateRelationshipReque
|
|||
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.model.rest.PerformStepRequest;
|
||||
|
||||
public interface Projects<P extends Project> {
|
||||
|
||||
|
@ -39,7 +39,7 @@ public interface Projects<P extends Project> {
|
|||
public String queryForJSON(QueryRequest request)throws RemoteException;
|
||||
|
||||
//Execution
|
||||
public P performStep(String id, StepExecutionRequest request) throws RemoteException;
|
||||
public P performStep(String id, PerformStepRequest request) throws RemoteException;
|
||||
|
||||
//FileSets
|
||||
public P registerFileSet(String id, RegisterFileSetRequest req) throws RemoteException, InvalidRequestException;
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.gcube.application.geoportal.common.model.document.lifecycle.Lifecycle
|
|||
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.rest.RegisterFileSetRequest;
|
||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
||||
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||
import org.gcube.application.geoportal.service.engine.mongo.ProfiledMongoManager;
|
||||
import org.gcube.application.geoportal.service.engine.providers.ConfigurationCache;
|
||||
|
@ -312,20 +312,20 @@ public class ProfiledDocuments {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Path("/" + InterfaceConstants.Methods.STEP + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||
public Project performStep(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||
StepExecutionRequest request) {
|
||||
PerformStepRequest performStepRequest) {
|
||||
Project theProject = new GuardedMethod<Project>() {
|
||||
@Override
|
||||
protected Project run() throws Exception, WebApplicationException {
|
||||
log.info("Executing step {} on Project ({},ID,{}) with options {}", request.getStepID(),
|
||||
manager.getUseCaseDescriptor().getId(), id, request.getOptions());
|
||||
return manager.performStep(id, request.getStepID(), request.getOptions());
|
||||
log.info("Executing step {} on Project ({},ID,{}) with options {}", performStepRequest.getStepID(),
|
||||
manager.getUseCaseDescriptor().getId(), id, performStepRequest.getOptions());
|
||||
return manager.performStep(id, performStepRequest.getStepID(), performStepRequest.getOptions());
|
||||
}
|
||||
}.execute().getResult();
|
||||
|
||||
log.info("Starting event...");
|
||||
|
||||
if(log.isInfoEnabled()) {
|
||||
List<Field> allFields = Arrays.asList(StepExecutionRequest.class.getDeclaredFields());
|
||||
List<Field> allFields = Arrays.asList(PerformStepRequest.class.getDeclaredFields());
|
||||
String fieldsName = allFields.stream().map(e -> e.getName()).collect(Collectors.joining(","));
|
||||
log.info("Fields name: "+fieldsName);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ public class ProfiledDocuments {
|
|||
item.setUserCaller(user.getUser());
|
||||
item.setContext(user.getContext());
|
||||
item.setEvent(event);
|
||||
item.setOptionalMessage(request.getMessage());
|
||||
item.setOptionalMessage(performStepRequest.getMessage());
|
||||
item.setUseCaseDescriptor(manager.getUseCaseDescriptor());
|
||||
item.setProject(theProject);
|
||||
log.info("By notifying event ({}, ID {})", event, item.getProjectId());
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.gcube.application.geoportal.common.model.document.access.Access;
|
|||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||
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.model.rest.PerformStepRequest;
|
||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||
import org.gcube.application.geoportal.common.utils.FileSets;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
|
@ -180,7 +180,7 @@ public abstract class AbstractProfiledDocumentsTests extends BasicServiceTestUni
|
|||
}
|
||||
|
||||
|
||||
protected Project step(String id, StepExecutionRequest request) throws Exception {
|
||||
protected Project step(String id, PerformStepRequest request) throws Exception {
|
||||
Project toReturn= check(baseTarget().
|
||||
path(InterfaceConstants.Methods.STEP).path(id).request(MediaType.APPLICATION_JSON).
|
||||
post(Entity.entity(Serialization.write(request),
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.gcube.application.geoportal.common.model.document.access.Access;
|
|||
import org.gcube.application.geoportal.common.model.document.identification.SpatialReference;
|
||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
||||
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||
|
@ -69,7 +69,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
|||
|
||||
System.out.println("Registered posizionamento, result is "+ Serialization.write(doc));
|
||||
// invoke step SUBMIT-FOR-REVIEW
|
||||
StepExecutionRequest submitReq=new StepExecutionRequest();
|
||||
PerformStepRequest submitReq=new PerformStepRequest();
|
||||
submitReq.setStepID("SUBMIT-FOR-REVIEW");
|
||||
// doc=step(doc.getId(),submitReq);
|
||||
doc=step(doc.getId(),submitReq);
|
||||
|
@ -79,7 +79,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
|||
|
||||
// invoke step Publish
|
||||
|
||||
StepExecutionRequest approveDraftReq=new StepExecutionRequest();
|
||||
PerformStepRequest approveDraftReq=new PerformStepRequest();
|
||||
approveDraftReq.setStepID("APPROVE-SUBMITTED");
|
||||
doc=step(doc.getId(),approveDraftReq);
|
||||
System.out.println(doc);
|
||||
|
@ -137,7 +137,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
|||
assertEquals(doc2.getRelationships().get(0).getTargetUCD(),doc1.getProfileID());
|
||||
assertEquals(doc2.getRelationships().get(0).getRelationshipName(),reverse);
|
||||
|
||||
StepExecutionRequest stepReq = new StepExecutionRequest();
|
||||
PerformStepRequest stepReq = new PerformStepRequest();
|
||||
stepReq.setStepID("SUBMIT-FOR-REVIEW");
|
||||
|
||||
step(doc1.getId(),stepReq);
|
||||
|
|
Loading…
Reference in New Issue