git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@31276 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
18271f631c
commit
cda4d2f4c0
679
build.xml
679
build.xml
|
@ -1,15 +1,15 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!-- Ant buildfile for GCUBE Services
|
<!-- Ant buildfile for GCUBE Services
|
||||||
|
|
||||||
Version 0.5
|
Version 0.5
|
||||||
|
|
||||||
REQUIRED INPUT PROPERTIES
|
INPUT PROPERTIES
|
||||||
|
|
||||||
This buildfile assumes that the following properties have or may have been defined in a "build.properties" file
|
This buildfile assumes that the following properties have or may have been defined in a "build.properties" file
|
||||||
in the configuration directory of the service (or else using the -D flag on the command line).
|
in the configuration directory of the service (or else using the -D flag on the command line).
|
||||||
|
|
||||||
package: (mandatory) Root package of the service implementation: it should be the first package in the
|
package: (mandatory) Root package of the service implementation: it should be the first package in the
|
||||||
implementation hierarchy which uniquely identifies the implementation.
|
implementation hierarchy which uniquely identifies the implementation.
|
||||||
lib.dir: (mandatory) Root directory where auxiliary jar files are located. Ideally outside ${base.dir} as not needed for remote build and dynamic deployment.
|
lib.dir: (mandatory) Root directory where auxiliary jar files are located. Ideally outside ${base.dir} as not needed for remote build and dynamic deployment.
|
||||||
wsdl.<n>: (mandatory) Name of the <n>-th port-type of the service, as defined in the "name" attributed of the
|
wsdl.<n>: (mandatory) Name of the <n>-th port-type of the service, as defined in the "name" attributed of the
|
||||||
"definitions" root element of the corresponding WSDL file.
|
"definitions" root element of the corresponding WSDL file.
|
||||||
|
@ -24,20 +24,23 @@ package.<n>: (optional) The package name of the stubs generated from WSDL and/
|
||||||
etics.build: (optional) Set to 'true', it indicates that build structures and procedures
|
etics.build: (optional) Set to 'true', it indicates that build structures and procedures
|
||||||
should be optimised for remote builds in ETICS. If it is omitted, this buildfile will optimise build structures and procedures
|
should be optimised for remote builds in ETICS. If it is omitted, this buildfile will optimise build structures and procedures
|
||||||
for local builds.
|
for local builds.
|
||||||
|
full.stubs: (optional) Set to 'false', it excludes auxiliary stub code placed under ${package}/stubs when building the stub distribution.
|
||||||
|
It is intended to simplify realignment of auxiliary and standard stub in IDE environments in case the latter change in non backwards-compatible ways.
|
||||||
|
After re-alignment, the property is typically left to its default of 'true' to restore a joint build of all stub code.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<project default="deployService" name="GCUBE Service Buildfile">
|
<project default="deployService" name="GCUBE Service Buildfile">
|
||||||
|
|
||||||
<!-- environment -->
|
<!-- environment -->
|
||||||
<property environment="env" />
|
<property environment="env" />
|
||||||
|
|
||||||
<!-- external environment -->
|
<!-- external environment -->
|
||||||
<echo message="container.dir ->${env.GLOBUS_LOCATION}" level="info"/>
|
<echo message="container.dir ->${env.GLOBUS_LOCATION}" level="info"/>
|
||||||
<property name="container.dir" value="${env.GLOBUS_LOCATION}" />
|
<property name="container.dir" value="${env.GLOBUS_LOCATION}" />
|
||||||
<property name="container.schema.dir" location="${container.dir}/share/schema" />
|
<property name="container.schema.dir" location="${container.dir}/share/schema" />
|
||||||
<property name="build.packages" location="${container.dir}/share/gcore_tools/build-packages.xml" />
|
<property name="build.packages" location="${container.dir}/share/gcore_tools/build-packages.xml" />
|
||||||
<property name="build.stubs" location="${container.dir}/share/gcore_tools/build-stubs.xml" />
|
<property name="build.stubs" location="${container.dir}/share/gcore_tools/build-stubs.xml" />
|
||||||
|
|
||||||
<!-- load non-standard tasks -->
|
<!-- load non-standard tasks -->
|
||||||
<taskdef resource="ise/antelope/tasks/antlib.xml">
|
<taskdef resource="ise/antelope/tasks/antlib.xml">
|
||||||
|
@ -63,7 +66,7 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
|
|
||||||
<stringutil property="package.dir" string="${package}"><!-- derive package.dir from ${package} -->
|
<stringutil property="package.dir" string="${package}"><!-- derive package.dir from ${package} -->
|
||||||
<replace regex="\." replacement="/"/>
|
<replace regex="\." replacement="/"/>
|
||||||
</stringutil>
|
</stringutil>
|
||||||
|
|
||||||
<!-- file defaults -->
|
<!-- file defaults -->
|
||||||
<property name="garname" value="${package}"/>
|
<property name="garname" value="${package}"/>
|
||||||
|
@ -83,38 +86,39 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<property name="full.stubs" value="true"/>
|
||||||
<property name="stubs.package" value="${package}.${stubs.dir.name}"/>
|
<property name="stubs.package" value="${package}.${stubs.dir.name}"/>
|
||||||
<property name="stubs.dir.name" value="stubs" /> <!-- auxiliary stub classes -->
|
<property name="stubs.dir.name" value="stubs" /> <!-- auxiliary stub classes -->
|
||||||
<property name="stubs.dir" value="${source.dir}/${package.dir}${stubs.dir.name}" />
|
<property name="stubs.dir" value="${source.dir}/${package.dir}/${stubs.dir.name}" />
|
||||||
<available file="${stubs.dir}" property="stubs.dir.present"/>
|
<available file="${stubs.dir}" property="stubs.dir.present"/>
|
||||||
|
|
||||||
<!-- temporary build locations -->
|
<!-- temporary build locations -->
|
||||||
<property name="build.dir" location="${build.location}/build" />
|
<property name="build.dir" location="${build.location}/build" />
|
||||||
<property name="build.class.dir" location="${build.dir}/classes" />
|
<property name="build.class.dir" location="${build.dir}/classes" />
|
||||||
<property name="build.lib.dir" location="${build.dir}/lib" />
|
<property name="build.lib.dir" location="${build.dir}/lib" />
|
||||||
<property name="build.schema.dir" location="${build.dir}/schema" />
|
<property name="build.schema.dir" location="${build.dir}/schema" />
|
||||||
<property name="build.schema.service.dir" location="${build.schema.dir}/${package}" />
|
<property name="build.schema.service.dir" location="${build.schema.dir}/${package}" />
|
||||||
<property name="build.stubs.dir" location="${build.dir}/stubs-${package}" />
|
<property name="build.stubs.dir" location="${build.dir}/stubs-${package}" />
|
||||||
<property name="build.stubs.src.dir" location="${build.stubs.dir}/src" />
|
<property name="build.stubs.src.dir" location="${build.stubs.dir}/src" />
|
||||||
<property name="build.stubs.class.dir" location="${build.stubs.dir}/classes" />
|
<property name="build.stubs.class.dir" location="${build.stubs.dir}/classes" />
|
||||||
|
|
||||||
<!-- misc defaults -->
|
<!-- misc defaults -->
|
||||||
<property name="java.debug" value="on" />
|
<property name="java.debug" value="on" />
|
||||||
<property name="java.deprecation" value="off" />
|
<property name="java.deprecation" value="off" />
|
||||||
|
|
||||||
<!-- common filesets -->
|
<!-- common filesets -->
|
||||||
<fileset dir="${build.lib.dir}" id="garjars" />
|
<fileset dir="${build.lib.dir}" id="garjars" />
|
||||||
<property name="garjars.id" value="garjars" />
|
<property name="garjars.id" value="garjars" />
|
||||||
<fileset dir="${build.schema.dir}" id="garschema">
|
<fileset dir="${build.schema.dir}" id="garschema">
|
||||||
<include name="${package}/**" />
|
<include name="${package}/**" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<property name="garschema.id" value="garschema" />
|
<property name="garschema.id" value="garschema" />
|
||||||
<fileset dir="${etc.dir}" id="garetc" />
|
<fileset dir="${etc.dir}" id="garetc" />
|
||||||
<property name="garetc.id" value="garetc" />
|
<property name="garetc.id" value="garetc" />
|
||||||
|
|
||||||
|
|
||||||
<!-- initialisation tasks -->
|
<!-- initialisation tasks -->
|
||||||
<target name="init" depends="clean" description="creates build structures">
|
<target name="init" depends="clean" description="creates build structures">
|
||||||
|
|
||||||
<!-- input summary -->
|
<!-- input summary -->
|
||||||
<echo message="Root Package -> ${package}" level="info"/>
|
<echo message="Root Package -> ${package}" level="info"/>
|
||||||
|
@ -131,163 +135,169 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
<!-- create dependency location, if it does not exist already -->
|
<!-- create dependency location, if it does not exist already -->
|
||||||
<mkdir dir="${lib.location}" />
|
<mkdir dir="${lib.location}" />
|
||||||
|
|
||||||
<!-- create temporary build folders -->
|
<!-- create temporary build folders -->
|
||||||
<mkdir dir="${build.dir}" />
|
<mkdir dir="${build.dir}" />
|
||||||
<mkdir dir="${build.class.dir}" />
|
<mkdir dir="${build.class.dir}" />
|
||||||
<delete dir="${build.lib.dir}" />
|
<delete dir="${build.lib.dir}" />
|
||||||
<mkdir dir="${build.lib.dir}" />
|
<mkdir dir="${build.lib.dir}" />
|
||||||
<mkdir dir="${build.schema.service.dir}" />
|
<mkdir dir="${build.schema.service.dir}" />
|
||||||
<mkdir dir="${build.stubs.dir}" />
|
<mkdir dir="${build.stubs.dir}" />
|
||||||
<mkdir dir="${build.stubs.src.dir}" />
|
<mkdir dir="${build.stubs.src.dir}" />
|
||||||
<mkdir dir="${build.stubs.class.dir}"/>
|
<mkdir dir="${build.stubs.class.dir}"/>
|
||||||
|
|
||||||
<!-- Populates schema folder -->
|
<!-- Populates schema folder -->
|
||||||
<copy toDir="${build.schema.dir}">
|
<copy toDir="${build.schema.dir}">
|
||||||
<fileset dir="${container.schema.dir}" casesensitive="yes">
|
<fileset dir="${container.schema.dir}" casesensitive="yes">
|
||||||
<include name="wsrf/**/*" />
|
<include name="wsrf/**/*" />
|
||||||
<include name="ws/**/*" />
|
<include name="ws/**/*" />
|
||||||
<include name="gcube/**/**/**/*" />
|
<include name="gcube/**/**/**/*" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
<copy toDir="${build.schema.service.dir}">
|
<copy toDir="${build.schema.service.dir}">
|
||||||
<fileset dir="${schema.dir}"/>
|
<fileset dir="${schema.dir}"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
|
<!-- Populates library folder -->
|
||||||
</target>
|
<copy toDir="${build.lib.dir}">
|
||||||
|
<fileset dir="${lib.location}">
|
||||||
<!-- wsdl specific tasks. Clone for each additional wsdl, if required -->
|
<exclude name="${jarfile.stubs}" />
|
||||||
<target name="processWSDL.1" depends="init" if="wsdl.1" description="Flattens wsdl and generate bindings">
|
</fileset>
|
||||||
<echo message="PROCESSING ${wsdl.1}'s WSDL:" level="debug"/>
|
</copy>
|
||||||
<ant antfile="${build.stubs}" target="flatten">
|
|
||||||
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="wsdl.source" value="${wsdl.1}.wsdl" />
|
|
||||||
<property name="wsdl.target" value="${wsdl.1}_flattened.wsdl" />
|
|
||||||
<property name="wsdl.porttype" value="${wsdl.1}PortType" />
|
|
||||||
</ant>
|
|
||||||
<ant antfile="${build.stubs}" target="generateBinding">
|
|
||||||
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="porttype.wsdl" value="${wsdl.1}_flattened.wsdl" />
|
|
||||||
<property name="binding.root" value="${wsdl.1}" />
|
|
||||||
</ant>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="processWSDL.2" depends="init" if="wsdl.2" description="Flattens wsdl and generate bindings">
|
|
||||||
<echo message="PROCESSING ${wsdl.2}'s WSDL:" level="debug"/>
|
|
||||||
<ant antfile="${build.stubs}" target="flatten">
|
|
||||||
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="wsdl.source" value="${wsdl.2}.wsdl" />
|
|
||||||
<property name="wsdl.target" value="${wsdl.2}_flattened.wsdl" />
|
|
||||||
<property name="wsdl.porttype" value="${wsdl.2}PortType" />
|
|
||||||
</ant>
|
|
||||||
<ant antfile="${build.stubs}" target="generateBinding">
|
|
||||||
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="porttype.wsdl" value="${wsdl.2}_flattened.wsdl" />
|
|
||||||
<property name="binding.root" value="${wsdl.2}" />
|
|
||||||
</ant>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="processWSDL.3" depends="init" if="wsdl.3" description="Flattens wsdl and generate bindings">
|
|
||||||
<echo message="PROCESSING ${wsdl.3}'s WSDL:" level="debug"/>
|
|
||||||
<ant antfile="${build.stubs}" target="flatten">
|
|
||||||
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="wsdl.source" value="${wsdl.3}.wsdl" />
|
|
||||||
<property name="wsdl.target" value="${wsdl.3}_flattened.wsdl" />
|
|
||||||
<property name="wsdl.porttype" value="${wsdl.3}PortType" />
|
|
||||||
</ant>
|
|
||||||
<ant antfile="${build.stubs}" target="generateBinding">
|
|
||||||
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="porttype.wsdl" value="${wsdl.3}_flattened.wsdl" />
|
|
||||||
<property name="binding.root" value="${wsdl.3}" />
|
|
||||||
</ant>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="processWSDL.4" depends="init" if="wsdl.4" description="Flattens wsdl and generate bindings">
|
|
||||||
<echo message="PROCESSING ${wsdl.4.name}'s WSDL:" level="debug"/>
|
|
||||||
<ant antfile="${build.stubs}" target="flatten">
|
|
||||||
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="wsdl.source" value="${wsdl.4}.wsdl" />
|
|
||||||
<property name="wsdl.target" value="${wsdl.4}_flattened.wsdl" />
|
|
||||||
<property name="wsdl.porttype" value="${wsdl.4}PortType" />
|
|
||||||
</ant>
|
|
||||||
<ant antfile="${build.stubs}" target="generateBinding">
|
|
||||||
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="porttype.wsdl" value="${wsdl.4}_flattened.wsdl" />
|
|
||||||
<property name="binding.root" value="${wsdl.4}" />
|
|
||||||
</ant>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="processWSDL.5" depends="init" if="wsdl.5" description="Flattens wsdl and generate bindings">
|
|
||||||
<echo message="PROCESSING ${wsdl.5}'s WSDL:" level="debug"/>
|
|
||||||
<ant antfile="${build.stubs}" target="flatten">
|
|
||||||
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
|
||||||
<property name="wsdl.source" value="${wsdl.5}.wsdl" />
|
|
||||||
<property name="wsdl.target" value="${wsdl.5}_flattened.wsdl" />
|
|
||||||
<property name="wsdl.porttype" value="${wsdl.5}PortType" />
|
|
||||||
</ant>
|
|
||||||
<ant antfile="${build.stubs}" target="generateBinding">
|
|
||||||
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
|
||||||
<property name="porttype.wsdl" value="${wsdl.5}_flattened.wsdl" />
|
|
||||||
<property name="binding.root" value="${wsdl.5}" />
|
|
||||||
</ant>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="processWSDL.6" depends="init" if="wsdl.6" description="Flattens wsdl and generate bindings">
|
</target>
|
||||||
<echo message="PROCESSING ${wsdl.6}'s WSDL:" level="debug"/>
|
|
||||||
<ant antfile="${build.stubs}" target="flatten">
|
<!-- wsdl specific tasks. Clone for each additional wsdl, if required -->
|
||||||
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
<target name="processWSDL.1" depends="init" if="wsdl.1" description="Flattens wsdl and generate bindings">
|
||||||
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
<echo message="PROCESSING ${wsdl.1}'s WSDL:" level="debug"/>
|
||||||
<property name="wsdl.source" value="${wsdl.6}.wsdl" />
|
<ant antfile="${build.stubs}" target="flatten">
|
||||||
<property name="wsdl.target" value="${wsdl.6}_flattened.wsdl" />
|
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
<property name="wsdl.porttype" value="${wsdl.6}PortType" />
|
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
</ant>
|
<property name="wsdl.source" value="${wsdl.1}.wsdl" />
|
||||||
<ant antfile="${build.stubs}" target="generateBinding">
|
<property name="wsdl.target" value="${wsdl.1}_flattened.wsdl" />
|
||||||
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
<property name="wsdl.porttype" value="${wsdl.1}PortType" />
|
||||||
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
</ant>
|
||||||
<property name="porttype.wsdl" value="${wsdl.6}_flattened.wsdl" />
|
<ant antfile="${build.stubs}" target="generateBinding">
|
||||||
<property name="binding.root" value="${wsdl.6}" />
|
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
||||||
</ant>
|
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="porttype.wsdl" value="${wsdl.1}_flattened.wsdl" />
|
||||||
|
<property name="binding.root" value="${wsdl.1}" />
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="processWSDL.2" depends="init" if="wsdl.2" description="Flattens wsdl and generate bindings">
|
||||||
|
<echo message="PROCESSING ${wsdl.2}'s WSDL:" level="debug"/>
|
||||||
|
<ant antfile="${build.stubs}" target="flatten">
|
||||||
|
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="wsdl.source" value="${wsdl.2}.wsdl" />
|
||||||
|
<property name="wsdl.target" value="${wsdl.2}_flattened.wsdl" />
|
||||||
|
<property name="wsdl.porttype" value="${wsdl.2}PortType" />
|
||||||
|
</ant>
|
||||||
|
<ant antfile="${build.stubs}" target="generateBinding">
|
||||||
|
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="porttype.wsdl" value="${wsdl.2}_flattened.wsdl" />
|
||||||
|
<property name="binding.root" value="${wsdl.2}" />
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="processWSDL.3" depends="init" if="wsdl.3" description="Flattens wsdl and generate bindings">
|
||||||
|
<echo message="PROCESSING ${wsdl.3}'s WSDL:" level="debug"/>
|
||||||
|
<ant antfile="${build.stubs}" target="flatten">
|
||||||
|
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="wsdl.source" value="${wsdl.3}.wsdl" />
|
||||||
|
<property name="wsdl.target" value="${wsdl.3}_flattened.wsdl" />
|
||||||
|
<property name="wsdl.porttype" value="${wsdl.3}PortType" />
|
||||||
|
</ant>
|
||||||
|
<ant antfile="${build.stubs}" target="generateBinding">
|
||||||
|
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="porttype.wsdl" value="${wsdl.3}_flattened.wsdl" />
|
||||||
|
<property name="binding.root" value="${wsdl.3}" />
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="processWSDL.4" depends="init" if="wsdl.4" description="Flattens wsdl and generate bindings">
|
||||||
|
<echo message="PROCESSING ${wsdl.4.name}'s WSDL:" level="debug"/>
|
||||||
|
<ant antfile="${build.stubs}" target="flatten">
|
||||||
|
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="wsdl.source" value="${wsdl.4}.wsdl" />
|
||||||
|
<property name="wsdl.target" value="${wsdl.4}_flattened.wsdl" />
|
||||||
|
<property name="wsdl.porttype" value="${wsdl.4}PortType" />
|
||||||
|
</ant>
|
||||||
|
<ant antfile="${build.stubs}" target="generateBinding">
|
||||||
|
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="porttype.wsdl" value="${wsdl.4}_flattened.wsdl" />
|
||||||
|
<property name="binding.root" value="${wsdl.4}" />
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="processWSDL.5" depends="init" if="wsdl.5" description="Flattens wsdl and generate bindings">
|
||||||
|
<echo message="PROCESSING ${wsdl.5}'s WSDL:" level="debug"/>
|
||||||
|
<ant antfile="${build.stubs}" target="flatten">
|
||||||
|
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="wsdl.source" value="${wsdl.5}.wsdl" />
|
||||||
|
<property name="wsdl.target" value="${wsdl.5}_flattened.wsdl" />
|
||||||
|
<property name="wsdl.porttype" value="${wsdl.5}PortType" />
|
||||||
|
</ant>
|
||||||
|
<ant antfile="${build.stubs}" target="generateBinding">
|
||||||
|
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="porttype.wsdl" value="${wsdl.5}_flattened.wsdl" />
|
||||||
|
<property name="binding.root" value="${wsdl.5}" />
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="processWSDL.6" depends="init" if="wsdl.6" description="Flattens wsdl and generate bindings">
|
||||||
|
<echo message="PROCESSING ${wsdl.6}'s WSDL:" level="debug"/>
|
||||||
|
<ant antfile="${build.stubs}" target="flatten">
|
||||||
|
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
|
||||||
|
<property name="wsdl.source" value="${wsdl.6}.wsdl" />
|
||||||
|
<property name="wsdl.target" value="${wsdl.6}_flattened.wsdl" />
|
||||||
|
<property name="wsdl.porttype" value="${wsdl.6}PortType" />
|
||||||
|
</ant>
|
||||||
|
<ant antfile="${build.stubs}" target="generateBinding">
|
||||||
|
<property name="source.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="target.binding.dir" value="${build.schema.service.dir}" />
|
||||||
|
<property name="porttype.wsdl" value="${wsdl.6}_flattened.wsdl" />
|
||||||
|
<property name="binding.root" value="${wsdl.6}" />
|
||||||
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="generateStubs.1" if="wsdl.1" description="Generate wsdl stub classes">
|
<target name="generateStubs.1" if="wsdl.1" description="Generate wsdl stub classes">
|
||||||
<echo message="GENERATING ${wsdl.1}'s STUBS:" level="debug"/>
|
<echo message="GENERATING ${wsdl.1}'s STUBS:" level="debug"/>
|
||||||
<ant antfile="${build.stubs}" target="generateStubs">
|
<ant antfile="${build.stubs}" target="generateStubs">
|
||||||
<property name="mappings" value="${mappings}"/>
|
<property name="mappings" value="${mappings}"/>
|
||||||
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
||||||
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
||||||
<property name="wsdl.file" value="${wsdl.1}_service.wsdl" />
|
<property name="wsdl.file" value="${wsdl.1}_service.wsdl" />
|
||||||
</ant>
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="generateStubs.2" if="wsdl.2" description="Generate wsdl stub classes">
|
<target name="generateStubs.2" if="wsdl.2" description="Generate wsdl stub classes">
|
||||||
<echo message="GENERATING ${wsdl.2}'s STUBS:" level="debug"/>
|
<echo message="GENERATING ${wsdl.2}'s STUBS:" level="debug"/>
|
||||||
<ant antfile="${build.stubs}" target="generateStubs">
|
<ant antfile="${build.stubs}" target="generateStubs">
|
||||||
<property name="mappings" value="${mappings}"/>
|
<property name="mappings" value="${mappings}"/>
|
||||||
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
||||||
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
||||||
<property name="wsdl.file" value="${wsdl.2}_service.wsdl" />
|
<property name="wsdl.file" value="${wsdl.2}_service.wsdl" />
|
||||||
</ant>
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="generateStubs.3" if="wsdl.3" description="Generate wsdl stub classes">
|
<target name="generateStubs.3" if="wsdl.3" description="Generate wsdl stub classes">
|
||||||
<echo message="GENERATING ${wsdl.3}'s STUBS:" level="debug"/>
|
<echo message="GENERATING ${wsdl.3}'s STUBS:" level="debug"/>
|
||||||
<ant antfile="${build.stubs}" target="generateStubs">
|
<ant antfile="${build.stubs}" target="generateStubs">
|
||||||
<property name="mappings" value="${mappings}"/>
|
<property name="mappings" value="${mappings}"/>
|
||||||
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
||||||
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
||||||
<property name="wsdl.file" value="${wsdl.3}_service.wsdl" />
|
<property name="wsdl.file" value="${wsdl.3}_service.wsdl" />
|
||||||
</ant>
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="generateStubs.4" if="wsdl.4" description="Generate wsdl stub classes">
|
<target name="generateStubs.4" if="wsdl.4" description="Generate wsdl stub classes">
|
||||||
<echo message="GENERATING ${wsdl.4}'s STUBS:" level="debug"/>
|
<echo message="GENERATING ${wsdl.4}'s STUBS:" level="debug"/>
|
||||||
|
@ -295,7 +305,7 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
<property name="mappings" value="${mappings}"/>
|
<property name="mappings" value="${mappings}"/>
|
||||||
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
|
||||||
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
|
||||||
<property name="wsdl.file" value="${wsdl.4}_service.wsdl" />
|
<property name="wsdl.file" value="${wsdl.4}_service.wsdl" />
|
||||||
</ant>
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
@ -318,10 +328,10 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
<property name="wsdl.file" value="${wsdl.6}_service.wsdl" />
|
<property name="wsdl.file" value="${wsdl.6}_service.wsdl" />
|
||||||
</ant>
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Cross-wsdl tasks. Adds dependencies for each additional wsdl, if required -->
|
<!-- Cross-wsdl tasks. Adds dependencies for each additional wsdl, if required -->
|
||||||
<target name="processWSDLs" depends="processWSDL.1,processWSDL.2,processWSDL.3,processWSDL.4,processWSDL.5,processWSDL.6" description="generate bindings for all porttypes" />
|
<target name="processWSDLs" depends="processWSDL.1,processWSDL.2,processWSDL.3,processWSDL.4,processWSDL.5,processWSDL.6" description="generate bindings for all porttypes" />
|
||||||
<target name="generateStubs" depends="generateMappings,generateStubs.1,generateStubs.2,generateStubs.3,generateStubs.4,generateStubs.5,generateStubs.6" description="generate stub classes for all porttypes" />
|
<target name="generateStubs" depends="generateMappings,generateStubs.1,generateStubs.2,generateStubs.3,generateStubs.4,generateStubs.5,generateStubs.6" description="generate stub classes for all porttypes" />
|
||||||
|
|
||||||
<target name="generateMappings">
|
<target name="generateMappings">
|
||||||
<var name="mappings" value=""/>
|
<var name="mappings" value=""/>
|
||||||
|
@ -373,8 +383,15 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
</if>
|
</if>
|
||||||
<var name="mappings" value="${mappings} -N${namespace.6}=${package.6} -N${namespace.6}/service=${package.6}.service -N${namespace.6}/bindings=${package.6}.bindings"/>
|
<var name="mappings" value="${mappings} -N${namespace.6}=${package.6} -N${namespace.6}/service=${package.6}.service -N${namespace.6}/bindings=${package.6}.bindings"/>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<var name="mappings" value="${mappings} -Nhttp://gcube-system.org/namespaces/common=org.gcube.common"/>
|
||||||
|
<!-- ADD LATER TO
|
||||||
|
<var name="mappings" value="${mappings} -x http://gcube-system.org/namespaces/common"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
<!-- Service tasks -->
|
<!-- Service tasks -->
|
||||||
|
|
||||||
|
@ -383,9 +400,10 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
<arg value="${gar.location}/${package}.gar"/>
|
<arg value="${gar.location}/${package}.gar"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="buildService" depends="processWSDLs" description="compiles service implementation">
|
<target name="buildService" depends="processWSDLs" description="compiles service implementation">
|
||||||
<javac srcdir="${source.dir}" destdir="${build.class.dir}" debug="${java.debug}" deprecation="${java.deprecation}">
|
<javac srcdir="${source.dir}" destdir="${build.class.dir}" debug="${java.debug}" deprecation="${java.deprecation}"> <exclude name="${package.dir}/${stubs.dir.name}/**"/>
|
||||||
|
<exclude name="${stubs.dir}/**"/>
|
||||||
<classpath>
|
<classpath>
|
||||||
<fileset dir="${lib.location}">
|
<fileset dir="${lib.location}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
|
@ -395,136 +413,163 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
<exclude name="${jarfile}" />
|
<exclude name="${jarfile}" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="jarService" depends="buildService" description="jars service implementation">
|
<target name="jarService" depends="buildService" description="jars service implementation">
|
||||||
<copy todir="${build.class.dir}">
|
<copy todir="${build.class.dir}">
|
||||||
<fileset dir="${source.dir}">
|
<fileset dir="${source.dir}">
|
||||||
<include name="org/**/*.xsl"/>
|
<include name="org/**/*.xsd"/>
|
||||||
<include name="org/**/*.xsd"/>
|
<include name="org/**/*.xml"/>
|
||||||
</fileset>
|
<include name="org/**/*.properties"/>
|
||||||
</copy>
|
</fileset>
|
||||||
<jar jarfile="${build.lib.dir}/${jarfile}" basedir="${build.class.dir}">
|
</copy>
|
||||||
<include name="${package.dir}/**" />
|
<jar jarfile="${build.lib.dir}/${jarfile}" basedir="${build.class.dir}">
|
||||||
</jar>
|
<include name="${package.dir}/**" />
|
||||||
</target>
|
</jar>
|
||||||
|
</target>
|
||||||
<target name="garService" depends="jarService" description="creates service gar">
|
|
||||||
<ant antfile="${build.packages}" target="makeGar">
|
<target name="garService" depends="jarService" description="creates service gar">
|
||||||
<property name="garserverdeployment.file" value="${etc.dir}/deploy-server.wsdd" />
|
<ant antfile="${build.packages}" target="makeGar">
|
||||||
<property name="garserverdeployment_NOSEC.file" value="${etc.dir}/deploy-server.wsdd_NOSEC" />
|
<property name="garserverdeployment.file" value="${etc.dir}/deploy-server.wsdd" />
|
||||||
<property name="garclientdeployment.file" value="${etc.dir}/deploy-client.wsdd" />
|
<property name="garserverdeployment_NOSEC.file" value="${etc.dir}/deploy-server.wsdd_NOSEC" />
|
||||||
<property name="garclientserverdeployment.file" value="${etc.dir}/deploy-client-server.wsdd" />
|
<property name="garclientdeployment.file" value="${etc.dir}/deploy-client.wsdd" />
|
||||||
<property name="garjndiconfigdeployment.file" value="${etc.dir}/deploy-jndi-config.xml" />
|
<property name="garclientserverdeployment.file" value="${etc.dir}/deploy-client-server.wsdd" />
|
||||||
<property name="gar.id" value="${package}" />
|
<property name="garjndiconfigdeployment.file" value="${etc.dir}/deploy-jndi-config.xml" />
|
||||||
<reference refid="${garjars.id}" />
|
<property name="gar.id" value="${package}" />
|
||||||
<reference refid="${garschema.id}" />
|
<reference refid="${garjars.id}" />
|
||||||
<reference refid="${garetc.id}" />
|
<reference refid="${garschema.id}" />
|
||||||
</ant>
|
<reference refid="${garetc.id}" />
|
||||||
|
</ant>
|
||||||
<delete dir="tmp" />
|
<delete dir="tmp" />
|
||||||
<move file="${garfile}" toDir="${gar.location}"/>
|
<move file="${garfile}" toDir="${gar.location}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Stub Build tasks -->
|
<!-- Stub Build tasks -->
|
||||||
|
|
||||||
<target name="buildStubs" depends="processWSDLs,generateStubs" description="build service stubs">
|
<target name="buildStubs" depends="processWSDLs,generateStubs" description="build service stubs">
|
||||||
<if name="stubs.dir.present">
|
<if name="full.stubs" value="true">
|
||||||
<copy toDir="${build.stubs.src.dir}/${package.dir}/${stubs.dir.name}" overwrite="true">
|
<if name="stubs.dir.present">
|
||||||
<fileset dir="${stubs.dir}" casesensitive="yes">
|
<copy toDir="${build.stubs.src.dir}/${package.dir}/${stubs.dir.name}" overwrite="true">
|
||||||
<exclude name="**/*.class" />
|
<fileset dir="${stubs.dir}" casesensitive="yes">
|
||||||
</fileset>
|
<exclude name="**/*.class" />
|
||||||
</copy>
|
</fileset>
|
||||||
</if>
|
</copy>
|
||||||
<javac srcdir="${build.stubs.src.dir}" destdir="${build.stubs.class.dir}" debug="${java.debug}" deprecation="${java.deprecation}" description="compile stub classes">
|
</if>
|
||||||
<include name="**/*.java" />
|
</if>
|
||||||
<classpath>
|
<javac srcdir="${build.stubs.src.dir}" destdir="${build.stubs.class.dir}" debug="${java.debug}" deprecation="${java.deprecation}" description="compile stub classes">
|
||||||
<fileset dir="${container.dir}/lib">
|
<include name="**/*.java" />
|
||||||
<include name="*.jar" />
|
<classpath>
|
||||||
<exclude name="${jarfile.stubs}" />
|
<fileset dir="${container.dir}/lib">
|
||||||
<exclude name="${jarfile}" />
|
<include name="*.jar" />
|
||||||
|
<exclude name="${jarfile.stubs}" />
|
||||||
|
<exclude name="${jarfile}" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${lib.location}">
|
<fileset dir="${lib.location}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
<exclude name="**/${jarfile.stubs}" />
|
<exclude name="**/${jarfile.stubs}" />
|
||||||
<exclude name="**/${jarfile}" />
|
<exclude name="**/${jarfile}" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<copy toDir="${build.stubs.class.dir}/META-INF" overwrite="false"><!-- copy configuration info as well -->
|
</target>
|
||||||
|
|
||||||
|
<target name="jarStubs" depends="buildStubs" description="jar stub classes">
|
||||||
|
<copy toDir="${build.stubs.class.dir}/META-INF">
|
||||||
<fileset dir="${etc.dir}" casesensitive="yes" />
|
<fileset dir="${etc.dir}" casesensitive="yes" />
|
||||||
</copy>
|
</copy>
|
||||||
</target>
|
<copy todir="${build.stubs.class.dir}">
|
||||||
|
<fileset dir="${source.dir}">
|
||||||
<target name="jarStubs" depends="buildStubs" description="jar stub classes">
|
<include name="org/**/*.xsd"/>
|
||||||
<jar destfile="${build.lib.dir}/${jarfile.stubs}" basedir="${build.stubs.class.dir}" />
|
<include name="org/**/*.properties"/>
|
||||||
</target>
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<jar destfile="${build.lib.dir}/${jarfile.stubs}" basedir="${build.stubs.class.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="deployStubs" depends="jarStubs" description="deploy stub jar">
|
<target name="deployStubs" depends="jarStubs" description="deploy stub jar">
|
||||||
<copy file="${build.lib.dir}/${jarfile.stubs}" toDir="${lib.location}"/>
|
<copy file="${build.lib.dir}/${jarfile.stubs}" toDir="${lib.location}"/>
|
||||||
<if name="etics.build" value="false">
|
<if name="etics.build" value="false">
|
||||||
<copy file="${build.lib.dir}/${jarfile.stubs}" toDir="${container.dir}/lib"/>
|
<copy file="${build.lib.dir}/${jarfile.stubs}" toDir="${container.dir}/lib"/>
|
||||||
</if>
|
</if>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="stubs" depends="deployStubs" description="generates, builds, jars and deploy stubs"/>
|
<target name="stubs" depends="deployStubs" description="generates, builds, jars and deploy stubs"/>
|
||||||
|
|
||||||
<!-- undeployement tasks -->
|
<!-- undeployement tasks -->
|
||||||
<target name="undeployStubs" description="deploy stub jar">
|
<target name="undeployStubs" description="deploy stub jar">
|
||||||
<delete file="${container.dir}/lib/${jarfile.stubs}"/>
|
<delete file="${container.dir}/lib/${jarfile.stubs}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="undeployService" description="undeploy service jar">
|
<target name="undeployService" description="undeploy service jar">
|
||||||
<exec executable="${container.dir}/bin/gcore-undeploy-service">
|
<exec executable="${container.dir}/bin/gcore-undeploy-service">
|
||||||
<arg value="${package}"/>
|
<arg value="${package}"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- javadoc tasks -->
|
<!-- javadoc tasks -->
|
||||||
<target name="doc">
|
<target name="doc">
|
||||||
<javadoc access="public" author="true" sourcepath="${source.dir}" packagenames="${package}.*"
|
<javadoc access="public" author="true" sourcepath="${source.dir}" packagenames="${package}.*"
|
||||||
destdir="doc/api" nodeprecated="false" nodeprecatedlist="false"
|
destdir="doc/api" nodeprecated="false" nodeprecatedlist="false"
|
||||||
noindex="false" nonavbar="false" notree="false"
|
noindex="false" nonavbar="false" notree="false"
|
||||||
source="1.5"
|
source="1.5"
|
||||||
splitindex="true"
|
splitindex="true"
|
||||||
use="true" version="true" failonerror="false">
|
use="true" version="true" failonerror="false">
|
||||||
<classpath>
|
<classpath>
|
||||||
<fileset dir="${lib.location}">
|
<fileset dir="${lib.location}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
<exclude name="**/${jarfile}" />
|
<exclude name="**/${jarfile}" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${container.dir}/lib">
|
<fileset dir="${container.dir}/lib">
|
||||||
<include name="*.jar" />
|
<include name="*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javadoc>
|
</javadoc>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="docstubs">
|
<target name="docstubs">
|
||||||
<javadoc access="public" author="true" destdir="doc/api" nodeprecated="false"
|
<javadoc access="public" author="true" destdir="doc/api" nodeprecated="false"
|
||||||
packagenames="${package}.${stubs.dir.name}.*"
|
packagenames="${package}.${stubs.dir.name}.*"
|
||||||
nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false"
|
nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false"
|
||||||
source="1.5" sourcepath="${build.stubs.src.dir}"
|
source="1.5" sourcepath="${build.stubs.src.dir}"
|
||||||
splitindex="true" use="true" version="true"
|
splitindex="true" use="true" version="true"
|
||||||
failonerror="false">
|
failonerror="false">
|
||||||
<classpath>
|
<classpath>
|
||||||
<fileset dir="${lib.location}">
|
<fileset dir="${lib.location}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
<exclude name="**/${jarfile.stubs}" />
|
<exclude name="**/${jarfile.stubs}" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${container.dir}/lib">
|
<fileset dir="${container.dir}/lib">
|
||||||
<include name="*.jar" />
|
<include name="*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javadoc>
|
</javadoc>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="doctests">
|
||||||
<target name="clean">
|
<javadoc access="public" author="true" destdir="doc/api" nodeprecated="false"
|
||||||
|
packagenames="${package}.${stubs.dir.name}.test/*"
|
||||||
|
nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false"
|
||||||
|
source="1.5" sourcepath="${build.stubs.src.dir}"
|
||||||
|
splitindex="true" use="true" version="true"
|
||||||
|
failonerror="false">
|
||||||
|
<classpath>
|
||||||
|
<fileset dir="${lib.location}">
|
||||||
|
<include name="**/*.jar" />
|
||||||
|
<exclude name="**/${jarfile.stubs}" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${container.dir}/lib">
|
||||||
|
<include name="*.jar" />
|
||||||
|
</fileset>
|
||||||
|
</classpath>
|
||||||
|
</javadoc>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="clean">
|
||||||
<delete dir="${build.dir}" quiet="true"/>
|
<delete dir="${build.dir}" quiet="true"/>
|
||||||
<delete dir="${service.dir}/tmp" quiet="true"/>
|
<delete dir="${service.dir}/tmp" quiet="true"/>
|
||||||
<delete file="${gar.location}/${garfile}" quiet="true"/>
|
<delete file="${gar.location}/${garfile}" quiet="true"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -142,6 +142,10 @@
|
||||||
|
|
||||||
<xsd:element name="setCloudVMsRequestMessage" type="xsd:int"/>
|
<xsd:element name="setCloudVMsRequestMessage" type="xsd:int"/>
|
||||||
|
|
||||||
|
<xsd:element name="getCloudVMsResponseMessage" type="xsd:int"/>
|
||||||
|
|
||||||
|
<xsd:element name="getCloudVMsRequestMessage" type="coretypes:VOID"/>
|
||||||
|
|
||||||
<xsd:element name="isUseCloudResponseMessage" type="xsd:boolean"/>
|
<xsd:element name="isUseCloudResponseMessage" type="xsd:boolean"/>
|
||||||
|
|
||||||
<xsd:element name="isUseCloudRequestMessage" type="coretypes:VOID"/>
|
<xsd:element name="isUseCloudRequestMessage" type="coretypes:VOID"/>
|
||||||
|
@ -240,6 +244,13 @@
|
||||||
<part name="response" element="tns:setCloudVMsResponseMessage"/>
|
<part name="response" element="tns:setCloudVMsResponseMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
<message name="GetCloudVMsInputMessage">
|
||||||
|
<part name="request" element="tns:getCloudVMsRequestMessage"/>
|
||||||
|
</message>
|
||||||
|
<message name="GetCloudVMsOutputMessage">
|
||||||
|
<part name="response" element="tns:getCloudVMsResponseMessage"/>
|
||||||
|
</message>
|
||||||
|
|
||||||
<message name="IsUseCloudInputMessage">
|
<message name="IsUseCloudInputMessage">
|
||||||
<part name="request" element="tns:isUseCloudRequestMessage"/>
|
<part name="request" element="tns:isUseCloudRequestMessage"/>
|
||||||
</message>
|
</message>
|
||||||
|
@ -355,6 +366,11 @@
|
||||||
<output message="tns:SetCloudVMsOutputMessage"/>
|
<output message="tns:SetCloudVMsOutputMessage"/>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
|
<operation name="getCloudVMs">
|
||||||
|
<input message="tns:GetCloudVMsInputMessage"/>
|
||||||
|
<output message="tns:GetCloudVMsOutputMessage"/>
|
||||||
|
</operation>
|
||||||
|
|
||||||
<operation name="isUseCloud">
|
<operation name="isUseCloud">
|
||||||
<input message="tns:IsUseCloudInputMessage"/>
|
<input message="tns:IsUseCloudInputMessage"/>
|
||||||
<output message="tns:IsUseCloudOutputMessage"/>
|
<output message="tns:IsUseCloudOutputMessage"/>
|
||||||
|
|
|
@ -38,7 +38,7 @@ private GCUBELog logger= new GCUBELog(GHNConsumer.class);
|
||||||
|
|
||||||
logger.info("notification received for genericResource "+id+" and operation "+operation);
|
logger.info("notification received for genericResource "+id+" and operation "+operation);
|
||||||
|
|
||||||
if (id.compareTo(this.functionalityResourceId)==0 && (operation.compareTo("update")==0)){
|
if ((operation.compareTo("update")==0) && id.compareTo(this.functionalityResourceId)==0){
|
||||||
logger.trace("notification received for functionalityResource with id "+id+" in scope "+scope.toString());
|
logger.trace("notification received for functionalityResource with id "+id+" in scope "+scope.toString());
|
||||||
KGCUBEGenericFunctionalityResource resource= new KGCUBEGenericFunctionalityResource();
|
KGCUBEGenericFunctionalityResource resource= new KGCUBEGenericFunctionalityResource();
|
||||||
resource.load(new StringReader(profile));
|
resource.load(new StringReader(profile));
|
||||||
|
@ -54,6 +54,7 @@ private GCUBELog logger= new GCUBELog(GHNConsumer.class);
|
||||||
FunctionalityHandler functionalityHandler= new FunctionalityHandler();
|
FunctionalityHandler functionalityHandler= new FunctionalityHandler();
|
||||||
KGCUBEGenericFunctionalityResource functResource=new KGCUBEGenericFunctionalityResource();
|
KGCUBEGenericFunctionalityResource functResource=new KGCUBEGenericFunctionalityResource();
|
||||||
functResource.load(new StringReader(profile));
|
functResource.load(new StringReader(profile));
|
||||||
|
this.functionalityResourceId=functResource.getID();
|
||||||
functionalityHandler.add(functResource);
|
functionalityHandler.add(functResource);
|
||||||
} else
|
} else
|
||||||
if (ServiceContext.getContext().getSecondaryTypeGenericResourceRequired().contains(genericResource.getSecondaryType()))
|
if (ServiceContext.getContext().getSecondaryTypeGenericResourceRequired().contains(genericResource.getSecondaryType()))
|
||||||
|
|
|
@ -10,18 +10,20 @@ import org.gcube.vremanagement.vremodeler.stubs.deployreport.DeployReport;
|
||||||
public class ModelerPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<ModelerResource>{
|
public class ModelerPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<ModelerResource>{
|
||||||
|
|
||||||
|
|
||||||
protected void onLoad(ModelerResource resource, ObjectInputStream ois) throws Exception {
|
protected synchronized void onLoad(ModelerResource resource, ObjectInputStream ois) throws Exception {
|
||||||
super.onLoad(resource, ois);
|
super.onLoad(resource, ois);
|
||||||
resource.setId((String)ois.readObject());
|
resource.setId((String)ois.readObject());
|
||||||
resource.setDeployReport((DeployReport)ois.readObject());
|
resource.setDeployReport((DeployReport)ois.readObject());
|
||||||
resource.setUseCloud(ois.readBoolean());
|
resource.setUseCloud(ois.readBoolean());
|
||||||
|
if (resource.isUseCloud())resource.setNumberOfVMsForCloud(ois.readInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void onStore(ModelerResource resource,ObjectOutputStream oos) throws Exception {
|
protected synchronized void onStore(ModelerResource resource,ObjectOutputStream oos) throws Exception {
|
||||||
super.onStore(resource, oos);
|
super.onStore(resource, oos);
|
||||||
oos.writeObject(resource.getId());
|
oos.writeObject(resource.getId());
|
||||||
oos.writeObject(resource.getDeployReport());
|
oos.writeObject(resource.getDeployReport());
|
||||||
oos.writeBoolean(resource.isUseCloud());
|
oos.writeBoolean(resource.isUseCloud());
|
||||||
|
if (resource.isUseCloud())oos.writeInt(resource.getNumberOfVMsForCloud());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
this.setId((String) args[0]);
|
this.setId((String) args[0]);
|
||||||
this.deployReport=null;
|
this.deployReport=null;
|
||||||
this.isUseCloud=false;
|
this.isUseCloud=false;
|
||||||
|
this.numberOfVMsForCloud=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -98,11 +98,6 @@ public class ModelerService {
|
||||||
*/
|
*/
|
||||||
public GHNList getGHNs(VOID var) throws GCUBEFault{
|
public GHNList getGHNs(VOID var) throws GCUBEFault{
|
||||||
logger.trace("getGHNs method");
|
logger.trace("getGHNs method");
|
||||||
try {
|
|
||||||
if (getResource().isUseCloud()) throw new GCUBEFault("deply on cloud is selected, the ghns cannot be returned");
|
|
||||||
} catch (ResourceException e1) {
|
|
||||||
throw new GCUBEFault(e1);
|
|
||||||
}
|
|
||||||
ResultSet res;
|
ResultSet res;
|
||||||
ArrayList<String> relatedGHN=new ArrayList<String>();
|
ArrayList<String> relatedGHN=new ArrayList<String>();
|
||||||
try{
|
try{
|
||||||
|
@ -511,10 +506,21 @@ public class ModelerService {
|
||||||
getResource().store();
|
getResource().store();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseCloud() throws Exception{
|
/**
|
||||||
|
*
|
||||||
|
* @param r VOID
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public boolean isUseCloud(VOID r) throws Exception{
|
||||||
return getResource().isUseCloud();
|
return getResource().isUseCloud();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param numberOfVMs
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public void setCloudVMs(int numberOfVMs) throws Exception{
|
public void setCloudVMs(int numberOfVMs) throws Exception{
|
||||||
ModelerResource resource = getResource();
|
ModelerResource resource = getResource();
|
||||||
if (!resource.isUseCloud()) throw new Exception("the number of VMs cannot be set, you are not using cloud deployement");
|
if (!resource.isUseCloud()) throw new Exception("the number of VMs cannot be set, you are not using cloud deployement");
|
||||||
|
@ -522,4 +528,16 @@ public class ModelerService {
|
||||||
resource.store();
|
resource.store();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param r VOID
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public int getCloudVMs(VOID r) throws Exception{
|
||||||
|
ModelerResource resource = getResource();
|
||||||
|
if (!resource.isUseCloud()) throw new Exception("the number of VMs cannot be returned, you are not using cloud deployement");
|
||||||
|
return resource.getNumberOfVMsForCloud();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ public class ServiceContext extends GCUBEServiceContext{
|
||||||
|
|
||||||
ISNotifier notifier= GHNContext.getImplementation(ISNotifier.class);
|
ISNotifier notifier= GHNContext.getImplementation(ISNotifier.class);
|
||||||
for (GCUBEScope scope : ServiceContext.getContext().getInstance().getScopes().values()){
|
for (GCUBEScope scope : ServiceContext.getContext().getInstance().getScopes().values()){
|
||||||
|
if (scope.isInfrastructure()) continue;
|
||||||
ServiceContext.getContext().setScope(scope);
|
ServiceContext.getContext().setScope(scope);
|
||||||
|
|
||||||
ArrayList<String> genResList= new ArrayList<String>();
|
ArrayList<String> genResList= new ArrayList<String>();
|
||||||
|
|
|
@ -3,7 +3,6 @@ package org.gcube.vremanagement.vremodeler.impl.deploy;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.java.dev.jaxb.array.StringArray;
|
import net.java.dev.jaxb.array.StringArray;
|
||||||
import org.apache.axis.client.Call;
|
import org.apache.axis.client.Call;
|
||||||
|
@ -15,6 +14,7 @@ import org.gcube.vremanagement.vremodeler.stubs.deployreport.GHNonCloudReport;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.deployreport.State;
|
import org.gcube.vremanagement.vremodeler.stubs.deployreport.State;
|
||||||
import org.uoa.eolus.Eolus;
|
import org.uoa.eolus.Eolus;
|
||||||
import org.uoa.eolus.EolusServiceLocator;
|
import org.uoa.eolus.EolusServiceLocator;
|
||||||
|
import org.uoa.eolus.startContainer;
|
||||||
|
|
||||||
|
|
||||||
public class DeployGHNsOnCloud{
|
public class DeployGHNsOnCloud{
|
||||||
|
@ -52,11 +52,10 @@ public class DeployGHNsOnCloud{
|
||||||
|
|
||||||
((Stub) eolus)._setProperty(Call.USERNAME_PROPERTY, username);
|
((Stub) eolus)._setProperty(Call.USERNAME_PROPERTY, username);
|
||||||
((Stub) eolus)._setProperty(Call.PASSWORD_PROPERTY, password);
|
((Stub) eolus)._setProperty(Call.PASSWORD_PROPERTY, password);
|
||||||
|
|
||||||
//filling the report
|
//filling the report
|
||||||
List<State> ghnsStates=new ArrayList<State>(numberOfVMs);
|
report.setDeployingState(new State[numberOfVMs]);
|
||||||
Collections.fill(ghnsStates, State.Running);
|
Arrays.fill(report.getDeployingState(), State.Waiting);
|
||||||
this.report.setDeployingState(ghnsStates);
|
|
||||||
|
|
||||||
VM[] hostnames=createVMs(eolus);
|
VM[] hostnames=createVMs(eolus);
|
||||||
configureAndStartContainers(eolus, hostnames);
|
configureAndStartContainers(eolus, hostnames);
|
||||||
|
@ -81,38 +80,51 @@ public class DeployGHNsOnCloud{
|
||||||
StringArray vnets = new StringArray();
|
StringArray vnets = new StringArray();
|
||||||
vnets.setItem(nets);
|
vnets.setItem(nets);
|
||||||
|
|
||||||
//TODO: change this code
|
//TODO: change this code to support more VMs templates
|
||||||
String template=eolus.getTemplates().getItem()[0];
|
String template=eolus.getTemplates().getItem()[0];
|
||||||
|
logger.trace("got the template: "+template);
|
||||||
VM[] vmsNames= new VM[numberOfVMs];
|
VM[] vmsNames= new VM[numberOfVMs];
|
||||||
//the first VM will be set with limited resource (1Gb of ram) for the RM
|
//the first VM will be set with limited resource (1Gb of ram) for the RM
|
||||||
eolus.createVM(template, vreName+"ResourceManager", 2, 1024, vnets);
|
eolus.createVM(template, vreName+"ResourceManager", 2, 1024, vnets);
|
||||||
vmsNames[0]= new VM(vreName+"ResourceManager");
|
vmsNames[0]= new VM(vreName+"ResourceManager");
|
||||||
|
logger.trace("creating the first VM for ResourceManager "+vreName+"ResourceManager");
|
||||||
|
report.getDeployingState()[0]=State.Running;
|
||||||
//the others VMs will be created with 2 GB of ram
|
//the others VMs will be created with 2 GB of ram
|
||||||
for (int i=1; i<numberOfVMs; i++){
|
for (int i=1; i<numberOfVMs; i++){
|
||||||
eolus.createVM(template, vreName+i, 2, 2048, vnets);
|
eolus.createVM(template, vreName+i, 2, 2048, vnets);
|
||||||
vmsNames[i]= new VM(vreName+"ResourceManager");
|
vmsNames[i]= new VM(vreName+i);
|
||||||
|
report.getDeployingState()[i]=State.Running;
|
||||||
|
logger.trace("creating the VM"+i+" "+ vreName+i);
|
||||||
}
|
}
|
||||||
|
|
||||||
//waiting few seconds
|
logger.trace("checking the VMs Availability");
|
||||||
Thread.sleep(10000);
|
|
||||||
|
|
||||||
|
//waiting few seconds
|
||||||
|
Thread.sleep(30000);
|
||||||
|
|
||||||
//check if the VMs are ready
|
//check if the VMs are ready
|
||||||
boolean[] arrayCheck= new boolean[numberOfVMs];
|
boolean[] arrayCheck= new boolean[numberOfVMs];
|
||||||
Arrays.fill(arrayCheck, false);
|
Arrays.fill(arrayCheck, false);
|
||||||
while (!and(arrayCheck)){
|
while (!and(arrayCheck)){
|
||||||
|
//waiting few seconds
|
||||||
|
Thread.sleep(30000);
|
||||||
|
|
||||||
//TODO: this cycle cannot continue forever
|
//TODO: this cycle cannot continue forever
|
||||||
for (int i=0; i<numberOfVMs; i++){
|
for (int i=0; i<numberOfVMs; i++){
|
||||||
try{
|
try{
|
||||||
if (arrayCheck[i]) continue;
|
if (arrayCheck[i]) continue;
|
||||||
if(eolus.getVMStatus(vmsNames[i].getName()).equalsIgnoreCase("running")){
|
String vmState= eolus.getVMStatus(vmsNames[i].getName());
|
||||||
|
if(vmState.equalsIgnoreCase("running")){
|
||||||
arrayCheck[i]=true;
|
arrayCheck[i]=true;
|
||||||
vmsNames[i].setIp(eolus.getVMIP(vmsNames[i].getName()));
|
vmsNames[i].setIp(eolus.getVMIP(vmsNames[i].getName()));
|
||||||
}
|
//report.getDeployingState().set(i, State.Finished);
|
||||||
|
logger.trace("the VM "+vmsNames[i].getName()+" is RUNNING with ip "+vmsNames[i].getIp());
|
||||||
|
}
|
||||||
|
//else if(!vmState.equalsIgnoreCase("staging"));
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
//if one fails i cannot continue
|
//if one fails i cannot continue
|
||||||
logger.error("error deploying "+vmsNames[i].getName());
|
logger.error("error deploying "+vmsNames[i].getName(),e);
|
||||||
report.getDeployingState().set(i, State.Failed);
|
report.getDeployingState()[i]=State.Failed;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,26 +136,44 @@ public class DeployGHNsOnCloud{
|
||||||
private void configureAndStartContainers(Eolus eolus, VM[] hostnames) throws Exception {
|
private void configureAndStartContainers(Eolus eolus, VM[] hostnames) throws Exception {
|
||||||
String[] scopes=ServiceContext.getContext().getScope().toString().split("/");
|
String[] scopes=ServiceContext.getContext().getScope().toString().split("/");
|
||||||
String cmdtorun = "configureGHN.sh "+scopes[1]+" "+scopes[2];
|
String cmdtorun = "configureGHN.sh "+scopes[1]+" "+scopes[2];
|
||||||
|
logger.trace("configuring ghns with command "+cmdtorun);
|
||||||
String[] res;
|
String[] res;
|
||||||
for (int i=1; i<hostnames.length; i++){
|
for (int i=0; i<hostnames.length; i++){
|
||||||
res = eolus.execCMD(cmdtorun, hostnames[i].getName()).getItem();
|
res = eolus.execCMD(cmdtorun, hostnames[i].getName()).getItem();
|
||||||
if (res.length > 2)
|
logger.trace("configuring the GHN on host for VM "+hostnames[i].getName()+" got the following report:");
|
||||||
this.report.getDeployingState().set(i, State.Failed);
|
logger.trace("std output "+res[0]);
|
||||||
|
//terrible... waiting for enhancement
|
||||||
|
if (res.length > 2) {
|
||||||
|
this.report.getDeployingState()[i]= State.Failed;
|
||||||
|
logger.trace("std error "+res[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//waiting few seconds before start the container
|
||||||
|
Thread.sleep(60000);
|
||||||
|
//starting the containers
|
||||||
|
for (int i=0; i<hostnames.length; i++){
|
||||||
|
Thread startcontainerthread = new startContainer(eolus,hostnames[i].getName());
|
||||||
|
startcontainerthread.start();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkGHNAvailability(VM[] hostnames) throws Exception{
|
private void checkGHNAvailability(VM[] hostnames) throws Exception{
|
||||||
boolean[] arrayCheck= new boolean[hostnames.length];
|
boolean[] arrayCheck= new boolean[hostnames.length];
|
||||||
Arrays.fill(arrayCheck, false);
|
Arrays.fill(arrayCheck, false);
|
||||||
while (!and(arrayCheck)){
|
while (!and(arrayCheck)){
|
||||||
|
logger.trace("checking published GHNs");
|
||||||
|
Thread.sleep(40000);
|
||||||
ResultSet queryRes;
|
ResultSet queryRes;
|
||||||
for (int i=0; i<hostnames.length; i++){
|
for (int i=0; i<hostnames.length; i++){
|
||||||
if (arrayCheck[i]) continue;
|
if (arrayCheck[i]) continue;
|
||||||
queryRes= DBInterface.queryDB("select id from ghn where host='"+hostnames[i].getIp()+"'");
|
queryRes= DBInterface.queryDB("select id from ghn where host LIKE '"+hostnames[i].getIp()+"%'");
|
||||||
if (queryRes.next()) {
|
if (queryRes.next()) {
|
||||||
hostnames[i].setGhnId(queryRes.getString(1));
|
hostnames[i].setGhnId(queryRes.getString(1));
|
||||||
|
logger.trace("the host "+hostnames[i].getName()+" has been retrieved with ghn id "+hostnames[i].getGhnId());
|
||||||
arrayCheck[i]=true;
|
arrayCheck[i]=true;
|
||||||
this.report.getDeployingState().set(i, State.Finished);
|
this.report.getDeployingState()[i]= State.Finished;
|
||||||
DBInterface.ExecuteUpdate("update GHN set isoncloud='true' where id='"+hostnames[i].getGhnId()+"'");
|
DBInterface.ExecuteUpdate("update GHN set isoncloud='true' where id='"+hostnames[i].getGhnId()+"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,34 +195,65 @@ public class DeployGHNsOnCloud{
|
||||||
private String ip;
|
private String ip;
|
||||||
private String name;
|
private String name;
|
||||||
private String ghnId;
|
private String ghnId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
public VM(String name) {
|
public VM(String name) {
|
||||||
super();
|
super();
|
||||||
this.ip=null;
|
this.ip=null;
|
||||||
this.ghnId=null;
|
this.ghnId=null;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the ip
|
||||||
|
*/
|
||||||
public String getIp() {
|
public String getIp() {
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ip the VM's ip
|
||||||
|
*/
|
||||||
public void setIp(String ip) {
|
public void setIp(String ip) {
|
||||||
this.ip = ip;
|
this.ip = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the VM name
|
||||||
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name the VM name
|
||||||
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the ghn ID
|
||||||
|
*/
|
||||||
public String getGhnId() {
|
public String getGhnId() {
|
||||||
return ghnId;
|
return ghnId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ghnId
|
||||||
|
*/
|
||||||
public void setGhnId(String ghnId) {
|
public void setGhnId(String ghnId) {
|
||||||
this.ghnId = ghnId;
|
this.ghnId = ghnId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,19 +62,18 @@ public class DeployVRE extends Thread{
|
||||||
private GCUBEScope startingScope;
|
private GCUBEScope startingScope;
|
||||||
private String vreName=null;
|
private String vreName=null;
|
||||||
private CollectionResourceCreation collectionResourceCreation;
|
private CollectionResourceCreation collectionResourceCreation;
|
||||||
private DeployReport report;
|
|
||||||
|
|
||||||
|
|
||||||
public DeployVRE(String resourceId, GCUBEScope scope) throws GCUBEFault, Exception{
|
public DeployVRE(String resourceId, GCUBEScope scope) throws GCUBEFault, Exception{
|
||||||
this.resourceId=resourceId;
|
this.resourceId=resourceId;
|
||||||
this.startingScope= scope;
|
this.startingScope= scope;
|
||||||
this.report= new DeployReport();
|
|
||||||
try{
|
try{
|
||||||
ResultSet resGenericInfo = DBInterface.queryDB("select VRE.name from VRE where VRE.id='"+this.resourceId+"'; ");
|
ResultSet resGenericInfo = DBInterface.queryDB("select VRE.name from VRE where VRE.id='"+this.resourceId+"'; ");
|
||||||
if (!resGenericInfo.next()) {
|
if (!resGenericInfo.next()) {
|
||||||
throw new GCUBEFault("The VRE with ID "+this.resourceId+" cannot be retrieved on the DB");
|
throw new GCUBEFault("The VRE with ID "+this.resourceId+" cannot be retrieved on the DB");
|
||||||
}
|
}
|
||||||
vreName= resGenericInfo.getString(1);
|
vreName= resGenericInfo.getString(1);
|
||||||
|
System.out.println(vreName);
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
logger.error("error retrieving the VRE Name",e);
|
logger.error("error retrieving the VRE Name",e);
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -91,6 +90,8 @@ public class DeployVRE extends Thread{
|
||||||
*/
|
*/
|
||||||
public void run(){
|
public void run(){
|
||||||
try {
|
try {
|
||||||
|
getResource().setDeployReport(new DeployReport());
|
||||||
|
|
||||||
//reports initialization
|
//reports initialization
|
||||||
getResource().getDeployReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Running);
|
getResource().getDeployReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Running);
|
||||||
|
|
||||||
|
@ -98,15 +99,16 @@ public class DeployVRE extends Thread{
|
||||||
GHNstoUse ghnsToUse=null;
|
GHNstoUse ghnsToUse=null;
|
||||||
if (getResource().isUseCloud()){
|
if (getResource().isUseCloud()){
|
||||||
DeployGHNsOnCloud ghnOnCloud = new DeployGHNsOnCloud(getResource().getNumberOfVMsForCloud(), vreName);
|
DeployGHNsOnCloud ghnOnCloud = new DeployGHNsOnCloud(getResource().getNumberOfVMsForCloud(), vreName);
|
||||||
this.report.setCloudDeployingReport(ghnOnCloud.getReport());
|
getResource().getDeployReport().setCloudDeployingReport(ghnOnCloud.getReport());
|
||||||
try{
|
try{
|
||||||
ghnsToUse = ghnOnCloud.run();
|
ghnsToUse = ghnOnCloud.run();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
logger.error("error creating VMs on cloud",e);
|
logger.error("error creating VMs on cloud",e);
|
||||||
this.report.getCloudDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Failed);
|
getResource().getDeployReport().getCloudDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Failed);
|
||||||
|
throw new Exception("error creating VMs on cloud",e);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
this.report.getCloudDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Skipped);
|
getResource().getDeployReport().getCloudDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Skipped);
|
||||||
ResultSet resRelatedGHN=DBInterface.queryDB("select VRERELATEDGHN.ghnid, GHN.domain, VRERELATEDGHN.ISCANDIDATE from VRERELATEDGHN, GHN where GHN.id=VRERELATEDGHN.ghnid and VRERELATEDGHN.vreid='"+this.resourceId+"' ORDER BY GHN.host; ");
|
ResultSet resRelatedGHN=DBInterface.queryDB("select VRERELATEDGHN.ghnid, GHN.domain, VRERELATEDGHN.ISCANDIDATE from VRERELATEDGHN, GHN where GHN.id=VRERELATEDGHN.ghnid and VRERELATEDGHN.vreid='"+this.resourceId+"' ORDER BY GHN.host; ");
|
||||||
ghnsToUse = new GHNstoUse();
|
ghnsToUse = new GHNstoUse();
|
||||||
while (resRelatedGHN.next()) {
|
while (resRelatedGHN.next()) {
|
||||||
|
@ -116,9 +118,9 @@ public class DeployVRE extends Thread{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!deployManagerOnVRE(ghnsToUse.candidateForRM)){
|
if (deployManagerOnVRE(ghnsToUse.candidateForRM)){
|
||||||
|
|
||||||
if (!createVRE(ghnsToUse.getGhns())){
|
if (createVRE(ghnsToUse.getGhns())){
|
||||||
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished+"' WHERE VRE.id='"+this.resourceId+"';");
|
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished+"' WHERE VRE.id='"+this.resourceId+"';");
|
||||||
getResource().getDeployReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished);
|
getResource().getDeployReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished);
|
||||||
getResource().store();
|
getResource().store();
|
||||||
|
@ -151,7 +153,6 @@ public class DeployVRE extends Thread{
|
||||||
|
|
||||||
|
|
||||||
private boolean deployManagerOnVRE(String candidateGhnId) throws GCUBEFault, ResourceException{
|
private boolean deployManagerOnVRE(String candidateGhnId) throws GCUBEFault, ResourceException{
|
||||||
String vreName= null;
|
|
||||||
try {
|
try {
|
||||||
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='Deploying' WHERE VRE.id='"+this.resourceId+"';");
|
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='Deploying' WHERE VRE.id='"+this.resourceId+"';");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -188,7 +189,9 @@ public class DeployVRE extends Thread{
|
||||||
arp.setServices(services);
|
arp.setServices(services);
|
||||||
arp.setTargetScope(this.scope+"/"+vreName);
|
arp.setTargetScope(this.scope+"/"+vreName);
|
||||||
String reportId=resourceManagerPT.addResources(arp);
|
String reportId=resourceManagerPT.addResources(arp);
|
||||||
|
logger.trace("the report id for Rm is "+reportId);
|
||||||
|
//waiting few seconds
|
||||||
|
Thread.currentThread().sleep(60000);
|
||||||
int attempt=0;
|
int attempt=0;
|
||||||
do{
|
do{
|
||||||
Thread.currentThread().sleep(20000);
|
Thread.currentThread().sleep(20000);
|
||||||
|
@ -198,10 +201,10 @@ public class DeployVRE extends Thread{
|
||||||
getResource().store();
|
getResource().store();
|
||||||
}while (!isDeploymentStatusFinished(report) && attempt<10);
|
}while (!isDeploymentStatusFinished(report) && attempt<10);
|
||||||
|
|
||||||
}catch(Exception e){e.printStackTrace(); throw e;}
|
}catch(Exception e){logger.error("error deploying RM on VRE",e); throw e;}
|
||||||
logger.trace("report step 1: "+report);
|
logger.trace("report step 1: "+report);
|
||||||
logger.info("is something failed in the first step?"+isSomethingFailed(report));
|
logger.info("is something failed in the first step?"+isSomethingFailed(report));
|
||||||
return isSomethingFailed(report);
|
return !isSomethingFailed(report);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -218,7 +221,6 @@ public class DeployVRE extends Thread{
|
||||||
logger.error("DeployingVRE step 1 -- failed "+e);
|
logger.error("DeployingVRE step 1 -- failed "+e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.vreName= vreName;
|
|
||||||
collectionResourceCreation= new CollectionResourceCreation(this.resourceId, this.vreName);
|
collectionResourceCreation= new CollectionResourceCreation(this.resourceId, this.vreName);
|
||||||
getResource().getDeployReport().getResourceManagerDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished);
|
getResource().getDeployReport().getResourceManagerDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished);
|
||||||
getResource().store();
|
getResource().store();
|
||||||
|
@ -293,7 +295,9 @@ public class DeployVRE extends Thread{
|
||||||
|
|
||||||
String report=null;
|
String report=null;
|
||||||
String reportId=rmPortType.createScope(scopeParameter);
|
String reportId=rmPortType.createScope(scopeParameter);
|
||||||
|
|
||||||
|
logger.trace("the report id for Rm is "+reportId);
|
||||||
|
|
||||||
int reportAttempt=0;
|
int reportAttempt=0;
|
||||||
do{
|
do{
|
||||||
try{
|
try{
|
||||||
|
@ -309,7 +313,7 @@ public class DeployVRE extends Thread{
|
||||||
|
|
||||||
logger.info("is something failed in the second step?"+isSomethingFailed(report));
|
logger.info("is something failed in the second step?"+isSomethingFailed(report));
|
||||||
logger.trace("report step 2: "+report);
|
logger.trace("report step 2: "+report);
|
||||||
return isSomethingFailed(report);
|
return !isSomethingFailed(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class GHNHandler implements ResourceHandler<GCUBEHostingNode> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insert(GCUBEHostingNode ghn) throws Exception {
|
private void insert(GCUBEHostingNode ghn) throws Exception {
|
||||||
|
|
||||||
|
//GHN(ID VARCHAR NOT NULL PRIMARY KEY,HOST VARCHAR,SECURITY VARCHAR,UPTIME VARCHAR,MAINMEMORYVA VARCHAR,MAINMEMORYVS VARCHAR,LOCALAS VARCHAR,LOCATION VARCHAR,COUNTRY VARCHAR,DOMAIN VARCHAR, ISONCLOUD BOOLEAN)
|
||||||
ArrayList<String> row= new ArrayList<String>(10);
|
ArrayList<String> row= new ArrayList<String>(10);
|
||||||
String id= ghn.getID();
|
String id= ghn.getID();
|
||||||
row.add(id);
|
row.add(id);
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package org.gcube.vremanagement.vremodeler.stubs.deployreport;
|
package org.gcube.vremanagement.vremodeler.stubs.deployreport;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class GHNonCloudReport implements Serializable {
|
public class GHNonCloudReport implements Serializable {
|
||||||
/**
|
/**
|
||||||
|
@ -13,11 +10,10 @@ public class GHNonCloudReport implements Serializable {
|
||||||
|
|
||||||
private State state;
|
private State state;
|
||||||
|
|
||||||
private List<State> deployingState= new ArrayList<State>();
|
private State[] deployingState;
|
||||||
|
|
||||||
public GHNonCloudReport() {
|
public GHNonCloudReport() {
|
||||||
this.state= State.Waiting;
|
this.state= State.Waiting;
|
||||||
Collections.fill(this.deployingState, State.Waiting);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,11 +25,11 @@ public class GHNonCloudReport implements Serializable {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<State> getDeployingState() {
|
public State[] getDeployingState() {
|
||||||
return deployingState;
|
return deployingState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDeployingState(List<State> deployingState) {
|
public void setDeployingState(State[] deployingState) {
|
||||||
this.deployingState = deployingState;
|
this.deployingState = deployingState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,17 @@
|
||||||
package org.gcube.vremanagement.vremodeler.test;
|
package org.gcube.vremanagement.vremodeler.test;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.axis.message.addressing.EndpointReferenceType;
|
import org.apache.axis.message.addressing.EndpointReferenceType;
|
||||||
|
import org.apache.axis.types.URI;
|
||||||
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
|
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
|
||||||
import org.gcube.common.core.contexts.GHNContext;
|
|
||||||
import org.gcube.common.core.informationsystem.client.AtomicCondition;
|
|
||||||
import org.gcube.common.core.informationsystem.client.ISClient;
|
|
||||||
import org.gcube.common.core.informationsystem.client.queries.GCUBERIQuery;
|
|
||||||
import org.gcube.common.core.resources.GCUBERunningInstance;
|
|
||||||
import org.gcube.common.core.scope.GCUBEScope;
|
import org.gcube.common.core.scope.GCUBEScope;
|
||||||
import org.gcube.common.core.types.VOID;
|
import org.gcube.common.core.types.VOID;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
|
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
|
||||||
|
import org.gcube.vremanagement.vremodeler.stubs.CollectionList;
|
||||||
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.ModelerFactoryPortType;
|
import org.gcube.vremanagement.vremodeler.stubs.ModelerFactoryPortType;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.ModelerServicePortType;
|
import org.gcube.vremanagement.vremodeler.stubs.ModelerServicePortType;
|
||||||
|
import org.gcube.vremanagement.vremodeler.stubs.VREDescription;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerFactoryServiceAddressingLocator;
|
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerFactoryServiceAddressingLocator;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerServiceAddressingLocator;
|
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerServiceAddressingLocator;
|
||||||
|
|
||||||
|
@ -31,10 +26,11 @@ public class ModelerTest {
|
||||||
GCUBERIQuery riquery= client.getQuery(GCUBERIQuery.class);
|
GCUBERIQuery riquery= client.getQuery(GCUBERIQuery.class);
|
||||||
riquery.addAtomicConditions(new AtomicCondition("//ServiceName", "VREModeler"));
|
riquery.addAtomicConditions(new AtomicCondition("//ServiceName", "VREModeler"));
|
||||||
List<GCUBERunningInstance> results=client.execute(riquery, GCUBEScope.getScope(args[0]));
|
List<GCUBERunningInstance> results=client.execute(riquery, GCUBEScope.getScope(args[0]));
|
||||||
|
*/
|
||||||
ModelerFactoryServiceAddressingLocator mfal =new ModelerFactoryServiceAddressingLocator();
|
ModelerFactoryServiceAddressingLocator mfal =new ModelerFactoryServiceAddressingLocator();
|
||||||
EndpointReferenceType epr= results.get(0).getAccessPoint().getEndpoint("gcube/vremanagement/vremodeler/ModelerFactoryService");
|
/*EndpointReferenceType epr= results.get(0).getAccessPoint().getEndpoint("gcube/vremanagement/vremodeler/ModelerFactoryService");
|
||||||
System.out.println(epr);
|
System.out.println(epr);*/
|
||||||
|
EndpointReferenceType epr= new EndpointReferenceType(new URI("http://nb-lelii.isti.cnr.it:8080/wsrf/services/gcube/vremanagement/vremodeler/ModelerFactoryService"));
|
||||||
ModelerFactoryPortType mfptp= mfal.getModelerFactoryPortTypePort(epr);
|
ModelerFactoryPortType mfptp= mfal.getModelerFactoryPortTypePort(epr);
|
||||||
|
|
||||||
mfptp = GCUBERemotePortTypeContext.getProxy(mfptp, GCUBEScope.getScope(args[0]));
|
mfptp = GCUBERemotePortTypeContext.getProxy(mfptp, GCUBEScope.getScope(args[0]));
|
||||||
|
@ -43,40 +39,57 @@ public class ModelerTest {
|
||||||
|
|
||||||
ModelerServiceAddressingLocator msal= new ModelerServiceAddressingLocator();
|
ModelerServiceAddressingLocator msal= new ModelerServiceAddressingLocator();
|
||||||
ModelerServicePortType msptp=msal.getModelerServicePortTypePort(eprModelerRes);
|
ModelerServicePortType msptp=msal.getModelerServicePortTypePort(eprModelerRes);
|
||||||
|
|
||||||
|
|
||||||
msptp = GCUBERemotePortTypeContext.getProxy(msptp, GCUBEScope.getScope(args[0]));
|
msptp = GCUBERemotePortTypeContext.getProxy(msptp, GCUBEScope.getScope(args[0]));
|
||||||
|
|
||||||
|
|
||||||
System.out.println("creation requested");
|
System.out.println("creation requested");
|
||||||
VRERequest vreReq= new VRERequest();
|
|
||||||
vreReq.setStartTime(new Date().getTime());
|
|
||||||
vreReq.setEndTime(new Date().getTime());
|
|
||||||
vreReq.setVREDescription("desc");
|
|
||||||
vreReq.setVREDesigner("Lucio");
|
|
||||||
vreReq.setVREManager("Lucio");
|
|
||||||
vreReq.setVREName("test");
|
|
||||||
msptp.setVREModel(vreReq);
|
|
||||||
|
|
||||||
System.out.println("first call done");
|
|
||||||
System.out.println(msptp.getGHNs(new VOID()));
|
|
||||||
|
|
||||||
/*
|
|
||||||
CollectionArray ca= new CollectionArray();
|
VREDescription vreReq= new VREDescription();
|
||||||
ca.setCollectionElement(new String[]{"e60f6340-e970-11dd-bb52-d1724dda0823"});
|
Calendar cal= Calendar.getInstance();
|
||||||
msptp.setCollection(ca);
|
vreReq.setStartTime(Calendar.getInstance());
|
||||||
|
cal.add(Calendar.MONTH, 1);
|
||||||
|
vreReq.setEndTime(cal);
|
||||||
|
vreReq.setDescription("desc");
|
||||||
|
vreReq.setDesigner("Lucio");
|
||||||
|
vreReq.setManager("Lucio");
|
||||||
|
vreReq.setName("testCloud");
|
||||||
|
msptp.setDescription(vreReq);
|
||||||
|
System.out.println("description set");
|
||||||
|
|
||||||
|
CollectionList cl=msptp.getCollection(new VOID());
|
||||||
|
|
||||||
|
System.out.println("collection list is null?"+(cl.getList()==null));
|
||||||
|
|
||||||
|
for(int i=0; i< cl.getList().length; i++)
|
||||||
|
System.out.println(i+" - "+cl.getList(i));
|
||||||
|
|
||||||
|
msptp.setCollection(new CollectionArray(new String[]{cl.getList(0).getId()}));
|
||||||
|
|
||||||
|
System.out.println("collection set");
|
||||||
|
|
||||||
FunctionalityIDArray fida= new FunctionalityIDArray();
|
FunctionalityIDArray fida= new FunctionalityIDArray();
|
||||||
fida.setFunctionalityIDElement(new String[]{"0"});
|
fida.setFunctionalityIDElement(new String[]{"0"});
|
||||||
msptp.setFunctionality(fida);
|
msptp.setFunctionality(fida);
|
||||||
|
|
||||||
|
System.out.println("functionality set");
|
||||||
|
|
||||||
GHNArray ghnArray= new GHNArray();
|
msptp.setUseCloud(true);
|
||||||
ghnArray.setGHNElement(new String[]{"64033f00-ea3a-11dd-af49-d0586efd3870","29b7ff70-ea3a-11dd-810a-d18bf0285315"});
|
msptp.setCloudVMs(2);
|
||||||
msptp.setGHNs(ghnArray);
|
|
||||||
|
|
||||||
System.out.println("-"+msptp.checkStatus(new VOID()).getReports(0)+"-");
|
|
||||||
|
|
||||||
|
//msptp.setUseCloud(false);
|
||||||
|
//msptp.setGHNs(new GHNArray(new String[]{"af63ccc0-d6a7-11df-b524-ba33a5c87470","73ceb130-e844-11df-a7f0-e529e2191760"},"af63ccc0-d6a7-11df-b524-ba33a5c87470"));
|
||||||
|
|
||||||
msptp.deployVRE(new VOID());
|
msptp.deployVRE(new VOID());
|
||||||
*/
|
|
||||||
|
for (int i=0; i<200; i++){
|
||||||
|
Thread.sleep(30000);
|
||||||
|
System.out.println("report is:");
|
||||||
|
System.out.println(msptp.checkStatus(new VOID()));
|
||||||
|
}
|
||||||
|
|
||||||
}catch(Exception e){e.printStackTrace();}
|
}catch(Exception e){e.printStackTrace();}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue