git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@464 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fa745c0992
commit
71fe76d29a
|
@ -66,7 +66,9 @@ public class DBInterface {
|
||||||
st = conn.createStatement(); // statement objects can be reused with
|
st = conn.createStatement(); // statement objects can be reused with
|
||||||
st.executeUpdate(query);
|
st.executeUpdate(query);
|
||||||
st.close();
|
st.close();
|
||||||
}catch(SQLException e){logger.error("error executing Query", e);throw new RemoteException("error creating SQL statement",e);}
|
}catch(SQLException e){//logger.error("error executing Query", e);
|
||||||
|
throw new RemoteException("error creating SQL statement",e);}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +84,9 @@ public class DBInterface {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try{
|
try{
|
||||||
st = conn.createStatement(); // statement objects can be reused with
|
st = conn.createStatement(); // statement objects can be reused with
|
||||||
}catch(SQLException e){logger.error("error creating SQL statement");throw new RemoteException("error creating SQL statement",e);}
|
}catch(SQLException e){//logger.error("error creating SQL statement");
|
||||||
|
throw new RemoteException("error creating SQL statement",e);}
|
||||||
|
|
||||||
String insertQuery="";
|
String insertQuery="";
|
||||||
|
|
||||||
for (String[] row: values)
|
for (String[] row: values)
|
||||||
|
@ -97,17 +101,22 @@ public class DBInterface {
|
||||||
else insertQuery+="'"+row[i].replaceAll("'"," ")+"',";
|
else insertQuery+="'"+row[i].replaceAll("'"," ")+"',";
|
||||||
|
|
||||||
insertQuery+=");";
|
insertQuery+=");";
|
||||||
logger.debug(insertQuery);
|
//logger.debug(insertQuery);
|
||||||
//System.out.println(insertQuery);
|
//System.out.println(insertQuery);
|
||||||
|
|
||||||
st.executeUpdate(insertQuery); // run the query
|
st.executeUpdate(insertQuery); // run the query
|
||||||
}catch(SQLException e){logger.error("HSQLDB ERROR: Problem inserting data "+e.getMessage()+" -- "+insertQuery);}
|
}catch(SQLException e){//logger.error("HSQLDB ERROR: Problem inserting data "+e.getMessage()+" -- "+insertQuery);
|
||||||
catch(Exception e){logger.error("VDLModelService error: Problem inserting data "+e.getMessage());}
|
}
|
||||||
|
|
||||||
|
catch(Exception e){//logger.error("VDLModelService error: Problem inserting data "+e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
st.close();
|
st.close();
|
||||||
}catch(SQLException e){logger.error("error closing SQL statement");throw new RemoteException("error closing SQL statement",e);}
|
}catch(SQLException e){//logger.error("error closing SQL statement");
|
||||||
|
throw new RemoteException("error closing SQL statement",e);}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,24 +15,9 @@ import org.apache.axis.message.addressing.AttributedURI;
|
||||||
import org.apache.axis.message.addressing.EndpointReferenceType;
|
import org.apache.axis.message.addressing.EndpointReferenceType;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.diligentproject.common.profile.service.DHNRequirements;
|
|
||||||
import org.diligentproject.dvos.authentication.util.ConfigureSecurity;
|
|
||||||
import org.diligentproject.informationservice.dishlsclient.impl.DISHLSClient;
|
|
||||||
import org.diligentproject.informationservice.dishlsclient.impl.DISHLSClientException;
|
|
||||||
import org.diligentproject.informationservice.dishlsclient.impl.DISHLSCredentialException;
|
|
||||||
import org.diligentproject.informationservice.dishlsclient.impl.GeneralQueryManager;
|
|
||||||
import org.diligentproject.informationservice.dishlsclient.impl.RunningInstanceManager;
|
|
||||||
import org.diligentproject.metadatamanagement.metadatabrokerlibrary.programs.TPIOType;
|
|
||||||
import org.diligentproject.metadatamanagement.metadatabrokerservice.stubs.FindPossibleTransformationPrograms;
|
|
||||||
import org.diligentproject.metadatamanagement.metadatabrokerservice.stubs.FindPossibleTransformationProgramsResponse;
|
|
||||||
import org.diligentproject.metadatamanagement.metadatabrokerservice.stubs.MetadataBrokerPortType;
|
|
||||||
import org.diligentproject.metadatamanagement.metadatabrokerservice.stubs.service.MetadataBrokerServiceAddressingLocator;
|
|
||||||
import org.diligentproject.vdlgeneratorservice.model.impl.CredentialManager;
|
|
||||||
import org.diligentproject.vdlgeneratorservice.model.impl.ModelService;
|
|
||||||
import org.gcube.vremanagement.vremodeler.impl.ModelFactoryService;
|
import org.gcube.vremanagement.vremodeler.impl.ModelFactoryService;
|
||||||
import org.globus.axis.gsi.GSIConstants;
|
import org.globus.axis.gsi.GSIConstants;
|
||||||
import org.gridforum.jgss.ExtendedGSSCredential;
|
import org.gridforum.jgss.ExtendedGSSCredential;
|
||||||
import org.ietf.jgss.GSSCredential;
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
@ -40,7 +25,6 @@ import org.xml.sax.InputSource;
|
||||||
|
|
||||||
public class DIStoDBUtil {
|
public class DIStoDBUtil {
|
||||||
|
|
||||||
private static Log logger =LogFactory.getLog(ModelService.class.getName());
|
|
||||||
private static UUIDGen uuidMFGEN=UUIDGenFactory.getUUIDGen();
|
private static UUIDGen uuidMFGEN=UUIDGenFactory.getUUIDGen();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,14 +36,14 @@ public class DIStoDBUtil {
|
||||||
|
|
||||||
cleanDB();
|
cleanDB();
|
||||||
insertCollection(epr, cred);
|
insertCollection(epr, cred);
|
||||||
logger.debug("initialization: collection");
|
//logger.debug("initialization: collection");
|
||||||
insertMetadataCollection(epr, cred);
|
insertMetadataCollection(epr, cred);
|
||||||
logger.debug("initialization: metadata");
|
//logger.debug("initialization: metadata");
|
||||||
insertCS(epr, cred);
|
insertCS(epr, cred);
|
||||||
logger.debug("initialization: cs");
|
//logger.debug("initialization: cs");
|
||||||
insertServices(epr, cred);
|
insertServices(epr, cred);
|
||||||
insertDHN(epr, cred);
|
insertDHN(epr, cred);
|
||||||
logger.debug("initialization: DHN");
|
//logger.debug("initialization: DHN");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void cleanDB() throws RemoteException
|
private static void cleanDB() throws RemoteException
|
||||||
|
@ -82,7 +66,9 @@ public class DIStoDBUtil {
|
||||||
DBInterface.deleteAll("runninginstance");
|
DBInterface.deleteAll("runninginstance");
|
||||||
DBInterface.deleteAll("dhnrelatedri");
|
DBInterface.deleteAll("dhnrelatedri");
|
||||||
DBInterface.deleteAll("cs");
|
DBInterface.deleteAll("cs");
|
||||||
}catch (SQLException e){logger.error("error cleaning DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error cleaning DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +117,7 @@ public class DIStoDBUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("VDL Model Service: parsing results error");
|
//logger.error("VDL Model Service: parsing results error");
|
||||||
throw new RemoteException(e.getMessage(),e);
|
throw new RemoteException(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
return returnedValues.toArray(new String[0][0]);
|
return returnedValues.toArray(new String[0][0]);
|
||||||
|
@ -153,8 +139,7 @@ public class DIStoDBUtil {
|
||||||
q= DISHLSClient.getGeneralQueryManager(cred, epr);
|
q= DISHLSClient.getGeneralQueryManager(cred, epr);
|
||||||
results= q.queryDISIC(query, cred, epr);
|
results= q.queryDISIC(query, cred, epr);
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
// TODO Auto-generated catch block
|
//logger.error("VDL Model Service: error initializing database");
|
||||||
logger.error("VDL Model Service: error initializing database");
|
|
||||||
throw new RemoteException(e1.getMessage(), e1);
|
throw new RemoteException(e1.getMessage(), e1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,23 +155,24 @@ public class DIStoDBUtil {
|
||||||
private static void insertCollection(EndpointReferenceType epr, ExtendedGSSCredential cred) throws RemoteException {
|
private static void insertCollection(EndpointReferenceType epr, ExtendedGSSCredential cred) throws RemoteException {
|
||||||
String collectionQuery= "for $CollectionProfile in collection(\"/db/Profiles/Collection\")//Document/Data/child::*[local-name()='Profile']/DILIGENTResource where $CollectionProfile/Profile/IsUserCollection[string(@value) eq \"true\"] return <r><Id>{$CollectionProfile/UniqueID/string()}</Id><Name>{$CollectionProfile/Profile/Name/string()}</Name><Description>{$CollectionProfile/Profile/Description/string()}</Description><NumberOfMembers>{$CollectionProfile/Profile/NumberOfMembers/string()}</NumberOfMembers><CreationTime>{$CollectionProfile/Profile/CreationTime/string()}</CreationTime><LastUpdateTime>{$CollectionProfile/Profile/LastUpdateTime/string()}</LastUpdateTime></r>";
|
String collectionQuery= "for $CollectionProfile in collection(\"/db/Profiles/Collection\")//Document/Data/child::*[local-name()='Profile']/DILIGENTResource where $CollectionProfile/Profile/IsUserCollection[string(@value) eq \"true\"] return <r><Id>{$CollectionProfile/UniqueID/string()}</Id><Name>{$CollectionProfile/Profile/Name/string()}</Name><Description>{$CollectionProfile/Profile/Description/string()}</Description><NumberOfMembers>{$CollectionProfile/Profile/NumberOfMembers/string()}</NumberOfMembers><CreationTime>{$CollectionProfile/Profile/CreationTime/string()}</CreationTime><LastUpdateTime>{$CollectionProfile/Profile/LastUpdateTime/string()}</LastUpdateTime></r>";
|
||||||
String results=makeQueryDIS(epr, cred, collectionQuery);
|
String results=makeQueryDIS(epr, cred, collectionQuery);
|
||||||
logger.debug(results);
|
//logger.debug(results);
|
||||||
String[][] resultsParsed= parseResults(results, "r");
|
String[][] resultsParsed= parseResults(results, "r");
|
||||||
//test
|
//test
|
||||||
|
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("collection", resultsParsed, false);
|
DBInterface.InsertInto("collection", resultsParsed, false);
|
||||||
}catch (SQLException e){logger.error("VDLModel: DB error "+e.getMessage()); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("VDLModel: DB error "+e.getMessage());
|
||||||
|
throw new RemoteException(e.getMessage(),e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static String[] ParseTP(String[] tp){
|
private static String[] ParseTP(String[] tp){
|
||||||
logger.debug("ParseTP start");
|
//logger.debug("ParseTP start");
|
||||||
|
|
||||||
String[] schemaNameURI=tp[1].split("=");
|
String[] schemaNameURI=tp[1].split("=");
|
||||||
String lng="anylanguage";
|
String lng="anylanguage";
|
||||||
logger.debug("MetadataFormatParsed: "+schemaNameURI[0]+ ", "+schemaNameURI[1]+", "+lng);
|
//logger.debug("MetadataFormatParsed: "+schemaNameURI[0]+ ", "+schemaNameURI[1]+", "+lng);
|
||||||
return new String[]{tp[0],schemaNameURI[0],schemaNameURI[1],lng};
|
return new String[]{tp[0],schemaNameURI[0],schemaNameURI[1],lng};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,13 +184,13 @@ public class DIStoDBUtil {
|
||||||
*/
|
*/
|
||||||
private static String ContainsControl(String[] item, ArrayList<String[]> container){
|
private static String ContainsControl(String[] item, ArrayList<String[]> container){
|
||||||
for(String[] cont: container){
|
for(String[] cont: container){
|
||||||
logger.debug("MDFormat: "+cont[1]+" "+cont[2]);
|
//logger.debug("MDFormat: "+cont[1]+" "+cont[2]);
|
||||||
logger.debug("MDFormat: confr "+cont[1]+" "+cont[2]);
|
//logger.debug("MDFormat: confr "+cont[1]+" "+cont[2]);
|
||||||
if((cont[1].compareTo(item[1])==0) && (cont[2].compareTo(item[2])==0)) //&& ((cont[3].compareTo("anylanguage")==0) || cont[3].compareTo(item[3])==0)
|
if((cont[1].compareTo(item[1])==0) && (cont[2].compareTo(item[2])==0)) //&& ((cont[3].compareTo("anylanguage")==0) || cont[3].compareTo(item[3])==0)
|
||||||
return cont[0];
|
return cont[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
logger.debug("MDFormat: not yet present");
|
//logger.debug("MDFormat: not yet present");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +209,7 @@ public class DIStoDBUtil {
|
||||||
tempQuery+=" $CollectionProfile/Profile/RelatedCollection/CollectionID/string() eq '"+res.getString(1)+"' or ";
|
tempQuery+=" $CollectionProfile/Profile/RelatedCollection/CollectionID/string() eq '"+res.getString(1)+"' or ";
|
||||||
tempQuery=tempQuery.substring(0, tempQuery.length()-4);
|
tempQuery=tempQuery.substring(0, tempQuery.length()-4);
|
||||||
} catch (SQLException e1) {
|
} catch (SQLException e1) {
|
||||||
logger.error("VDLModel: initialization error on inserMetadataCollection");
|
//logger.error("VDLModel: initialization error on inserMetadataCollection");
|
||||||
throw new RemoteException("VDLModel: initialization error on inserMetadataCollection",e1);
|
throw new RemoteException("VDLModel: initialization error on inserMetadataCollection",e1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,10 +347,12 @@ public class DIStoDBUtil {
|
||||||
singleDerivableMDF[2]=tpID;
|
singleDerivableMDF[2]=tpID;
|
||||||
singleDerivableMDF[3]=singleColl[3];
|
singleDerivableMDF[3]=singleColl[3];
|
||||||
MDDerivableArray.add(singleDerivableMDF);
|
MDDerivableArray.add(singleDerivableMDF);
|
||||||
}catch(Exception e1){logger.error("VDLModel: error parsing derivable"); e1.printStackTrace();}
|
}catch(Exception e1){//logger.error("VDLModel: error parsing derivable");
|
||||||
|
e1.printStackTrace();}
|
||||||
|
|
||||||
}
|
}
|
||||||
}catch(Exception e){logger.error("VDLModel: error retriving Derivable MDF for collection "+singleColl[0]); e.printStackTrace();}
|
}catch(Exception e){//logger.error("VDLModel: error retriving Derivable MDF for collection "+singleColl[0]);
|
||||||
|
e.printStackTrace();}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,7 +362,7 @@ public class DIStoDBUtil {
|
||||||
for (String[] tempNative: MDNativeArray){
|
for (String[] tempNative: MDNativeArray){
|
||||||
if (tempDeriv[3].compareTo(tempNative[2])==0 && (tempDeriv[1].compareTo(tempNative[1])==0)){
|
if (tempDeriv[3].compareTo(tempNative[2])==0 && (tempDeriv[1].compareTo(tempNative[1])==0)){
|
||||||
tempRemove.add(tempDeriv);
|
tempRemove.add(tempDeriv);
|
||||||
logger.debug("removed Doubled value");
|
//logger.debug("removed Doubled value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -386,7 +374,8 @@ public class DIStoDBUtil {
|
||||||
DBInterface.InsertInto("mdformat", MDFormatArray.toArray(new String[0][0]), false);
|
DBInterface.InsertInto("mdformat", MDFormatArray.toArray(new String[0][0]), false);
|
||||||
DBInterface.InsertInto("nativemdf", MDNativeArray.toArray(new String[0][0]), true);
|
DBInterface.InsertInto("nativemdf", MDNativeArray.toArray(new String[0][0]), true);
|
||||||
DBInterface.InsertInto("derivablemdf",MDDerivableArray.toArray(new String[0][0]), true);
|
DBInterface.InsertInto("derivablemdf",MDDerivableArray.toArray(new String[0][0]), true);
|
||||||
}catch (SQLException e){logger.error("error DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +392,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("cs", resultsParsed, false);
|
DBInterface.InsertInto("cs", resultsParsed, false);
|
||||||
}catch (SQLException e){logger.error("error DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -433,10 +423,10 @@ public class DIStoDBUtil {
|
||||||
try {
|
try {
|
||||||
riID=DISHLSClient.getRunningInstanceManager(cred,epr).getAllRunningInstancesOnDHN(singleDHN[0], cred, epr);
|
riID=DISHLSClient.getRunningInstanceManager(cred,epr).getAllRunningInstancesOnDHN(singleDHN[0], cred, epr);
|
||||||
} catch (DISHLSClientException e) {
|
} catch (DISHLSClientException e) {
|
||||||
logger.error("VDLModel: Error initializing DB with DHN and RI (DISHLSClient error)");
|
//logger.error("VDLModel: Error initializing DB with DHN and RI (DISHLSClient error)");
|
||||||
throw new RemoteException("Error querying DIS-IP (DISHLSClient error)", e);
|
throw new RemoteException("Error querying DIS-IP (DISHLSClient error)", e);
|
||||||
} catch (DISHLSCredentialException e) {
|
} catch (DISHLSCredentialException e) {
|
||||||
logger.error("VDLModel: Error initializing DB with DHN and RI (Credential error)");
|
//logger.error("VDLModel: Error initializing DB with DHN and RI (Credential error)");
|
||||||
throw new RemoteException("Error querying DIS-IP (Credential error)", e);
|
throw new RemoteException("Error querying DIS-IP (Credential error)", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +453,8 @@ public class DIStoDBUtil {
|
||||||
DBInterface.InsertInto("dhn", resultsDHNParsed, false);
|
DBInterface.InsertInto("dhn", resultsDHNParsed, false);
|
||||||
DBInterface.InsertInto("runninginstance", resultsRIParsed, false);
|
DBInterface.InsertInto("runninginstance", resultsRIParsed, false);
|
||||||
DBInterface.InsertInto("dhnrelatedri", DNHRelatedRIArray.toArray(new String[0][0]), false);
|
DBInterface.InsertInto("dhnrelatedri", DNHRelatedRIArray.toArray(new String[0][0]), false);
|
||||||
}catch (SQLException e){logger.error("error DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +468,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("relatedserviceid", resultsParsed, false);
|
DBInterface.InsertInto("relatedserviceid", resultsParsed, false);
|
||||||
}catch (SQLException e){logger.error("error DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateServices(EndpointReferenceType epr, ExtendedGSSCredential cred, String resourceID, int op) throws RemoteException {
|
public static void updateServices(EndpointReferenceType epr, ExtendedGSSCredential cred, String resourceID, int op) throws RemoteException {
|
||||||
|
@ -490,7 +482,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("relatedserviceid", resultsParsed, false);
|
DBInterface.InsertInto("relatedserviceid", resultsParsed, false);
|
||||||
}catch (SQLException e){logger.error("error DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -498,7 +491,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.ExecuteUpdate("Delete from relatedserviceid where id='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from relatedserviceid where id='"+resourceID+"'");
|
||||||
}catch (SQLException e){logger.error("error DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,7 +509,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("collection", resultsParsed, false);
|
DBInterface.InsertInto("collection", resultsParsed, false);
|
||||||
}catch (SQLException e){logger.error("error updating collection on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating collection on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -523,7 +518,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.ExecuteUpdate("Delete from collection where id='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from collection where id='"+resourceID+"'");
|
||||||
}catch (SQLException e){logger.error("error updating collection on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating collection on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,10 +546,10 @@ public class DIStoDBUtil {
|
||||||
try {
|
try {
|
||||||
riID=DISHLSClient.getRunningInstanceManager(cred,epr).getAllRunningInstancesOnDHN(resourceID, cred, epr);
|
riID=DISHLSClient.getRunningInstanceManager(cred,epr).getAllRunningInstancesOnDHN(resourceID, cred, epr);
|
||||||
} catch (DISHLSClientException e) {
|
} catch (DISHLSClientException e) {
|
||||||
logger.error("VDLModel: Error initializing DB with DHN and RI (DISHLSClient error)");
|
//logger.error("VDLModel: Error initializing DB with DHN and RI (DISHLSClient error)");
|
||||||
throw new RemoteException("Error querying DIS-IP (DISHLSClient error)", e);
|
throw new RemoteException("Error querying DIS-IP (DISHLSClient error)", e);
|
||||||
} catch (DISHLSCredentialException e) {
|
} catch (DISHLSCredentialException e) {
|
||||||
logger.error("VDLModel: Error initializing DB with DHN and RI (Credential error)");
|
//logger.error("VDLModel: Error initializing DB with DHN and RI (Credential error)");
|
||||||
throw new RemoteException("Error querying DIS-IP (Credential error)", e);
|
throw new RemoteException("Error querying DIS-IP (Credential error)", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +568,8 @@ public class DIStoDBUtil {
|
||||||
DBInterface.InsertInto("dhn", resultsDHNParsed, false);
|
DBInterface.InsertInto("dhn", resultsDHNParsed, false);
|
||||||
DBInterface.InsertInto("runninginstance", resultsRIParsed, false);
|
DBInterface.InsertInto("runninginstance", resultsRIParsed, false);
|
||||||
DBInterface.InsertInto("dhnrelatedri", DNHRelatedRIArray.toArray(new String[0][0]), false);
|
DBInterface.InsertInto("dhnrelatedri", DNHRelatedRIArray.toArray(new String[0][0]), false);
|
||||||
}catch (SQLException e){logger.error("error updating DHN on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating DHN on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -581,7 +578,8 @@ public class DIStoDBUtil {
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.ExecuteUpdate("Delete from dhn where id='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from dhn where id='"+resourceID+"'");
|
||||||
DBInterface.ExecuteUpdate("Delete from dhnrelatedri where DHNID='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from dhnrelatedri where DHNID='"+resourceID+"'");
|
||||||
}catch (SQLException e){logger.error("error updating DHN on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating DHN on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -598,7 +596,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("cs", resultsParsed, false);
|
DBInterface.InsertInto("cs", resultsParsed, false);
|
||||||
}catch (SQLException e){logger.error("error updating CS on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating CS on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -606,7 +605,8 @@ public class DIStoDBUtil {
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.ExecuteUpdate("Delete from cs where id='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from cs where id='"+resourceID+"'");
|
||||||
}catch (SQLException e){logger.error("error updating CS on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating CS on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,8 @@ public class DIStoDBUtil {
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("runninginstance", resultsRIParsed, false);
|
DBInterface.InsertInto("runninginstance", resultsRIParsed, false);
|
||||||
DBInterface.InsertInto("dhnrelatedri", resultRelatedDhn, false);
|
DBInterface.InsertInto("dhnrelatedri", resultRelatedDhn, false);
|
||||||
}catch (SQLException e){logger.error("error updating RI on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating RI on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -635,7 +636,8 @@ public class DIStoDBUtil {
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
DBInterface.ExecuteUpdate("Delete from runninginstance where id='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from runninginstance where id='"+resourceID+"'");
|
||||||
DBInterface.ExecuteUpdate("Delete from dhnrelatedri where RIID='"+resourceID+"'");
|
DBInterface.ExecuteUpdate("Delete from dhnrelatedri where RIID='"+resourceID+"'");
|
||||||
}catch (SQLException e){logger.error("error updating RI on DB"); e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
}catch (SQLException e){//logger.error("error updating RI on DB");
|
||||||
|
e.printStackTrace(); throw new RemoteException(e.getMessage(),e); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue