This commit is contained in:
Lucio Lelii 2009-09-30 13:35:26 +00:00
parent 4c9fdac867
commit 1810e8e70d
1 changed files with 14 additions and 20 deletions

View File

@ -82,7 +82,7 @@ public class ModelerService {
} catch (Exception e) {
logger.error(" "+e.getMessage());
logger.error(e);
throw new GCUBEFault(e);
}
@ -110,8 +110,7 @@ public class ModelerService {
res=DBInterface.queryDB("select * from VRE where VRE.id='"+ID+"';");
toReturn=XMLUtil.PrepareVREModelXML(res);
} catch (Exception e) {
logger.error("VDLModel parsing error in function getDLModel "+e);
e.printStackTrace();
logger.error("VDLModel parsing error in function getDLModel ",e);
throw new GCUBEFault(e);
}
@ -139,7 +138,7 @@ public class ModelerService {
}catch(Exception e) {
logger.error("VDL Model: error retreiving GHNs"+e);
logger.error("VDL Model: error retreiving GHNs",e);
throw new GCUBEFault(e);}
return XMLUtil.PrepareGHNsXML(res, relatedGHN);
}
@ -171,8 +170,7 @@ public class ModelerService {
DBInterface.insertInto("VRERELATEDGHN", values.toArray(new String[0][0]));
}catch(Exception e){
logger.error("error setting GHNs "+e);
e.printStackTrace();
logger.error("error setting GHNs ",e);
throw new GCUBEFault(e);}
}
@ -200,8 +198,7 @@ public class ModelerService {
}
}catch(Exception e) {
logger.error("VDL Model: error on DB");
e.printStackTrace();
logger.error("error getting collections",e);
throw new GCUBEFault(e);}
@ -239,7 +236,7 @@ public class ModelerService {
DBInterface.connect();
DBInterface.insertInto("VRERELATEDCOLLECTION", values.toArray(new String[0][0]));
}catch(Exception e){
e.printStackTrace();
logger.error("error setting collection",e);
throw new GCUBEFault(e);
}
@ -262,7 +259,7 @@ public class ModelerService {
//retrieve all possible metadataformat for the selected collection
nativeMetadataFormat= new Hashtable<ModelerCollection, List<MetadataFormat>>();
ResultSet allPossibleMDF= DBInterface.queryDB("select rel.collid, mdf.id, mdf.name, mdf.schemauri, mdf.language, coll.name, coll.description from COLLECTION as coll, VRERELATEDCOLLECTION as rel, MDCOLLECTION as mcoll, MDFORMAT as mdf, NATIVEMDF as native where rel.vreid='"+getResource().getId()+"' and mcoll.relatedcollectionid=rel.collid and mdf.id=native.mdfid and native.mdcollid=mcoll.id and coll.id=rel.collid;");
ResultSet allPossibleMDF= DBInterface.queryDB("select rel.collid, mdf.id, mdf.name, mdf.schemauri, mdf.language, coll.name, coll.description from COLLECTION as coll, VRERELATEDCOLLECTION as rel, MCOLLECTION as mcoll, METADATAFORMAT as mdf, NATIVEMDF as native where rel.vreid='"+getResource().getId()+"' and mcoll.relatedcollectionid=rel.collid and mdf.id=native.mdfid and native.mdcollid=mcoll.id and coll.id=rel.collid;");
while (allPossibleMDF.next()){
ModelerCollection collection= new ModelerCollection(allPossibleMDF.getString(1), allPossibleMDF.getString(7), allPossibleMDF.getString(6) );
MetadataFormat mf= new MetadataFormat(allPossibleMDF.getString(2), allPossibleMDF.getString(3), new URI(allPossibleMDF.getString(4)), allPossibleMDF.getString(5));
@ -278,7 +275,7 @@ public class ModelerService {
//retrieving selected metadaformat
//hashtable <collectionId, MetadataFormat>
selectedMetadataFormat= new Hashtable<ModelerCollection, List<MetadataFormat>>();
ResultSet selectedFormat= DBInterface.queryDB("select rel.collid, mf.id, mf.name, mf.schemauri, mf.language , coll.name, coll.description from COLLECTION as coll, VRERELATEDMETADATAFORMAT as rel, MDFORMAT as mf where mf.id=rel.mfid and rel.vreid='"+getResource().getId()+"' and coll.id=rel.collid;");
ResultSet selectedFormat= DBInterface.queryDB("select rel.collid, mf.id, mf.name, mf.schemauri, mf.language , coll.name, coll.description from COLLECTION as coll, VRERELATEDMETADATAFORMAT as rel, METADATAFORMAT as mf where mf.id=rel.mfid and rel.vreid='"+getResource().getId()+"' and coll.id=rel.collid;");
while (selectedFormat.next()){
ModelerCollection collection= new ModelerCollection(selectedFormat.getString(1), selectedFormat.getString(7), selectedFormat.getString(6));
MetadataFormat mf= new MetadataFormat(selectedFormat.getString(2),selectedFormat.getString(3), new URI(selectedFormat.getString(4)), selectedFormat.getString(5));
@ -333,8 +330,7 @@ public class ModelerService {
}catch(Exception e) {
e.printStackTrace();
logger.error("ModelService: getMEtadataRelatedToCollection Error "+e.getMessage());
logger.error("ModelService: getMEtadataRelatedToCollection Error ",e);
throw new GCUBEFault(e);
}
@ -375,8 +371,7 @@ public class ModelerService {
DBInterface.insertInto("VRERELATEDMETADATAFORMAT", values.toArray(new String[0][0]));
}catch(Exception e){
logger.error("setMetadataRelateToCollectio failed ");
e.printStackTrace();
logger.error("setMetadataRelateToCollection failed ",e);
throw new GCUBEFault(e);
}
@ -409,8 +404,7 @@ public class ModelerService {
while (selectedCSRes.next())
selectedCS.add(selectedCSRes.getString(1));
} catch (Exception e) {
//logger.error("VDLModel Service: error retrieving functionality");
e.printStackTrace();
logger.error("VDLModel Service: error retrieving functionality",e);
throw new GCUBEFault(e);
}
@ -466,7 +460,7 @@ public class ModelerService {
DBInterface.insertInto("VRERELATEDCS", values.toArray(new String[0][0]));
}
}catch(Exception e){
e.printStackTrace();
logger.error("error setting funzionality",e);
throw new GCUBEFault(e);}
}
@ -519,13 +513,13 @@ public class ModelerService {
try {
resourceID = getResource().getId();
} catch (ResourceException e) {
logger.error("Error retrieving the Resource Requested"); throw new GCUBEUnrecoverableFault(e);
logger.error("Error retrieving the Resource Requested",e); throw new GCUBEUnrecoverableFault(e);
}
try{
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+DEPLOYING+"' WHERE VRE.id='"+resourceID+"';");
} catch (GCUBEFault e) {
logger.error("HSQLDB Error "+e);
logger.error("HSQLDB Error ",e);
throw new GCUBEUnrecoverableFault(e);
}