ref 18964: Create a Generic Resource to record Dismissed VREs

https://support.d4science.org/issues/18964

Create a library to support the resource access
This commit is contained in:
Giancarlo Panichi 2020-04-09 17:25:48 +02:00
parent b5fb5e9cdb
commit b1786b53d2
2 changed files with 366 additions and 79 deletions

View File

@ -145,99 +145,56 @@ public class DetachedREsTest extends TestCase {
try { try {
logger.info("Check Marshalling"); logger.info("Check Marshalling");
// final String GCUBEAPPS = "gCubeApps";
// final String FARM = "FARM";
// final String D4RESEARCH = "D4Research";
// final String PARTHENOSVO = "ParthenosVO";
// final String D4OS = "D4OS";
// ------ BlueBridge Gateway begin
GatewayJAXB blueBridgeGateway = new GatewayJAXB(); GatewayJAXB blueBridgeGateway = new GatewayJAXB();
blueBridgeGateway.setScope("-1"); blueBridgeGateway.setScope("-1");
blueBridgeGateway.setName("BlueBridge Gateway"); blueBridgeGateway.setName("BlueBridge Gateway");
// gCubeApps createBlueBridgeGateway(blueBridgeGateway);
final String GCUBEAPPS = "gCubeApps";
VOJAXB gCubeApps = new VOJAXB();
gCubeApps.setScope("/d4science.research-infrastructures.eu/" + GCUBEAPPS);
gCubeApps.setName(GCUBEAPPS);
LinkedHashMap<String, VREJAXB> gCubeAppsVREs = new LinkedHashMap<>(); // ------ D4Science.org Detached Gateway begin
GatewayJAXB d4ScienceOrgDetachedGateway = new GatewayJAXB();
d4ScienceOrgDetachedGateway.setScope("-2");
d4ScienceOrgDetachedGateway.setName("D4Science.org Detached Gateway");
String[] gCubeAppsVREsArray = { "AquacultureTrainingLab", "BlueBRIDGE-PSC", "BlueBridgeProject", createD4ScienceOrgDetachedGateway(d4ScienceOrgDetachedGateway);
"CES_TCRE", "ICES_DALSA", "ICES_DASC", "ICES_FIACO", "ICES_StockAssessmentAdvanced",
"ICES_TCSSM", "iSearch", "SIASPA" };
for (String vre : gCubeAppsVREsArray) { // ------ PARTHENOS Detached Gateway begin
VREJAXB gCubeAppsVREJAXB = new VREJAXB(); GatewayJAXB parthenosDetachedGateway = new GatewayJAXB();
gCubeAppsVREJAXB.setScope("/d4science.research-infrastructures.eu/" + GCUBEAPPS + "/" + vre); parthenosDetachedGateway.setScope("-3");
gCubeAppsVREJAXB.setName(new String(vre).replace("_", " ")); parthenosDetachedGateway.setName("PARTHENOS Detached Gateway");
gCubeAppsVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
gCubeAppsVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
gCubeAppsVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/"+vre);
gCubeAppsVREJAXB
.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
gCubeAppsVREs.put("/d4science.research-infrastructures.eu/" + GCUBEAPPS + "/" + vre,
gCubeAppsVREJAXB);
}
gCubeApps.setVres(gCubeAppsVREs);
// FARM createParthenosDetachedGateway(parthenosDetachedGateway);
final String FARM = "FARM";
VOJAXB farm = new VOJAXB();
farm.setScope("/d4science.research-infrastructures.eu/" + FARM);
farm.setName(FARM);
LinkedHashMap<String, VREJAXB> farmVREs = new LinkedHashMap<>(); // ------ AGINFRAPlus Detached Gateway begin
GatewayJAXB aginfraPlusDetachedGateway = new GatewayJAXB();
aginfraPlusDetachedGateway.setScope("-4");
aginfraPlusDetachedGateway.setName("AGINFRAPlus Detached Gateway");
String[] farmVREsArray = { "AlieiaVRE", "Aquabiotech", "ARDAG_Aquaculture", "EllinikaPsariaVRE", createAginfraPlusDetachedGateway(aginfraPlusDetachedGateway);
"ForkysVRE", "GALAXIDI", "iLKNAK_Aquaculture", "KIMAGRO_Fishfarming", "MARKELLOS_Aquaculture",
"NHREUS_Aquaculture", "STRATOS_AQUACULTURES", "SustainableBlueEconomy", "TBTI_VRE" };
for (String vre : farmVREsArray) { // ------ EOSC-Secretriat Detached Gateway begin
VREJAXB farmVREJAXB = new VREJAXB(); GatewayJAXB eoscSecretariatDetachedGateway = new GatewayJAXB();
farmVREJAXB.setScope("/d4science.research-infrastructures.eu/" + FARM + "/" + vre); eoscSecretariatDetachedGateway.setScope("-5");
farmVREJAXB.setName(new String(vre).replace("_", " ")); eoscSecretariatDetachedGateway.setName("EOSC-Secretariat Detached Gateway");
farmVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
farmVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
farmVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/"+vre);
farmVREJAXB
.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
farmVREs.put("/d4science.research-infrastructures.eu/" + FARM + "/" + vre, farmVREJAXB);
}
farm.setVres(farmVREs);
// D4Research createEOSCSecretariatDetachedGateway(eoscSecretariatDetachedGateway);
final String D4RESEARCH = "D4Research";
VOJAXB d4Research = new VOJAXB();
d4Research.setScope("/d4science.research-infrastructures.eu/" + D4RESEARCH);
d4Research.setName(D4RESEARCH); // Gateway Add
// -------------------
LinkedHashMap<String, VREJAXB> d4ResearchVREs = new LinkedHashMap<>();
String[] d4ResearchVREsArray = { "Blue-Datathon", "BlueBRIDGEReview", "DRuMFISH",
"ICES_AbundanceEstimationFromAcoustic", "ICES_BNetworkAnalysis", "ICES_FIACO2017",
"ICES_IntroStockAssessment", "ICES_IntroToREnv", "ICES_LogbookData", "ICES_MSE", "ICES_MSY",
"InfraTraining" };
for (String vre : d4ResearchVREsArray) {
VREJAXB d4ResearchVREJAXB = new VREJAXB();
d4ResearchVREJAXB.setScope("/d4science.research-infrastructures.eu/" + D4RESEARCH + "/" + vre);
d4ResearchVREJAXB.setName(new String(vre).replace("_", " "));
d4ResearchVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
d4ResearchVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
d4ResearchVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/"+vre);
d4ResearchVREJAXB
.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
d4ResearchVREs.put("/d4science.research-infrastructures.eu/" + D4RESEARCH + "/" + vre,
d4ResearchVREJAXB);
}
d4Research.setVres(d4ResearchVREs);
// Gateway
LinkedHashMap<String, VOJAXB> vos = new LinkedHashMap<>();
vos.put("/d4science.research-infrastructures.eu/" + D4RESEARCH, d4Research);
vos.put("/d4science.research-infrastructures.eu/" + FARM, farm);
vos.put("/d4science.research-infrastructures.eu/" + GCUBEAPPS, gCubeApps);
blueBridgeGateway.setVos(vos);
LinkedHashMap<String, GatewayJAXB> gateways = new LinkedHashMap<>(); LinkedHashMap<String, GatewayJAXB> gateways = new LinkedHashMap<>();
gateways.put("-1", blueBridgeGateway); gateways.put("-1", blueBridgeGateway);
gateways.put("-2", d4ScienceOrgDetachedGateway);
gateways.put("-3", parthenosDetachedGateway);
gateways.put("-4", aginfraPlusDetachedGateway);
gateways.put("-5", eoscSecretariatDetachedGateway);
DetachedREsJAXB detachedREs = new DetachedREsJAXB(); DetachedREsJAXB detachedREs = new DetachedREsJAXB();
detachedREs.setEnabled(true); detachedREs.setEnabled(true);
@ -265,7 +222,7 @@ public class DetachedREsTest extends TestCase {
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
DetachedREsJAXB configUnmarshalled = (DetachedREsJAXB) jaxbUnmarshaller.unmarshal(file); DetachedREsJAXB configUnmarshalled = (DetachedREsJAXB) jaxbUnmarshaller.unmarshal(file);
logger.debug("DetachedREs unmarshallded: " + configUnmarshalled); logger.debug("DetachedREs unmarshallded: " + configUnmarshalled);
file.delete(); //file.delete();
logger.info("Success!"); logger.info("Success!");
assertTrue(true); assertTrue(true);
@ -279,4 +236,311 @@ public class DetachedREsTest extends TestCase {
} }
} }
private void createEOSCSecretariatDetachedGateway(GatewayJAXB eoscSecretariatDetachedGateway) {
// D4OS
VOJAXB d4osOfEOSCSecretariatDetachedGateway = new VOJAXB();
d4osOfEOSCSecretariatDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4OS.getId());
d4osOfEOSCSecretariatDetachedGateway.setName(VOProduction.D4OS.getId());
LinkedHashMap<String, VREJAXB> d4osVREsOfEOSCSecretariatDetachedGateway = new LinkedHashMap<>();
String[] d4osVREsOfEOSCSecretariatDetachedGatewayArray = { "INFRAEOSC5ProjectsCollaboratory" };
for (String vre : d4osVREsOfEOSCSecretariatDetachedGatewayArray) {
VREJAXB d4osVREJAXB = new VREJAXB();
d4osVREJAXB.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4OS.getId() + "/" + vre);
d4osVREJAXB.setName(new String(vre).replace("_", " "));
d4osVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
d4osVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
d4osVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
d4osVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
d4osVREsOfEOSCSecretariatDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.D4OS.getId() + "/" + vre, d4osVREJAXB);
}
d4osOfEOSCSecretariatDetachedGateway.setVres(d4osVREsOfEOSCSecretariatDetachedGateway);
LinkedHashMap<String, VOJAXB> vosOfEOSCSecretariatDetachedGateway = new LinkedHashMap<>();
vosOfEOSCSecretariatDetachedGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.D4OS.getId(),
d4osOfEOSCSecretariatDetachedGateway);
eoscSecretariatDetachedGateway.setVos(vosOfEOSCSecretariatDetachedGateway);
}
private void createAginfraPlusDetachedGateway(GatewayJAXB aginfraPlusDetachedGateway) {
// FARM
VOJAXB farmOfAginfraPlusDetachedGateway = new VOJAXB();
farmOfAginfraPlusDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId());
farmOfAginfraPlusDetachedGateway.setName(VOProduction.FARM.getId());
LinkedHashMap<String, VREJAXB> farmVREsOfAginfraPlusDetachedGateway = new LinkedHashMap<>();
String[] farmVREsOfAginfraPlusDetachedGatewayArray = { "EOSCFood" };
for (String vre : farmVREsOfAginfraPlusDetachedGatewayArray) {
VREJAXB farmVREJAXB = new VREJAXB();
farmVREJAXB.setScope("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId() + "/" + vre);
farmVREJAXB.setName(new String(vre).replace("_", " "));
farmVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
farmVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
farmVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
farmVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
farmVREsOfAginfraPlusDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId() + "/" + vre, farmVREJAXB);
}
farmOfAginfraPlusDetachedGateway.setVres(farmVREsOfAginfraPlusDetachedGateway);
LinkedHashMap<String, VOJAXB> vosOfAginfraPlusDetachedGateway = new LinkedHashMap<>();
vosOfAginfraPlusDetachedGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId(),
farmOfAginfraPlusDetachedGateway);
aginfraPlusDetachedGateway.setVos(vosOfAginfraPlusDetachedGateway);
}
private void createParthenosDetachedGateway(GatewayJAXB parthenosDetachedGateway) {
// ParthenosVO
VOJAXB parthenosVOOfParthenosDetachedGateway = new VOJAXB();
parthenosVOOfParthenosDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.PARTHENOSVO.getId());
parthenosVOOfParthenosDetachedGateway.setName(VOProduction.PARTHENOSVO.getId());
LinkedHashMap<String, VREJAXB> parthenosVOVREsOfParthenosDetachedGateway = new LinkedHashMap<>();
String[] parthenosVOVREsOfParthenosDetachedGatewayArray = { "RubRIcA" };
for (String vre : parthenosVOVREsOfParthenosDetachedGatewayArray) {
VREJAXB parthenosVOVREJAXB = new VREJAXB();
parthenosVOVREJAXB
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.PARTHENOSVO.getId() + "/" + vre);
parthenosVOVREJAXB.setName(new String(vre).replace("_", " "));
parthenosVOVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
parthenosVOVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
parthenosVOVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
parthenosVOVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
parthenosVOVREsOfParthenosDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.PARTHENOSVO.getId() + "/" + vre,
parthenosVOVREJAXB);
}
parthenosVOOfParthenosDetachedGateway.setVres(parthenosVOVREsOfParthenosDetachedGateway);
// D4Research
VOJAXB d4ResearchOfParthenosDetachedGateway = new VOJAXB();
d4ResearchOfParthenosDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId());
d4ResearchOfParthenosDetachedGateway.setName(VOProduction.D4RESEARCH.getId());
LinkedHashMap<String, VREJAXB> d4ResearchVREsOfParthenosDetachedGateway = new LinkedHashMap<>();
String[] d4ResearchVREsOfParthenosDetachedGatewayArray = { "NERLiX" };
for (String vre : d4ResearchVREsOfParthenosDetachedGatewayArray) {
VREJAXB d4ResearchVREJAXB = new VREJAXB();
d4ResearchVREJAXB
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId() + "/" + vre);
d4ResearchVREJAXB.setName(new String(vre).replace("_", " "));
d4ResearchVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
d4ResearchVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
d4ResearchVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
d4ResearchVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
d4ResearchVREsOfParthenosDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId() + "/" + vre,
d4ResearchVREJAXB);
}
d4ResearchOfParthenosDetachedGateway.setVres(d4ResearchVREsOfParthenosDetachedGateway);
LinkedHashMap<String, VOJAXB> vosOfParthenosDetachedGateway = new LinkedHashMap<>();
vosOfParthenosDetachedGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId(),
d4ResearchOfParthenosDetachedGateway);
vosOfParthenosDetachedGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.PARTHENOSVO.getId(),
parthenosVOOfParthenosDetachedGateway);
parthenosDetachedGateway.setVos(vosOfParthenosDetachedGateway);
}
private void createBlueBridgeGateway(GatewayJAXB blueBridgeGateway) {
// gCubeApps
VOJAXB gCubeAppsOfBlueBridgeGateway = new VOJAXB();
gCubeAppsOfBlueBridgeGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId());
gCubeAppsOfBlueBridgeGateway.setName(VOProduction.GCUBEAPPS.getId());
LinkedHashMap<String, VREJAXB> gCubeAppsVREsOfBlueBridgeGateway = new LinkedHashMap<>();
String[] gCubeAppsVREsOfBluebridgeGatewayArray = { "AquacultureTrainingLab", "BlueBRIDGE-PSC",
"BlueBridgeProject", "CES_TCRE", "ICES_DALSA", "ICES_DASC", "ICES_FIACO",
"ICES_StockAssessmentAdvanced", "ICES_TCSSM", "iSearch", "SIASPA" };
for (String vre : gCubeAppsVREsOfBluebridgeGatewayArray) {
VREJAXB gCubeAppsVREJAXB = new VREJAXB();
gCubeAppsVREJAXB
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId() + "/" + vre);
gCubeAppsVREJAXB.setName(new String(vre).replace("_", " "));
gCubeAppsVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
gCubeAppsVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
gCubeAppsVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
gCubeAppsVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
gCubeAppsVREsOfBlueBridgeGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId() + "/" + vre,
gCubeAppsVREJAXB);
}
gCubeAppsOfBlueBridgeGateway.setVres(gCubeAppsVREsOfBlueBridgeGateway);
// FARM
VOJAXB farmOfBlueBridgeGateway = new VOJAXB();
farmOfBlueBridgeGateway.setScope("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId());
farmOfBlueBridgeGateway.setName(VOProduction.FARM.getId());
LinkedHashMap<String, VREJAXB> farmVREsOfBlueBridgeGateway = new LinkedHashMap<>();
String[] farmVREsOfBlueBridgeGatewayArray = { "AlieiaVRE", "Aquabiotech", "ARDAG_Aquaculture",
"EllinikaPsariaVRE", "ForkysVRE", "GALAXIDI", "iLKNAK_Aquaculture", "KIMAGRO_Fishfarming",
"MARKELLOS_Aquaculture", "NHREUS_Aquaculture", "STRATOS_AQUACULTURES", "SustainableBlueEconomy",
"TBTI_VRE" };
for (String vre : farmVREsOfBlueBridgeGatewayArray) {
VREJAXB farmVREJAXB = new VREJAXB();
farmVREJAXB.setScope("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId() + "/" + vre);
farmVREJAXB.setName(new String(vre).replace("_", " "));
farmVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
farmVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
farmVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
farmVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
farmVREsOfBlueBridgeGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId() + "/" + vre, farmVREJAXB);
}
farmOfBlueBridgeGateway.setVres(farmVREsOfBlueBridgeGateway);
// D4Research
VOJAXB d4ResearchOfBlueBridgeGateway = new VOJAXB();
d4ResearchOfBlueBridgeGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId());
d4ResearchOfBlueBridgeGateway.setName(VOProduction.D4RESEARCH.getId());
LinkedHashMap<String, VREJAXB> d4ResearchVREsOfBlueBridgeGateway = new LinkedHashMap<>();
String[] d4ResearchVREsOfBlueBridgeGatewayArray = { "Blue-Datathon", "BlueBRIDGEReview", "BOBLME_HilsaAWG",
"DRuMFISH", "ICES_AbundanceEstimationFromAcoustic", "ICES_BNetworkAnalysis", "ICES_FIACO2017",
"ICES_IntroStockAssessment", "ICES_IntroToREnv", "ICES_LogbookData", "ICES_MSE", "ICES_MSY",
"InfraTraining", "Sinay", "StatnMap" };
for (String vre : d4ResearchVREsOfBlueBridgeGatewayArray) {
VREJAXB d4ResearchVREJAXB = new VREJAXB();
d4ResearchVREJAXB
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId() + "/" + vre);
d4ResearchVREJAXB.setName(new String(vre).replace("_", " "));
d4ResearchVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
d4ResearchVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
d4ResearchVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
d4ResearchVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
d4ResearchVREsOfBlueBridgeGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId() + "/" + vre,
d4ResearchVREJAXB);
}
d4ResearchOfBlueBridgeGateway.setVres(d4ResearchVREsOfBlueBridgeGateway);
LinkedHashMap<String, VOJAXB> vosOfBlueBridgeGateway = new LinkedHashMap<>();
vosOfBlueBridgeGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId(),
d4ResearchOfBlueBridgeGateway);
vosOfBlueBridgeGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId(),
farmOfBlueBridgeGateway);
vosOfBlueBridgeGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId(),
gCubeAppsOfBlueBridgeGateway);
blueBridgeGateway.setVos(vosOfBlueBridgeGateway);
}
private void createD4ScienceOrgDetachedGateway(GatewayJAXB d4ScienceOrgDetachedGateway) {
// gCubeApps
VOJAXB gCubeAppsOfD4ScienceOrgDetachedGateway = new VOJAXB();
gCubeAppsOfD4ScienceOrgDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId());
gCubeAppsOfD4ScienceOrgDetachedGateway.setName(VOProduction.GCUBEAPPS.getId());
LinkedHashMap<String, VREJAXB> gCubeAppsVREsOfD4ScienceOrgDetachedGateway = new LinkedHashMap<>();
String[] gCubeAppsVREsOfD4ScienceOrgDetachedGatewayArray = { "CNR_OpenScienceTF", "EGIEngage", "ICOS_ETC" };
for (String vre : gCubeAppsVREsOfD4ScienceOrgDetachedGatewayArray) {
VREJAXB gCubeAppsVREJAXB = new VREJAXB();
gCubeAppsVREJAXB
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId() + "/" + vre);
gCubeAppsVREJAXB.setName(new String(vre).replace("_", " "));
gCubeAppsVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
gCubeAppsVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
gCubeAppsVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
gCubeAppsVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
gCubeAppsVREsOfD4ScienceOrgDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId() + "/" + vre,
gCubeAppsVREJAXB);
}
gCubeAppsOfD4ScienceOrgDetachedGateway.setVres(gCubeAppsVREsOfD4ScienceOrgDetachedGateway);
// FARM
VOJAXB farmOfD4ScienceOrgDetachedGateway = new VOJAXB();
farmOfD4ScienceOrgDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId());
farmOfD4ScienceOrgDetachedGateway.setName(VOProduction.FARM.getId());
LinkedHashMap<String, VREJAXB> farmVREsOfD4ScienceOrgDetachedGateway = new LinkedHashMap<>();
String[] farmVREsOfD4ScienceOrgDetachedGatewayArray = { "EUChinaFoodSTAR" };
for (String vre : farmVREsOfD4ScienceOrgDetachedGatewayArray) {
VREJAXB farmVREJAXB = new VREJAXB();
farmVREJAXB.setScope("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId() + "/" + vre);
farmVREJAXB.setName(new String(vre).replace("_", " "));
farmVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
farmVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
farmVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
farmVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
farmVREsOfD4ScienceOrgDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId() + "/" + vre, farmVREJAXB);
}
farmOfD4ScienceOrgDetachedGateway.setVres(farmVREsOfD4ScienceOrgDetachedGateway);
// D4Research
VOJAXB d4ResearchOfD4ScienceOrgDetachedGateway = new VOJAXB();
d4ResearchOfD4ScienceOrgDetachedGateway
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId());
d4ResearchOfD4ScienceOrgDetachedGateway.setName(VOProduction.D4RESEARCH.getId());
LinkedHashMap<String, VREJAXB> d4ResearchVREsOfD4ScienceOrgDetachedGateway = new LinkedHashMap<>();
String[] d4ResearchVREsOfD4ScienceOrgDetachedGatewayArray = { "EOSC_Services", "FAIR_DM",
"FisheriesAndEcosystemAtMii", "ISTIOpenAccess" };
for (String vre : d4ResearchVREsOfD4ScienceOrgDetachedGatewayArray) {
VREJAXB d4ResearchVREJAXB = new VREJAXB();
d4ResearchVREJAXB
.setScope("/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId() + "/" + vre);
d4ResearchVREJAXB.setName(new String(vre).replace("_", " "));
d4ResearchVREJAXB.setStartDate(new GregorianCalendar(2018, GregorianCalendar.JANUARY, 1).getTime());
d4ResearchVREJAXB.setEndDate(new GregorianCalendar(2020, GregorianCalendar.MARCH, 3).getTime());
d4ResearchVREJAXB.setCatalogUrl("http://data.d4science.org/ctlg/" + vre);
d4ResearchVREJAXB.setManagers(new ArrayList<String>(Arrays.asList("Leonardo Candela", "Pasquale Pagano")));
d4ResearchVREsOfD4ScienceOrgDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId() + "/" + vre,
d4ResearchVREJAXB);
}
d4ResearchOfD4ScienceOrgDetachedGateway.setVres(d4ResearchVREsOfD4ScienceOrgDetachedGateway);
LinkedHashMap<String, VOJAXB> vosOfD4ScienceOrgDetachedGateway = new LinkedHashMap<>();
vosOfD4ScienceOrgDetachedGateway.put(
"/d4science.research-infrastructures.eu/" + VOProduction.D4RESEARCH.getId(),
d4ResearchOfD4ScienceOrgDetachedGateway);
vosOfD4ScienceOrgDetachedGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.FARM.getId(),
farmOfD4ScienceOrgDetachedGateway);
vosOfD4ScienceOrgDetachedGateway.put("/d4science.research-infrastructures.eu/" + VOProduction.GCUBEAPPS.getId(),
gCubeAppsOfD4ScienceOrgDetachedGateway);
d4ScienceOrgDetachedGateway.setVos(vosOfD4ScienceOrgDetachedGateway);
}
} }

View File

@ -0,0 +1,23 @@
package org.gcube.infrastructure.detachedres.detachedreslibrary;
/**
*
* @author Giancarlo Panichi
*
*/
public enum VOProduction {
GCUBEAPPS("gCubeApps"), FARM("FARM"), D4RESEARCH("D4Research"), PARTHENOSVO("ParthenosVO"), D4OS("D4OS");
String id;
VOProduction(String id) {
this.id = id;
}
public String getId() {
return this.id;
}
}