git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@5224 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
20529f2353
commit
d756cc37f0
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORELIBS"/>
|
||||||
|
<classpathentry kind="lib" path="/home/lucio/gCore/lib/org.gcube.vremanagement.vremodeler.stubs.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>VREModeler</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
|
@ -153,12 +153,6 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
<fileset dir="${schema.dir}"/>
|
<fileset dir="${schema.dir}"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
<!-- Populates library folder -->
|
|
||||||
<copy toDir="${build.lib.dir}">
|
|
||||||
<fileset dir="${lib.location}">
|
|
||||||
<exclude name="${jarfile.stubs}" />
|
|
||||||
</fileset>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
<xsd:element name="createResourceResponse" type="wsa:EndpointReferenceType"/>
|
<xsd:element name="createResourceResponse" type="wsa:EndpointReferenceType"/>
|
||||||
|
|
||||||
|
|
||||||
<xsd:element name="getAllDLsMessageResponse" type="xsd:string"/>
|
<xsd:element name="getAllVREsMessageResponse" type="xsd:string"/>
|
||||||
<xsd:element name="getAllDLsMessageRequest" type="coretypes:VOID"/>
|
<xsd:element name="getAllVREsMessageRequest" type="coretypes:VOID"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@
|
||||||
|
|
||||||
<xsd:element name="initDBResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="initDBResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="removeDLRequestMessage" type="xsd:string"/>
|
<xsd:element name="removeVRERequestMessage" type="xsd:string"/>
|
||||||
|
|
||||||
|
|
||||||
<xsd:element name="removeDLResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="removeVREResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="getExistingNamesResponseMessage">
|
<xsd:element name="getExistingNamesResponseMessage">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
|
@ -72,11 +72,11 @@
|
||||||
<message name="CreateResourceResponse">
|
<message name="CreateResourceResponse">
|
||||||
<part name="response" element="tns:createResourceResponse"/>
|
<part name="response" element="tns:createResourceResponse"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="GetAllDLsRequest">
|
<message name="GetAllVREsRequest">
|
||||||
<part name="request" element="tns:getAllDLsMessageRequest"/>
|
<part name="request" element="tns:getAllVREsMessageRequest"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="GetAllDLsResponse">
|
<message name="GetAllVREsResponse">
|
||||||
<part name="response" element="tns:getAllDLsMessageResponse"/>
|
<part name="response" element="tns:getAllVREsMessageResponse"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="InitDBInputMessage">
|
<message name="InitDBInputMessage">
|
||||||
<part name="request" element="tns:initDBRequestMessage"/>
|
<part name="request" element="tns:initDBRequestMessage"/>
|
||||||
|
@ -84,11 +84,11 @@
|
||||||
<message name="InitDBOutputMessage">
|
<message name="InitDBOutputMessage">
|
||||||
<part name="response" element="tns:initDBResponseMessage"/>
|
<part name="response" element="tns:initDBResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="RemoveDLInputMessage">
|
<message name="RemoveVREInputMessage">
|
||||||
<part name="request" element="tns:removeDLRequestMessage"/>
|
<part name="request" element="tns:removeVRERequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="RemoveDLOutputMessage">
|
<message name="RemoveVREOutputMessage">
|
||||||
<part name="response" element="tns:removeDLResponseMessage"/>
|
<part name="response" element="tns:removeVREResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="GetExistingNamesInputMessage">
|
<message name="GetExistingNamesInputMessage">
|
||||||
<part name="request" element="tns:getExistingNamesRequestMessage"/>
|
<part name="request" element="tns:getExistingNamesRequestMessage"/>
|
||||||
|
@ -108,9 +108,9 @@
|
||||||
<input message="tns:CreateResourceRequest"/>
|
<input message="tns:CreateResourceRequest"/>
|
||||||
<output message="tns:CreateResourceResponse"/>
|
<output message="tns:CreateResourceResponse"/>
|
||||||
</operation>
|
</operation>
|
||||||
<operation name="getAllDLs">
|
<operation name="getAllVREs">
|
||||||
<input message="tns:GetAllDLsRequest"/>
|
<input message="tns:GetAllVREsRequest"/>
|
||||||
<output message="tns:GetAllDLsResponse"/>
|
<output message="tns:GetAllVREsResponse"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="initDB">
|
<operation name="initDB">
|
||||||
|
@ -118,14 +118,14 @@
|
||||||
<output message="tns:InitDBOutputMessage"/>
|
<output message="tns:InitDBOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="getExistingNamesDLs">
|
<operation name="getExistingNamesVREs">
|
||||||
<input message="tns:GetExistingNamesInputMessage"/>
|
<input message="tns:GetExistingNamesInputMessage"/>
|
||||||
<output message="tns:GetExistingNamesOutputMessage"/>
|
<output message="tns:GetExistingNamesOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="removeDL">
|
<operation name="removeVRE">
|
||||||
<input message="tns:RemoveDLInputMessage"/>
|
<input message="tns:RemoveVREInputMessage"/>
|
||||||
<output message="tns:RemoveDLOutputMessage"/>
|
<output message="tns:RemoveVREOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
</portType>
|
</portType>
|
||||||
|
|
||||||
|
|
|
@ -32,24 +32,24 @@
|
||||||
|
|
||||||
<!-- REQUESTS AND RESPONSES -->
|
<!-- REQUESTS AND RESPONSES -->
|
||||||
|
|
||||||
<xsd:element name="getVdlModelRequestMessage" type="coretypes:VOID"/>
|
<xsd:element name="getVREModelRequestMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="getVdlModelResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="getVREModelResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:complexType name="vdlRequest">
|
<xsd:complexType name="VRERequest">
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="DLName" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
<xsd:element name="VREName" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
||||||
<xsd:element name="DLDescription" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
<xsd:element name="VREDescription" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
||||||
<xsd:element name="DLDesigner" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
<xsd:element name="VREDesigner" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
||||||
<xsd:element name="DLManager" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
<xsd:element name="VREManager" type="xsd:string" minOccurs="1" maxOccurs="1" />
|
||||||
<xsd:element name="StartTime" type="xsd:long" minOccurs="1" maxOccurs="1" />
|
<xsd:element name="StartTime" type="xsd:long" minOccurs="1" maxOccurs="1" />
|
||||||
<xsd:element name="EndTime" type="xsd:long" minOccurs="1" maxOccurs="1" />
|
<xsd:element name="EndTime" type="xsd:long" minOccurs="1" maxOccurs="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
|
|
||||||
<xsd:element name="setVdlModelRequestMessage" type="tns:vdlRequest"/>
|
<xsd:element name="setVREModelRequestMessage" type="tns:VRERequest"/>
|
||||||
|
|
||||||
<xsd:element name="setVdlModelResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="setVREModelResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="getCollectionRequestMessage" type="coretypes:VOID"/>
|
<xsd:element name="getCollectionRequestMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
|
@ -111,27 +111,27 @@
|
||||||
|
|
||||||
<xsd:element name="setFunctionalityRequestMessage" type="tns:functionalityIDArray"/>
|
<xsd:element name="setFunctionalityRequestMessage" type="tns:functionalityIDArray"/>
|
||||||
|
|
||||||
<xsd:element name="getDHNResponseMessage" type="xsd:string"/>
|
<xsd:element name="getGHNResponseMessage" type="xsd:string"/>
|
||||||
|
|
||||||
<xsd:element name="getDHNRequestMessage" type="coretypes:VOID"/>
|
<xsd:element name="getGHNRequestMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="setDHNResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="setGHNResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:complexType name="DHNArray">
|
<xsd:complexType name="GHNArray">
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="DHNElement" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
|
<xsd:element name="GHNElement" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
|
|
||||||
<xsd:element name="setDHNRequestMessage" type="tns:DHNArray"/>
|
<xsd:element name="setGHNRequestMessage" type="tns:GHNArray"/>
|
||||||
|
|
||||||
<xsd:element name="setDLtoPendingStateRequestMessage" type="coretypes:VOID"/>
|
<xsd:element name="setVREtoPendingStateRequestMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="setDLtoPendingStateResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="setVREtoPendingStateResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="deployDLRequestMessage" type="coretypes:VOID"/>
|
<xsd:element name="deployVRERequestMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="deployDLResponseMessage" type="coretypes:VOID"/>
|
<xsd:element name="deployVREResponseMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,18 +159,18 @@
|
||||||
|
|
||||||
============================================================-->
|
============================================================-->
|
||||||
|
|
||||||
<message name="GetVDLModelInputMessage">
|
<message name="GetVREModelInputMessage">
|
||||||
<part name="request" element="tns:getVdlModelRequestMessage"/>
|
<part name="request" element="tns:getVREModelRequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="GetVDLModelOutputMessage">
|
<message name="GetVREModelOutputMessage">
|
||||||
<part name="response" element="tns:getVdlModelResponseMessage"/>
|
<part name="response" element="tns:getVREModelResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="SetVDLModelInputMessage">
|
<message name="SetVREModelInputMessage">
|
||||||
<part name="request" element="tns:setVdlModelRequestMessage"/>
|
<part name="request" element="tns:setVREModelRequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="SetVDLModelOutputMessage">
|
<message name="SetVREModelOutputMessage">
|
||||||
<part name="response" element="tns:setVdlModelResponseMessage"/>
|
<part name="response" element="tns:setVREModelResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="GetCollectionInputMessage">
|
<message name="GetCollectionInputMessage">
|
||||||
|
@ -230,32 +230,32 @@
|
||||||
<part name="response" element="tns:setFunctionalityResponseMessage"/>
|
<part name="response" element="tns:setFunctionalityResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="GetDHNInputMessage">
|
<message name="GetGHNInputMessage">
|
||||||
<part name="request" element="tns:getDHNRequestMessage"/>
|
<part name="request" element="tns:getGHNRequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="GetDHNOutputMessage">
|
<message name="GetGHNOutputMessage">
|
||||||
<part name="response" element="tns:getDHNResponseMessage"/>
|
<part name="response" element="tns:getGHNResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="SetDHNInputMessage">
|
<message name="SetGHNInputMessage">
|
||||||
<part name="request" element="tns:setDHNRequestMessage"/>
|
<part name="request" element="tns:setGHNRequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="SetDHNOutputMessage">
|
<message name="SetGHNOutputMessage">
|
||||||
<part name="response" element="tns:setDHNResponseMessage"/>
|
<part name="response" element="tns:setGHNResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="SetDLtoPendingStateInputMessage">
|
<message name="SetVREtoPendingStateInputMessage">
|
||||||
<part name="request" element="tns:setDLtoPendingStateRequestMessage"/>
|
<part name="request" element="tns:setVREtoPendingStateRequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="SetDLtoPendingStateOutputMessage">
|
<message name="SetVREtoPendingStateOutputMessage">
|
||||||
<part name="response" element="tns:setDLtoPendingStateResponseMessage"/>
|
<part name="response" element="tns:setVREtoPendingStateResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="DeployDLInputMessage">
|
<message name="DeployVREInputMessage">
|
||||||
<part name="request" element="tns:deployDLRequestMessage"/>
|
<part name="request" element="tns:deployVRERequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
<message name="DeployDLOutputMessage">
|
<message name="DeployVREOutputMessage">
|
||||||
<part name="response" element="tns:deployDLResponseMessage"/>
|
<part name="response" element="tns:deployVREResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
|
||||||
|
@ -271,14 +271,14 @@
|
||||||
wsrp:ResourceProperties="tns:ModelerProperties"
|
wsrp:ResourceProperties="tns:ModelerProperties"
|
||||||
wsdlpp:extends="provider:GCUBEProvider">
|
wsdlpp:extends="provider:GCUBEProvider">
|
||||||
|
|
||||||
<operation name="setDLModel">
|
<operation name="setVREModel">
|
||||||
<input message="tns:SetVDLModelInputMessage"/>
|
<input message="tns:SetVREModelInputMessage"/>
|
||||||
<output message="tns:SetVDLModelOutputMessage"/>
|
<output message="tns:SetVREModelOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="getDLModel">
|
<operation name="getVREModel">
|
||||||
<input message="tns:GetVDLModelInputMessage"/>
|
<input message="tns:GetVREModelInputMessage"/>
|
||||||
<output message="tns:GetVDLModelOutputMessage"/>
|
<output message="tns:GetVREModelOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,24 +324,24 @@
|
||||||
<output message="tns:SetFunctionalityOutputMessage"/>
|
<output message="tns:SetFunctionalityOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="getDHNs">
|
<operation name="getGHNs">
|
||||||
<input message="tns:GetDHNInputMessage"/>
|
<input message="tns:GetGHNInputMessage"/>
|
||||||
<output message="tns:GetDHNOutputMessage"/>
|
<output message="tns:GetGHNOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="setDHNs">
|
<operation name="setGHNs">
|
||||||
<input message="tns:SetDHNInputMessage"/>
|
<input message="tns:SetGHNInputMessage"/>
|
||||||
<output message="tns:SetDHNOutputMessage"/>
|
<output message="tns:SetGHNOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="setDLtoPendingState">
|
<operation name="setVREtoPendingState">
|
||||||
<input message="tns:SetDLtoPendingStateInputMessage"/>
|
<input message="tns:SetVREtoPendingStateInputMessage"/>
|
||||||
<output message="tns:SetDLtoPendingStateOutputMessage"/>
|
<output message="tns:SetVREtoPendingStateOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="deployDL">
|
<operation name="deployVRE">
|
||||||
<input message="tns:DeployDLInputMessage"/>
|
<input message="tns:DeployVREInputMessage"/>
|
||||||
<output message="tns:DeployDLOutputMessage"/>
|
<output message="tns:DeployVREOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,15 @@
|
||||||
package org.gcube.vremanagement.vremodeler.db;
|
package org.gcube.vremanagement.vremodeler.db;
|
||||||
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
|
||||||
import org.apache.axis.components.uuid.UUIDGen;
|
import org.apache.axis.components.uuid.UUIDGen;
|
||||||
import org.apache.axis.components.uuid.UUIDGenFactory;
|
import org.apache.axis.components.uuid.UUIDGenFactory;
|
||||||
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.LogFactory;
|
|
||||||
import org.gcube.common.core.contexts.GHNContext;
|
import org.gcube.common.core.contexts.GHNContext;
|
||||||
import org.gcube.common.core.faults.GCUBEFault;
|
import org.gcube.common.core.faults.GCUBEFault;
|
||||||
import org.gcube.common.core.informationsystem.client.AtomicCondition;
|
|
||||||
import org.gcube.common.core.informationsystem.client.ISClient;
|
import org.gcube.common.core.informationsystem.client.ISClient;
|
||||||
import org.gcube.common.core.informationsystem.client.ISQuery;
|
|
||||||
import org.gcube.common.core.informationsystem.client.queries.GCUBECSQuery;
|
import org.gcube.common.core.informationsystem.client.queries.GCUBECSQuery;
|
||||||
import org.gcube.common.core.informationsystem.client.queries.GCUBECollectionQuery;
|
import org.gcube.common.core.informationsystem.client.queries.GCUBECollectionQuery;
|
||||||
import org.gcube.common.core.informationsystem.client.queries.GCUBEGHNQuery;
|
import org.gcube.common.core.informationsystem.client.queries.GCUBEGHNQuery;
|
||||||
|
@ -32,18 +20,10 @@ import org.gcube.common.core.resources.GCUBECS;
|
||||||
import org.gcube.common.core.resources.GCUBECollection;
|
import org.gcube.common.core.resources.GCUBECollection;
|
||||||
import org.gcube.common.core.resources.GCUBEHostingNode;
|
import org.gcube.common.core.resources.GCUBEHostingNode;
|
||||||
import org.gcube.common.core.resources.GCUBEMCollection;
|
import org.gcube.common.core.resources.GCUBEMCollection;
|
||||||
import org.gcube.common.core.resources.GCUBEResource;
|
|
||||||
import org.gcube.common.core.resources.GCUBERunningInstance;
|
import org.gcube.common.core.resources.GCUBERunningInstance;
|
||||||
import org.gcube.common.core.resources.GCUBEService;
|
import org.gcube.common.core.resources.GCUBEService;
|
||||||
import org.gcube.common.core.scope.GCUBEScope;
|
import org.gcube.common.core.scope.GCUBEScope;
|
||||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.ModelFactoryService;
|
|
||||||
import org.globus.axis.gsi.GSIConstants;
|
|
||||||
import org.gridforum.jgss.ExtendedGSSCredential;
|
|
||||||
import org.w3c.dom.Document;
|
|
||||||
import org.w3c.dom.Element;
|
|
||||||
import org.w3c.dom.NodeList;
|
|
||||||
import org.xml.sax.InputSource;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -193,10 +173,10 @@ public class IStoDBUtil {
|
||||||
//preparing collectionList to insert
|
//preparing collectionList to insert
|
||||||
//table declaration:
|
//table declaration:
|
||||||
//COLLECTION(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR,DESCRIPTION VARCHAR,MEMBERS VARCHAR,CREATION VARCHAR,LASTUPDATE VARCHAR)
|
//COLLECTION(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR,DESCRIPTION VARCHAR,MEMBERS VARCHAR,CREATION VARCHAR,LASTUPDATE VARCHAR)
|
||||||
List<List<String>> values = new LinkedList<List<String>>();
|
List<List<String>> values = new ArrayList<List<String>>(collectionList.size());
|
||||||
List<String> row;
|
List<String> row;
|
||||||
for (GCUBECollection col: collectionList ){
|
for (GCUBECollection col: collectionList ){
|
||||||
row= new LinkedList<String>();
|
row= new ArrayList<String>(6);
|
||||||
row.add(col.getID());
|
row.add(col.getID());
|
||||||
row.add(col.getName());
|
row.add(col.getName());
|
||||||
row.add(col.getDescription());
|
row.add(col.getDescription());
|
||||||
|
@ -237,10 +217,10 @@ public class IStoDBUtil {
|
||||||
//preparing collectionList to insert
|
//preparing collectionList to insert
|
||||||
//table declaration:
|
//table declaration:
|
||||||
//MDCOLLECTION(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR,DESCRIPTION VARCHAR,RELATEDCOLLECTIONID VARCHAR NOT NULL)
|
//MDCOLLECTION(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR,DESCRIPTION VARCHAR,RELATEDCOLLECTIONID VARCHAR NOT NULL)
|
||||||
List<List<String>> values = new LinkedList<List<String>>();
|
List<List<String>> values = new ArrayList<List<String>>(collectionList.size());
|
||||||
List<String> row;
|
List<String> row;
|
||||||
for (GCUBEMCollection col: collectionList ){
|
for (GCUBEMCollection col: collectionList ){
|
||||||
row= new LinkedList<String>();
|
row= new ArrayList<String>(4);
|
||||||
row.add(col.getID());
|
row.add(col.getID());
|
||||||
row.add(col.getName());
|
row.add(col.getName());
|
||||||
row.add(col.getDescription());
|
row.add(col.getDescription());
|
||||||
|
@ -438,10 +418,10 @@ public class IStoDBUtil {
|
||||||
//preparing collectionList to insert
|
//preparing collectionList to insert
|
||||||
//table declaration:
|
//table declaration:
|
||||||
//TABLE CS(ID VARCHAR NOT NULL PRIMARY KEY, NAME VARCHAR NOT NULL, DESCRIPTION VARCHAR NOT NULL)
|
//TABLE CS(ID VARCHAR NOT NULL PRIMARY KEY, NAME VARCHAR NOT NULL, DESCRIPTION VARCHAR NOT NULL)
|
||||||
List<List<String>> values = new LinkedList<List<String>>();
|
List<List<String>> values = new ArrayList<List<String>>(csList.size());
|
||||||
List<String> row;
|
List<String> row;
|
||||||
for (GCUBECS cs: csList ){
|
for (GCUBECS cs: csList ){
|
||||||
row= new LinkedList<String>();
|
row= new ArrayList<String>(3);
|
||||||
row.add(cs.getID());
|
row.add(cs.getID());
|
||||||
row.add(cs.getProcessName());
|
row.add(cs.getProcessName());
|
||||||
row.add(cs.getDescription());
|
row.add(cs.getDescription());
|
||||||
|
@ -464,7 +444,7 @@ public class IStoDBUtil {
|
||||||
|
|
||||||
private static void insertGHN(GCUBEScope scope) throws GCUBEFault {
|
private static void insertGHN(GCUBEScope scope) throws GCUBEFault {
|
||||||
List<GCUBEHostingNode> ghnList= null;
|
List<GCUBEHostingNode> ghnList= null;
|
||||||
List<GCUBERunningInstance> riTotalList= new LinkedList<GCUBERunningInstance>();;
|
List<GCUBERunningInstance> riTotalList= new ArrayList<GCUBERunningInstance>();;
|
||||||
try{
|
try{
|
||||||
if (queryClient==null) queryClient= GHNContext.getImplementation(ISClient.class);
|
if (queryClient==null) queryClient= GHNContext.getImplementation(ISClient.class);
|
||||||
GCUBEGHNQuery query= queryClient.getQuery(GCUBEGHNQuery.class);
|
GCUBEGHNQuery query= queryClient.getQuery(GCUBEGHNQuery.class);
|
||||||
|
@ -480,10 +460,10 @@ public class IStoDBUtil {
|
||||||
//preparing collectionList to insert
|
//preparing collectionList to insert
|
||||||
//table declaration:
|
//table declaration:
|
||||||
//TABLE DHN(ID VARCHAR NOT NULL PRIMARY KEY,HOST VARCHAR,SECURITY VARCHAR,UPTIME VARCHAR,MAINMEMORYVA VARCHAR,MAINMEMORYVS VARCHAR,LOCALAS VARCHAR,LOCATION VARCHAR,COUNTRY VARCHAR,DOMAIN VARCHAR)
|
//TABLE DHN(ID VARCHAR NOT NULL PRIMARY KEY,HOST VARCHAR,SECURITY VARCHAR,UPTIME VARCHAR,MAINMEMORYVA VARCHAR,MAINMEMORYVS VARCHAR,LOCALAS VARCHAR,LOCATION VARCHAR,COUNTRY VARCHAR,DOMAIN VARCHAR)
|
||||||
List<List<String>> values = new LinkedList<List<String>>();
|
List<List<String>> values = new ArrayList<List<String>>(ghnList.size());
|
||||||
List<String> row;
|
List<String> row;
|
||||||
for (GCUBEHostingNode ghn: ghnList ){
|
for (GCUBEHostingNode ghn: ghnList ){
|
||||||
row= new LinkedList<String>();
|
row= new ArrayList<String>(10);
|
||||||
String id= ghn.getID();
|
String id= ghn.getID();
|
||||||
row.add(id);
|
row.add(id);
|
||||||
row.add(ghn.getNodeDescription().getName());
|
row.add(ghn.getNodeDescription().getName());
|
||||||
|
@ -513,20 +493,20 @@ public class IStoDBUtil {
|
||||||
//RUNNINGINSTANCE(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL, CLASS VARCHAR NOT NULL)
|
//RUNNINGINSTANCE(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL, CLASS VARCHAR NOT NULL)
|
||||||
//GHNRELATEDRI(DHNID VARCHAR NOT NULL,RIID VARCHAR NOT NULL,PRIMARY KEY(DHNID,RIID))
|
//GHNRELATEDRI(DHNID VARCHAR NOT NULL,RIID VARCHAR NOT NULL,PRIMARY KEY(DHNID,RIID))
|
||||||
if (riTotalList!=null & riTotalList.size()>0){
|
if (riTotalList!=null & riTotalList.size()>0){
|
||||||
riValues = new LinkedList<List<String>>();
|
riValues = new ArrayList<List<String>>();
|
||||||
List<String> riRow;
|
List<String> riRow;
|
||||||
|
|
||||||
riRelatedGHNvalues = new LinkedList<List<String>>();
|
riRelatedGHNvalues = new ArrayList<List<String>>(riTotalList.size());
|
||||||
List<String> riRelatedGHNrow;
|
List<String> riRelatedGHNrow;
|
||||||
|
|
||||||
for (GCUBERunningInstance ri :riTotalList){
|
for (GCUBERunningInstance ri :riTotalList){
|
||||||
riRow= new LinkedList<String>();
|
riRow= new ArrayList<String>(3);
|
||||||
riRow.add(ri.getID());
|
riRow.add(ri.getID());
|
||||||
riRow.add(ri.getServiceName());
|
riRow.add(ri.getServiceName());
|
||||||
riRow.add(ri.getServiceClass());
|
riRow.add(ri.getServiceClass());
|
||||||
riValues.add(riRow);
|
riValues.add(riRow);
|
||||||
|
|
||||||
riRelatedGHNrow= new LinkedList<String>();
|
riRelatedGHNrow= new ArrayList<String>();
|
||||||
riRelatedGHNrow.add(ri.getGHNID());
|
riRelatedGHNrow.add(ri.getGHNID());
|
||||||
riRelatedGHNrow.add(ri.getID());
|
riRelatedGHNrow.add(ri.getID());
|
||||||
riRelatedGHNvalues.add(riRelatedGHNrow);
|
riRelatedGHNvalues.add(riRelatedGHNrow);
|
||||||
|
@ -559,10 +539,10 @@ public class IStoDBUtil {
|
||||||
//table declaration:
|
//table declaration:
|
||||||
// RELATEDSERVICEID(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL)
|
// RELATEDSERVICEID(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL)
|
||||||
//this table represent the service available on the IS
|
//this table represent the service available on the IS
|
||||||
List<List<String>> values = new LinkedList<List<String>>();
|
List<List<String>> values = new ArrayList<List<String>>(serviceList.size());
|
||||||
List<String> row;
|
List<String> row;
|
||||||
for (GCUBEService service: serviceList ){
|
for (GCUBEService service: serviceList ){
|
||||||
row = new LinkedList<String>();
|
row = new ArrayList<String>(3);
|
||||||
row.add(service.getID());
|
row.add(service.getID());
|
||||||
row.add(service.getServiceName());
|
row.add(service.getServiceName());
|
||||||
row.add(service.getServiceClass());
|
row.add(service.getServiceClass());
|
||||||
|
|
|
@ -10,7 +10,6 @@ import org.gcube.common.core.faults.GCUBEFault;
|
||||||
import org.gcube.common.core.porttypes.GCUBEStartupPortType;
|
import org.gcube.common.core.porttypes.GCUBEStartupPortType;
|
||||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||||
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.GetExistingNamesResponseMessage;
|
|
||||||
import org.globus.wsrf.encoding.ObjectDeserializer;
|
import org.globus.wsrf.encoding.ObjectDeserializer;
|
||||||
import org.globus.wsrf.tests.basic.CreateResource;
|
import org.globus.wsrf.tests.basic.CreateResource;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
@ -85,7 +84,7 @@ public class ModelFactoryService extends GCUBEStartupPortType{
|
||||||
* @return String
|
* @return String
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*/
|
*/
|
||||||
public String getAllDLs() throws GCUBEFault{
|
public String getAllVREs() throws GCUBEFault{
|
||||||
String toReturn = null;
|
String toReturn = null;
|
||||||
ResultSet res=null;
|
ResultSet res=null;
|
||||||
try{
|
try{
|
||||||
|
@ -93,7 +92,7 @@ public class ModelFactoryService extends GCUBEStartupPortType{
|
||||||
res= DBInterface.queryDB("select DL.name, DL.description, DL.status, DL.epr from DL;");
|
res= DBInterface.queryDB("select DL.name, DL.description, DL.status, DL.epr from DL;");
|
||||||
}catch(Exception e) {logger.error("VDL Model: error on DB"); throw new GCUBEFault(e);}
|
}catch(Exception e) {logger.error("VDL Model: error on DB"); throw new GCUBEFault(e);}
|
||||||
try {
|
try {
|
||||||
toReturn=XMLUtil.PrepareAllDLsXML(res);
|
toReturn=XMLUtil.PrepareAllVREsXML(res);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("VDLModel parsing error in function getAllDLs "+e.getMessage());
|
logger.error("VDLModel parsing error in function getAllDLs "+e.getMessage());
|
||||||
throw new GCUBEFault(e);
|
throw new GCUBEFault(e);
|
||||||
|
@ -113,7 +112,7 @@ public class ModelFactoryService extends GCUBEStartupPortType{
|
||||||
*/
|
*/
|
||||||
public void removeDL(String request) throws GCUBEFault{
|
public void removeDL(String request) throws GCUBEFault{
|
||||||
try{
|
try{
|
||||||
ResultSet res=DBInterface.queryDB("Select DL.epr from DL where DL.id='"+request+"';");
|
ResultSet res=DBInterface.queryDB("Select VRE.epr from VRE where VRE.id='"+request+"';");
|
||||||
EndpointReferenceType dlEpr;
|
EndpointReferenceType dlEpr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,10 +120,10 @@ public class ModelFactoryService extends GCUBEStartupPortType{
|
||||||
StringReader stringReader = new StringReader(res.getString(1));
|
StringReader stringReader = new StringReader(res.getString(1));
|
||||||
InputSource inputSource = new InputSource(stringReader);
|
InputSource inputSource = new InputSource(stringReader);
|
||||||
dlEpr = (EndpointReferenceType) ObjectDeserializer.deserialize(inputSource, EndpointReferenceType.class);
|
dlEpr = (EndpointReferenceType) ObjectDeserializer.deserialize(inputSource, EndpointReferenceType.class);
|
||||||
}else throw new Exception("DL not retreived in DB");
|
}else throw new Exception("VRE not retreived in DB");
|
||||||
|
|
||||||
//destroy the resource;
|
//destroy the resource;
|
||||||
DBInterface.ExecuteUpdate("DELETE FROM DL where DL.id='"+request+"';");
|
DBInterface.ExecuteUpdate("DELETE FROM VRE where VRE.id='"+request+"';");
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("VDLModel: "+e.getMessage());
|
logger.error("VDLModel: "+e.getMessage());
|
||||||
|
|
|
@ -5,13 +5,16 @@ import java.sql.Date;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.common.core.faults.GCUBEFault;
|
import org.gcube.common.core.faults.GCUBEFault;
|
||||||
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
|
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.DHNArray;
|
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.FunctionalityIDArray;
|
import org.gcube.vremanagement.vremodeler.stubs.FunctionalityIDArray;
|
||||||
|
import org.gcube.vremanagement.vremodeler.stubs.GHNArray;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.SetMDFormatArgs;
|
import org.gcube.vremanagement.vremodeler.stubs.SetMDFormatArgs;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.VdlRequest;
|
import org.gcube.vremanagement.vremodeler.stubs.VRERequest;
|
||||||
|
|
||||||
import org.globus.wsrf.ResourceException;
|
import org.globus.wsrf.ResourceException;
|
||||||
import org.globus.wsrf.encoding.ObjectSerializer;
|
import org.globus.wsrf.encoding.ObjectSerializer;
|
||||||
import org.globus.wsrf.encoding.SerializationException;
|
import org.globus.wsrf.encoding.SerializationException;
|
||||||
|
@ -31,7 +34,7 @@ public class ModelerService {
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setDLModel(VdlRequest request) throws GCUBEFault{
|
public void setVREModel(VRERequest request) throws GCUBEFault{
|
||||||
|
|
||||||
Date dateFrom=null, dateTo=null;
|
Date dateFrom=null, dateTo=null;
|
||||||
ResultSet res=null;
|
ResultSet res=null;
|
||||||
|
@ -41,7 +44,7 @@ public class ModelerService {
|
||||||
{
|
{
|
||||||
dateFrom=new Date(request.getStartTime());
|
dateFrom=new Date(request.getStartTime());
|
||||||
dateTo=new Date(request.getEndTime());
|
dateTo=new Date(request.getEndTime());
|
||||||
DBInterface.queryDB("update DL set name='"+request.getDLName()+"', description='"+request.getDLDescription()+"', dldesigner='"+request.getDLDesigner()+"', dlmanager= '"+request.getDLManager()+"', intervalfrom='"+dateFrom+"', intervalto='"+dateTo+"' where DL.id='"+getResource().getID()+"'; ");
|
DBInterface.queryDB("update VRE set name='"+request.getVREName()+"', description='"+request.getVREDescription()+"', dldesigner='"+request.getVREDesigner()+"', dlmanager= '"+request.getVREManager()+"', intervalfrom='"+dateFrom+"', intervalto='"+dateTo+"' where DL.id='"+getResource().getID()+"'; ");
|
||||||
}else{
|
}else{
|
||||||
dateFrom=new Date(request.getStartTime());
|
dateFrom=new Date(request.getStartTime());
|
||||||
dateTo=new Date(request.getEndTime());
|
dateTo=new Date(request.getEndTime());
|
||||||
|
@ -54,7 +57,7 @@ public class ModelerService {
|
||||||
throw new RemoteException("VDL Model Service: error serializing EPR",e);
|
throw new RemoteException("VDL Model Service: error serializing EPR",e);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBInterface.ExecuteUpdate("insert into DL values('"+getResource().getID()+"','"+request.getDLName()+"','"+request.getDLDescription()+"','"+request.getDLDesigner()+"','"+request.getDLManager()+"','"+dateFrom+"','"+dateTo+"','"+eprToString+"','In Progress'); ");
|
DBInterface.ExecuteUpdate("insert into VRE values('"+getResource().getID()+"','"+request.getVREName()+"','"+request.getVREDescription()+"','"+request.getVREDesigner()+"','"+request.getVREManager()+"','"+dateFrom+"','"+dateTo+"','"+eprToString+"','In Progress'); ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +78,7 @@ public class ModelerService {
|
||||||
* @return VoidType
|
* @return VoidType
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*/
|
*/
|
||||||
public String getDLModel() throws GCUBEFault{
|
public String getVREModel() throws GCUBEFault{
|
||||||
|
|
||||||
|
|
||||||
String toReturn =null;
|
String toReturn =null;
|
||||||
|
@ -86,7 +89,7 @@ public class ModelerService {
|
||||||
String ID=getResource().getId();
|
String ID=getResource().getId();
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
res=DBInterface.queryDB("select * from DL where DL.id='"+ID+"';");
|
res=DBInterface.queryDB("select * from DL where DL.id='"+ID+"';");
|
||||||
toReturn=XMLUtil.PrepareDLModelXML(res);
|
toReturn=XMLUtil.PrepareVREModelXML(res);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//logger.error("VDLModel parsing error in function getDLModel "+e.getMessage());
|
//logger.error("VDLModel parsing error in function getDLModel "+e.getMessage());
|
||||||
throw new GCUBEFault(e);
|
throw new GCUBEFault(e);
|
||||||
|
@ -101,22 +104,22 @@ public class ModelerService {
|
||||||
* @return a XML String
|
* @return a XML String
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*/
|
*/
|
||||||
public String getDHNs() throws GCUBEFault{
|
public String getGHNs() throws GCUBEFault{
|
||||||
ResultSet res;
|
ResultSet res;
|
||||||
ArrayList<String> relatedDHN=new ArrayList<String>();
|
ArrayList<String> relatedGHN=new ArrayList<String>();
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
res= DBInterface.queryDB("select * from DHN;");
|
res= DBInterface.queryDB("select * from GHN;");
|
||||||
|
|
||||||
ResultSet resRelated= DBInterface.queryDB("select dhnid from DLRELATEDDHN where DLRELATEDDHN.dlid='"+getResource().getId()+"';");
|
ResultSet resRelated= DBInterface.queryDB("select ghnid from VRERELATEDGHN where VRERELATEDGHN.dlid='"+getResource().getId()+"';");
|
||||||
while(resRelated.next()){
|
while(resRelated.next()){
|
||||||
relatedDHN.add(resRelated.getString(1));
|
relatedGHN.add(resRelated.getString(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e) {//logger.error("VDL Model: error on DB");
|
}catch(Exception e) {//logger.error("VDL Model: error on DB");
|
||||||
throw new GCUBEFault(e);}
|
throw new GCUBEFault(e);}
|
||||||
|
|
||||||
return XMLUtil.PrepareDHNsXML(res, relatedDHN);
|
return XMLUtil.PrepareGHNsXML(res, relatedGHN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,24 +130,24 @@ public class ModelerService {
|
||||||
* @return VoidType
|
* @return VoidType
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*/
|
*/
|
||||||
public void setDHNs(DHNArray request) throws GCUBEFault{
|
public void setGHNs(GHNArray request) throws GCUBEFault{
|
||||||
try{
|
try{
|
||||||
String instanceID=(String) getResource().getId();
|
String instanceID=(String) getResource().getId();
|
||||||
DBInterface.ExecuteUpdate("DELETE FROM DLRELATEDDHN WHERE DLRELATEDDHN.dlid='"+instanceID+"';");
|
DBInterface.ExecuteUpdate("DELETE FROM VRERELATEDDHN WHERE VRERELATEDDHN.vreid='"+instanceID+"';");
|
||||||
|
|
||||||
String[][] toInsert= new String[request.getDHNElement().length][2];
|
|
||||||
|
|
||||||
String dlKey=instanceID;
|
String dlKey=instanceID;
|
||||||
//logger.debug("KEY: "+dlKey);
|
|
||||||
|
|
||||||
for (int i=0; i<request.getDHNElement().length; i++)
|
ArrayList<List<String>> values= new ArrayList<List<String>>(request.getGHNElement().length);
|
||||||
|
ArrayList<String> row=null;
|
||||||
|
for (int i=0; i<request.getGHNElement().length; i++)
|
||||||
{
|
{
|
||||||
toInsert[i][0]=dlKey;
|
row= new ArrayList<String>(2);
|
||||||
toInsert[i][1]=request.getDHNElement()[i];
|
row.add(dlKey);
|
||||||
//logger.debug("selected dhn is: "+request.getCollectionElement()[i]);
|
row.add(request.getGHNElement()[i]);
|
||||||
|
values.add(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBInterface.InsertInto("DLRELATEDDHN", toInsert, false);
|
DBInterface.InsertInto("VRERELATEDGHN", values);
|
||||||
}catch(Exception e){throw new GCUBEFault(e);}
|
}catch(Exception e){throw new GCUBEFault(e);}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -165,7 +168,7 @@ public class ModelerService {
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
res= DBInterface.queryDB("select * from COLLECTION;");
|
res= DBInterface.queryDB("select * from COLLECTION;");
|
||||||
|
|
||||||
ResultSet resRelated= DBInterface.queryDB("select collid from DLRELATEDCOLLECTION where DLRELATEDCOLLECTION.dlid='"+getResource().getId()+"';");
|
ResultSet resRelated= DBInterface.queryDB("select collid from VRERELATEDCOLLECTION where VRERELATEDCOLLECTION.dlid='"+getResource().getId()+"';");
|
||||||
while(resRelated.next()){
|
while(resRelated.next()){
|
||||||
relatedCollection.add(resRelated.getString(1));
|
relatedCollection.add(resRelated.getString(1));
|
||||||
}
|
}
|
||||||
|
@ -186,21 +189,21 @@ public class ModelerService {
|
||||||
*/
|
*/
|
||||||
public void setCollection(CollectionArray request) throws GCUBEFault{
|
public void setCollection(CollectionArray request) throws GCUBEFault{
|
||||||
try{
|
try{
|
||||||
DBInterface.ExecuteUpdate("DELETE FROM DLRELATEDCOLLECTION WHERE DLRELATEDCOLLECTION.dlid='"+getResource().getID()+"';");
|
DBInterface.connect();
|
||||||
|
DBInterface.ExecuteUpdate("DELETE FROM VRERELATEDCOLLECTION WHERE VRERELATEDCOLLECTION.vreid='"+getResource().getID()+"';");
|
||||||
String[][] toInsert= new String[request.getCollectionElement().length][2];
|
|
||||||
|
|
||||||
String dlKey=(String) getResource().getId();
|
String dlKey=(String) getResource().getId();
|
||||||
//logger.debug("KEY: "+dlKey);
|
|
||||||
|
|
||||||
|
ArrayList<List<String>> values= new ArrayList<List<String>>(request.getCollectionElement().length);
|
||||||
|
ArrayList<String> row=null;
|
||||||
for (int i=0; i<request.getCollectionElement().length; i++)
|
for (int i=0; i<request.getCollectionElement().length; i++)
|
||||||
{
|
{
|
||||||
toInsert[i][0]=dlKey;
|
row = new ArrayList<String>(2);
|
||||||
toInsert[i][1]=request.getCollectionElement()[i];
|
row.add(dlKey);
|
||||||
//logger.debug("selected collection is: "+request.getCollectionElement()[i]);
|
row.add(request.getCollectionElement()[i]);
|
||||||
}
|
}
|
||||||
|
DBInterface.connect();
|
||||||
DBInterface.InsertInto("DLRELATEDCOLLECTION", toInsert, false);
|
DBInterface.InsertInto("VRERELATEDCOLLECTION", values);
|
||||||
}catch(Exception e){throw new GCUBEFault(e);}
|
}catch(Exception e){throw new GCUBEFault(e);}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -261,7 +264,7 @@ public class ModelerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return XMLUtil.PrepareMCFormatXML(resNative, resDerivable, totalMF, selectedMetadataStructure);
|
return XMLUtil.PrepareMCFormatXML(null, null, null, selectedMetadataStructure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,26 +280,25 @@ public class ModelerService {
|
||||||
try{
|
try{
|
||||||
DBInterface.ExecuteUpdate("DELETE FROM DLRELATEDMETADATAFORMAT WHERE DLRELATEDMETADATAFORMAT.dlid='"+getResource().getId()+"';");
|
DBInterface.ExecuteUpdate("DELETE FROM DLRELATEDMETADATAFORMAT WHERE DLRELATEDMETADATAFORMAT.dlid='"+getResource().getId()+"';");
|
||||||
String[] singleElement;
|
String[] singleElement;
|
||||||
ArrayList<String[]> elementsList= new ArrayList<String[]>();
|
|
||||||
String key=(String) getResource().getId();
|
String key=(String) getResource().getId();
|
||||||
|
|
||||||
//logger.debug(request.getCollectionIDArray().length+" "+request.getMdFormatIDArray().length+" "+request.getCheckedArray().length+" "+request.getCheckedArray(0).getCheckedRowElement().length);
|
//logger.debug(request.getCollectionIDArray().length+" "+request.getMdFormatIDArray().length+" "+request.getCheckedArray().length+" "+request.getCheckedArray(0).getCheckedRowElement().length);
|
||||||
|
ArrayList<List<String>> values= new ArrayList<List<String>>(request.getCollectionIDArray().length);
|
||||||
|
ArrayList<String> row=null;
|
||||||
for (int i=0; i<request.getCollectionIDArray().length; i++)
|
for (int i=0; i<request.getCollectionIDArray().length; i++)
|
||||||
for( int j=0; j<request.getMdFormatIDArray().length; j++)
|
for( int j=0; j<request.getMdFormatIDArray().length; j++)
|
||||||
{
|
{
|
||||||
if (request.getCheckedArray(i).getCheckedRowElement(j)){
|
if (request.getCheckedArray(i).getCheckedRowElement(j)){
|
||||||
singleElement=new String[3];
|
row =new ArrayList<String>(3);
|
||||||
singleElement[0]=key;
|
row.add(key);
|
||||||
singleElement[1]=request.getCollectionIDArray(i);
|
row.add(request.getCollectionIDArray(i));
|
||||||
singleElement[2]=request.getMdFormatIDArray(j);
|
row.add(request.getMdFormatIDArray(j));
|
||||||
elementsList.add(singleElement);
|
values.add(row);
|
||||||
//logger.debug("SELECTED coll "+singleElement[1]+" MF "+singleElement[2]);
|
|
||||||
}
|
}
|
||||||
//logger.debug("pervenuto: coll "+ request.getCollectionIDArray(i)+" MF "+request.getMdFormatIDArray(j));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBInterface.InsertInto("DLRELATEDMETADATAFORMAT", elementsList.toArray(new String[0][0]), false);
|
DBInterface.InsertInto("VRERELATEDMETADATAFORMAT", values);
|
||||||
}catch(Exception e){throw new GCUBEFault(e);}
|
}catch(Exception e){throw new GCUBEFault(e);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,10 +322,10 @@ public class ModelerService {
|
||||||
try {
|
try {
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
resFunct= DBInterface.queryDB("select * from functionality where father is null;");
|
resFunct= DBInterface.queryDB("select * from functionality where father is null;");
|
||||||
selectedFuncRes= DBInterface.queryDB("select funcid from DLRELATEDFUNCT where dlid='"+getResource().getID()+"';");
|
selectedFuncRes= DBInterface.queryDB("select funcid from DLRELATEDFUNCT where vreid='"+getResource().getID()+"';");
|
||||||
while (selectedFuncRes.next())
|
while (selectedFuncRes.next())
|
||||||
selectedFunctionality.add(selectedFuncRes.getInt(1));
|
selectedFunctionality.add(selectedFuncRes.getInt(1));
|
||||||
selectedCSRes= DBInterface.queryDB("select csid from DLRELATEDCS where dlid='"+getResource().getID()+"';");
|
selectedCSRes= DBInterface.queryDB("select csid from VRERELATEDCS where vreid='"+getResource().getID()+"';");
|
||||||
while (selectedCSRes.next())
|
while (selectedCSRes.next())
|
||||||
selectedCS.add(selectedCSRes.getString(1));
|
selectedCS.add(selectedCSRes.getString(1));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -345,34 +347,41 @@ public class ModelerService {
|
||||||
*/
|
*/
|
||||||
public void setFunctionality(FunctionalityIDArray request) throws GCUBEFault {
|
public void setFunctionality(FunctionalityIDArray request) throws GCUBEFault {
|
||||||
try{
|
try{
|
||||||
DBInterface.ExecuteUpdate("DELETE FROM DLRELATEDFUNCT WHERE DLRELATEDFUNCT.dlid='"+getResource().getId()+"';");
|
DBInterface.ExecuteUpdate("DELETE FROM VRERELATEDFUNCT WHERE VRERELATEDFUNCT.vreid='"+getResource().getId()+"';");
|
||||||
DBInterface.ExecuteUpdate("DELETE FROM DLRELATEDCS WHERE DLRELATEDCS.dlid='"+getResource().getId()+"';");
|
DBInterface.ExecuteUpdate("DELETE FROM VRERELATEDCS WHERE VRERELATEDCS.vreid='"+getResource().getId()+"';");
|
||||||
|
|
||||||
|
|
||||||
String dlKey=(String) getResource().getId();
|
String dlKey=(String) getResource().getId();
|
||||||
//logger.debug("KEY: "+dlKey);
|
//logger.debug("KEY: "+dlKey);
|
||||||
|
|
||||||
if (request.getFunctionalityIDElement()!=null){
|
if (request.getFunctionalityIDElement()!=null){
|
||||||
String[][] toInsertFunc= new String[request.getFunctionalityIDElement().length][2];
|
ArrayList<List<String>> values= new ArrayList<List<String>>(request.getFunctionalityIDElement().length);
|
||||||
|
ArrayList<String> row=null;
|
||||||
for (int i=0; i<request.getFunctionalityIDElement().length; i++)
|
for (int i=0; i<request.getFunctionalityIDElement().length; i++)
|
||||||
{
|
{
|
||||||
toInsertFunc[i][0]=dlKey;
|
row= new ArrayList<String>(2);
|
||||||
toInsertFunc[i][1]=request.getFunctionalityIDElement()[i];
|
row.add(dlKey);
|
||||||
|
row.add(request.getFunctionalityIDElement()[i]);
|
||||||
|
values.add(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBInterface.InsertInto("DLRELATEDFUNCT", toInsertFunc, false);
|
DBInterface.InsertInto("VRERELATEDFUNCT", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.getCsIDElement()!=null)
|
if (request.getCsIDElement()!=null)
|
||||||
{
|
{
|
||||||
String[][] toInsertCS= new String[request.getCsIDElement().length][2];
|
ArrayList<List<String>> values= new ArrayList<List<String>>(request.getCsIDElement().length);
|
||||||
|
ArrayList<String> row=null;
|
||||||
|
|
||||||
for (int i=0; i<request.getCsIDElement().length; i++)
|
for (int i=0; i<request.getCsIDElement().length; i++)
|
||||||
{
|
{
|
||||||
toInsertCS[i][0]=dlKey;
|
row= new ArrayList<String>(2);
|
||||||
toInsertCS[i][1]=request.getCsIDElement()[i];
|
row.add(dlKey);
|
||||||
|
row.add(request.getCsIDElement()[i]);
|
||||||
|
values.add(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBInterface.InsertInto("DLRELATEDCS", toInsertCS, false);
|
DBInterface.InsertInto("VRERELATEDCS", values);
|
||||||
}
|
}
|
||||||
}catch(Exception e){throw new GCUBEFault(e);}
|
}catch(Exception e){throw new GCUBEFault(e);}
|
||||||
|
|
||||||
|
@ -408,9 +417,9 @@ public class ModelerService {
|
||||||
* @return
|
* @return
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*/
|
*/
|
||||||
public void setDLtoPendingState() throws GCUBEFault{
|
public void setVREtoPendingState() throws GCUBEFault{
|
||||||
try{
|
try{
|
||||||
DBInterface.ExecuteUpdate("UPDATE DL SET STATUS='Pending' WHERE DL.id='"+getResource().getId()+"';");
|
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='Pending' WHERE VRE.id='"+getResource().getId()+"';");
|
||||||
}catch(Exception e){throw new GCUBEFault(e);}
|
}catch(Exception e){throw new GCUBEFault(e);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +429,7 @@ public class ModelerService {
|
||||||
* @return
|
* @return
|
||||||
* @throws RemoteException -
|
* @throws RemoteException -
|
||||||
*/
|
*/
|
||||||
public void deployDL() throws RemoteException{
|
public void deployVRE() throws RemoteException{
|
||||||
/*DBInterface.ExecuteUpdate("UPDATE DL SET STATUS='Deploying' WHERE DL.id='"+getResource().getId()+"';");
|
/*DBInterface.ExecuteUpdate("UPDATE DL SET STATUS='Deploying' WHERE DL.id='"+getResource().getId()+"';");
|
||||||
DLManagementFactoryServiceAddressingLocator dlMan=new DLManagementFactoryServiceAddressingLocator();
|
DLManagementFactoryServiceAddressingLocator dlMan=new DLManagementFactoryServiceAddressingLocator();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package org.gcube.vremanagement.vremodeler.impl;
|
package org.gcube.vremanagement.vremodeler.impl;
|
||||||
|
|
||||||
import org.gcube.common.core.contexts.GCUBEServiceContext;
|
import org.gcube.common.core.contexts.GCUBEServiceContext;
|
||||||
|
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||||
|
import org.gcube.vremanagement.vremodeler.db.IStoDBUtil;
|
||||||
|
|
||||||
public class ServiceContext extends GCUBEServiceContext{
|
public class ServiceContext extends GCUBEServiceContext{
|
||||||
|
|
||||||
|
@ -18,6 +20,7 @@ public class ServiceContext extends GCUBEServiceContext{
|
||||||
|
|
||||||
protected void onReady() throws Exception{
|
protected void onReady() throws Exception{
|
||||||
logger.info("ready event invoked on " + this.getName());
|
logger.info("ready event invoked on " + this.getName());
|
||||||
|
IStoDBUtil.initDB(ServiceContext.getContext().getStartScopes()[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class XMLUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected static String PrepareDHNsXML(ResultSet res, ArrayList<String> relatedDHNs){
|
protected static String PrepareGHNsXML(ResultSet res, ArrayList<String> relatedGHNs){
|
||||||
StringBuilder temp = new StringBuilder(),
|
StringBuilder temp = new StringBuilder(),
|
||||||
runningInstancesString ;
|
runningInstancesString ;
|
||||||
ResultSet riRes;
|
ResultSet riRes;
|
||||||
|
@ -65,8 +65,8 @@ public class XMLUtil {
|
||||||
temp.append("<ResultSet>");
|
temp.append("<ResultSet>");
|
||||||
try{
|
try{
|
||||||
while (res.next()){
|
while (res.next()){
|
||||||
selectedString= relatedDHNs.contains(res.getString("ID")) ? "true" : "false";
|
selectedString= relatedGHNs.contains(res.getString("ID")) ? "true" : "false";
|
||||||
riRes= DBInterface.queryDB("select RI.id, RI.name from RUNNINGINSTANCE as RI, DHNRELATEDRI as REL where REL.DHNID='"+res.getString("ID")+"' and REL.RIID=RI.ID");
|
riRes= DBInterface.queryDB("select RI.id, RI.name from RUNNINGINSTANCE as RI, GHNRELATEDRI as REL where REL.DHNID='"+res.getString("ID")+"' and REL.RIID=RI.ID");
|
||||||
runningInstancesString= new StringBuilder();
|
runningInstancesString= new StringBuilder();
|
||||||
while (riRes.next()){
|
while (riRes.next()){
|
||||||
runningInstancesString.append("<RunningInstance id=\"");
|
runningInstancesString.append("<RunningInstance id=\"");
|
||||||
|
@ -76,7 +76,7 @@ public class XMLUtil {
|
||||||
runningInstancesString.append("\" />");
|
runningInstancesString.append("\" />");
|
||||||
}
|
}
|
||||||
|
|
||||||
temp.append("<DHN><ID>");
|
temp.append("<GHN><ID>");
|
||||||
temp.append(res.getString(1));
|
temp.append(res.getString(1));
|
||||||
temp.append("</ID><Host>");
|
temp.append("</ID><Host>");
|
||||||
temp.append(res.getString(2));
|
temp.append(res.getString(2));
|
||||||
|
@ -100,7 +100,7 @@ public class XMLUtil {
|
||||||
temp.append(runningInstancesString);
|
temp.append(runningInstancesString);
|
||||||
temp.append("</RunningInstances><Libraries></Libraries></Info><Selected>");
|
temp.append("</RunningInstances><Libraries></Libraries></Info><Selected>");
|
||||||
temp.append(selectedString);
|
temp.append(selectedString);
|
||||||
temp.append("</Selected></DHN>");
|
temp.append("</Selected></GHN>");
|
||||||
}
|
}
|
||||||
}catch(SQLException e){//logger.error("database error "+e.getMessage());
|
}catch(SQLException e){//logger.error("database error "+e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -342,7 +342,7 @@ public class XMLUtil {
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
protected static String PrepareDLModelXML(ResultSet res) throws Exception{
|
protected static String PrepareVREModelXML(ResultSet res) throws Exception{
|
||||||
|
|
||||||
StringBuilder toReturn=new StringBuilder();
|
StringBuilder toReturn=new StringBuilder();
|
||||||
|
|
||||||
|
@ -351,11 +351,11 @@ public class XMLUtil {
|
||||||
toReturn.append(res.getString(2));
|
toReturn.append(res.getString(2));
|
||||||
toReturn.append("</Name><Description>");
|
toReturn.append("</Name><Description>");
|
||||||
toReturn.append(res.getString(3));
|
toReturn.append(res.getString(3));
|
||||||
toReturn.append("</Description><DLDesigner>");
|
toReturn.append("</Description><VREDesigner>");
|
||||||
toReturn.append(res.getString(4));
|
toReturn.append(res.getString(4));
|
||||||
toReturn.append("</DLDesigner><DLManager>");
|
toReturn.append("</DLDesigner><VREManager>");
|
||||||
toReturn.append(res.getString(5));
|
toReturn.append(res.getString(5));
|
||||||
toReturn.append("</DLManager><StartTime>");
|
toReturn.append("</VREManager><StartTime>");
|
||||||
toReturn.append(res.getDate(6).getTime());
|
toReturn.append(res.getDate(6).getTime());
|
||||||
toReturn.append("</StartTime><EndTime>");
|
toReturn.append("</StartTime><EndTime>");
|
||||||
toReturn.append(res.getDate(7).getTime());
|
toReturn.append(res.getDate(7).getTime());
|
||||||
|
@ -371,11 +371,11 @@ public class XMLUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected static String PrepareAllDLsXML(ResultSet res) throws Exception{
|
protected static String PrepareAllVREsXML(ResultSet res) throws Exception{
|
||||||
StringBuilder toReturn=new StringBuilder();
|
StringBuilder toReturn=new StringBuilder();
|
||||||
toReturn.append("<ResultSet>");
|
toReturn.append("<ResultSet>");
|
||||||
while (res.next()){
|
while (res.next()){
|
||||||
toReturn.append("<DL><Name>");
|
toReturn.append("<VRE><Name>");
|
||||||
toReturn.append(res.getString(1));
|
toReturn.append(res.getString(1));
|
||||||
toReturn.append("</Name><Description>");
|
toReturn.append("</Name><Description>");
|
||||||
toReturn.append(res.getString(2));
|
toReturn.append(res.getString(2));
|
||||||
|
@ -383,7 +383,7 @@ public class XMLUtil {
|
||||||
toReturn.append(res.getString(3));
|
toReturn.append(res.getString(3));
|
||||||
toReturn.append("</State><EPR>");
|
toReturn.append("</State><EPR>");
|
||||||
toReturn.append(res.getString(4));
|
toReturn.append(res.getString(4));
|
||||||
toReturn.append("</EPR></DL>");
|
toReturn.append("</EPR></VRE>");
|
||||||
}
|
}
|
||||||
|
|
||||||
toReturn.append("</ResultSet>");
|
toReturn.append("</ResultSet>");
|
||||||
|
|
Loading…
Reference in New Issue