git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application/perform-service@176737 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
54b1f808a9
commit
009b4be6a0
|
@ -19,21 +19,12 @@ public class LocalConfiguration {
|
|||
public static final String MAPPING_DB_ENDPOINT_NAME="mapping-db.ep.name";
|
||||
public static final String MAPPING_DB_ENDPOINT_CATEGORY="mapping-db.ep.category";
|
||||
|
||||
//
|
||||
// public static final String PERFORMANCE_DB_ENDPOINT_NAME="performance-db.ep.name";
|
||||
// public static final String PERFORMANCE_DB_ENDPOINT_CATEGORY="performance-db.ep.category";
|
||||
//
|
||||
|
||||
|
||||
public static final String IMPORTER_COMPUTATION_ID="dm.importer.computationid";
|
||||
|
||||
public static final String IMPORTER_OUTPUT_ANAGRAPHIC="dm.importer.out.anagraphic";
|
||||
public static final String IMPORTER_OUTPUT_BATCHES="dm.importer.out.batches";
|
||||
public static final String IMPORTER_OUTPUT_ANNUAL="dm.importer.out.annual";
|
||||
public static final String IMPORTER_OUTPUT_ANTIBIOTICS="dm.importer.out.antibiotics";
|
||||
public static final String IMPORTER_OUTPUT_ANTIPARASITIC="dm.importer.out.antiparasitic";
|
||||
public static final String IMPORTER_OUTPUT_LETHALINCIDENTS="dm.importer.out.lethalincidents";
|
||||
|
||||
|
||||
public static final String LOAD_SCHEMA="schema.load";
|
||||
public static final String SKIP_ON_SCHEMA_ERROR="schema.load.skipError";
|
||||
|
||||
static LocalConfiguration instance=null;
|
||||
|
||||
|
|
|
@ -4,8 +4,10 @@ import javax.ws.rs.ApplicationPath;
|
|||
|
||||
import org.gcube.application.perform.service.engine.Importer;
|
||||
import org.gcube.application.perform.service.engine.MappingManager;
|
||||
import org.gcube.application.perform.service.engine.PerformanceManager;
|
||||
import org.gcube.application.perform.service.engine.impl.ImporterImpl;
|
||||
import org.gcube.application.perform.service.engine.impl.MappingManagerImpl;
|
||||
import org.gcube.application.perform.service.engine.impl.PerformanceManagerImpl;
|
||||
import org.gcube.application.perform.service.rest.Import;
|
||||
import org.gcube.application.perform.service.rest.Mappings;
|
||||
import org.gcube.application.perform.service.rest.Performance;
|
||||
|
@ -31,7 +33,7 @@ public class PerformService extends ResourceConfig{
|
|||
protected void configure() {
|
||||
bind(MappingManagerImpl.class).to(MappingManager.class);
|
||||
bind(ImporterImpl.class).to(Importer.class);
|
||||
|
||||
bind(PerformanceManagerImpl.class).to(PerformanceManager.class);
|
||||
}
|
||||
};
|
||||
register(binder);
|
||||
|
|
|
@ -37,18 +37,18 @@ public class PerformServiceLifecycleManager extends ApplicationLifecycleHandler
|
|||
ApplicationContext context=ContextProvider.get();
|
||||
URL resourceUrl = context.application().getResource("/WEB-INF/config.properties");
|
||||
LocalConfiguration.init(resourceUrl);
|
||||
|
||||
|
||||
ServletContext ctx=ContextProvider.get().application();
|
||||
String webinfPath=ctx.getRealPath("/WEB-INF");
|
||||
|
||||
initSchema(webinfPath);
|
||||
log.info("Loaded configuration schema : ");
|
||||
for(Entry<AnalysisType,Set<ImportedTable>> entry:PerformanceManagerImpl.getAnalysisConfiguration().entrySet()) {
|
||||
log.info("Tables registered for {} ",entry.getKey());
|
||||
for(ImportedTable t:entry.getValue())
|
||||
log.info("Table {} : {} [Analysis : {}]",t.getSchema().getRelatedDescription(),t.getTableName(),t.getSchema().getAnalysisEnabled());
|
||||
}
|
||||
|
||||
if(Boolean.parseBoolean(LocalConfiguration.getProperty(LocalConfiguration.LOAD_SCHEMA))) {
|
||||
initSchema(webinfPath);
|
||||
log.info("Loaded configuration schema : ");
|
||||
for(Entry<AnalysisType,Set<ImportedTable>> entry:PerformanceManagerImpl.getAnalysisConfiguration().entrySet()) {
|
||||
log.info("Tables registered for {} ",entry.getKey());
|
||||
for(ImportedTable t:entry.getValue())
|
||||
log.info("Table {} : {} [Analysis : {}]",t.getSchema().getRelatedDescription(),t.getTableName(),t.getSchema().getAnalysisEnabled());
|
||||
}
|
||||
}else log.warn("SKIPPING LOADING CONFIGURATION. INVALID BEHAVIOUR IN PRODUCTION ENVIRONMENT.");
|
||||
}catch(Exception ex) {
|
||||
throw new RuntimeException("Unable to init",ex);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,10 @@ public class AnalysisType {
|
|||
private String id;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AnalysisType [name=" + name + ", id=" + id + "]";
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -5,14 +5,9 @@ db.pools.min_total=3
|
|||
mapping-db.ep.name=PF_DB
|
||||
mapping-db.ep.category=Database
|
||||
|
||||
performance-db.ep.name=PF_DB2
|
||||
performance-db.ep.category=PF_DB2
|
||||
|
||||
dm.importer.computationid=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.PERFORMFISH_DATA_EXTRACTOR
|
||||
dm.importer.out.anagraphic=AnagraphicTable
|
||||
dm.importer.out.batches=BatchesTable
|
||||
dm.importer.out.annual=AnnualTable
|
||||
dm.importer.out.antibiotics=AntibioticsTable
|
||||
dm.importer.out.antiparasitic=AntiparasiticTable
|
||||
dm.importer.out.lethalincidents=LethalIncidentsTable
|
||||
|
||||
schema.load=false
|
||||
schema.load.skipError=true
|
||||
|
|
@ -9,10 +9,14 @@ public class PerformanceTest extends CommonTest{
|
|||
|
||||
@Test
|
||||
public void getBatch() {
|
||||
WebTarget target=
|
||||
// target(ServiceConstants.SERVICE_NAME).
|
||||
// path(ServiceConstants.APPLICATION_PATH).
|
||||
target(ServiceConstants.Performance.PATH);
|
||||
WebTarget target=
|
||||
target(ServiceConstants.Performance.PATH).
|
||||
queryParam(ServiceConstants.Performance.AREA_PARAMETER, "A1","A2").
|
||||
queryParam(ServiceConstants.Performance.QUARTER_PARAMETER, "Q1","Q2").
|
||||
queryParam(ServiceConstants.Performance.FARM_ID_PARAMETER, "1233556","12346").
|
||||
queryParam(ServiceConstants.Performance.SPECIES_ID_PARAMETER, "Gadilidae","Tonno").
|
||||
queryParam(ServiceConstants.Performance.BATCH_TYPE_PARAMETER, "GROW_OUT_AGGREGATED").
|
||||
queryParam(ServiceConstants.Performance.PERIOD_PARAMETER, "First","Spring");
|
||||
|
||||
System.out.println(target.getUri());
|
||||
Response resp=target.request().get();
|
||||
|
|
Loading…
Reference in New Issue