This commit is contained in:
Fabio Sinibaldi 2019-01-04 17:36:04 +00:00
parent 51577389a5
commit eb77600697
5 changed files with 85 additions and 5 deletions

View File

@ -21,4 +21,8 @@ public interface ServiceConstants {
public static final String EXCEL_FILE_PARAMETER="source";
}
public static interface Performance{
public static final String PATH="performance";
}
}

View File

@ -28,6 +28,8 @@ public class ImporterImpl implements Importer {
private static final String ORPHAN_IMPORTS="";
private static final String ACQUIRE_PS="";
private static final String GET_BY_ID="";
private static final String INSERT_ROUTINE="";
private static ISQueryDescriptor isQueryDescriptor=null;
@ -107,10 +109,22 @@ public class ImporterImpl implements Importer {
}
private ComputationId submit(ImportRequest request) {
throw new RuntimeException("IMPLEMENT THIS SHIT");
}
private ImportRoutineDescriptor register(ComputationId computationId,ImportRequest request) {
private ImportRoutineDescriptor register(ComputationId computationId,ImportRequest request) throws SQLException {
ImportRoutineDescriptor toReturn=new ImportRoutineDescriptor();
// SET FIELDS into OBJECT
DataBaseManager db=DataBaseManager.get(getISQueryDescriptor());
Connection conn=db.getConnection();
PreparedStatement ps=conn.prepareStatement(INSERT_ROUTINE);
// set fields
throw new RuntimeException("IMPLEMENT THIS SHIT");
}

View File

@ -17,8 +17,17 @@ import org.gcube.smartgears.annotations.ManagedBy;
@Path(ServiceConstants.Import.PATH)
@ManagedBy(PerformServiceManager.class)
public class Execution {
public class Import {
/**
* Launches DM Import
*
*
* @param batchType
* @param farmid
* @param sourceFile
*/
@POST
public void importExcel(@QueryParam(ServiceConstants.Import.BATCH_TYPE_PARAMETER)String batchType,
@QueryParam(ServiceConstants.Import.FARM_ID_PARAMETER)Long farmid,
@ -28,7 +37,12 @@ public class Execution {
}
/**
* Returns all Import routine per farm id
*
*
* @return
*/
@GET
@Path("{"+ServiceConstants.Import.FARM_ID_PARAMETER+"}")
public List<ImportRoutineDescriptor> getAll(){

View File

@ -33,7 +33,16 @@ public class Mappings {
@Inject
private MappingManager mappings;
/**
* Returns Complete Batch Bean
*
* @param name
* @param type
* @param farmid
* @return
*/
@GET
@Path(ServiceConstants.Mappings.BATCHES_METHOD)
@Produces(MediaType.APPLICATION_JSON)
@ -63,7 +72,13 @@ public class Mappings {
}
/**
* Returns complete FARM Bean
*
* @param farmid
* @param farmuuid
* @return
*/
@GET
@Path(ServiceConstants.Mappings.FARM_METHOD)
@Produces(MediaType.APPLICATION_JSON)

View File

@ -0,0 +1,33 @@
package org.gcube.application.perform.service.rest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import org.gcube.application.perform.service.PerformServiceManager;
import org.gcube.application.perform.service.ServiceConstants;
import org.gcube.smartgears.annotations.ManagedBy;
@Path(ServiceConstants.Import.PATH)
@ManagedBy(PerformServiceManager.class)
public class Performance {
/**
* Creates CSV file representing a dataset with
*
* deanonimized labels
* filter based on selection
*
*
* @return Storage ID (Volatile)
*/
@GET
public String getPerformance(){
throw new WebApplicationException("Not YET Implemented", Response.Status.NOT_IMPLEMENTED);
}
}