diff --git a/.gitattributes b/.gitattributes index 6091d59bc4cd2d2e08ed6437a5004b025a31bf88..cb7e98181f734dedd28edb0d870ce3be6b8457f2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2382,66 +2382,6 @@ RTCP/Storage/src/MeasurementSetFormat.cc -text RTCP/Storage/src/OutputThread.cc -text RTCP/Storage/test/tDAL_HDF5.cc -text RTCP/Storage/test/tMeasurementSetFormat.parset -text -SAS/OTB/MoM-OTDB-adapter/.cvsignore -text -SAS/OTB/MoM-OTDB-adapter/.euml2 -text -SAS/OTB/MoM-OTDB-adapter/.umlproject -text -SAS/OTB/MoM-OTDB-adapter/config/config.xml -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-otdb.xml -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-stub.xml -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/log4j.properties -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/adapter_lofar17_nfra_nl.cer -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-keystore.jks -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-trusted-keystore.jks -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter.cer -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.bat -text -SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.sh -text -SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-keystore.jks -text -SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-trusted-keystore.jks -text -SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter.cer -text -SAS/OTB/MoM-OTDB-adapter/examples/obs-50-active.xml -text -SAS/OTB/MoM-OTDB-adapter/examples/obs-50-specified.xml -text -SAS/OTB/MoM-OTDB-adapter/examples/obs-52-active.xml -text -SAS/OTB/MoM-OTDB-adapter/examples/obs-52-finished.xml -text -SAS/OTB/MoM-OTDB-adapter/examples/obs-52-specified.xml -text -SAS/OTB/MoM-OTDB-adapter/lib/astron-http-utils.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/astron-utils.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/commons-codec-1.3.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/commons-logging.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/commons-validator.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/httpclient-4.0-beta2.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/httpcore-4.0.1.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/httpcore-nio-4.0.1.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/httpmime-4.0-beta2.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/log4j-1.2.15.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/mail.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/xercesImpl-2.8.1.jar -text -SAS/OTB/MoM-OTDB-adapter/lib/xml-apis-1.3.03.jar -text -SAS/OTB/MoM-OTDB-adapter/sharedlib/jOTDB2.jar -text -SAS/OTB/MoM-OTDB-adapter/src/config.xsd -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/AdapterConfiguration.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/ConfigXMLParser.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Configuration.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Mom2Configuration.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/OTDBConfiguration.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/RepositoryConfiguration.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/StubConfiguration.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Beam.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Repository.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/RepositoryException.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/StubRepository.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServer.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2HttpRequestHandler.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/AbstractThread.java -text -SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/XMLConstants.java -text -SAS/OTB/MoM-OTDB-adapter/src/schemas/LofarMoM2.xsd -text -SAS/OTB/MoM-OTDB-adapter/src/schemas/MoM2.xsd -text -SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepositoryTest.java -text -SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Client.java -text -SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServerTest.java -text -SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParserTest.java -text -SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGeneratorTest.java -text -SAS/OTB/MoM-OTDB-adapter/uml/MoM-OTDB-adapter.usd -text -SAS/OTB/MoM-OTDB-adapter/uml/momlistener.usd -text SAS/OTB/OTB/conf/ParmDBConfiguration.xml -text SAS/OTB/OTB/conf/Plotter-config-plottertest.jar -text SAS/OTB/OTB/doc/OTB.EAP -text @@ -2523,16 +2463,6 @@ SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/navigation/Down16.gi SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/navigation/Up16.gif -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ImagerPanel.form -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.form -text -SAS/OTB/jOTDB2/.cvsignore -text -SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCampaign.h -text -SAS/OTB/jOTDB2/make_jar.sh -text svneol=native#application/octet-stream -SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaign.java -text -SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignAdapter.java -text -SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInfo.java -text -SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInterface.java -text -SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCampaign.cc -text -SAS/OTB/jOTDB2/test/tCampaign.java -text -SAS/OTB/jOTDB2/test/testStates.java -text SAS/OTB/jOTDB3/CMakeLists.txt -text SAS/OTB/jOTDB3/build.xml -text SAS/OTB/jOTDB3/include/jOTDB3/CMakeLists.txt -text diff --git a/.gitignore b/.gitignore index da0f07d160eb847b7fa267b0b684bd1537568781..d5b290c2df5552713ede66b59815a57acc7e2c62 100644 --- a/.gitignore +++ b/.gitignore @@ -262,17 +262,9 @@ RTCP/Run/lofarconf RTCP/Storage/Makefile.common RTCP/Storage/autoconf_share RTCP/Storage/lofarconf -SAS/OTB/MoM-OTDB-adapter/bin -SAS/OTB/MoM-OTDB-adapter/tasks SAS/OTB/OTB/build SAS/OTB/OTB/dist SAS/OTB/OTB/nbproject -SAS/OTB/jOTDB2/Makefile.common -SAS/OTB/jOTDB2/autoconf_share -SAS/OTB/jOTDB2/build -SAS/OTB/jOTDB2/dist -SAS/OTB/jOTDB2/lofarconf -SAS/OTB/jOTDB2/nbproject SAS/OTB/jOTDB3/build SAS/OTB/jOTDB3/dist SAS/OTB/nbproject diff --git a/SAS/OTB/CMakeLists.txt b/SAS/OTB/CMakeLists.txt index 31b152a5deb0f1d920d86e10891502321a70cc8a..dd27d10fd4327a42a9ab762c8fa6e740610892bc 100644 --- a/SAS/OTB/CMakeLists.txt +++ b/SAS/OTB/CMakeLists.txt @@ -1,6 +1,5 @@ # $Id$ -lofar_add_package(jOTDB2) lofar_add_package(jOTDB3) add_subdirectory(scripts) diff --git a/SAS/OTB/MoM-OTDB-adapter/.classpath b/SAS/OTB/MoM-OTDB-adapter/.classpath deleted file mode 100644 index 6eede998fcdcce47c93384bbaed1cac574c0d5bf..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/.classpath +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="test"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/> - <classpathentry kind="lib" path="lib/commons-logging.jar"/> - <classpathentry kind="lib" path="lib/commons-validator.jar"/> - <classpathentry kind="lib" path="sharedlib/jOTDB2.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> - <classpathentry kind="lib" path="lib/astron-http-utils.jar"/> - <classpathentry kind="lib" path="lib/astron-utils.jar"/> - <classpathentry kind="lib" path="lib/httpclient-4.0-beta2.jar"/> - <classpathentry kind="lib" path="lib/httpcore-4.0.1.jar"/> - <classpathentry kind="lib" path="lib/httpcore-nio-4.0.1.jar"/> - <classpathentry kind="lib" path="lib/httpmime-4.0-beta2.jar"/> - <classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/> - <classpathentry kind="lib" path="lib/xercesImpl-2.8.1.jar"/> - <classpathentry kind="lib" path="lib/xml-apis-1.3.03.jar"/> - <classpathentry kind="lib" path="lib/mail.jar"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/SAS/OTB/MoM-OTDB-adapter/.cvsignore b/SAS/OTB/MoM-OTDB-adapter/.cvsignore deleted file mode 100644 index 7cccd3888e265f47b8cd1fc4786a9c2683dadad4..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -tasks diff --git a/SAS/OTB/MoM-OTDB-adapter/.euml2 b/SAS/OTB/MoM-OTDB-adapter/.euml2 deleted file mode 100644 index 46fb5a72e47edd2f1288ad479aa43620399baef6..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/.euml2 +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<properties:ProjectDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:properties="properties.xmi" modelDir="" libraryDir="" profileDir="" templateDir=""> - <profiles id="org.eclipse.uml2.uml.resources.StandardProfile" description="Standard Profile" uri="platform:/plugin/org.eclipse.uml2.uml.resources/profiles/Standard.profile.uml" exported="false" kind="system"/> - <profiles id="com.soyatec.uml.JavaProfile" description="Java Profile" uri="platform:/plugin/com.soyatec.core/profiles/Java.profile.uml" exported="false" kind="system"/> - <profiles id="com.soyatec.uml.SoyatecProfile" description="Soyatec Profile" uri="platform:/plugin/com.soyatec.core/profiles/Soyatec.profile.uml" exported="false" kind="system"/> - <profiles id="com.soyatec.uml.ArchetypeProfile" description="Archetype Profile" uri="platform:/plugin/com.soyatec.core/profiles/Archetype.profile.uml" exported="false" kind="system"/> -</properties:ProjectDescription> diff --git a/SAS/OTB/MoM-OTDB-adapter/.project b/SAS/OTB/MoM-OTDB-adapter/.project deleted file mode 100644 index 2de9036249ee0196b1f628dc8123c7951d4d7e8f..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>MoM-OTDB-adapter</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> diff --git a/SAS/OTB/MoM-OTDB-adapter/.umlproject b/SAS/OTB/MoM-OTDB-adapter/.umlproject deleted file mode 100644 index 46fb5a72e47edd2f1288ad479aa43620399baef6..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/.umlproject +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<properties:ProjectDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:properties="properties.xmi" modelDir="" libraryDir="" profileDir="" templateDir=""> - <profiles id="org.eclipse.uml2.uml.resources.StandardProfile" description="Standard Profile" uri="platform:/plugin/org.eclipse.uml2.uml.resources/profiles/Standard.profile.uml" exported="false" kind="system"/> - <profiles id="com.soyatec.uml.JavaProfile" description="Java Profile" uri="platform:/plugin/com.soyatec.core/profiles/Java.profile.uml" exported="false" kind="system"/> - <profiles id="com.soyatec.uml.SoyatecProfile" description="Soyatec Profile" uri="platform:/plugin/com.soyatec.core/profiles/Soyatec.profile.uml" exported="false" kind="system"/> - <profiles id="com.soyatec.uml.ArchetypeProfile" description="Archetype Profile" uri="platform:/plugin/com.soyatec.core/profiles/Archetype.profile.uml" exported="false" kind="system"/> -</properties:ProjectDescription> diff --git a/SAS/OTB/MoM-OTDB-adapter/build/build.xml b/SAS/OTB/MoM-OTDB-adapter/build/build.xml deleted file mode 100644 index 0be3fe6e3e10e18a5a6619bc9d199a872d97c23a..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/build/build.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version = '1.0' encoding = 'windows-1252'?> - -<project name="ant" default="jar" basedir="."> - - <property name="projectDir" value=".." /> - <property name="buildDir" value="${projectDir}/build" /> - <property name="destinationDir" value="${buildDir}/dist" /> - <property name="libDir" value="${destinationDir}/lib" /> - <property name="srcDir" value="${projectDir}/src" /> - <property name="classesDir" value="${destinationDir}/classes" /> - <property name="jarFile" value="${destinationDir}/mom-otdb-adapter.jar" /> - - <property name="main.class" value="nl.astron.lofar.odtb.mom2otdbadapter.MomOtdbAdapter" /> - - <path id="classpath"> - <fileset dir="${libDir}"> - <include name="*.jar" /> - </fileset> - </path> - - - <target name="init"> - <tstamp> - <format property="TIMEDATE" pattern="hh:mm d-MM-yyyy" /> - </tstamp> - <echo message="Current time and date = ${TIMEDATE}" /> - </target> - - <target name="prepare" depends="init"> - <delete dir="${destinationDir}" /> - <mkdir dir="${destinationDir}" /> - <mkdir dir="${libDir}" /> - <mkdir dir="${classesDir}" /> - <mkdir dir="${destinationDir}/logs" /> - <copy todir="${libDir}"> - <fileset dir="${projectDir}/lib"> - <include name="*.jar" /> - </fileset> - <fileset dir="${projectDir}/sharedlib"> - <include name="*.jar" /> - </fileset> - </copy> - <copy todir="${destinationDir}"> - <fileset dir="${projectDir}/dist-sources"/> - </copy> - </target> - - - <target name="compile" depends="prepare"> - <javac srcdir="${srcDir}" destdir="${classesDir}" debug="on" excludes="test/**"> - <classpath refid="classpath" /> - </javac> - <copy todir="${classesDir}"> - <fileset dir="${srcDir}"> - <exclude name="**/*.java" /> - </fileset> - </copy> - </target> - - <target name="jar" depends="compile"> - <manifestclasspath property="jar.classpath" jarfile="${jarFile}"> - <classpath refid="classpath" /> - </manifestclasspath> - <jar destfile="${jarFile}" basedir="${classesDir}"> - <manifest> - <attribute name="Main-Class" value="${main.class}" /> - <attribute name="Built-By" value="${user.name}" /> - <attribute name="Class-Path" value="${jar.classpath}" /> - </manifest> - </jar> - <delete dir="${classesDir}" /> - </target> - -</project> - - diff --git a/SAS/OTB/MoM-OTDB-adapter/config/config.xml b/SAS/OTB/MoM-OTDB-adapter/config/config.xml deleted file mode 100644 index 9dd61dd70865326fb47516e9861018b0a08df232..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/config/config.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<config:config xmlns:config="http://www.astron.nl/MoM-OTDB-adapter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.astron.nl/MoM-OTDB-adapter config.xsd "> - <config:mom2> - <config:username>momotdbadapter</config:username> - <config:password>momotdbadapter</config:password> - <config:authurl>http://localhost:8080/useradministration</config:authurl> - <config:mom2-import-url>http://localhost:8080/mom3/interface/importXML2.do</config:mom2-import-url> - <config:mom2-schemas-url>http://localhost:8080/mom3/schemas/</config:mom2-schemas-url> - </config:mom2> - <config:stub> - <config:interval>5</config:interval> - </config:stub> - <config:adapter> - <config:httpport>8081</config:httpport> - <config:keystore-location>c:/mom-otdb-adapter-keystore.jks</config:keystore-location> - <config:keystore-password>adapter</config:keystore-password> - <config:trusted-keystore-location>c:/mom-otdb-adapter-trusted-keystore.jks</config:trusted-keystore-location> - <config:trusted-keystore-password>adapter-trusted</config:trusted-keystore-password> - </config:adapter> -</config:config> diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-otdb.xml b/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-otdb.xml deleted file mode 100644 index 0cf2714d7963f29826eab2005767a3fc0d37cedb..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-otdb.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<config:config xmlns:config="http://www.astron.nl/MoM-OTDB-adapter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.astron.nl/MoM-OTDB-adapter ../src/config.xsd "> - <!-- Section to configure the communication with MoM --> - <config:mom2> - <!-- The MoM-OTDB-adapter logs in with this given username/password. --> - <config:username>momotdbadapter</config:username> - <config:password>momotdbadapter</config:password> - <!-- The URL where the MoM-OTDB-adapter logs in. --> - <config:authurl>http://momhost:8080/useradministration</config:authurl> - <!-- The import XML URL of MoM --> - <config:mom2-import-url>http://momhost:8080/mom3/interface/importXML2.do</config:mom2-import-url> - <!-- The MoM schema's URL. This is not for validation of xml files in the MoM-OTDB-adapter. - Validation of the xml files are agains the schemas in the jar. - This URL is only used for generating xml files for the MoM import. - So if there are errors you can use it in eclipse with validition enabled--> - <config:mom2-schemas-url>http://momhost:8080/mom3/schemas/</config:mom2-schemas-url> - </config:mom2> - <!-- Section to configure the communication with OTDB --> - <config:otdb> - <!-- Interval in seconds that the MoM-OTDB-adapter checks OTDB for changes. Do not put this lower then 3 seconds. --> - <config:interval>5</config:interval> - <!-- Template ID for the UV Observation. This ID must be exists in OTDB. --> - <config:uvObservationTemplateId>5001</config:uvObservationTemplateId> - <!-- RMI host of OTDB --> - <config:rmihost>lofar17.astron.nl</config:rmihost> - <!-- RMI port of OTDB --> - <config:rmiport>10399</config:rmiport> - </config:otdb> - <!-- Section to configure the MoM-OTDB-adapter --> - <config:adapter> - <!-- Port where the HTTP server of MoM-OTDB-adapter should run --> - <config:httpport>8082</config:httpport> - <!-- Keystore file for MoM-OTDB-adapter. This file should contain the MoM-OTDB-adapter public/private key --> - <config:keystore-location>./keystores/mom-otdb-adapter-keystore.jks</config:keystore-location> - <!-- Password of the Keystore file for MoM-OTDB-adapter. --> - <config:keystore-password>adapter</config:keystore-password> - <!-- Trusted Keystore file for MoM-OTDB-adapter. This file should contain all client public keys --> - <config:trusted-keystore-location>./keystores/mom-otdb-adapter-trusted-keystore.jks</config:trusted-keystore-location> - <!-- Password of the Trusted Keystore file for MoM-OTDB-adapter. --> - <config:trusted-keystore-password>adapter-trusted</config:trusted-keystore-password> - </config:adapter> -</config:config> diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-stub.xml b/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-stub.xml deleted file mode 100644 index 47e2cce5ce577323d1739f464ecee42825c7d1ee..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/config-stub.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<config:config xmlns:config="http://www.astron.nl/MoM-OTDB-adapter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.astron.nl/MoM-OTDB-adapter config.xsd "> - <!-- Section to configure the communication with MoM --> - <config:mom2> - <!-- The MoM-OTDB-adapter logs in with this given username/password. --> - <config:username>momotdbadapter</config:username> - <config:password>momotdbadapter</config:password> - <!-- The URL where the MoM-OTDB-adapter logs in. --> - <config:authurl>http://momhost:8080/useradministration</config:authurl> - <!-- The import XML URL of MoM --> - <config:mom2-import-url>http://momhost:8080/mom3/interface/importXML2.do</config:mom2-import-url> - <!-- The MoM schema's URL. This is not for validation of xml files in the MoM-OTDB-adapter. - Validation of the xml files are agains the schemas in the jar. - This URL is only used for generating xml files for the MoM import. - So if there are errors you can use it in eclipse with validition enabled--> - <config:mom2-schemas-url>http://momhost:8080/mom3/schemas/</config:mom2-schemas-url> - </config:mom2> - <!-- Section to configure the communication with the Stub --> - <config:stub> - <!-- Interval in seconds that the MoM-OTDB-adapter checks Stub for changes. Do not put this lower then 3 seconds. --> - <config:interval>5</config:interval> - </config:stub> - <!-- Section to configure the MoM-OTDB-adapter --> - <config:adapter> - <!-- Port where the HTTP server of MoM-OTDB-adapter should run --> - <config:httpport>8082</config:httpport> - <!-- Keystore file for MoM-OTDB-adapter. This file should contain the MoM-OTDB-adapter public/private key --> - <config:keystore-location>./keystores/mom-otdb-adapter-keystore.jks</config:keystore-location> - <!-- Password of the Keystore file for MoM-OTDB-adapter. --> - <config:keystore-password>adapter</config:keystore-password> - <!-- Trusted Keystore file for MoM-OTDB-adapter. This file should contain all client public keys --> - <config:trusted-keystore-location>./keystores/mom-otdb-adapter-trusted-keystore.jks</config:trusted-keystore-location> - <!-- Password of the Trusted Keystore file for MoM-OTDB-adapter. --> - <config:trusted-keystore-password>adapter-trusted</config:trusted-keystore-password> - </config:adapter> -</config:config> diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/log4j.properties b/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/log4j.properties deleted file mode 100644 index dd77492685bdd659e7f97c720b5b326a06a0b221..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/dist-sources/conf/log4j.properties +++ /dev/null @@ -1,33 +0,0 @@ -# -# Configures Log4j as the Tomcat system logger -# -log4j.rootLogger=INFO, FILE, MAIL - - -log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender -log4j.appender.MAIL.Threshold=FATAL -log4j.appender.MAIL.BufferSize=10 -log4j.appender.MAIL.From=lofar17@astron.nl -log4j.appender.MAIL.SMTPHost=127.0.0.1 -log4j.appender.MAIL.Subject=Error on mom2-otdb-adapter (Log4j) -log4j.appender.MAIL.To=verhoef@astron.nl,vermaas@astron.nl,holties@astron.nl -log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout -log4j.appender.MAIL.layout.ConversionPattern=%d %-5p %c{2}:%L - %m%n - - - -# -# Configuration for a rolling log file ("mom2-otdb-adapter.log"). -# -log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.FILE.File=./logs/mom-otdb-adapter.log -log4j.appender.FILE.layout=org.apache.log4j.PatternLayout -log4j.appender.FILE.layout.ConversionPattern=%d %-5p %c{2}:%L - %m%n - - -log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender -log4j.appender.DEBUG.File=./logs/debug.log -log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout -log4j.appender.DEBUG.layout.ConversionPattern=%d %-5p %c{2}:%L - %m%n - -log4j.logger.nl.astron.lofar.odtb.mom2otdbadapter=DEBUG, DEBUG \ No newline at end of file diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/adapter_lofar17_nfra_nl.cer b/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/adapter_lofar17_nfra_nl.cer deleted file mode 100644 index 8083c1ad360c9ac187199481cb4751c4b3a90c95..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/adapter_lofar17_nfra_nl.cer and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-keystore.jks b/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-keystore.jks deleted file mode 100644 index 94d38c26d50996bfb9ad3c44d6de7316150b8c36..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-keystore.jks and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-trusted-keystore.jks b/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-trusted-keystore.jks deleted file mode 100644 index a205ee06bc29c9f20c313fefbdbd5e7645deb0bd..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter-trusted-keystore.jks and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter.cer b/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter.cer deleted file mode 100644 index c538b58fe489ee7274d32548ba3401eebc363ddf..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/dist-sources/keystores/mom-otdb-adapter.cer and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.bat b/SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.bat deleted file mode 100644 index 764e99a7dcd9caa5563a8d0e443aab5d19f0cb26..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.bat +++ /dev/null @@ -1 +0,0 @@ -java -jar ./mom-otdb-adapter.jar -c ./conf/config-otdb.xml -l ./conf/log4j.properties \ No newline at end of file diff --git a/SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.sh b/SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.sh deleted file mode 100644 index 4086a3cb1fb60dbe5fb6bf0328b2e6dbe983c1f6..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/dist-sources/mom-otdb-adapter.sh +++ /dev/null @@ -1,4 +0,0 @@ - -export JAVAHOME=/usr/local/jdk1.6.0_01 - -$JAVAHOME/bin/java -jar ./mom-otdb-adapter.jar -c ./conf/config-otdb.xml -l ./conf/log4j.properties diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-keystore.jks b/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-keystore.jks deleted file mode 100644 index cdc413d52c360d766bdd2efc34fea863a6f6fa4c..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-keystore.jks and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-trusted-keystore.jks b/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-trusted-keystore.jks deleted file mode 100644 index a205ee06bc29c9f20c313fefbdbd5e7645deb0bd..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter-trusted-keystore.jks and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter.cer b/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter.cer deleted file mode 100644 index c538b58fe489ee7274d32548ba3401eebc363ddf..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/examples/mom-otdb-adapter.cer and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/obs-50-active.xml b/SAS/OTB/MoM-OTDB-adapter/examples/obs-50-active.xml deleted file mode 100644 index 4ecfd6e5641494f2d4e79d2e8e3dba171d2b1501..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/examples/obs-50-active.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lofar:observation mom2Id="50" - xmlns:lofar="http://www.astron.nl/MoM2-Lofar" - xmlns:mom2="http://www.astron.nl/MoM2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar C:/java/workspace/MoM-OTDB-adapter/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 C:/java/workspace/MoM-OTDB-adapter/schemas/MoM2.xsd "> - <currentStatus> - <mom2:activeStatus/> - </currentStatus> - <children/> - <observationAttributes> - <observationId>5005</observationId> - <clock/> - <startTime>2009-09-30T13:54:11</startTime> - <stations/> - </observationAttributes> -</lofar:observation> diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/obs-50-specified.xml b/SAS/OTB/MoM-OTDB-adapter/examples/obs-50-specified.xml deleted file mode 100644 index c24c52cdcc789d039df2ea4b59c12b4bc797de5d..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/examples/obs-50-specified.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lofar:observation mom2Id="50" - xmlns:lofar="http://www.astron.nl/MoM2-Lofar" - xmlns:mom2="http://www.astron.nl/MoM2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar C:/java/workspace/MoM-OTDB-adapter/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 C:/java/workspace/MoM-OTDB-adapter/schemas/MoM2.xsd "> - <currentStatus> - <mom2:preparedStatus/> - </currentStatus> - <children> - <item index="0"> - <lofar:measurement mom2Id="51" xsi:type="lofar:UVMeasurementType"> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT10M</duration> - <subbands>255,256,257</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - <item index="1"> - <lofar:measurement mom2Id="52" xsi:type="lofar:UVMeasurementType"> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT40M</duration> - <subbands>224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - <item index="2"> - <lofar:measurement mom2Id="53" xsi:type="lofar:UVMeasurementType"> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT10M</duration> - <subbands>224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - </children> - <observationAttributes> - <observationId>5004</observationId> - <antenna>HBA Both</antenna> - <clock> - <channelWidth units="Hz">610.3515625</channelWidth> - <samplesPerSecond>155648</samplesPerSecond> - <subbandWidth units="Hz">156.25</subbandWidth> - <systemClock units="Hz">160</systemClock> - </clock> - <integrationInterval>4</integrationInterval> - <channelsPerSubband>256</channelsPerSubband> - <instrumentFilter>10-90 MHz</instrumentFilter> - <stations> - <station> - <name>CS302</name> - </station> - <station> - <name>CS303</name> - </station> - </stations> - </observationAttributes> -</lofar:observation> diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-active.xml b/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-active.xml deleted file mode 100644 index 207fd0088204fee2a0c3f6b294b89804b938e398..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-active.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lofar:observation mom2Id="52" - xmlns:lofar="http://www.astron.nl/MoM2-Lofar" - xmlns:mom2="http://www.astron.nl/MoM2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar C:/java/workspace/MoM-OTDB-adapter/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 C:/java/workspace/MoM-OTDB-adapter/schemas/MoM2.xsd "> - <currentStatus> - <mom2:activeStatus/> - </currentStatus> - <children> - <item index="0"> - <lofar:measurement mom2Id="51" xsi:type="lofar:UVMeasurementType"> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT10M</duration> - <subbands>255,256,257</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - <item index="1"> - <lofar:measurement mom2Id="52" xsi:type="lofar:UVMeasurementType"> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT40M</duration> - <subbands>224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - <item index="2"> - <lofar:measurement mom2Id="53" xsi:type="lofar:UVMeasurementType"> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT10M</duration> - <subbands>224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - </children> - <observationAttributes> - <observationId>5039</observationId> - <antenna>HBA Both</antenna> - <clock> - <channelWidth units="Hz">610.3515625</channelWidth> - <samplesPerSecond>155648</samplesPerSecond> - <subbandWidth units="Hz">156.25</subbandWidth> - <systemClock units="Hz">160</systemClock> - </clock> - <channelsPerSubband>256</channelsPerSubband> - <instrumentFilter>10-90 MHz</instrumentFilter> - <stations/> - </observationAttributes> -</lofar:observation> diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-finished.xml b/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-finished.xml deleted file mode 100644 index 24df60585720ab4c1b74d4c11a431039c886bf5c..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-finished.xml +++ /dev/null @@ -1,1127 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lofar:observation mom2Id="52" - xmlns:lofar="http://www.astron.nl/MoM2-Lofar" - xmlns:mom2="http://www.astron.nl/MoM2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar C:/java/workspace/MoM-OTDB-adapter/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 C:/java/workspace/MoM-OTDB-adapter/schemas/MoM2.xsd "> - <currentStatus> - <mom2:successfulStatus/> - </currentStatus> - <children> - <item index="0"> - <lofar:measurement mom2Id="51" xsi:type="lofar:UVMeasurementType"> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>SB0.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>0</subband> - <stationSubband>255</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB1.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>1</subband> - <stationSubband>256</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB2.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>2</subband> - <stationSubband>257</stationSubband> - </lofar:uvDataProduct> - </item> - </resultDataProducts> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT10M</duration> - <subbands>255,256,257</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - <item index="1"> - <lofar:measurement mom2Id="52" xsi:type="lofar:UVMeasurementType"> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>SB0.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>0</subband> - <stationSubband>224</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB1.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>1</subband> - <stationSubband>225</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB2.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>2</subband> - <stationSubband>226</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB3.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>3</subband> - <stationSubband>227</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB4.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>4</subband> - <stationSubband>228</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB5.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>5</subband> - <stationSubband>229</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB6.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>6</subband> - <stationSubband>230</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB7.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>7</subband> - <stationSubband>231</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB8.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>8</subband> - <stationSubband>232</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB9.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>9</subband> - <stationSubband>233</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB10.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>10</subband> - <stationSubband>234</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB11.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>11</subband> - <stationSubband>235</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB12.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>12</subband> - <stationSubband>236</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB13.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>13</subband> - <stationSubband>237</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB14.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>14</subband> - <stationSubband>238</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB15.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>15</subband> - <stationSubband>239</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB16.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>16</subband> - <stationSubband>240</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB17.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>17</subband> - <stationSubband>241</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB18.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>18</subband> - <stationSubband>242</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB19.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>19</subband> - <stationSubband>243</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB20.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>20</subband> - <stationSubband>244</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB21.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>21</subband> - <stationSubband>245</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB22.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>22</subband> - <stationSubband>246</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB23.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>23</subband> - <stationSubband>247</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB24.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>24</subband> - <stationSubband>248</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB25.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>25</subband> - <stationSubband>249</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB26.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>26</subband> - <stationSubband>250</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB27.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>27</subband> - <stationSubband>251</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB28.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>28</subband> - <stationSubband>252</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB29.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>29</subband> - <stationSubband>253</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB30.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>30</subband> - <stationSubband>254</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB31.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>31</subband> - <stationSubband>255</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB32.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>32</subband> - <stationSubband>256</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB33.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>33</subband> - <stationSubband>257</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB34.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>34</subband> - <stationSubband>258</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB35.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>35</subband> - <stationSubband>259</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB36.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>36</subband> - <stationSubband>260</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB37.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>37</subband> - <stationSubband>261</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB38.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>38</subband> - <stationSubband>262</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB39.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>39</subband> - <stationSubband>263</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB40.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>40</subband> - <stationSubband>264</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB41.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>41</subband> - <stationSubband>265</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB42.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>42</subband> - <stationSubband>266</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB43.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>43</subband> - <stationSubband>267</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB44.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>44</subband> - <stationSubband>268</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB45.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>45</subband> - <stationSubband>269</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB46.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>46</subband> - <stationSubband>270</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB47.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>47</subband> - <stationSubband>271</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB48.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>48</subband> - <stationSubband>272</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB49.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>49</subband> - <stationSubband>273</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB50.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>50</subband> - <stationSubband>274</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB51.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>51</subband> - <stationSubband>275</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB52.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>52</subband> - <stationSubband>276</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB53.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>53</subband> - <stationSubband>277</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB54.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>54</subband> - <stationSubband>278</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB55.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>55</subband> - <stationSubband>279</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB56.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>56</subband> - <stationSubband>280</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB57.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>57</subband> - <stationSubband>281</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB58.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>58</subband> - <stationSubband>282</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB59.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>59</subband> - <stationSubband>283</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB60.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>60</subband> - <stationSubband>284</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB61.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>61</subband> - <stationSubband>285</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB62.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>62</subband> - <stationSubband>286</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB63.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>63</subband> - <stationSubband>287</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB64.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>64</subband> - <stationSubband>288</stationSubband> - </lofar:uvDataProduct> - </item> - </resultDataProducts> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT40M</duration> - <subbands>224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - <item index="2"> - <lofar:measurement mom2Id="53" xsi:type="lofar:UVMeasurementType"> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>SB0.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>0</subband> - <stationSubband>224</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB1.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>1</subband> - <stationSubband>225</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB2.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>2</subband> - <stationSubband>226</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB3.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>3</subband> - <stationSubband>227</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB4.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>4</subband> - <stationSubband>228</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB5.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>5</subband> - <stationSubband>229</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB6.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>6</subband> - <stationSubband>230</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB7.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>7</subband> - <stationSubband>231</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB8.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>8</subband> - <stationSubband>232</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB9.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>9</subband> - <stationSubband>233</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB10.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>10</subband> - <stationSubband>234</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB11.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>11</subband> - <stationSubband>235</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB12.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>12</subband> - <stationSubband>236</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB13.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>13</subband> - <stationSubband>237</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB14.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>14</subband> - <stationSubband>238</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB15.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>15</subband> - <stationSubband>239</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB16.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>16</subband> - <stationSubband>240</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB17.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>17</subband> - <stationSubband>241</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB18.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>18</subband> - <stationSubband>242</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB19.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>19</subband> - <stationSubband>243</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB20.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>20</subband> - <stationSubband>244</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB21.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>21</subband> - <stationSubband>245</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB22.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>22</subband> - <stationSubband>246</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB23.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>23</subband> - <stationSubband>247</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB24.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>24</subband> - <stationSubband>248</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB25.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>25</subband> - <stationSubband>249</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB26.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>26</subband> - <stationSubband>250</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB27.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>27</subband> - <stationSubband>251</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB28.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>28</subband> - <stationSubband>252</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB29.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>29</subband> - <stationSubband>253</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB30.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>30</subband> - <stationSubband>254</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB31.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>31</subband> - <stationSubband>255</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB32.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>32</subband> - <stationSubband>256</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB33.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>33</subband> - <stationSubband>257</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB34.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>34</subband> - <stationSubband>258</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB35.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>35</subband> - <stationSubband>259</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB36.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>36</subband> - <stationSubband>260</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB37.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>37</subband> - <stationSubband>261</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB38.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>38</subband> - <stationSubband>262</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB39.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>39</subband> - <stationSubband>263</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB40.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>40</subband> - <stationSubband>264</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB41.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>41</subband> - <stationSubband>265</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB42.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>42</subband> - <stationSubband>266</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB43.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>43</subband> - <stationSubband>267</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB44.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>44</subband> - <stationSubband>268</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB45.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>45</subband> - <stationSubband>269</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB46.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>46</subband> - <stationSubband>270</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB47.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>47</subband> - <stationSubband>271</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB48.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>48</subband> - <stationSubband>272</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB49.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>49</subband> - <stationSubband>273</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB50.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>50</subband> - <stationSubband>274</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB51.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>51</subband> - <stationSubband>275</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB52.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>52</subband> - <stationSubband>276</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB53.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>53</subband> - <stationSubband>277</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB54.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>54</subband> - <stationSubband>278</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB55.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>55</subband> - <stationSubband>279</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB56.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>56</subband> - <stationSubband>280</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB57.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>57</subband> - <stationSubband>281</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB58.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>58</subband> - <stationSubband>282</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB59.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>59</subband> - <stationSubband>283</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB60.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>60</subband> - <stationSubband>284</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB61.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>61</subband> - <stationSubband>285</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB62.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>62</subband> - <stationSubband>286</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB63.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>63</subband> - <stationSubband>287</stationSubband> - </lofar:uvDataProduct> - </item> - <item> - <lofar:uvDataProduct> - <name>SB64.MS</name> - <fileFormat>AIPS++/CASA</fileFormat> - <subband>64</subband> - <stationSubband>288</stationSubband> - </lofar:uvDataProduct> - </item> - </resultDataProducts> - <measurementAttributes> - <ra>85.650575</ra> - <dec>49.852009</dec> - <equinox>J2000</equinox> - <duration>PT10M</duration> - <subbands>224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288</subbands> - </measurementAttributes> - </lofar:measurement> - </item> - </children> - <observationAttributes> - <observationId>5039</observationId> - <antenna>HBA Both</antenna> - <clock> - <channelWidth units="Hz">610.3515625</channelWidth> - <samplesPerSecond>155648</samplesPerSecond> - <subbandWidth units="Hz">156.25</subbandWidth> - <systemClock units="Hz">160</systemClock> - </clock> - <channelsPerSubband>256</channelsPerSubband> - <instrumentFilter>10-90 MHz</instrumentFilter> - <stations/> - </observationAttributes> -</lofar:observation> diff --git a/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-specified.xml b/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-specified.xml deleted file mode 100644 index b5d3f47de0796bcbdabc343cf85d71e82f705ab4..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/examples/obs-52-specified.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lofar:observation mom2Id="52" - xmlns:lofar="http://www.astron.nl/MoM2-Lofar" - xmlns:mom2="http://www.astron.nl/MoM2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar C:/java/workspace/MoM-OTDB-adapter/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 C:/java/workspace/MoM-OTDB-adapter/schemas/MoM2.xsd "> - <currentStatus> - <mom2:preparedStatus/> - </currentStatus> - <children/> - <observationAttributes> - <observationId>5038</observationId> - <antenna>HBA Both</antenna> - <clock> - <channelWidth units="Hz">610.3515625</channelWidth> - <samplesPerSecond>155648</samplesPerSecond> - <subbandWidth units="Hz">156.25</subbandWidth> - <systemClock units="Hz">160</systemClock> - </clock> - <integrationInterval>4</integrationInterval> - <channelsPerSubband>256</channelsPerSubband> - <instrumentFilter>10-90 MHz</instrumentFilter> - <stations> - <station> - <name>CS302</name> - </station> - <station> - <name>CS303</name> - </station> - </stations> - </observationAttributes> -</lofar:observation> diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/astron-http-utils.jar b/SAS/OTB/MoM-OTDB-adapter/lib/astron-http-utils.jar deleted file mode 100644 index 0f7523bed5ea0235e82eb175113d67b3c70ede76..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/astron-http-utils.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/astron-utils.jar b/SAS/OTB/MoM-OTDB-adapter/lib/astron-utils.jar deleted file mode 100644 index 8d524115aa645773a973370b765065707f8a9e6e..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/astron-utils.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/commons-codec-1.3.jar b/SAS/OTB/MoM-OTDB-adapter/lib/commons-codec-1.3.jar deleted file mode 100644 index 957b6752af9a60c1bb2a4f65db0e90e5ce00f521..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/commons-codec-1.3.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/commons-logging.jar b/SAS/OTB/MoM-OTDB-adapter/lib/commons-logging.jar deleted file mode 100644 index b73a80fab641131e6fbe3ae833549efb3c540d17..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/commons-logging.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/commons-validator.jar b/SAS/OTB/MoM-OTDB-adapter/lib/commons-validator.jar deleted file mode 100644 index 55b12b1a98dcb29746fc866ef35216ef50a05626..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/commons-validator.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/httpclient-4.0-beta2.jar b/SAS/OTB/MoM-OTDB-adapter/lib/httpclient-4.0-beta2.jar deleted file mode 100644 index e773cccbaa5ef94c4aad574f32d8311e2f0dd1ed..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/httpclient-4.0-beta2.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/httpcore-4.0.1.jar b/SAS/OTB/MoM-OTDB-adapter/lib/httpcore-4.0.1.jar deleted file mode 100644 index 4638daa5f0a031a1e1f1c053534d0aeecf95cf9b..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/httpcore-4.0.1.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/httpcore-nio-4.0.1.jar b/SAS/OTB/MoM-OTDB-adapter/lib/httpcore-nio-4.0.1.jar deleted file mode 100644 index 3772777fbc9ad017c0463ba613a28f23b73f0d3a..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/httpcore-nio-4.0.1.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/httpmime-4.0-beta2.jar b/SAS/OTB/MoM-OTDB-adapter/lib/httpmime-4.0-beta2.jar deleted file mode 100644 index 84d6849a47c843ad3ccfec32218ff578160409a2..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/httpmime-4.0-beta2.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/log4j-1.2.15.jar b/SAS/OTB/MoM-OTDB-adapter/lib/log4j-1.2.15.jar deleted file mode 100644 index c930a6ab4d4b73c1a6feb9e929091205664bb340..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/log4j-1.2.15.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/mail.jar b/SAS/OTB/MoM-OTDB-adapter/lib/mail.jar deleted file mode 100644 index 59543774f218e4fd2a899ac75f118066c9395cab..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/mail.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/xercesImpl-2.8.1.jar b/SAS/OTB/MoM-OTDB-adapter/lib/xercesImpl-2.8.1.jar deleted file mode 100644 index 3b351f6e2b566f73b742510738a52b866b4ffd0d..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/xercesImpl-2.8.1.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/lib/xml-apis-1.3.03.jar b/SAS/OTB/MoM-OTDB-adapter/lib/xml-apis-1.3.03.jar deleted file mode 100644 index b338fb66932a763d6939dc93f27ed985ca5d1ebb..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/lib/xml-apis-1.3.03.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/sharedlib/jOTDB2.jar b/SAS/OTB/MoM-OTDB-adapter/sharedlib/jOTDB2.jar deleted file mode 100644 index 402f5c6cad18b372473ad873ef7ed079cf6d814f..0000000000000000000000000000000000000000 Binary files a/SAS/OTB/MoM-OTDB-adapter/sharedlib/jOTDB2.jar and /dev/null differ diff --git a/SAS/OTB/MoM-OTDB-adapter/src/config.xsd b/SAS/OTB/MoM-OTDB-adapter/src/config.xsd deleted file mode 100644 index 9cbeeb34d46c9ed51a02c9f5c0ffd06258467de5..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/config.xsd +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.astron.nl/MoM-OTDB-adapter" - xmlns:config="http://www.astron.nl/MoM-OTDB-adapter" elementFormDefault="qualified"> - - <element name="config" type="config:MoM2OTDBAdapterType"></element> - - <complexType name="MoM2OTDBAdapterType"> - <sequence> - <element name="mom2" type="config:MoM2ConfigType"/> - <choice> - <element name="otdb" type="config:OTDBConfigType"/> - <element name="stub" type="config:StubConfigType"/> - </choice> - <element name="adapter" type="config:AdapterConfigType"/> - </sequence> - </complexType> - - <complexType name="MoM2ConfigType"> - <sequence> - <element name="username" type="string"/> - <element name="password" type="string"/> - <element name="authurl" type="string"/> - <element name="mom2-import-url" type="string"/> - <element name="mom2-schemas-url" type="string"/> - </sequence> - - </complexType> - <complexType name="RepositoryConfigType"> - <sequence> - <element name="interval" type="integer"/> - </sequence> - </complexType> - <complexType name="OTDBConfigType"> - <complexContent> - <extension base="config:RepositoryConfigType"> - <sequence> - <element name="uvObservationTemplateId" type="integer"/> - <element name="rmihost" type="string"/> - <element name="rmiport" type="integer"/> - </sequence> - </extension> - </complexContent> - - </complexType> - <complexType name="StubConfigType"> - <complexContent> - <extension base="config:RepositoryConfigType"> - </extension> - </complexContent> - </complexType> - <complexType name="AdapterConfigType"> - <sequence> - <element name="httpport" type="integer"/> - <element name="keystore-location" type="string"/> - <element name="keystore-password" type="string"/> - <element name="trusted-keystore-location" type="string"/> - <element name="trusted-keystore-password" type="string"/> - </sequence> - </complexType> -</schema> diff --git a/SAS/OTB/MoM-OTDB-adapter/src/log4j.properties b/SAS/OTB/MoM-OTDB-adapter/src/log4j.properties deleted file mode 100644 index 9f2302738766ac66922e61d1d1a7369ea5dfcd05..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/log4j.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# Configures Log4j as the Tomcat system logger -# -log4j.rootLogger=INFO, CONSOLE - -# -# Configuration for standard output ("catalina.out"). -# -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c{2}:%L - %m%n - - -# -# Application logging options -# -#log4j.logger.nl.astron.lofar=INFO, CONSOLE - - - - - diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/MomOtdbAdapter.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/MomOtdbAdapter.java deleted file mode 100644 index 4a13a675b7330551a16f2d71a4b96c7cbe52f430..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/MomOtdbAdapter.java +++ /dev/null @@ -1,132 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter; - -import java.io.File; -import java.io.IOException; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; -import java.util.Locale; -import java.util.TimeZone; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.ConfigXMLParser; -import nl.astron.lofar.odtb.mom2otdbadapter.config.Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.config.OTDBConfiguration; -import nl.astron.lofar.odtb.mom2otdbadapter.config.StubConfiguration; -import nl.astron.lofar.odtb.mom2otdbadapter.data.OTDBRepository; -import nl.astron.lofar.odtb.mom2otdbadapter.data.Repository; -import nl.astron.lofar.odtb.mom2otdbadapter.data.StubRepository; -import nl.astron.lofar.odtb.mom2otdbadapter.mom2listener.HttpServer; -import nl.astron.lofar.odtb.mom2otdbadapter.otdblistener.OTDBListener; -import nl.astron.lofar.odtb.mom2otdbadapter.otdblistener.Queue; -import nl.astron.lofar.odtb.mom2otdbadapter.otdblistener.TaskExecutor; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.log4j.PropertyConfigurator; - -public class MomOtdbAdapter { - - private static Log log = LogFactory.getLog(MomOtdbAdapter.class); - - /** - * Starts all services - * - * @throws IOException - * @throws CertificateException - * @throws NoSuchAlgorithmException - * @throws KeyStoreException - * @throws KeyManagementException - * @throws UnrecoverableKeyException - */ - protected void startServices(Configuration config) throws IOException, UnrecoverableKeyException, - KeyManagementException, KeyStoreException, NoSuchAlgorithmException, CertificateException { - TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - Locale.setDefault(Locale.US); - Queue queue = new Queue(); - Repository repository = null; - if (config.getRepository() instanceof StubConfiguration) { - repository = new StubRepository(); - } else if (config.getRepository() instanceof OTDBConfiguration) { - repository = new OTDBRepository((OTDBConfiguration) config.getRepository()); - } - TaskExecutor otdbQueueProcessor = new TaskExecutor(queue, config.getMom2()); - otdbQueueProcessor.start(); - - OTDBListener otdbListener = new OTDBListener(queue, config, repository); - otdbListener.start(); - - HttpServer server = new HttpServer(config, repository); - server.start(); - } - - - /** - * @param args - */ - public static void main(String[] args) throws Exception { - File log4jLocation = null; - File configLocation = null; - boolean valid = true; - if (args.length > 0) { - for (int i = 0; i < args.length - 1; i = i + 2) { - String argument = args[i]; - String value = args[i + 1]; - if (argument.equals("-l")) { - log4jLocation = new File(value); - } else if (argument.equals("-c")) { - configLocation = new File(value); - } - } - } - if (configLocation == null) { - valid = false; - showSyntax(); - } else { - if (!configLocation.exists()) { - System.out.println(configLocation.getPath() + " does not exist"); - valid = false; - } - } - if (valid) { - if (log4jLocation != null && !log4jLocation.exists()) { - System.out.println(log4jLocation.getPath() + " does not exist"); - } - } - if (valid) { - MomOtdbAdapter adapter = new MomOtdbAdapter(); - - try { - if (log4jLocation != null) { - PropertyConfigurator.configure(log4jLocation.getAbsolutePath()); - - log.info("MomOtdbAdapter started. log4j: " + log4jLocation.getAbsolutePath()); - } else { - log.info("MomOtdbAdapter started."); - } - adapter.startServices(ConfigXMLParser.parse(configLocation)); - } catch (Exception e) { - log.error(e.getMessage(), e); - System.exit(0); - } - } else { - System.out.println("Unable to start MomOtdbAdapter"); - System.exit(0); - } - } - - /** - * Shows the syntax of this program - */ - public static void showSyntax() { - - System.out.println("\n--- Syntax ---"); - System.out.println("java -jar mom-otdb-adapter.jar " + " -argument <value> ..."); - System.out.println("\n--- Arguments ---"); - System.out.println("-c <config file>"); - System.out.println("-l <log4j.properties file>"); - System.out.println("\n---Example ---"); - System.out.println("java -jar mom-otdb-adapter.jar -c ./config.xml -l ./log4j.properties"); - }; -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/AdapterConfiguration.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/AdapterConfiguration.java deleted file mode 100644 index 9be4cd767522b863ec859ac32e94a91a2ad973e2..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/AdapterConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -public class AdapterConfiguration { - - private Integer httpPort; - private String keystoreLocation; - private String keystorePassword; - private String trustedKeystoreLocation; - private String trustedKeystorePassword; - - public Integer getHttpPort() { - return httpPort; - } - public void setHttpPort(Integer httpPort) { - this.httpPort = httpPort; - } - public String getKeystoreLocation() { - return keystoreLocation; - } - public void setKeystoreLocation(String keystoreLocation) { - this.keystoreLocation = keystoreLocation; - } - public String getKeystorePassword() { - return keystorePassword; - } - public void setKeystorePassword(String keystorePassword) { - this.keystorePassword = keystorePassword; - } - public String getTrustedKeystoreLocation() { - return trustedKeystoreLocation; - } - public void setTrustedKeystoreLocation(String trustedKeystoreLocation) { - this.trustedKeystoreLocation = trustedKeystoreLocation; - } - public String getTrustedKeystorePassword() { - return trustedKeystorePassword; - } - public void setTrustedKeystorePassword(String trustedKeystorePassword) { - this.trustedKeystorePassword = trustedKeystorePassword; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/ConfigXMLParser.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/ConfigXMLParser.java deleted file mode 100644 index 726e786c0ad81356a1fa012243d5aa96afb8e8af..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/ConfigXMLParser.java +++ /dev/null @@ -1,162 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import nl.astron.util.AstronConverter; -import nl.astron.util.AstronValidator; -import nl.astron.util.XMLConverter; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; - -/** - * parse the XML input from MoM and returns a LofarObservations. If needed it - * used the Mom2OtdbConverter to convert values to otdb values - * - * @author Bastiaan Verhoef - * - */ -public class ConfigXMLParser { - - private static final String ADAPTER = "adapter"; - private static final String OTDB = "otdb"; - private static final String STUB = "stub"; - private static final String MOM2 = "mom2"; - private static Log log = LogFactory.getLog(ConfigXMLParser.class); - - /** - * Parse a xml document and returns a lofar obseravation - * - * @param document - * xml document - * @return LofarObservation - * @throws Exception - * @throws URISyntaxException - * @throws FileNotFoundException - */ - public static Configuration parse(File xml) throws Exception { - log.info("Mom-otdb-adapter config file: " + xml.getPath()); - URL url = ConfigXMLParser.class.getClassLoader().getResource("config.xsd"); - Document document = XMLConverter.convertXMLToDocument(new InputSource(new FileInputStream(xml)), url); - Configuration configuration = new Configuration(); - - /* - * search for project - */ - Node element = document.getDocumentElement(); - Map<String, Element> elementsMap = getElementMap(element.getChildNodes()); - - configuration.setMom2(parseMom2Configuration(elementsMap.get(MOM2))); - - if (elementsMap.containsKey(STUB)) { - configuration.setRepository(parseStubConfiguration(elementsMap.get(STUB))); - } else if (elementsMap.containsKey(OTDB)) { - configuration.setRepository(parseOTDBConfiguration(elementsMap.get(OTDB))); - } - configuration.setAdapter(parseAdapterConfiguration(elementsMap.get(ADAPTER))); - return configuration; - } - - private static Mom2Configuration parseMom2Configuration(Element mom2Element) { - Map<String, Element> elements = getElementMap(mom2Element.getChildNodes()); - Mom2Configuration mom2Configuration = new Mom2Configuration(); - mom2Configuration.setUsername(getValue(elements.get("username"))); - mom2Configuration.setPassword(getValue(elements.get("password"))); - mom2Configuration.setAuthUrl(getValue(elements.get("authurl"))); - mom2Configuration.setMom2ImportUrl(getValue(elements.get("mom2-import-url"))); - mom2Configuration.setMom2SchemasUrl(getValue(elements.get("mom2-schemas-url"))); - return mom2Configuration; - } - - private static StubConfiguration parseStubConfiguration(Element element) { - Map<String, Element> elements = getElementMap(element.getChildNodes()); - StubConfiguration configuration = new StubConfiguration(); - configuration.setInterval(AstronConverter.toInteger(getValue(elements.get("interval")))); - return configuration; - } - - private static OTDBConfiguration parseOTDBConfiguration(Element element) { - Map<String, Element> elements = getElementMap(element.getChildNodes()); - OTDBConfiguration configuration = new OTDBConfiguration(); - configuration.setInterval(AstronConverter.toInteger(getValue(elements.get("interval")))); - configuration.setTemplateId(AstronConverter.toInteger(getValue(elements.get("uvObservationTemplateId")))); - configuration.setRmiPort(AstronConverter.toInteger(getValue(elements.get("rmiport")))); - configuration.setRmiHost(getValue(elements.get("rmihost"))); - return configuration; - } - - private static AdapterConfiguration parseAdapterConfiguration(Element element) { - Map<String, Element> elements = getElementMap(element.getChildNodes()); - AdapterConfiguration configuration = new AdapterConfiguration(); - configuration.setHttpPort(AstronConverter.toInteger(getValue(elements.get("httpport")))); - configuration.setKeystoreLocation(getValue(elements.get("keystore-location"))); - configuration.setKeystorePassword(getValue(elements.get("keystore-password"))); - configuration.setTrustedKeystoreLocation(getValue(elements.get("trusted-keystore-location"))); - configuration.setTrustedKeystorePassword(getValue(elements.get("trusted-keystore-password"))); - return configuration; - - } - - /** - * The getValue method returns the value of an node - * - * @param node - * @return value of the node - */ - private static String getValue(Node node) { - String value = null; - if (node.getFirstChild() != null) { - value = node.getFirstChild().getNodeValue(); - } - return value; - } - - /** - * Returns the node name without prefix - * - * @param node - * @return node name withoud prefix - */ - private static String removePrefix(Node node) { - return removePrefix(node.getNodeName()); - } - - private static String removePrefix(String nodeName) { - String[] nodeSplit = nodeName.split(":"); - String withoutPrefix = nodeSplit[nodeSplit.length - 1]; - return withoutPrefix; - } - - private static Map<String, Element> getElementMap(NodeList nodeList) { - Map<String, Element> elementMap = new HashMap<String, Element>(); - for (int i = 0; i < nodeList.getLength(); i++) { - Node childNode = nodeList.item(i); - if (isElement(childNode)) { - String key = removePrefix(childNode); - elementMap.put(key, (Element) childNode); - } - } - return elementMap; - - } - - private static boolean isElement(Node node) { - if (AstronValidator.implementsInterface(Element.class, node.getClass())) { - return true; - } else { - return false; - } - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Configuration.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Configuration.java deleted file mode 100644 index beb4234e35c8723378366054423848a3396ae29f..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Configuration.java +++ /dev/null @@ -1,32 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -public class Configuration { - private AdapterConfiguration adapter; - private Mom2Configuration mom2; - private RepositoryConfiguration repository; - - public AdapterConfiguration getAdapter() { - return adapter; - } - - public void setAdapter(AdapterConfiguration adapter) { - this.adapter = adapter; - } - - public Mom2Configuration getMom2() { - return mom2; - } - - public void setMom2(Mom2Configuration mom2) { - this.mom2 = mom2; - } - - public RepositoryConfiguration getRepository() { - return repository; - } - - public void setRepository(RepositoryConfiguration repository) { - this.repository = repository; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Mom2Configuration.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Mom2Configuration.java deleted file mode 100644 index 639bf3588417b498528d4c98a2b2a288ad2e0191..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/Mom2Configuration.java +++ /dev/null @@ -1,42 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -public class Mom2Configuration { - - private String username; - private String password; - private String authUrl; - private String mom2ImportUrl; - private String mom2SchemasUrl; - - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - public String getAuthUrl() { - return authUrl; - } - public void setAuthUrl(String authUrl) { - this.authUrl = authUrl; - } - public String getMom2ImportUrl() { - return mom2ImportUrl; - } - public void setMom2ImportUrl(String mom2ImportUrl) { - this.mom2ImportUrl = mom2ImportUrl; - } - public String getMom2SchemasUrl() { - return mom2SchemasUrl; - } - public void setMom2SchemasUrl(String mom2SchemasUrl) { - this.mom2SchemasUrl = mom2SchemasUrl; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/OTDBConfiguration.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/OTDBConfiguration.java deleted file mode 100644 index f09291fd091f130753397bec905b8dc187124532..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/OTDBConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -public class OTDBConfiguration extends RepositoryConfiguration { - - private String rmiHost; - private Integer rmiPort; - private Integer templateId; - - public String getRmiHost() { - return rmiHost; - } - - public void setRmiHost(String rmiHost) { - this.rmiHost = rmiHost; - } - - public Integer getRmiPort() { - return rmiPort; - } - - public void setRmiPort(Integer rmiPort) { - this.rmiPort = rmiPort; - } - - public void setTemplateId(Integer templateId) { - this.templateId = templateId; - } - - public Integer getTemplateId() { - return templateId; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/RepositoryConfiguration.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/RepositoryConfiguration.java deleted file mode 100644 index 43b129c8a72fb6cc03f61e441ecb1ccd5627c708..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/RepositoryConfiguration.java +++ /dev/null @@ -1,14 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -public class RepositoryConfiguration { - - private Integer interval; - - public void setInterval(Integer interval) { - this.interval = interval; - } - - public Integer getInterval() { - return interval; - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/StubConfiguration.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/StubConfiguration.java deleted file mode 100644 index 1fd916519b322a801b02a0ad7c0a4ee3b41cc56f..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/config/StubConfiguration.java +++ /dev/null @@ -1,5 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.config; - -public class StubConfiguration extends RepositoryConfiguration { - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Beam.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Beam.java deleted file mode 100644 index b2f1548c9d516c14bdc8cab9c550659f2979c78b..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Beam.java +++ /dev/null @@ -1,125 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -public class Beam implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -2820149572789270759L; - - private LofarObservation parentObservation; - - private Integer mom2Id ; - - /** - * Angle 1 (mom2 -> otdb) - * e.g. [6.123662, 5.233748, 1459568] - */ - private List<Double> raList = new ArrayList<Double>(); - /** - * Angle 2 (mom2 -> otdb) - * e.g. [1.026719, 0,711018, 0384089] - */ - private List<Double> decList = new ArrayList<Double>(); - - /** - * Direction type (mom2 -> otdb) - * e.g. J2000 - */ - private String equinox; - - /** - * duration - */ - private List<Integer> durations = new ArrayList<Integer>(); - - private List<Integer> angleTimes= new ArrayList<Integer>(); - - /** - * subbands that must be used (mom2 -> otdb) - * e.g. [1,3,5,7] - */ - private List<Integer> subbands = new ArrayList<Integer>(); - - private List<Integer> beamlets = new ArrayList<Integer>(); - - public Beam(LofarObservation observation){ - this.parentObservation = observation; - } - - public Integer getMom2Id() { - return mom2Id; - } - - public void setMom2Id(Integer mom2Id) { - this.mom2Id = mom2Id; - } - - - public String getEquinox() { - return equinox; - } - - public void setEquinox(String equinox) { - this.equinox = equinox; - } - - - public List<Double> getRaList() { - return raList; - } - - public void setRaList(List<Double> raList) { - this.raList = raList; - } - - public List<Double> getDecList() { - return decList; - } - - public void setDecList(List<Double> decList) { - this.decList = decList; - } - - public List<Integer> getDurations() { - return durations; - } - - public void setDurations(List<Integer> durations) { - this.durations = durations; - } - - public List<Integer> getAngleTimes() { - return angleTimes; - } - - public void setAngleTimes(List<Integer> angleTimes) { - this.angleTimes = angleTimes; - } - - public List<Integer> getSubbands() { - return subbands; - } - - public void setSubbands(List<Integer> subbands) { - this.subbands = subbands; - } - - public LofarObservation getParentObservation() { - return parentObservation; - } - - public List<Integer> getBeamlets() { - return beamlets; - } - - public void setBeamlets(List<Integer> beamlets) { - this.beamlets = beamlets; - } - - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/LofarObservation.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/LofarObservation.java deleted file mode 100644 index 14257d5e3e370810905a6011199f2313eb958286..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/LofarObservation.java +++ /dev/null @@ -1,233 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - - -/** - * This data class is a mapping to the lofar observation data of OTDB - * It contains data that will store in OTDB - * - * @author Bastiaan Verhoef - * - */ -public class LofarObservation implements Serializable{ - /* - * for both input and output - */ - - /** - * - */ - private static final long serialVersionUID = 6822871605012685225L; - - /** - * mom2Id of the lofar observation (mom2 <-> otdb) - * e.g. 200 - */ - private Integer mom2Id; - - private Integer observationId; - - /** - * status of a lofar observation, (mom2 <-> otdb) - * e.g. being specified. - */ - private String status; - - private int beamletNumber = 0; - - /** - * timestamp of status change in UTC (mom2 <-> otdb) - * e.g. 2005-Dec-22 15:00:00 - * - */ - private Date timeStamp; - /* - * only for input - */ - private String stationSet; - /** - * Stations that belongs to the array configuration (mom2 -> otdb) - * e.g. [CS001,CS002] - */ - private List<String> stations = new ArrayList<String>(); - - private String antennaArray; - - private String antennaSet; - - /** - * Band selection (mom2 -> otdb) - * e.g. LB_10_90 - */ - private String bandFilter; - - private String clockMode; - - private List<Beam> beams = new ArrayList<Beam>(); - /* - * only for output - */ - - /** - * start time of observation (mom2 <- otdb) - * e.g. 2005-Dec-22 14:50:00 - * - */ - private Date startTime; - /** - * end time of observation (mom2 <- otdb) - * e.g. 2005-Dec-22 14:53:00 - * - */ - private Date endTime; - private Double clockFrequency; - private Double channelWidth; - private Integer channelsPerSubband; - private Double subbandWidth; - private String fileNameMask; - private Integer samplesPerSecond; - private Double integrationInterval; - - public Integer getMom2Id() { - return mom2Id; - } - public void setMom2Id(Integer mom2Id) { - this.mom2Id = mom2Id; - } - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - - - public String getAntennaArray() { - return antennaArray; - } - public void setAntennaArray(String antennaArray) { - this.antennaArray = antennaArray; - } - public String getAntennaSet() { - return antennaSet; - } - public void setAntennaSet(String antennaSet) { - this.antennaSet = antennaSet; - } - public String getBandFilter() { - return bandFilter; - } - public void setBandFilter(String bandFilter) { - this.bandFilter = bandFilter; - } - - - public List<Beam> getBeams() { - return beams; - } - public void setBeams(List<Beam> beams) { - this.beams = beams; - } - - - public String getStationSet() { - return stationSet; - } - public void setStationSet(String stationSet) { - this.stationSet = stationSet; - } - public List<String> getStations() { - return stations; - } - - public void setStations(List<String> stations) { - this.stations = stations; - } - - public String getClockMode() { - return clockMode; - } - public void setClockMode(String clockMode) { - this.clockMode = clockMode; - } - public Integer getObservationId() { - return observationId; - } - public void setObservationId(Integer observationId) { - this.observationId = observationId; - } - public Date getTimeStamp() { - return timeStamp; - } - public void setTimeStamp(Date timeStamp) { - this.timeStamp = timeStamp; - } - public Date getStartTime() { - return startTime; - } - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - public Date getEndTime() { - return endTime; - } - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - public Double getChannelWidth() { - return channelWidth; - } - public void setChannelWidth(Double channelWidth) { - this.channelWidth = channelWidth; - } - public Integer getChannelsPerSubband() { - return channelsPerSubband; - } - public void setChannelsPerSubband(Integer channelsPerSubband) { - this.channelsPerSubband = channelsPerSubband; - } - public Double getSubbandWidth() { - return subbandWidth; - } - public void setSubbandWidth(Double subbandWidth) { - this.subbandWidth = subbandWidth; - } - public String getFileNameMask() { - return fileNameMask; - } - public void setFileNameMask(String fileNameMask) { - this.fileNameMask = fileNameMask; - } - public Double getClockFrequency() { - return clockFrequency; - } - public void setClockFrequency(Double clockFrequency) { - this.clockFrequency = clockFrequency; - } - public Integer getSamplesPerSecond() { - return samplesPerSecond; - } - public void setSamplesPerSecond(Integer samplesPerSecond) { - this.samplesPerSecond = samplesPerSecond; - } - public Double getIntegrationInterval() { - return integrationInterval; - } - public void setIntegrationInterval(Double integrationInterval) { - this.integrationInterval = integrationInterval; - } - public int getBeamletNumber() { - return beamletNumber; - } - public void setBeamletNumber(int beamletNumber) { - this.beamletNumber = beamletNumber; - } - - - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepository.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepository.java deleted file mode 100644 index d08114ae7f3bdcdf09f4b85d6a27c5df8aba8c63..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepository.java +++ /dev/null @@ -1,639 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -import java.rmi.NotBoundException; -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Vector; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.OTDBConfiguration; -import nl.astron.lofar.odtb.mom2otdbadapter.util.Mom2OtdbConverter; -import nl.astron.lofar.sas.otb.jotdb2.jConverterInterface; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBinterface; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBtree; -import nl.astron.lofar.sas.otb.jotdb2.jTreeMaintenanceInterface; -import nl.astron.lofar.sas.otb.jotdb2.jTreeState; -import nl.astron.util.AstronConverter; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Repository that stores and retrieves LofarObservation objects to the jOTDB - * RMI interface. It converts it to the tree structure of jOTDB and vice versa. - * - * @author Bastiaan Verhoef - * - */ -public class OTDBRepository implements Repository { - - private static final int KILO = 1000; - - private static final int MEGA = KILO * KILO; - - private static final String DESCRIPTION = "Created by MoM-OTDB-adapter"; - - private static final String CHANNELS_PER_SUBBAND = "channelsPerSubband"; - - private static final String FILE_NAME_MASK = "MSNameMask"; - - private static final String INTEGRATION_STEPS = "integrationSteps"; - - private static final String IONPROC = "IONProc"; - - private static final String OLAP = "OLAP"; - - private static final String ONLINE_CONTROL = "OnlineControl"; - - private static final String OBSERVATION_CONTROL = "ObservationControl"; - - private static final String STATION_LIST = "stationList"; - - private static final String VIRTUAL_INSTRUMENT = "VirtualInstrument"; - - private static final String BEAM_MOM_ID = "momID"; - - private static final String SUBBAND_LIST = "subbandList"; - - private static final String BEAMLET_LIST = "beamletList"; - - private static final String DURATIONS = "durations"; - - private static final String ANGLE_TIMES = "angleTimes"; - - private static final String ANGLE2 = "angle2"; - - private static final String ANGLE1 = "angle1"; - - private static final String DIRECTION_TYPES = "directionTypes"; - - private static final String SAMPLE_CLOCK = "systemClock"; - - private static final String SUBBAND_WIDTH = "subbandWidth"; - - private static final String SAMPLES_PER_SECOND = "samplesPerSecond"; - - private static final String CHANNEL_WIDTH = "channelWidth"; - - private static final String BEAM = "Beam"; - - private static final String CLOCK_MODE = "clockMode"; - - private static final String BAND_FILTER = "bandFilter"; - - private static final String ANTENNA_SET = "antennaSet"; - - private static final String ANTENNA_ARRAY = "antennaArray"; - - private static final String TEMPLATE_TYPE = "VItemplate"; - - private static final String VIC_TYPE = "VHtree"; - - private Log log = LogFactory.getLog(this.getClass()); - - private jOTDBinterface remoteOTDB = null; - - private jTreeMaintenanceInterface tm = null; - - private jConverterInterface converter = null; - - public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; - - public static final String OTDB_DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss"; - - private boolean connected = false; - - private OTDBConfiguration config; - - /** - * Constructor that makes a connection to the specified rmi server on the - * specified rmi port - * - * @param rmiServerName - * @param port - * @throws NotBoundException - * @throws RemoteException - * @throws NotBoundException - */ - public OTDBRepository(OTDBConfiguration config) { - log.info("OTDBRepository started that communicates with OTDB(" + config.getRmiHost() + ":" - + config.getRmiPort() + ")"); - this.config = config; - - } - - private void init() throws RemoteException, NotBoundException { - if (!connected) { - Registry remoteRegistry = LocateRegistry.getRegistry(config.getRmiHost(), config.getRmiPort()); - remoteOTDB = (jOTDBinterface) remoteRegistry.lookup(jOTDBinterface.SERVICENAME); - tm = (jTreeMaintenanceInterface) remoteRegistry.lookup(jTreeMaintenanceInterface.SERVICENAME); - converter = (jConverterInterface) remoteRegistry.lookup(jConverterInterface.SERVICENAME); - connected = true; - log.info("OTDBRepository connected to OTDB(" + config.getRmiHost() + ":" + config.getRmiPort() + ")"); - } - } - - /** - * Stores a lofarObservation to jOTDB - * - * @param lofarObservation - * @throws RemoteException - */ - public void store(LofarObservation lofarObservation) throws RepositoryException { - log.info("Store observation with mom2Id " + lofarObservation.getMom2Id()); - try { - init(); - Integer treeId = lofarObservation.getObservationId(); - if (treeId == null) { - treeId = tm.copyTemplateTree(config.getTemplateId()); - log.info("New template created with id " + treeId + " from template " + config.getTemplateId() - + " for observation (mom2Id " + lofarObservation.getMom2Id() + ")"); - } - if (Mom2OtdbConverter.OTDB_BEING_SPECIFIED_STATUS.equals(lofarObservation.getStatus())) { - log.info("Store observation with mom2Id " + lofarObservation.getMom2Id() + " and treeId " + treeId); - jOTDBnode observationNode = getObservationNode(treeId); - List<jOTDBnode> beams = new ArrayList<jOTDBnode>(); - Vector<jOTDBnode> childs = getChilds(observationNode); - for (jOTDBnode node : childs) { - if (ANTENNA_ARRAY.equals(node.name)) { - fillNode(node, lofarObservation.getAntennaArray()); - } else if (ANTENNA_SET.equals(node.name)) { - fillNode(node, lofarObservation.getAntennaSet()); - } else if (BAND_FILTER.equals(node.name)) { - fillNode(node, lofarObservation.getBandFilter()); - } else if (CLOCK_MODE.equals(node.name)) { - fillNode(node, lofarObservation.getClockMode()); - } else if (BEAM.equals(node.name)) { - beams.add(node); - } else if (VIRTUAL_INSTRUMENT.equals(node.name)) { - jOTDBnode stationSetNode = getNode(node, "stationSet"); - fillNode(stationSetNode, lofarObservation.getStationSet()); - jOTDBnode stationsNode = getNode(node, STATION_LIST); - fillNode(stationsNode, lofarObservation.getStations()); - } else if (OBSERVATION_CONTROL.equals(node.name)) { - jOTDBnode onlineControlNode = getNode(node, ONLINE_CONTROL); - if (onlineControlNode != null) { - jOTDBnode olapNode = getNode(onlineControlNode, OLAP); - if (olapNode != null) { - jOTDBnode ionProcNode = getNode(olapNode, IONPROC); - if (ionProcNode != null) { - jOTDBnode integrationStepsNode = getNode(olapNode, INTEGRATION_STEPS); - fillNode(integrationStepsNode, lofarObservation.getIntegrationInterval().toString()); - } - } - } - - } - } - - if (beams.size() > 0) { - for (int i = 1; i < beams.size(); i++) { - tm.deleteNode(beams.get(i)); - } - - jOTDBnode aDefaultNode = beams.get(0); - beams.clear(); - for (int i = 0; i < lofarObservation.getBeams().size(); i++) { - int nodeID = tm.dupNode(treeId, aDefaultNode.nodeID(), (short) i); - Beam beam = lofarObservation.getBeams().get(i); - jOTDBnode beamNode = tm.getNode(treeId, nodeID); - - Vector<jOTDBnode> beamChilds = getChilds(beamNode); - // get all the params per child - for (jOTDBnode beamChild : beamChilds) { - if (DIRECTION_TYPES.equals(beamChild.name)) { - fillNode(beamChild, beam.getEquinox()); - } else if (ANGLE1.equals(beamChild.name)) { - fillNode(beamChild, beam.getRaList()); - } else if (ANGLE2.equals(beamChild.name)) { - fillNode(beamChild, beam.getDecList()); - } else if (ANGLE_TIMES.equals(beamChild.name)) { - fillNode(beamChild, beam.getAngleTimes()); - } else if (DURATIONS.equals(beamChild.name)) { - fillNode(beamChild, beam.getDurations()); - } else if (SUBBAND_LIST.equals(beamChild.name)) { - fillNode(beamChild, beam.getSubbands()); - } else if (BEAMLET_LIST.equals(beamChild.name)) { - fillNode(beamChild, beam.getBeamlets()); - } else if (BEAM_MOM_ID.equals(beamChild.name)) { - fillNode(beamChild, beam.getMom2Id().toString()); - } - - } - log.info("Store measurement with mom2Id " + beam.getMom2Id()); - } - // store new number of instances in baseSetting - aDefaultNode.instances = (short) (lofarObservation.getBeams().size()); // - - // default - // at - // -1 - saveNode(aDefaultNode); - } - - } - short statusId = converter.getTreeState(lofarObservation.getStatus()); - tm.setTreeState(treeId, statusId); - tm.setMomInfo(treeId, lofarObservation.getMom2Id(), "no campaign"); - tm.setDescription(treeId, DESCRIPTION); - if (Mom2OtdbConverter.OTDB_APPROVED_STATUS.equals(lofarObservation.getStatus())) { - jOTDBtree treeInfo = remoteOTDB.getTreeInfo(treeId, false); - if (treeInfo.type == converter.getTreeType(TEMPLATE_TYPE)) { - int vicTreeId = tm.instanciateTree(treeId); - log.info("VIC tree build " + vicTreeId + " from template " + treeId + " for observation (mom2Id " - + lofarObservation.getMom2Id() + ")"); - tm.setDescription(vicTreeId, DESCRIPTION); - tm.deleteTree(treeId); - log.info("Template " + treeId + " for observation (mom2Id " + lofarObservation.getMom2Id() - + ") deleted"); - } - } - } catch (RemoteException re) { - connected = false; - throw new RepositoryException(re); - } catch (NotBoundException e) { - connected = false; - throw new RepositoryException(e); - } - } - - @SuppressWarnings("unchecked") - private jOTDBnode getClockModeNode(int treeId, String clockMode) throws RemoteException { - jOTDBnode node = null; - Vector<jOTDBnode> childs = tm.getItemList(treeId, "%" + clockMode.substring(2)); - if (childs.size() > 0) { - node = childs.get(0); - } - return node; - } - - @SuppressWarnings("unchecked") - private Vector<jOTDBnode> getChilds(jOTDBnode node) throws RemoteException { - return tm.getItemList(node.treeID(), node.nodeID(), 1); - - } - - @SuppressWarnings("unchecked") - private jOTDBnode getObservationNode(int treeId) throws RemoteException { - jOTDBnode node = null; - Vector<jOTDBnode> childs = tm.getItemList(treeId, "%Observation"); - if (childs.size() > 0) { - node = childs.get(0); - } - - return node; - } - - private void saveNode(jOTDBnode aNode) throws RemoteException { - if (aNode == null) { - return; - } - tm.saveNode(aNode); - - } - - private void fillNode(jOTDBnode node, String value) throws RemoteException { - if (value != null && node != null) { - node.limits = value; - saveNode(node); - } - } - - private void fillNode(jOTDBnode node, List<?> values) throws RemoteException { - - if (values != null && node != null) { - String value = "["; - for (int i = 0; i < values.size(); i++) { - if (i > 0) { - value += ","; - } - value += values.get(i); - } - value += "]"; - node.limits = value; - saveNode(node); - } - } - - private void fillDoubleList(jOTDBnode node, List<Double> values) throws RemoteException { - - if (values != null && node != null) { - String value = node.limits.replaceAll("[\\]\\[ ]", ""); - String[] array = value.split(","); - for (String arrayItem : array) { - Double doubleValue = AstronConverter.toDouble(arrayItem); - if (doubleValue != null) { - values.add(doubleValue); - } - } - } - } - - private void fillStringList(jOTDBnode node, List<String> values) throws RemoteException { - - if (values != null && node != null) { - String value = node.limits.replaceAll("[\\]\\[ ]", ""); - String[] array = value.split(","); - for (String arrayItem : array) { - values.add(arrayItem); - } - } - } - - private void fillIntegerList(jOTDBnode node, List<Integer> values) throws RemoteException { - - if (values != null && node != null) { - String value = node.limits.replaceAll("[\\]\\[ ]", ""); - String[] array = value.split(","); - for (String arrayItem : array) { - Integer intValue = AstronConverter.toInteger(arrayItem); - if (intValue != null) { - values.add(intValue); - } - } - } - } - - /** - * Stores parameter in the tree by given parent node - * - * @param parentNode - * parent node - * @param paramName - * parameter name - * @param paramValue - * parameter value - * @throws RemoteException - */ - protected void storeParam(jOTDBnode parentNode, String paramName, String paramValue) throws RemoteException { - jOTDBnode node = getNode(parentNode, paramName); - if (node != null) { - if (paramValue != null) { - node.limits = paramValue; - } else { - node.limits = ""; - } - tm.saveNode(node); - } - - } - - /** - * Retrieves node by parent node and parameter name - * - * @param parentNode - * parent node - * @param paramName - * name of the parameter - * @return node - * @throws RemoteException - */ - @SuppressWarnings("unchecked") - private jOTDBnode getNode(jOTDBnode parentNode, String paramName) throws RemoteException { - jOTDBnode node = null; - /* - * if no parent node, do not retrieve something - */ - if (parentNode != null) { - Vector<jOTDBnode> vector = tm.getItemList(parentNode.treeID(), "%" + paramName); - for (int i = 0; i < vector.size(); i++) { - node = (jOTDBnode) vector.get(i); - /* - * - */ - if (node.parentID() == parentNode.nodeID()) { - return node; - } - - } - } - - return node; - } - - private String getValue(jOTDBnode parentNode, String paramName) throws RemoteException { - jOTDBnode node = getNode(parentNode, paramName); - if (node != null) { - return node.limits; - } else { - return null; - } - } - - private String getValue(jOTDBnode node) throws RemoteException { - if (node != null) { - return node.limits; - } else { - return null; - } - } - - /** - * Retrieve lates changes between start- en endtime - * - * @param startDate - * start time - * @param endDate - * end time - * @return List of lofarObservation objects - * @throws RemoteException - */ - @SuppressWarnings("unchecked") - public List<LofarObservation> getLatestChanges(Date startDate, Date endDate) throws RepositoryException { - try { - init(); - String startTime = AstronConverter.toDateString(startDate, DATE_TIME_FORMAT); - String endTime = AstronConverter.toDateString(endDate, DATE_TIME_FORMAT); - // log.info("Retrieve latest changes between:" + startTime + " and " - // + endTime); - remoteOTDB.connect(); - List<LofarObservation> result = new ArrayList<LofarObservation>(); - Vector<jTreeState> stateList = remoteOTDB.getStateList(0, false, startTime, endTime); - // for (jTreeState state : stateList) { - // log.info("date: " + state.timestamp); - // } - Collections.sort(stateList, new TreeStateComparator()); - short vicTree = converter.getTreeType(VIC_TYPE); - short templateTree = converter.getTreeType(TEMPLATE_TYPE); - for (jTreeState state : stateList) { - jOTDBtree treeInfo = remoteOTDB.getTreeInfo(state.treeID, false); - String status = converter.getTreeState(state.newState); - // log.info("treeId: " + state.treeID + " momId: " + state.momID - // + " status:" + status + " date: " - // + state.timestamp); - if (state.momID > 0 && isStatusThatMustBeExported(status) - && (treeInfo.type == vicTree || treeInfo.type == templateTree)) { - log.info("Found changes in treeId: " + state.treeID + " momId: " + state.momID + " status:" - + status + " date: " + state.timestamp); - LofarObservation lofarObservation = new LofarObservation(); - lofarObservation.setMom2Id(state.momID); - lofarObservation.setObservationId(state.treeID); - lofarObservation.setStatus(status); - lofarObservation.setTimeStamp(AstronConverter.toDate(state.timestamp, OTDB_DATE_TIME_FORMAT)); - // it must be a template - if (treeInfo.type == templateTree) { - - jOTDBnode observationNode = getObservationNode(state.treeID); - fillLofarObservation(observationNode, lofarObservation, true); - - } else if (treeInfo.type == vicTree) { - - jOTDBnode observationNode = getObservationNode(state.treeID); - fillLofarObservation(observationNode, lofarObservation, false); - lofarObservation - .setStartTime(AstronConverter.toDate(treeInfo.starttime, OTDB_DATE_TIME_FORMAT)); - lofarObservation.setEndTime(AstronConverter.toDate(treeInfo.stoptime, OTDB_DATE_TIME_FORMAT)); - } - result.add(lofarObservation); - } - } - - return result; - } catch (RemoteException re) { - connected = false; - throw new RepositoryException(re); - } catch (NotBoundException e) { - connected = false; - throw new RepositoryException(e); - } - } - - private void fillLofarObservation(jOTDBnode observationNode, LofarObservation lofarObservation, boolean templateTree) - throws RemoteException { - List<jOTDBnode> beams = new ArrayList<jOTDBnode>(); - Vector<jOTDBnode> childs = getChilds(observationNode); - for (jOTDBnode node : childs) { - String nodeName = getNodeNameWithoutPrefix(node.name); - if (ANTENNA_ARRAY.equals(nodeName)) { - lofarObservation.setAntennaArray(getValue(node)); - } else if (ANTENNA_SET.equals(nodeName)) { - lofarObservation.setAntennaSet(getValue(node)); - } else if (BAND_FILTER.equals(nodeName)) { - lofarObservation.setBandFilter(getValue(node)); - } else if (CLOCK_MODE.equals(nodeName)) { - String clockMode = getValue(node); - jOTDBnode clockNode = getClockModeNode(lofarObservation.getObservationId(), clockMode); - Vector<jOTDBnode> clockNodeChilds = getChilds(clockNode); - for (jOTDBnode clockNodeChild : clockNodeChilds) { - String clockNodeName = getNodeNameWithoutPrefix(clockNodeChild.name); - if (CHANNEL_WIDTH.equals(clockNodeName)) { - lofarObservation.setChannelWidth(AstronConverter.toDouble(getValue(clockNodeChild))); - } else if (SAMPLES_PER_SECOND.equals(clockNodeName)) { - lofarObservation.setSamplesPerSecond(AstronConverter.toInteger(getValue(clockNodeChild))); - } else if (SUBBAND_WIDTH.equals(clockNodeName)) { - lofarObservation.setSubbandWidth(AstronConverter.toDouble(getValue(clockNodeChild)) * KILO); - } else if (SAMPLE_CLOCK.equals(clockNodeName)) { - lofarObservation.setClockFrequency(AstronConverter.toDouble(getValue(clockNodeChild)) * MEGA); - } - } - } else if (CHANNELS_PER_SUBBAND.equals(nodeName)) { - lofarObservation.setChannelsPerSubband(AstronConverter.toInteger(getValue(node))); - } else if (FILE_NAME_MASK.equals(nodeName)) { - lofarObservation.setFileNameMask((getValue(node))); - } else if (BEAM.equals(nodeName) || nodeName.startsWith(BEAM + "[")) { - beams.add(node); - } else if (VIRTUAL_INSTRUMENT.equals(nodeName)) { - jOTDBnode stationsNode = getNode(node, STATION_LIST); - fillStringList(stationsNode, lofarObservation.getStations()); - } else if (OBSERVATION_CONTROL.equals(nodeName)) { - jOTDBnode onlineControlNode = getNode(node, ONLINE_CONTROL); - if (onlineControlNode != null) { - jOTDBnode olapNode = getNode(onlineControlNode, OLAP); - if (olapNode != null) { - jOTDBnode ionProcNode = getNode(olapNode, IONPROC); - if (ionProcNode != null) { - lofarObservation.setIntegrationInterval(AstronConverter.toDouble(getValue(olapNode, - INTEGRATION_STEPS))); - } - } - } - - } - } - - if (beams.size() > 0) { - int index = 0; - if (templateTree) { - index = 1; - } - for (; index < beams.size(); index++) { - jOTDBnode beamNode = beams.get(index); - Beam beam = new Beam(lofarObservation); - Vector<jOTDBnode> beamChilds = getChilds(beamNode); - - // get all the params per child - for (jOTDBnode beamChild : beamChilds) { - String nodeName = getNodeNameWithoutPrefix(beamChild.name); - if (DIRECTION_TYPES.equals(nodeName)) { - beam.setEquinox(getValue(beamChild)); - } else if (ANGLE1.equals(nodeName)) { - fillDoubleList(beamChild, beam.getRaList()); - } else if (ANGLE2.equals(nodeName)) { - fillDoubleList(beamChild, beam.getDecList()); - } else if (ANGLE_TIMES.equals(nodeName)) { - fillIntegerList(beamChild, beam.getAngleTimes()); - } else if (DURATIONS.equals(nodeName)) { - fillIntegerList(beamChild, beam.getDurations()); - } else if (SUBBAND_LIST.equals(nodeName)) { - fillIntegerList(beamChild, beam.getSubbands()); - } else if (BEAMLET_LIST.equals(nodeName)) { - fillIntegerList(beamChild, beam.getBeamlets()); - } else if (BEAM_MOM_ID.equals(nodeName)) { - beam.setMom2Id(AstronConverter.toInteger(getValue(beamChild))); - } - - } - if (beam.getMom2Id() != null && beam.getMom2Id().intValue() >= 0) { - lofarObservation.getBeams().add(beam); - } - } - - } - } - - private String getNodeNameWithoutPrefix(String nodeName) { - return nodeName.substring(nodeName.lastIndexOf('.') + 1); - - } - - /** - * Checkes if observation with a status must be exported to MoM - * - * @param code - * @return true, if it must be exported - */ - protected boolean isStatusThatMustBeExported(String code) { - if (code.equals("specified")) { - return true; - } - if (code.equals("active")) { - return true; - } - if (code.equals("finished")) { - return true; - } - if (code.equals("aborted")) { - return true; - } - if (code.equals("failed")) { - return true; - } - return false; - } - - public static class TreeStateComparator implements Comparator<jTreeState> { - - @Override - public int compare(jTreeState treeStateOne, jTreeState treeStateTwo) { - Date dateOne = AstronConverter.toDate(treeStateOne.timestamp, OTDB_DATE_TIME_FORMAT); - Date dateTwo = AstronConverter.toDate(treeStateTwo.timestamp, OTDB_DATE_TIME_FORMAT); - return dateOne.compareTo(dateTwo); - } - - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Repository.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Repository.java deleted file mode 100644 index c9b2780e873c70397911ab32e17e3a48f62ba3bd..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/Repository.java +++ /dev/null @@ -1,11 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -import java.util.Date; -import java.util.List; - -public interface Repository { - - public void store(LofarObservation lofarObservation) throws RepositoryException; - - public List<LofarObservation> getLatestChanges(Date startDate, Date endDate) throws RepositoryException; -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/RepositoryException.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/RepositoryException.java deleted file mode 100644 index 1ccf96eccf00084818d35729e242c30df32349b4..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/RepositoryException.java +++ /dev/null @@ -1,26 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -public class RepositoryException extends Exception { - - /** - * - */ - private static final long serialVersionUID = -3822871541324865707L; - - public RepositoryException() { - super(); - } - - public RepositoryException(String message, Throwable cause) { - super(message, cause); - } - - public RepositoryException(String message) { - super(message); - } - - public RepositoryException(Throwable cause) { - super(cause); - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/StubRepository.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/StubRepository.java deleted file mode 100644 index deb3a522f4c21f22f38e9db763c5e13869a302a0..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/data/StubRepository.java +++ /dev/null @@ -1,100 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import nl.astron.lofar.odtb.mom2otdbadapter.util.Mom2OtdbConverter; - -public class StubRepository implements Repository { - private Log log = LogFactory.getLog(this.getClass()); - private Map<Integer, LofarObservation> observationsMap = new HashMap<Integer, LofarObservation>(); - private int lastObservationId = 1; - - public StubRepository(){ - log.info("StubRepository started"); - } - - @Override - public List<LofarObservation> getLatestChanges(Date startDate, Date endDate) throws RepositoryException { - List<Integer> observationToRemoved = new ArrayList<Integer>(); - List<LofarObservation> results = new ArrayList<LofarObservation>(); - for (Map.Entry<Integer, LofarObservation> entry : observationsMap.entrySet()) { - LofarObservation observation = entry.getValue(); - observation.setStatus(changeStatus(observation.getStatus())); - observation.setTimeStamp(new Date()); - if (observation.getStatus() != null) { - if (Mom2OtdbConverter.OTDB_ACTIVE_STATUS.equals(observation.getStatus())){ - observation.setStartTime(new Date()); - }else if (Mom2OtdbConverter.OTDB_FINISHED_STATUS.equals(observation.getStatus())){ - int duration = 0; - for (Beam beam : observation.getBeams()) { - duration += beam.getDurations().get(0); - } - Calendar cal = Calendar.getInstance(); - cal.setTime(observation.getStartTime()); - cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + duration); - observation.setEndTime(cal.getTime()); - } - - if (observation.getClockMode().equals("<<Clock200")) { - observation.setClockFrequency(200000000d); - observation.setSubbandWidth(195312.5d); - observation.setChannelWidth(762.939453125d); - observation.setSamplesPerSecond(196608); - } else if (observation.getClockMode().equals("<<Clock160")) { - observation.setClockFrequency(160000000d); - observation.setSubbandWidth(156250d); - observation.setChannelWidth(610.3515625d); - observation.setSamplesPerSecond(155648); - } - observation.setChannelsPerSubband(256); - observation.setFileNameMask("/data/L${YEAR}_${MSNUMBER}/L${OBSERVATION}_B${BEAM}_SB${SUBBAND}.MS"); - results.add(observation); - } - if (Mom2OtdbConverter.OTDB_FINISHED_STATUS.equals(observation.getStatus())){ - observationToRemoved.add(entry.getKey()); - } - - - } - for (Integer mom2Id: observationToRemoved){ - observationsMap.remove(mom2Id); - } - - return results; - } - - @Override - public synchronized void store(LofarObservation lofarObservation) throws RepositoryException { - if (observationsMap.containsKey(lofarObservation.getMom2Id())){ - LofarObservation obs = observationsMap.get(lofarObservation.getMom2Id()); - obs.setStatus(lofarObservation.getStatus()); - }else { - lofarObservation.setObservationId(lastObservationId); - lastObservationId++; - observationsMap.put(lofarObservation.getMom2Id(),lofarObservation); - } - - } - - public String changeStatus(String status) { - if (Mom2OtdbConverter.OTDB_BEING_SPECIFIED_STATUS.equals(status)) { - return Mom2OtdbConverter.OTDB_SPECIFIED_STATUS; - } - if (Mom2OtdbConverter.OTDB_APPROVED_STATUS.equals(status)) { - return Mom2OtdbConverter.OTDB_ACTIVE_STATUS; - } - if (Mom2OtdbConverter.OTDB_ACTIVE_STATUS.equals(status)) { - return Mom2OtdbConverter.OTDB_FINISHED_STATUS; - } - return null; - - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServer.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServer.java deleted file mode 100644 index 98cb699642d7099192353cf583548549142dbcf7..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServer.java +++ /dev/null @@ -1,137 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; - -import javax.net.ssl.KeyManager; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLSession; -import javax.net.ssl.TrustManagerFactory; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.data.Repository; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.impl.DefaultConnectionReuseStrategy; -import org.apache.http.impl.DefaultHttpResponseFactory; -import org.apache.http.impl.nio.SSLServerIOEventDispatch; -import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor; -import org.apache.http.impl.nio.reactor.SSLIOSessionHandler; -import org.apache.http.nio.protocol.BufferingHttpServiceHandler; -import org.apache.http.nio.reactor.IOEventDispatch; -import org.apache.http.nio.reactor.ListeningIOReactor; -import org.apache.http.params.BasicHttpParams; -import org.apache.http.params.CoreConnectionPNames; -import org.apache.http.params.CoreProtocolPNames; -import org.apache.http.params.HttpParams; -import org.apache.http.protocol.BasicHttpProcessor; -import org.apache.http.protocol.HttpRequestHandler; -import org.apache.http.protocol.HttpRequestHandlerRegistry; -import org.apache.http.protocol.ResponseConnControl; -import org.apache.http.protocol.ResponseContent; -import org.apache.http.protocol.ResponseDate; -import org.apache.http.protocol.ResponseServer; - -public class HttpServer { - private static Log log = LogFactory.getLog(HttpServer.class); - private static final String JKS = "jks"; - - private Configuration config; - - private HttpRequestHandler httpRequestHandler; - - private SSLIOSessionHandler sslSessionHandler; - - public HttpServer(Configuration config, HttpRequestHandler httpRequestHandler, SSLIOSessionHandler sslSessionHandler) { - this.config = config; - this.httpRequestHandler = httpRequestHandler; - this.sslSessionHandler = sslSessionHandler; - } - - public HttpServer(Configuration config, Repository repository) { - this(config, new Mom2HttpRequestHandler(repository), new ClientAuthSSLIOSessionHandler()); - } - - public HttpServer(Configuration config, HttpRequestHandler httpRequestHandler) { - this(config, httpRequestHandler, new ClientAuthSSLIOSessionHandler()); - } - - public void start() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableKeyException, KeyManagementException{ - log.info("Starting http server on port " + config.getAdapter().getHttpPort()); - FileInputStream keyStoreInputStream = new FileInputStream(new File(config.getAdapter().getKeystoreLocation())); - KeyStore keystore = KeyStore.getInstance(JKS); - keystore.load(keyStoreInputStream, config.getAdapter().getKeystorePassword().toCharArray()); - log.info("Keystore " + config.getAdapter().getKeystoreLocation() + " loaded"); - KeyManagerFactory kmfactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - kmfactory.init(keystore, config.getAdapter().getKeystorePassword().toCharArray()); - KeyManager[] keymanagers = kmfactory.getKeyManagers(); - FileInputStream trustedKeyStoreInputStream = new FileInputStream(new File(config.getAdapter().getTrustedKeystoreLocation())); - KeyStore trustedKeystore = KeyStore.getInstance(JKS); - trustedKeystore.load(trustedKeyStoreInputStream, config.getAdapter().getTrustedKeystorePassword().toCharArray()); - TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(trustedKeystore); - log.info("Trusted keystore " + config.getAdapter().getKeystoreLocation() + " loaded"); - SSLContext sslcontext = SSLContext.getInstance("TLS"); - sslcontext.init(keymanagers, tmf.getTrustManagers(), null); - - HttpParams params = new BasicHttpParams(); - params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000).setIntParameter( - CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024).setBooleanParameter( - CoreConnectionPNames.STALE_CONNECTION_CHECK, false).setBooleanParameter( - CoreConnectionPNames.TCP_NODELAY, true).setParameter(CoreProtocolPNames.ORIGIN_SERVER, - "Jakarta-HttpComponents-NIO/1.1"); - - BasicHttpProcessor httpproc = new BasicHttpProcessor(); - httpproc.addInterceptor(new ResponseDate()); - httpproc.addInterceptor(new ResponseServer()); - httpproc.addInterceptor(new ResponseContent()); - httpproc.addInterceptor(new ResponseConnControl()); - - BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(httpproc, - new DefaultHttpResponseFactory(), new DefaultConnectionReuseStrategy(), params); - - // Set up request handlers - HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry(); - reqistry.register("*", httpRequestHandler); - - handler.setHandlerResolver(reqistry); - - // Provide an event logger - // handler.setEventListener(new EventLogger()); - - IOEventDispatch ioEventDispatch = new SSLServerIOEventDispatch(handler, sslcontext, sslSessionHandler, params); - - ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params); - log.info("Http server started on port " + config.getAdapter().getHttpPort()); - ioReactor.listen(new InetSocketAddress(config.getAdapter().getHttpPort())); - ioReactor.execute(ioEventDispatch); - - } - - - - static class ClientAuthSSLIOSessionHandler implements SSLIOSessionHandler { - public void initalize(SSLEngine sslengine, HttpParams params) throws SSLException { - // // Ask clients to authenticate - sslengine.setWantClientAuth(true); - } - - public void verify(SocketAddress remoteAddress, SSLSession session) throws SSLException { - // no extra authentication - } - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2HttpRequestHandler.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2HttpRequestHandler.java deleted file mode 100644 index cf04f45d35d57b1c156705fa306fdf84c844515c..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2HttpRequestHandler.java +++ /dev/null @@ -1,103 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import nl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation; -import nl.astron.lofar.odtb.mom2otdbadapter.data.Repository; -import nl.astron.lofar.odtb.mom2otdbadapter.data.RepositoryException; -import nl.astron.util.XMLConverter; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpEntityEnclosingRequest; -import org.apache.http.HttpRequest; -import org.apache.http.HttpResponse; -import org.apache.http.HttpStatus; -import org.apache.http.ParseException; -import org.apache.http.protocol.HttpContext; -import org.apache.http.protocol.HttpRequestHandler; -import org.apache.http.util.EntityUtils; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; - -public class Mom2HttpRequestHandler implements HttpRequestHandler { - private static Log log = LogFactory.getLog(Mom2HttpRequestHandler.class); - private Repository repository; - - public Mom2HttpRequestHandler(Repository repository) { - this.repository = repository; - } - - @Override - public void handle(HttpRequest request, HttpResponse response, HttpContext context) { - boolean requestHandledSuccessfull = false; - log.info("handle Mom2 request..."); - if (log.isDebugEnabled()) { - for (Header header : request.getAllHeaders()) { - log.debug("Header: " + header.getName() + " value: " + header.getValue()); - } - } - if (request instanceof HttpEntityEnclosingRequest) { - HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity(); - String content = null; - try { - content = EntityUtils.toString(entity); - if (log.isDebugEnabled()){ - log.debug(content); - } - } catch (ParseException e) { - response.setStatusCode(HttpStatus.SC_BAD_REQUEST); - log.error("Problem with parsing http request: " + e.getMessage(), e); - } catch (IOException e) { - response.setStatusCode(HttpStatus.SC_BAD_REQUEST); - log.error("Problem with reading http request: " + e.getMessage(), e); - } - if (content != null){ - InputSource inputSource = new InputSource(new StringReader(content)); - Document document = null; - try { - List<URL> schemas = new ArrayList<URL>(); - schemas.add(this.getClass().getClassLoader().getResource("schemas/MoM2.xsd")); - schemas.add(this.getClass().getClassLoader().getResource("schemas/LofarMoM2.xsd")); - document = XMLConverter.convertXMLToDocument(inputSource,schemas); - LofarObservation lofarObservation = XMLParser.getLofarObservation(document); - try { - repository.store(lofarObservation); - response.setStatusCode(HttpStatus.SC_OK); - requestHandledSuccessfull = true; - } catch (RepositoryException e) { - response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); - log.fatal("Problem occurred with OTDB: " + e.getMessage(), e); - } catch (Exception e) { - response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); - log.fatal("Problem occurred : " + e.getMessage(), e); - } - response.setStatusCode(HttpStatus.SC_OK); - } catch (Exception e) { - response.setStatusCode(HttpStatus.SC_BAD_REQUEST); - log.error("Problem with parsing xml content: " + e.getMessage(), e); - } - - } - - } else { - response.setStatusCode(HttpStatus.SC_BAD_REQUEST); - log.error("Request with invalid content, Content-Type must be 'text/xml'"); - - } - if (requestHandledSuccessfull){ - log.info("handle Mom2 request...done"); - }else { - log.info("handle Mom2 request...failed"); - } - - - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParser.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParser.java deleted file mode 100644 index 9068035e0a574b0976a362b1ba6ca2d8437c3e17..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParser.java +++ /dev/null @@ -1,399 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - -import java.util.HashMap; -import java.util.Map; - -import nl.astron.lofar.odtb.mom2otdbadapter.data.Beam; -import nl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation; -import nl.astron.lofar.odtb.mom2otdbadapter.util.Mom2OtdbConverter; -import nl.astron.lofar.odtb.mom2otdbadapter.util.XMLConstants; -import nl.astron.util.AstronConverter; -import nl.astron.util.AstronValidator; -import nl.astron.util.Frequency; -import nl.astron.util.XMLBuilder; -import nl.astron.util.Frequency.Unit; -import nl.astron.util.converters.TimeConverter; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * parse the XML input from MoM and returns a LofarObservations. If needed it - * used the Mom2OtdbConverter to convert values to otdb values - * - * @author Bastiaan Verhoef - * - */ -public class XMLParser { - - private static Log log = LogFactory.getLog(XMLParser.class); - - /** - * Parse a xml document and returns a lofar obseravation - * - * @param document - * xml document - * @return LofarObservation - */ - public static LofarObservation getLofarObservation(Document document) { - - LofarObservation lofarObservation = new LofarObservation(); - - /* - * search for project - */ - Node element = document.getDocumentElement(); - if (equalIgnorePrefix(element, XMLConstants.OBSERVATION)) { - String mom2Id = getAttribute(element.getAttributes(), XMLConstants.MOM2_ID); - lofarObservation.setMom2Id(AstronConverter.toInt(AstronConverter.toInteger(mom2Id))); - Map<String, Element> elementsMap = getElementMap(element.getChildNodes()); - - if (elementsMap.containsKey(XMLConstants.CURRENT_STATUS)) { - parseCurrentStatus(elementsMap.get(XMLConstants.CURRENT_STATUS), lofarObservation); - } - - if (elementsMap.containsKey(XMLConstants.OBSERVATION_ATTRIBUTES)) { - parseObservationAttributes(elementsMap.get(XMLConstants.OBSERVATION_ATTRIBUTES), lofarObservation); - } - if (elementsMap.containsKey(XMLConstants.CHILDREN)) { - parseChildren(elementsMap.get(XMLConstants.CHILDREN), lofarObservation); - } - } - - int offSet = 0; - for (Beam beam : lofarObservation.getBeams()) { - beam.getAngleTimes().add(offSet); - offSet += beam.getDurations().get(0); - } - log.info("Parsed xml of observation with mom2id: " + lofarObservation.getMom2Id()); - return lofarObservation; - } - - /** - * Parse the observationAttributes xml element. - * - * @param node - * xml node that must be parsed - * @param lofarObservation - * LofarObservation that must be filled - */ - private static void parseObservationAttributes(Element element, LofarObservation lofarObservation) { - Map<String, Element> elementsMap = getElementMap(element.getChildNodes()); - if (elementsMap.containsKey(XMLConstants.OBSERVATION_ID)) { - lofarObservation.setObservationId(AstronConverter.toInteger(getValue(elementsMap - .get(XMLConstants.OBSERVATION_ID)))); - } - if (lofarObservation.getStatus().equals(Mom2OtdbConverter.OTDB_BEING_SPECIFIED_STATUS)) { - NodeList specificationList = element.getElementsByTagName(XMLConstants.SPECIFICATION); - if (specificationList.getLength() > 0) { - Element specification = (Element) specificationList.item(0); - Map<String, Element> elements = getElementMap(specification.getChildNodes()); - - if (elements.containsKey(XMLConstants.ANTENNA)) { - String antenna = getValue(elements.get(XMLConstants.ANTENNA)); - lofarObservation.setAntennaArray(Mom2OtdbConverter.getOTDBAntennaArray(antenna)); - lofarObservation.setAntennaSet(Mom2OtdbConverter.getOTDBAntennaSet(antenna)); - } - if (elements.containsKey(XMLConstants.CLOCK)) { - lofarObservation.setClockMode(Mom2OtdbConverter.getOTDBClockMode(getMHzFrequency(elements - .get(XMLConstants.CLOCK)))); - } - if (elements.containsKey(XMLConstants.INTEGRATION_INTERVAL)) { - lofarObservation.setIntegrationInterval(AstronConverter.toDouble(getValue(elements - .get(XMLConstants.INTEGRATION_INTERVAL)))); - } - if (elements.containsKey(XMLConstants.INSTRUMENT_FILTER)) { - lofarObservation.setBandFilter(Mom2OtdbConverter.getOTDBBandFilter(getValue(elements - .get(XMLConstants.INSTRUMENT_FILTER)), lofarObservation.getAntennaArray())); - } - if (elements.containsKey(XMLConstants.STATION_SET)) { - lofarObservation.setStationSet(getValue(elements.get(XMLConstants.STATION_SET))); - } - if (elements.containsKey(XMLConstants.STATIONS)) { - String[] stations = getValue(elements.get(XMLConstants.STATIONS)).split(","); - for (String station : stations) { - lofarObservation.getStations().add(station); - } - } - - } - } - - } - - private static Double getMHzFrequency(Element frequencyElement) { - Frequency frequency = new Frequency(); - Double result = null; - if (frequencyElement != null) { - frequency.setFrequency(AstronConverter.toDouble(getValue(frequencyElement))); - frequency.setUnit(getAttribute(frequencyElement.getAttributes(), XMLBuilder.UNIT)); - if (!frequency.getUnit().equals(Unit.MHZ)) { - result = AstronConverter.getFrequencyFromFrequencyWithUnit(frequency); - } else { - result = frequency.getFrequency(); - } - } - return result; - } - - /** - * Parse the currentStatus xml element. - * - * @param node - * xml node that must be parsed - * @param lofarObservation - * LofarObservation that must be filled - */ - private static void parseCurrentStatus(Node node, LofarObservation lofarObservation) { - for (int i = 0; i < node.getChildNodes().getLength(); i++) { - Node nodeChild = node.getChildNodes().item(i); - /* - * if child is an element - */ - if (isElement(nodeChild)) { - String nodeName = removePrefix(nodeChild); - if (nodeName.endsWith(XMLConstants.STATUS_SUFFIX)) { - lofarObservation.setStatus(Mom2OtdbConverter.getOTDBStatus(formatStatus(nodeName))); - } - } - } - } - - /** - * Parse the children xml element. - * - * @param node - * xml node that must be parsed - * @param lofarObservation - * LofarObservation that must be filled - */ - private static void parseChildren(Node node, LofarObservation lofarObservation) { - if (lofarObservation.getStatus().equals(Mom2OtdbConverter.OTDB_BEING_SPECIFIED_STATUS)) { - for (int i = 0; i < node.getChildNodes().getLength(); i++) { - Node nodeChild = node.getChildNodes().item(i); - /* - * if child is an element - */ - if (isElement(nodeChild)) { - - if (equalIgnorePrefix(nodeChild, XMLConstants.ITEM)) { - parseItem(nodeChild, lofarObservation); - } - } - } - } - } - - /** - * Parse the item xml element. - * - * @param node - * xml node that must be parsed - * @param lofarObservation - * LofarObservation that must be filled - */ - private static void parseItem(Node node, LofarObservation lofarObservation) { - - for (int i = 0; i < node.getChildNodes().getLength(); i++) { - Node nodeChild = node.getChildNodes().item(i); - /* - * if child is an element - */ - if (isElement(nodeChild)) { - if (equalIgnorePrefix(nodeChild, XMLConstants.MEASUREMENT)) { - String measurementType = getAttribute(nodeChild.getAttributes(), XMLConstants.SCHEMA_NAMESPACE, - XMLConstants.XSI_TYPE); - if (XMLConstants.UVMEASUREMENT_TYPE.equals(removePrefix(measurementType))) { - lofarObservation.getBeams().add(parseUVMeasurement(nodeChild, lofarObservation)); - } - } - } - } - } - - /** - * Parse the measurement xml element. - * - * @param node - * xml node that must be parsed - * @param lofarObservation - * LofarObservation that must be filled - */ - private static Beam parseUVMeasurement(Node node, LofarObservation observation) { - Beam beam = new Beam(observation); - String mom2Id = getAttribute(node.getAttributes(), XMLConstants.MOM2_ID); - beam.setMom2Id(AstronConverter.toInteger(mom2Id)); - for (int i = 0; i < node.getChildNodes().getLength(); i++) { - Node nodeChild = node.getChildNodes().item(i); - /* - * if child is an element - */ - if (isElement(nodeChild)) { - - if (equalIgnorePrefix(nodeChild, XMLConstants.UV_MEASUREMENT_ATTRIBUTES)) { - parseMeasurementAttributes((Element) nodeChild, beam); - } - } - } - return beam; - - } - - /** - * Parse the measurementAttributes xml element. - * - * @param node - * xml node that must be parsed - * @param lofarObservation - * LofarObservation that must be filled - */ - private static void parseMeasurementAttributes(Element element, Beam beam) { - NodeList specificationList = element.getElementsByTagName(XMLConstants.SPECIFICATION); - if (specificationList.getLength() > 0) { - Element specification = (Element) specificationList.item(0); - Map<String, Element> elements = getElementMap(specification.getChildNodes()); - if (elements.containsKey(XMLConstants.RA)) { - beam.getRaList().add(AstronConverter.toDouble(getValue(elements.get(XMLConstants.RA)))); - } - if (elements.containsKey(XMLConstants.DEC)) { - beam.getDecList().add(AstronConverter.toDouble(getValue(elements.get(XMLConstants.DEC)))); - } - if (elements.containsKey(XMLConstants.EQUINOX)) { - beam.setEquinox(getValue(elements.get(XMLConstants.EQUINOX))); - } - if (elements.containsKey(XMLConstants.DURATION)) { - beam.getDurations().add( - TimeConverter.convertXMLDurationToSeconds(getValue(elements.get(XMLConstants.DURATION)))); - } - if (elements.containsKey(XMLConstants.SUBBANDS_SPECIFICATION)) { - Element subbandsSpecificationsElement = elements.get(XMLConstants.SUBBANDS_SPECIFICATION); - Map<String, Element> subbandsSpecificationsElements = getElementMap(subbandsSpecificationsElement - .getChildNodes()); - if (subbandsSpecificationsElements.containsKey(XMLConstants.SUBBANDS)) { - String subbands = getValue(subbandsSpecificationsElements.get(XMLConstants.SUBBANDS)); - String[] subbandsArray = null; - if (subbands.contains("..")){ - String[] tempArray = subbands.split("\\.\\."); - int startSubband = AstronConverter.toInteger(tempArray[0]); - int endSubband = AstronConverter.toInteger(tempArray[1]); - int length = endSubband - startSubband + 1; - subbandsArray = new String[length]; - for (int subbandNumber = startSubband, i = 0; subbandNumber <= endSubband; subbandNumber++, i++){ - subbandsArray[i] = subbandNumber + ""; - } - }else { - subbandsArray = subbands.split(","); - } - for (String subband : subbandsArray) { - beam.getSubbands().add(AstronConverter.toInteger(subband)); - beam.getBeamlets().add(beam.getParentObservation().getBeamletNumber()); - beam.getParentObservation() - .setBeamletNumber(beam.getParentObservation().getBeamletNumber() + 1); - } - - } - } - - } - - } - - /** - * Retrieve an attribute value from a attribute map - * - * @param map - * attribute map - * @param name - * name of the attribute - * @return attribute value - */ - private static String getAttribute(NamedNodeMap map, String name) { - Node node = map.getNamedItem(name); - return node.getNodeValue(); - } - - private static String getAttribute(NamedNodeMap map, String namespace, String name) { - Node node = map.getNamedItemNS(namespace, name); - return node.getNodeValue(); - } - - /** - * The getValue method returns the value of an node - * - * @param node - * @return value of the node - */ - private static String getValue(Node node) { - String value = null; - if (node.getFirstChild() != null) { - value = node.getFirstChild().getNodeValue(); - } - return value; - } - - /** - * Compares if a node has the given name, ignoring the prefix of the node - * - * @param node - * @param nodeName - * @return true, if equals - */ - private static boolean equalIgnorePrefix(Node node, String nodeName) { - String withoutPrefix = removePrefix(node); - return withoutPrefix.equals(nodeName); - } - - /** - * Returns the node name without prefix - * - * @param node - * @return node name withoud prefix - */ - private static String removePrefix(Node node) { - return removePrefix(node.getNodeName()); - } - - private static String removePrefix(String nodeName) { - String[] nodeSplit = nodeName.split(":"); - String withoutPrefix = nodeSplit[nodeSplit.length - 1]; - return withoutPrefix; - } - - /** - * Retrieve status from status element - * - * @param status - * status element string - * @return status - */ - private static String formatStatus(String status) { - return status.replaceAll(XMLConstants.STATUS_SUFFIX, ""); - } - - private static Map<String, Element> getElementMap(NodeList nodeList) { - Map<String, Element> elementMap = new HashMap<String, Element>(); - for (int i = 0; i < nodeList.getLength(); i++) { - Node childNode = nodeList.item(i); - if (isElement(childNode)) { - String key = removePrefix(childNode); - elementMap.put(key, (Element) childNode); - } - } - return elementMap; - - } - - private static boolean isElement(Node node) { - if (AstronValidator.implementsInterface(Element.class, node.getClass())) { - return true; - } else { - return false; - } - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/OTDBListener.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/OTDBListener.java deleted file mode 100644 index 4c56443f9433dcedd7356ddeefe4d65c11e5012f..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/OTDBListener.java +++ /dev/null @@ -1,107 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.io.IOException; -import java.util.List; - -import javax.xml.parsers.ParserConfigurationException; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation; -import nl.astron.lofar.odtb.mom2otdbadapter.data.Repository; -import nl.astron.lofar.odtb.mom2otdbadapter.data.RepositoryException; -import nl.astron.lofar.odtb.mom2otdbadapter.util.AbstractThread; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Polls if there are changes in the OTDB database. - * - * @author Bastiaan Verhoef - * - */ -public class OTDBListener extends AbstractThread { - - private Log log = LogFactory.getLog(this.getClass()); - - private Configuration configuration; - - private Queue queue = null; - - private Repository repository = null; - - /** - * Constructor - * - * @param queue - * Queue where this listener add the tasks - * @param milliseconds - * interval (in milliseconds) between the retrieval of the - * changes - * @param repository - * OTDBRepository where this listener retrieves the changes - */ - public OTDBListener(Queue queue, Configuration configuration, Repository repository) { - super(configuration.getRepository().getInterval()); - this.configuration = configuration; - this.queue = queue; - this.repository = repository; - log.info("OTDBListener started with interval of " + configuration.getRepository().getInterval() + " s."); - } - - /** - * Starts the OTDBListener and retrieves changes with an interval - * @throws RepositoryException - * @throws IOException - * @throws ParserConfigurationException - */ - public void doRun() throws RepositoryException, IOException, ParserConfigurationException { - if (log.isDebugEnabled()) { - log.debug("Looking for new tasks"); - } - /* - * get time period of this retrieval - */ - TimePeriod timePeriod = queue.getTimePeriod(); - /* - * look for new changes in this time period - */ - List<LofarObservation> lofarObservations = repository.getLatestChanges(timePeriod.getStartTime(), timePeriod - .getEndTime()); - /* - * convert retrieved observations to tasks and add the tasks to the - * queue - */ - for (LofarObservation observation : lofarObservations) { - Task task = convertToTask(observation); - if (task != null) { - queue.add(task); - } - } - if (lofarObservations.size() > 0) { - /* - * save the time period of this retrieval - */ - queue.saveTimePeriod(lofarObservations.get(lofarObservations.size() - 1).getTimeStamp()); - } - - } - - /** - * Converts a observation to a task using the xml generation - * - * @param lofarObservation - * @return Task - * @throws ParserConfigurationException - * @throws IOException - */ - protected Task convertToTask(LofarObservation lofarObservation) throws IOException, ParserConfigurationException { - Task task = new Task(); - String xml = XMLGenerator.getObservationXml(lofarObservation, configuration.getMom2()); - task.setXml(xml); - task.setMom2Id(lofarObservation.getMom2Id() + ""); - task.setTime(lofarObservation.getTimeStamp()); - return task; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/Queue.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/Queue.java deleted file mode 100644 index 677b03cac34649a2c0b657b8ef7ae4cffe61165d..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/Queue.java +++ /dev/null @@ -1,263 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import nl.astron.util.AstronConverter; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Queue of tasks - * - * @author Bastiaan Verhoef - * - */ -public class Queue { - private Log log = LogFactory.getLog(this.getClass()); - - private List<Task> tasks = new ArrayList<Task>(); - - private String taskDir = "./tasks"; - - private static final String FILE_DATE_TIME_FORMAT = "yyyy_MM_dd'T'HH_mm_ss"; - - private static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - // private static final String OTDB_TIME_FORMAT = "yyyy-MMM-dd HH:mm:ss"; - - private Date startTime = null; - - // private Date endTime = null; - - // private boolean isTaskLocked = false; - - /** - * Constructor that looks for tasks (*.xml) in the ./tasks directory and - * load them. - * - * @throws IOException - */ - public Queue() throws IOException { - File dir = new File(taskDir); - /* - * it the tasks dir not exists, create it - */ - if (!dir.exists()) { - dir.mkdir(); - } - /* - * if it exists, look for tasks - */ - else { - String[] files = dir.list(new TasksFilter()); - for (int i = 0; i < files.length; i++) { - Task task = new Task(); - String fileName = taskDir + File.separator + files[i]; - String xml = getFile(fileName); - task.setXml(xml); - task.setFileName(fileName); - tasks.add(task); - } - } - } - - /** - * Retrieve a task, if there are tasks, if there are no tasks, wait until a - * task is in the queue - * - * @return Task - */ - public synchronized Task get() { - while (tasks.size() == 0) { - log.info("No task available..."); - try { - wait(); - } catch (InterruptedException e) { - } - } - Task task = null; - synchronized (tasks) { - task = tasks.get(0); - } - if (log.isDebugEnabled()) { - log.debug("Get task (mom2Id: " + task.getMom2Id() + ") ....Number of tasks:" + tasks.size()); - } - return task; - } - - /** - * Remove a task - * - * @param task - * task to be removed - */ - public synchronized void remove(Task task) { - synchronized (tasks) { - File file = new File(task.getFileName()); - if (!file.delete()) { - log.error("Can not delete file:" + task.getFileName()); - } - log.info("Remove task( mom2Id: " + task.getMom2Id() + ") Number of tasks:" + tasks.size()); - tasks.remove(0); - } - } - - /** - * If a task can not be executed, move it to the end of the tasks list, so - * other tasks can be executed. - * - * @param task - * task to be moved to the end of the tasks list. - */ - public synchronized void moveToEndOfTaskList(Task task) { - log.info("Can not execute task(" + task.getMom2Id() + ") Number of tasks:" + tasks.size()); - synchronized (tasks) { - tasks.remove(0); - tasks.add(task); - } - } - - /** - * Retrieves the new time period, from the last time period to now - * - * @return Time period - * @throws IOException - */ - public synchronized TimePeriod getTimePeriod() throws IOException { - - String fileName = taskDir + File.separator + "last_time_period.txt"; - String content = getFile(fileName); - if (content != null) { - String[] time = content.split(","); - // long newStartTime = new Long().longValue(); - startTime = AstronConverter.toDate(time[1], DATE_TIME_FORMAT); - startTime.setSeconds(startTime.getSeconds() + 1); - // startTime.setTime(newStartTime); - - } else { - startTime = new Date(); - startTime.setTime(0); - - } - Date endTime = new Date(); - // endTime.setHours(endTime.getHours()+1); - TimePeriod time = new TimePeriod(); - time.setStartTime(startTime); - time.setEndTime(endTime); - // notifyAll(); - return time; - } - - /** - * Save the time period - * - * @throws IOException - */ - public synchronized void saveTimePeriod(Date endDate) throws IOException { - String fileName = taskDir + File.separator + "last_time_period.txt"; - String content = AstronConverter.toDateString(startTime, DATE_TIME_FORMAT) + "," - + AstronConverter.toDateString(endDate, DATE_TIME_FORMAT); - File file = new File(fileName); - if (!file.exists()) { - file.createNewFile(); - } - FileOutputStream fileOutputStream = new FileOutputStream(file); - PrintWriter out = new PrintWriter(fileOutputStream, true); - out.write(content); - out.close(); - fileOutputStream.close(); - } - - /** - * Add the task to the task list and store it as a xml file - * - * @param task - * Task to be stored - * @throws IOException - */ - public synchronized void add(Task task) throws IOException { - synchronized (tasks) { - tasks.add(task); - log.info("Add task (mom2Id: " + task.getMom2Id() + ") Number of tasks:" + tasks.size()); - storeTask(task); - } - notifyAll(); - } - - /** - * Retrieve file by file name - * - * @param fileName - * name of the file to be read - * @return file as string - * @throws IOException - */ - protected String getFile(String fileName) throws IOException { - File file = new File(fileName); - if (file.exists()) { - FileInputStream fileInputStream = new FileInputStream(file); - BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream)); - String line = null; - StringBuffer stringBuffer = new StringBuffer(); - while ((line = reader.readLine()) != null) { - stringBuffer.append(line); - } - fileInputStream.close(); - return stringBuffer.toString(); - } else { - return null; - } - - } - - /** - * Store a task - * - * @param task - * task to be stored - * @throws FileNotFoundException - * @throws IOException - */ - protected void storeTask(Task task) throws FileNotFoundException, IOException { - String fileName = taskDir + File.separator - + AstronConverter.toDateString(task.getTime(), FILE_DATE_TIME_FORMAT) + "mom2id_" + task.getMom2Id() - + ".xml"; - task.setFileName(fileName); - File file = new File(fileName); - if (!file.exists()) { - file.createNewFile(); - } - FileOutputStream fileOutputStream = new FileOutputStream(file); - PrintWriter out = new PrintWriter(fileOutputStream, true); - out.write(task.getXml()); - out.close(); - fileOutputStream.close(); - } - - /** - * Filters task files - * - * @author Bastiaan Verhoef - * - */ - class TasksFilter implements FilenameFilter { - /** - * filters task files, tasks files ends on .xml - */ - public boolean accept(File dir, String name) { - return (name.endsWith(".xml")); - } - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/Task.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/Task.java deleted file mode 100644 index 79a23a2e870f2005ecf7f45a30eb2eba96ee4b16..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/Task.java +++ /dev/null @@ -1,60 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.util.Date; - -/** - * Task - * @author Bastiaan Verhoef - * - */ -public class Task { - /** - * MoM2 xml representation of a lofarobservation - */ - protected String xml = null; - - /** - * Mom2 id - */ - protected String mom2Id = null; - /** - * Timestamp of the status change of the lofarobservation - */ - protected Date time = null; - - /** - * Name of the file that belongs to this task - */ - protected String fileName = null; - public String getXml() { - return xml; - } - - public void setXml(String xml) { - this.xml = xml; - } - - public String getMom2Id() { - return mom2Id; - } - - public void setMom2Id(String mom2Id) { - this.mom2Id = mom2Id; - } - - public Date getTime() { - return time; - } - - public void setTime(Date time) { - this.time = time; - } - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/TaskExecutor.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/TaskExecutor.java deleted file mode 100644 index dedd29f422f70feacc3745577d2a5118eb9d993e..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/TaskExecutor.java +++ /dev/null @@ -1,159 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.io.StringReader; -import java.util.ArrayList; -import java.util.List; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.Mom2Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.util.AbstractThread; -import nl.astron.util.XMLConverter; -import nl.astron.util.http.client.AstronHttpClient; -import nl.astron.util.http.client.HttpClientConfig; -import nl.astron.util.http.client.handler.StringResponseHandler; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.message.BasicNameValuePair; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; - -/** - * Execute the tasks that are in the queue - * - * @author Bastiaan Verhoef - * - */ -public class TaskExecutor extends AbstractThread { - private static final int INTERVAL = 30; - - private Log log = LogFactory.getLog(this.getClass()); - - private AstronHttpClient httpClient = null; - - private Queue queue = null; - - private Mom2Configuration config; - - /** - * Constructor - * - * @param queue - * Queue to retrieve tasks - * @param username - * username of mom2 - * @param password - * password of mom2 - * @param authUrl - * authorization module url - * @param momUrl - * mom2 module url - */ - public TaskExecutor(Queue queue, Mom2Configuration config) { - super(INTERVAL); - this.config = config; - this.queue = queue; - HttpClientConfig httpClientConfig = new HttpClientConfig(config.getAuthUrl()); - httpClient = new AstronHttpClient(httpClientConfig); - } - - /** - * start the taskExecutor thread - * @throws Exception - */ - public void doRun() throws Exception { - /* - * get new task, if no tasks available, wait until new tasks added - */ - Task task = queue.get(); - /* - * process task if task process successfull, remove tasks else move task - * to the end of the task list - */ - if (processTask(task)) { - queue.remove(task); - } else { - queue.moveToEndOfTaskList(task); - } - - } - - /** - * Process task. It logs in to MoM2, it post the task xml to MoM2 and - * logouts. - * - * @param task - * tass to process - * @return If MoM2 result is ok, it returns true - */ - protected boolean processTask(Task task) throws Exception { - httpClient.login(config.getUsername(), config.getPassword()); - log.info("Login " + config.getAuthUrl()); - List<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>(); - parameters.add(new BasicNameValuePair("command", "IMPORTXML2")); - parameters.add(new BasicNameValuePair("xmlcontent", task.getXml())); - log.info("Post xml (mom2Id: " + task.getMom2Id() + ") to mom2 " + config.getMom2ImportUrl()); - String result = httpClient.doPost(config.getMom2ImportUrl(), parameters, new StringResponseHandler()); - if (log.isDebugEnabled()) { - log.debug(result); - } - httpClient.logout(); - log.info("Logout " + config.getAuthUrl()); - return isSucceed(result); - } - - /** - * Analyzed the mom2 output and return if the task is done - * - * @param string - * @return true, if task is successfull executed - * @throws Exception - */ - protected boolean isSucceed(String string) throws Exception { - boolean result = false; - StringReader reader = new StringReader(string); - Document document = XMLConverter.convertXMLToDocument(new InputSource(reader)); - NodeList errors = document.getElementsByTagName("error"); - if (errors.getLength() > 0) { - String errorString = "Mom2 returns errors: "; - for (int i = 0; i < errors.getLength(); i++) { - if (i >= 1) { - errorString += "\n"; - } - NodeList description = ((Element) errors.item(i)).getElementsByTagName("description"); - errorString += getValue(description.item(0)); - } - log.fatal(errorString); - } else { - result = true; - } - return result; - } - - /** - * The equal method compares if an node has the given name - * - * @param node - * @param nodeName - * @return true, if equal - */ - protected boolean equal(Node node, String nodeName) { - return node.getNodeName().equals(nodeName); - } - - /** - * The getValue method returns the value of an node - * - * @param node - * @return value of the node - */ - protected String getValue(Node node) { - String value = null; - if (node.getFirstChild() != null) { - value = node.getFirstChild().getNodeValue(); - } - return value; - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/TimePeriod.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/TimePeriod.java deleted file mode 100644 index 368abb05bc6db2bb6503fe08f32b819aafabeaf4..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/TimePeriod.java +++ /dev/null @@ -1,30 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.io.Serializable; -import java.util.Date; - -/** - * Time period - * @author Bastiaan Verhoef - * - */ -public class TimePeriod implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8282521565309700261L; - protected Date startTime = null; - protected Date endTime = null; - public Date getEndTime() { - return endTime; - } - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - public Date getStartTime() { - return startTime; - } - public void setStartTime(Date startTime) { - this.startTime = startTime; - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGenerator.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGenerator.java deleted file mode 100644 index 0c45367af641d0ae022343364fc87bdd7474dab0..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGenerator.java +++ /dev/null @@ -1,204 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.io.IOException; -import java.io.StringWriter; -import java.util.Calendar; -import java.util.Date; - -import javax.xml.parsers.ParserConfigurationException; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.Mom2Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.data.Beam; -import nl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation; -import nl.astron.lofar.odtb.mom2otdbadapter.util.Mom2OtdbConverter; -import nl.astron.lofar.odtb.mom2otdbadapter.util.XMLConstants; -import nl.astron.util.XMLBuilder; -import nl.astron.util.XMLConverter; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * Generates MoM2-xml - * - * @author Bastiaan Verhoef - * - */ -public class XMLGenerator { - - private static final String STATION_NAME = "name"; - - private static final String MOM2_LOFAR_PREFIX = "lofar"; - - private static final String MOM2_PREFIX = "mom2"; - - // private static final String OTDB_DATETIME_FORMAT = - // "yyyy-MMM-dd HH:mm:ss"; - - // private static final String FAILED = "failed"; - // - // private static final String FINISHED = "finished"; - - /** - * Generates XML Document from lofarObservation - * - * @param observation - * LofarObservation - * @return MoM2 XML Document - * @throws ParserConfigurationException - */ - private static Document getObservationDocument(LofarObservation observation, Mom2Configuration config) - throws ParserConfigurationException { - XMLBuilder xmlBuilder = new XMLBuilder(); - xmlBuilder.addNamespace(MOM2_LOFAR_PREFIX, XMLConstants.MOM2_LOFAR_NAMESPACE, config.getMom2SchemasUrl() - + "LofarMoM2.xsd"); - xmlBuilder.addNamespace(MOM2_PREFIX, XMLConstants.MOM2_NAMESPACE, config.getMom2SchemasUrl() + "MoM2.xsd"); - Element observationElement = xmlBuilder.addRootElement(XMLConstants.MOM2_LOFAR_NAMESPACE, - XMLConstants.OBSERVATION); - addObservation(xmlBuilder, observationElement, observation); - return xmlBuilder.getDocument(); - - } - - /** - * Generates XML String from LofarObservaiton - * - * @param observation - * @return MoM2 XML String - * @throws IOException - * @throws ParserConfigurationException - */ - public static String getObservationXml(LofarObservation observation, Mom2Configuration config) throws IOException, - ParserConfigurationException { - Document document = getObservationDocument(observation, config); - StringWriter writer = new StringWriter(); - XMLConverter.serialize(document, writer); - return writer.toString(); - - } - - private static void addObservation(XMLBuilder xmlBuilder, Element observationElement, LofarObservation observation) { - if (observation.getMom2Id() != null) { - xmlBuilder.addAttributeToElement(observationElement, XMLConstants.MOM2_ID, observation.getMom2Id() - .toString()); - } - Element currentStatusElement = xmlBuilder.addElement(observationElement, XMLConstants.CURRENT_STATUS); - addXmlStatusElement(xmlBuilder, currentStatusElement, observation.getStatus()); - - - Element observationAttributes = xmlBuilder.addElement(observationElement, XMLConstants.MOM2_LOFAR_NAMESPACE, XMLConstants.OBSERVATION_ATTRIBUTES); - xmlBuilder.addTextElement(observationAttributes, XMLConstants.OBSERVATION_ID, observation.getObservationId()); - xmlBuilder.addTextElement(observationAttributes, XMLConstants.ANTENNA, Mom2OtdbConverter - .getMom2Antenna(observation.getAntennaSet())); - Element clockElement = xmlBuilder.addElement(observationAttributes, XMLConstants.CLOCK); - - xmlBuilder.addFrequencyElement(clockElement, "channelWidth", observation.getChannelWidth()); - xmlBuilder.addTextElement(clockElement, "samplesPerSecond", observation.getSamplesPerSecond()); - xmlBuilder.addFrequencyElement(clockElement, "subbandWidth", observation.getSubbandWidth()); - xmlBuilder.addFrequencyElement(clockElement, "systemClock", observation.getClockFrequency()); - xmlBuilder.addTextElement(observationAttributes, XMLConstants.INTEGRATION_INTERVAL, observation - .getIntegrationInterval()); - xmlBuilder.addTextElement(observationAttributes, "channelsPerSubband", observation.getChannelsPerSubband()); - xmlBuilder.addTextElement(observationAttributes, XMLConstants.INSTRUMENT_FILTER, Mom2OtdbConverter - .getMom2InstrumentFilter(observation.getBandFilter())); - Date startTime = observation.getStartTime(); - xmlBuilder.addTextDateTimeElement(observationAttributes, XMLConstants.START_TIME, startTime); - Date endTime = observation.getEndTime(); - xmlBuilder.addTextDateTimeElement(observationAttributes, XMLConstants.END_TIME, endTime); - - if (observation.getStations() != null) { - Element stationsElement = xmlBuilder.addElement(observationAttributes, XMLConstants.STATIONS); - for (String station : observation.getStations()) { - Element stationElement = xmlBuilder.addElement(stationsElement, XMLConstants.STATION); - xmlBuilder.addTextElement(stationElement, STATION_NAME, station); - } - } - addChildren(xmlBuilder, observationElement, observation); - } - - private static void addChildren(XMLBuilder xmlBuilder, Element observationElement, LofarObservation observation) { - if (observation.getBeams().size() > 0) { - Element childrenElement = xmlBuilder.addElement(observationElement, XMLConstants.CHILDREN); - for (int index = 0; index < observation.getBeams().size(); index++) { - addMeasurement(xmlBuilder, childrenElement, observation.getBeams().get(index), index); - } - } - - } - - private static void addMeasurement(XMLBuilder xmlBuilder, Element childrenElement, Beam beam, int index) { - Element measurementElement = xmlBuilder.addIndexedElement(childrenElement, XMLConstants.MOM2_LOFAR_NAMESPACE, - XMLConstants.MEASUREMENT, index); - xmlBuilder.addTypeAttributeToElement(measurementElement, XMLConstants.MOM2_LOFAR_NAMESPACE, - XMLConstants.UVMEASUREMENT_TYPE); - xmlBuilder.addAttributeToElement(measurementElement, XMLConstants.MOM2_ID, beam.getMom2Id().toString()); - Element currentStatusElement = xmlBuilder.addElement(measurementElement, XMLConstants.CURRENT_STATUS); - addXmlStatusElement(xmlBuilder, currentStatusElement, beam.getParentObservation().getStatus()); - if (Mom2OtdbConverter.OTDB_FINISHED_STATUS.equals(beam.getParentObservation().getStatus())) { - String fileMask = beam.getParentObservation().getFileNameMask(); - fileMask = fileMask.substring(fileMask.lastIndexOf("/") + 1); - fileMask = fileMask.replaceAll("\\$\\{OBSERVATION\\}", beam.getParentObservation().getObservationId() - .toString()); - fileMask = fileMask.replaceAll("\\$\\{BEAM\\}", index + ""); - if (beam.getSubbands().size() > 0) { - Element resultDataProducts = xmlBuilder.addElement(measurementElement, "resultDataProducts"); - for (int i = 0; i < beam.getSubbands().size(); i++) { - Element uvDataProduct = xmlBuilder.addIndexedElement(resultDataProducts, - XMLConstants.MOM2_LOFAR_NAMESPACE, "uvDataProduct"); - - xmlBuilder.addTextElement(uvDataProduct, "name", fileMask.replaceAll("\\$\\{SUBBAND\\}", i + "")); - xmlBuilder.addTextElement(uvDataProduct, "fileFormat", Mom2OtdbConverter - .getMom2DPFileType(fileMask)); - xmlBuilder.addTextElement(uvDataProduct, "subband", i); - xmlBuilder.addTextElement(uvDataProduct, "stationSubband", beam.getSubbands().get(i)); - } - - } - } - Element measurementAttributes = xmlBuilder.addElement(measurementElement,XMLConstants.MOM2_LOFAR_NAMESPACE, XMLConstants.UV_MEASUREMENT_ATTRIBUTES); - if (beam.getRaList().size() > 0 && beam.getDecList().size() > 0 && beam.getDurations().size() > 0 - && beam.getAngleTimes().size() > 0) { - xmlBuilder.addTextElement(measurementAttributes, XMLConstants.RA, beam.getRaList().get(0)); - - xmlBuilder.addTextElement(measurementAttributes, XMLConstants.DEC, beam.getDecList().get(0)); - xmlBuilder.addTextElement(measurementAttributes, XMLConstants.EQUINOX, beam.getEquinox()); - xmlBuilder.addDurationElement(measurementAttributes, XMLConstants.DURATION, beam.getDurations().get(0)); - Date startTime = beam.getParentObservation().getStartTime(); - if (startTime != null) { - Calendar cal = Calendar.getInstance(); - cal.setTime(startTime); - cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + beam.getAngleTimes().get(0)); - xmlBuilder.addTextDateTimeElement(measurementAttributes, XMLConstants.START_TIME, cal.getTime()); - if (beam.getParentObservation().getEndTime() != null) { - cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + beam.getDurations().get(0)); - xmlBuilder.addTextDateTimeElement(measurementAttributes, XMLConstants.END_TIME, cal.getTime()); - } - } - } - xmlBuilder.addTextElement(measurementAttributes, XMLConstants.SUBBANDS, Mom2OtdbConverter.getMom2Subbands(beam - .getSubbands())); - - } - - private static void addXmlStatusElement(XMLBuilder xmlBuilder, Element parent, String status) { - - xmlBuilder.addElement(parent, XMLConstants.MOM2_NAMESPACE, getStatusStringFromCode(status)); - - } - - private static String getStatusStringFromCode(String code) { - code = Mom2OtdbConverter.getMom2Status(code); - String[] splitted = code.split(" "); - String result = splitted[0]; - if (splitted.length > 1) { - for (int i = 1; i < splitted.length; i++) { - String split = splitted[i]; - String firstChar = split.substring(0, 1).toUpperCase(); - String otherChars = split.substring(1); - result += firstChar + otherChars; - } - } - return result + XMLConstants.STATUS_SUFFIX; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/AbstractThread.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/AbstractThread.java deleted file mode 100644 index 30c9dc8ca2b626eef0b2bdfe5ad8ce8e5292aa3c..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/AbstractThread.java +++ /dev/null @@ -1,51 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.util; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public abstract class AbstractThread extends Thread { - private Log log = LogFactory.getLog(this.getClass()); - private static final int MILLISECONDS = 1000; - - private int milliseconds = 5 * MILLISECONDS; - - public AbstractThread(int seconds) { - this.milliseconds = seconds * MILLISECONDS; - } - - @Override - public final void run() { - boolean exceptionThrowed = false; - while (true) { - try { - doRun(); - exceptionThrowed = false; - } catch (Exception e) { - if (!exceptionThrowed) { - exceptionThrowed = true; - log.fatal("Fatal exception occurred: " + e.getMessage(), e); - } else { - log.error("Fatal exception occurred: " + e.getMessage()); - } - - } finally { - sleep(); - } - } - } - - protected abstract void doRun() throws Exception; - - /** - * If some error occured, the task executor going to sleep for a while - */ - protected void sleep() { - try { - if (log.isDebugEnabled()) { - log.debug("Going to sleep: " + (milliseconds / MILLISECONDS)); - } - Thread.sleep(milliseconds); - } catch (InterruptedException e) { - } - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/Mom2OtdbConverter.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/Mom2OtdbConverter.java deleted file mode 100644 index e7115eafb2bc562949d111715626762651e507e8..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/Mom2OtdbConverter.java +++ /dev/null @@ -1,158 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.util; - -import java.text.DecimalFormat; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Converts mom2 values to otdb values - * - * @author Bastiaan Verhoef - * - */ -public class Mom2OtdbConverter { - - private static final String FITS = "FITS"; - private static final String HDF5 = "HDF5"; - private static final String AIPS_CASA = "AIPS++/CASA"; - private static final String FITS_EXTENSION = ".fits"; - private static final String H5_EXTENSION = ".h5"; - private static final String MS_EXTENSION = ".MS"; - public static final String OTDB_APPROVED_STATUS = "approved"; - public static final String OTDB_BEING_SPECIFIED_STATUS = "being specified"; - public static final String MOM2_DESCRIBED_STATUS = "described"; - public static final String MOM2_SPECIFIED_STATUS = "specified"; - public static final String MOM2_ACTIVE_STATUS = "active"; - public static final String MOM2_PREPARED_STATUS = "prepared"; - public static final String MOM2_FAILED_STATUS = "failed"; - public static final String MOM2_ABORTED_STATUS = "aborted"; - public static final String MOM2_SUCCESSFUL_STATUS = "successful"; - public static final String OTDB_FAILED_STATUS = "failed"; - public static final String OTDB_ABORTED_STATUS = "aborted"; - public static final String OTDB_FINISHED_STATUS = "finished"; - public static final String OTDB_ACTIVE_STATUS = "active"; - public static final String OTDB_SPECIFIED_STATUS = "specified"; - private static final String MHZ_SUFFIX = " MHz"; - private static final String CLOCK_MODE = "<<Clock"; - private static final DecimalFormat CLOCK_FORMATTER = new DecimalFormat("000"); - private static final Pattern INSTRUMENT_FILTER_PATTERN = Pattern.compile("(\\d+-\\d+)" + MHZ_SUFFIX); - - public static String getOTDBClockMode(Double clock) { - - return CLOCK_MODE + CLOCK_FORMATTER.format(clock); - - } - - public static String getOTDBAntennaArray(String antenna) { - return antenna.substring(0, 3).toUpperCase(); - } - - public static String getOTDBAntennaSet(String antenna) { - return antenna.toUpperCase().replace(' ', '_'); - } - - public static String getOTDBBandFilter(String instrumentFilter, String antennaArray) { - String result = antennaArray + "_"; - Matcher filterMatcher = INSTRUMENT_FILTER_PATTERN.matcher(instrumentFilter); - filterMatcher.find(); - return result + filterMatcher.group(1).replace('-', '_'); - - } - - /** - * Convert OTDB status from mom status - * - * @param status - * Mom2 status - * @return OTDB status - */ - public static String getOTDBStatus(String status) { - if (status.equals(MOM2_DESCRIBED_STATUS)) { - return OTDB_BEING_SPECIFIED_STATUS; - } else if (status.equals(MOM2_SPECIFIED_STATUS)) { - return OTDB_APPROVED_STATUS; - } - return null; - } - - public static String getMom2Antenna(String antennaSet) { - if (antennaSet != null) { - String result = antennaSet.replace('_', ' '); - int n = result.indexOf(' '); - n = n + 2; - result = result.substring(0, n) + result.substring(n, result.length()).toLowerCase(); - return result; - } - return null; - } - - public static String getMom2InstrumentFilter(String bandFilter) { - if (bandFilter != null) { - return bandFilter.substring(4).replace('_', '-') + MHZ_SUFFIX; - } - return null; - } - - public static String[] getStringArray(String string) { - String temp = string.replaceAll("[\\]\\[ ]", ""); - return temp.split(","); - } - - public static String getMom2Subbands(List<Integer> subbands) { - String result = ""; - if (subbands.size() >= 2) { - int firstSubband = subbands.get(0); - int lastSubband = subbands.get(subbands.size() - 1); - // is the array contiguous?? - if ((lastSubband - firstSubband +1) == subbands.size()) { - result += firstSubband + ".." + lastSubband; - return result; - } - } - - for (int i = 0; i < subbands.size(); i++) { - if (i > 0) { - result += "," + subbands.get(i); - } else { - result += subbands.get(i); - } - } - - return result; - } - - public static String getMom2DPFileType(String fileMask) { - if (fileMask.endsWith(MS_EXTENSION)) { - return AIPS_CASA; - } else if (fileMask.endsWith(H5_EXTENSION)) { - return HDF5; - } else if (fileMask.endsWith(FITS_EXTENSION)) { - return FITS; - } - return null; - } - - public static String getMom2Status(String code) { - if (code.equals(OTDB_APPROVED_STATUS)) { - return MOM2_SPECIFIED_STATUS; - } - if (code.equals(OTDB_SPECIFIED_STATUS)) { - return MOM2_PREPARED_STATUS; - } - if (code.equals(OTDB_ACTIVE_STATUS)) { - return MOM2_ACTIVE_STATUS; - } - if (code.equals(OTDB_FINISHED_STATUS)) { - return MOM2_SUCCESSFUL_STATUS; - } - if (code.equals(OTDB_ABORTED_STATUS)) { - return MOM2_ABORTED_STATUS; - } - if (code.equals(OTDB_FAILED_STATUS)) { - return MOM2_FAILED_STATUS; - } - return null; - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/XMLConstants.java b/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/XMLConstants.java deleted file mode 100644 index 4c58dd1de10e83c63ea6e7ee5afafc788502b9a8..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/nl/astron/lofar/odtb/mom2otdbadapter/util/XMLConstants.java +++ /dev/null @@ -1,62 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.util; - -public final class XMLConstants { - - public static final String MOM2_LOFAR_NAMESPACE = "http://www.astron.nl/MoM2-Lofar"; - - public static final String MOM2_NAMESPACE = "http://www.astron.nl/MoM2"; - - public static final String STATIONS = "stations"; - - public static final String STATION = "station"; - - - public static final String STATION_SET = "stationSet"; - - public static final String INTEGRATION_INTERVAL = "integrationInterval"; - - public static final String INSTRUMENT_FILTER = "instrumentFilter"; - - public static final String CLOCK = "clock"; - - public static final String ANTENNA = "antenna"; - - public static final String SPECIFICATION = "specification"; - - public static final String SCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"; - - public static final String MOM2_ID = "mom2Id"; - - public static final String OBSERVATION = "observation"; - - public static final String CURRENT_STATUS = "currentStatus"; - - public static final String OBSERVATION_ATTRIBUTES = "observationAttributes"; - - public static final String CHILDREN = "children"; - - public static final String ITEM = "item"; - - public static final String MEASUREMENT = "measurement"; - - public static final String UV_MEASUREMENT_ATTRIBUTES = "uvMeasurementAttributes"; - - public static final String RA = "ra"; - - public static final String DEC = "dec"; - - public static final String EQUINOX = "equinox"; - - public static final String DURATION = "duration"; - - public static final String SUBBANDS_SPECIFICATION = "subbandsSpecification"; - - public static final String SUBBANDS = "subbands"; - - public static final String UVMEASUREMENT_TYPE = "UVMeasurementType"; - public static final String XSI_TYPE = "type"; - public static final String STATUS_SUFFIX = "Status"; - public static final String OBSERVATION_ID = "observationId"; - public static final String START_TIME = "startTime"; - public static final String END_TIME = "endTime"; -} diff --git a/SAS/OTB/MoM-OTDB-adapter/src/schemas/LofarMoM2.xsd b/SAS/OTB/MoM-OTDB-adapter/src/schemas/LofarMoM2.xsd deleted file mode 100644 index 0eb43ee52d1a043acc8155a630c58268eb2fd1e4..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/schemas/LofarMoM2.xsd +++ /dev/null @@ -1,638 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<xsd:schema xmlns:persistent="http://www.astron.nl/PersistentObjects" xmlns:mom2="http://www.astron.nl/MoM2" xmlns="http://www.astron.nl/MoM2-Lofar" xmlns:user="http://www.astron.nl/useradmin" targetNamespace="http://www.astron.nl/MoM2-Lofar" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <xsd:import schemaLocation="MoM2.xsd" namespace="http://www.astron.nl/MoM2" /> - <xsd:import schemaLocation="http://proposal.astron.nl/schemas/UserAdmin.xsd" namespace="http://www.astron.nl/useradmin" /> - <xsd:import schemaLocation="http://proposal.astron.nl/schemas/PersistentObjects.xsd" namespace="http://www.astron.nl/PersistentObjects" /> - <xsd:annotation> - <xsd:documentation>XML Schema for the MoM2 datamodel of Lofar - </xsd:documentation> - </xsd:annotation> - <xsd:element name="project" substitutionGroup="mom2:project" type="LofarProjectType" /> - <xsd:complexType name="LofarProjectType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:ProjectType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="usedDataProducts" nillable="true" type="IndexedLofarProjectInputListType" /> - <xsd:element minOccurs="0" name="children" type="IndexedLofarCollectionChildListType" /> - <xsd:element minOccurs="0" name="members" nillable="true" type="mom2:IndexedMemberListType" /> - <xsd:choice minOccurs="0"> - <xsd:element ref="allocation" /> - </xsd:choice> - <xsd:element minOccurs="0" name="releaseDate" type="xsd:date" /> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - - <xsd:complexType name="LofarAllocationType"> - <xsd:complexContent> - <xsd:extension base="mom2:AllocationType"> - <xsd:sequence> - <xsd:element ref="resource" maxOccurs="unbounded"></xsd:element> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - - <xsd:element name="resource" type="LofarResourceType"></xsd:element> - <xsd:complexType name="LofarResourceType"> - <xsd:complexContent> - <xsd:extension base="mom2:ResourceType"> - <xsd:attribute name="queue" type="xsd:string"></xsd:attribute> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - - <xsd:element name="allocation" substitutionGroup="mom2:allocation" type="LofarAllocationType" /> - <xsd:complexType name="LofarProjectRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="LofarProjectType"> - <xsd:attribute name="id" type="xsd:integer" use="required" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarCollectionChildListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedMom2ObjectListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedLofarCollectionChildItemType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarCollectionChildItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedMom2ObjectItemType"> - <xsd:choice> - <xsd:element ref="collection" /> - <xsd:element ref="observation" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="collection" substitutionGroup="mom2:anyMom2Object" type="LofarCollectionType" /> - <xsd:element name="observation" substitutionGroup="mom2:anyMom2Object" type="LofarObservationType" /> - <xsd:complexType name="IndexedLofarProjectInputListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductListType"> - <xsd:sequence> - <xsd:element name="item" type="IndexedLofarProjectInputItemType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarProjectInputItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductItemType"> - <xsd:choice> - <xsd:element ref="proposalDocument" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="proposalDocument" substitutionGroup="mom2:anyDataProduct" type="LofarProposalDocumentType" /> - <xsd:complexType name="LofarProposalDocumentType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:DataProductType"> - <xsd:sequence> - <xsd:element name="name" type="xsd:string" /> - <!-- - The current LofarProject will be the owner! <xsd:element name="ownerMom2Object" type="Mom2ObjectRefType" - minOccurs="0"> </xsd:element> - --> - <xsd:element minOccurs="0" name="uri" type="xsd:string" /> - <xsd:element minOccurs="0" fixed="PROPOSAL" name="type" type="xsd:string" /> - <!-- - timeStamp to be set equal to time of upload! <xsd:element name="timeStamp" type="xsd:dateTime" minOccurs="0"> - </xsd:element> - --> - <xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarCollectionType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:CollectionType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="mom2:CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="mom2:ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="children" type="IndexedLofarCollectionChildListType" /> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarObservationType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:CollectionType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="mom2:CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="mom2:ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="usedDataProducts" nillable="true" type="mom2:IndexedDataProductListType" /> - <xsd:element minOccurs="0" name="resultDataProducts" nillable="true" type="mom2:IndexedDataProductListType" /> - <xsd:choice> - <xsd:element ref="observationAttributes" /> - </xsd:choice> - <xsd:element minOccurs="0" name="children" type="IndexedLofarObservationChildListType" /> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarObservationAttributesType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="mom2:SpecificAttributesType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="observationId" type="xsd:nonNegativeInteger" /> - <xsd:element minOccurs="0" name="antenna" type="LofarAntennaSelectionType" /> - <xsd:element minOccurs="0" name="clock" type="LofarClockType" /> - <xsd:element minOccurs="0" name="integrationInterval" type="xsd:double" /> - <xsd:element minOccurs="0" name="channelsPerSubband" type="xsd:short" /> - <xsd:element minOccurs="0" name="instrumentFilter" type="LofarBandFilterType" /> - <xsd:element minOccurs="0" name="startTime" type="xsd:dateTime" /> - <xsd:element minOccurs="0" name="endTime" type="xsd:dateTime" /> - <xsd:element minOccurs="0" name="stations" type="LofarStationsType" /> - <xsd:element minOccurs="0" name="specification" type="LofarObservationSpecificationAttributesType" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="observationAttributes" substitutionGroup="mom2:specificAttributes" type="LofarObservationAttributesType" /> - <xsd:complexType name="LofarObservationSpecificationAttributesType"> - <xsd:sequence> - <xsd:element name="antenna" type="LofarAntennaSelectionType" /> - <xsd:element name="clock" type="mom2:Frequency" /> - <xsd:element name="instrument" type="LofarInstrumentType" /> - <xsd:element name="instrumentFilter" type="LofarBandFilterType" /> - <xsd:element name="integrationInterval" type="xsd:double" /> - <xsd:element name="stationSet" type="LofarStationSelectionType" /> - <xsd:element minOccurs="0" name="stations"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:pattern value="\w{2}\d{3}(,\w{2}\d{3})*" /> - </xsd:restriction> - </xsd:simpleType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="LofarStationSelectionType"> - <xsd:simpleContent> - <xsd:restriction base="AbstractLofarStationSelectionType"> - <xsd:enumeration value="Single" /> - <xsd:enumeration value="Core" /> - <xsd:enumeration value="Dutch" /> - <xsd:enumeration value="All" /> - <xsd:enumeration value="Custom" /> - </xsd:restriction> - </xsd:simpleContent> - </xsd:complexType> - <xsd:complexType name="AbstractLofarStationSelectionType" abstract="true"> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute name="min" type="xsd:nonNegativeInteger" /> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - <xsd:complexType name="LofarStationsType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="station" type="LofarStationType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="LofarStationType"> - <xsd:sequence> - <xsd:element name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="location" type="LofarCoordinatesType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="LofarCoordinatesType"> - <xsd:sequence> - <xsd:element name="coordinateSystem"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="WGS84" /> - <xsd:enumeration value="ITRF2000" /> - </xsd:restriction> - </xsd:simpleType> - </xsd:element> - <xsd:element name="x" type="xsd:double" /> - <xsd:element name="y" type="xsd:double" /> - <xsd:element name="z" type="xsd:double" /> - </xsd:sequence> - </xsd:complexType> - <xsd:simpleType name="LofarAntennaSelectionType"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="HBA One" /> - <xsd:enumeration value="HBA Two" /> - <xsd:enumeration value="HBA Both" /> - <xsd:enumeration value="LBA Outer" /> - <xsd:enumeration value="LBA Inner" /> - <xsd:enumeration value="LBA Sparse" /> - <xsd:enumeration value="LBA X" /> - <xsd:enumeration value="LBA Y" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="LofarInstrumentType"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="Interferometer" /> - <xsd:enumeration value="Tied Array" /> - <xsd:enumeration value="Transient Buffer Board" /> - <xsd:enumeration value="Direct Data Storage" /> - <xsd:enumeration value="Non Standard" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="LofarBandFilterType"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="10-90 MHz" /> - <xsd:enumeration value="30-80 MHz" /> - <xsd:enumeration value="110-190 MHz" /> - <xsd:enumeration value="170-230 MHz" /> - <xsd:enumeration value="210-250 MHz" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:complexType name="LofarClockType"> - <xsd:sequence> - <xsd:element name="channelWidth" type="mom2:Frequency" /> - <xsd:element name="samplesPerSecond" type="xsd:double" /> - <xsd:element name="subbandWidth" type="mom2:Frequency" /> - <xsd:element name="systemClock" type="mom2:Frequency" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedLofarObservationChildListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedMom2ObjectListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedLofarObservationChildItemType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarObservationChildItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedMom2ObjectItemType"> - <xsd:choice> - <xsd:element ref="measurement" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="measurement" substitutionGroup="mom2:anyMom2Object" type="LofarMeasurementType" /> - <xsd:complexType name="TBBMeasurementType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="LofarMeasurementType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="mom2:CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="mom2:ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="resultDataProducts" nillable="true" type="IndexedLofarTBBDataProductListType" /> - <xsd:choice> - <xsd:element ref="tbbMeasurementAttributes" /> - </xsd:choice> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarTBBDataProductListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedLofarTBBDataProductType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarTBBDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductItemType"> - <xsd:choice> - <xsd:element ref="tbbDataProduct" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarTBBMeasurementAttributesType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="mom2:SpecificAttributesType"> - <xsd:sequence /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="tbbMeasurementAttributes" substitutionGroup="mom2:specificAttributes" type="LofarTBBMeasurementAttributesType" /> - - <xsd:complexType name="GenericMeasurementType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="LofarMeasurementType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="mom2:CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="mom2:ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="resultDataProducts" nillable="true" type="IndexedLofarTBBDataProductListType" /> - <xsd:choice> - <xsd:element ref="genericMeasurementAttributes" /> - </xsd:choice> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarGenericDataProductListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedLofarGenericDataProductType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarGenericDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductItemType"> - <xsd:choice> - <xsd:element ref="genericDataProduct" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarGenericMeasurementAttributesType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="mom2:SpecificAttributesType"> - <xsd:sequence /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="genericMeasurementAttributes" substitutionGroup="mom2:specificAttributes" type="LofarTBBMeasurementAttributesType" /> - - <xsd:complexType name="LofarMeasurementType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:extension base="mom2:Mom2ObjectType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="BFMeasurementType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="LofarMeasurementType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="mom2:CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="mom2:ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="resultDataProducts" nillable="true" type="IndexedLofarBFDataProductListType" /> - <xsd:choice> - <xsd:element ref="bfMeasurementAttributes" /> - </xsd:choice> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="bfMeasurementAttributes" substitutionGroup="mom2:specificAttributes" type="LofarBFMeasurementAttributesType" /> - <xsd:complexType name="IndexedLofarBFDataProductListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedLofarBFDataProductType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarBFDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductItemType"> - <xsd:choice> - <xsd:element ref="bfDataProduct" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="mom2:DataProductType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="storageTicket" type="xsd:string" /> - <xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong" /> - <xsd:element minOccurs="0" name="checksums" type="ChecksumTypes" /> - </xsd:sequence> - <xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger" /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:simpleType name="ChecksumAlgorithm"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="MD5" /> - <xsd:enumeration value="Adler32" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:complexType name="ChecksumTypes"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="checksum" type="ChecksumType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="ChecksumType"> - <xsd:sequence> - <xsd:element name="algorithm" type="ChecksumAlgorithm" /> - <xsd:element name="value" type="xsd:string" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="BFDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="LofarDataProductType"> - <xsd:sequence /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="UVDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="LofarDataProductType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="subband" type="xsd:nonNegativeInteger" /> - <xsd:element minOccurs="0" name="stationSubband" type="xsd:nonNegativeInteger" /> - <xsd:element minOccurs="0" name="centralFrequency" type="mom2:Frequency" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="TBBDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="LofarDataProductType"> - <xsd:sequence> - <xsd:element name="numberOfSamples" type="xsd:positiveInteger" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="GenericDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="LofarDataProductType"> - <xsd:sequence> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarBFMeasurementAttributesType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="LofarBeamMeasurementAttributesType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="UVMeasurementType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="LofarMeasurementType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="mom2:CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="mom2:ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="mom2:StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="mom2:CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="mom2:IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="mom2:IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="mom2:IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="mom2:IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="resultDataProducts" nillable="true" type="IndexedLofarUVDataProductListType" /> - <xsd:choice> - <xsd:element ref="uvMeasurementAttributes" /> - </xsd:choice> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="uvMeasurementAttributes" substitutionGroup="mom2:specificAttributes" type="LofarUVMeasurementAttributesType" /> - <xsd:complexType name="IndexedLofarUVDataProductListType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedLofarUVDataProductType" /> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedLofarUVDataProductType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="mom2:IndexedDataProductItemType"> - <xsd:choice> - <xsd:element ref="uvDataProduct" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarUVMeasurementAttributesType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="LofarBeamMeasurementAttributesType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarBeamMeasurementAttributesType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="mom2:SpecificAttributesType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="ra" type="xsd:double" /> - <xsd:element minOccurs="0" name="dec" type="xsd:double" /> - <xsd:element minOccurs="0" name="equinox" type="EquinoxType" /> - <xsd:element minOccurs="0" name="duration" type="xsd:duration" /> - <xsd:element minOccurs="0" name="startTime" type="xsd:dateTime" /> - <xsd:element minOccurs="0" name="endTime" type="xsd:dateTime" /> - <xsd:element minOccurs="0" name="centralFrequency" type="mom2:Frequency" /> - <xsd:element minOccurs="0" name="bandWidth" type="mom2:Frequency" /> - <xsd:element minOccurs="0" name="subbands" type="SubbandArrayType" /> - <xsd:element minOccurs="0" name="measurementType"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="Target" /> - <xsd:enumeration value="Calibration" /> - <xsd:enumeration value="Tune Up" /> - <xsd:enumeration value="Miscellaneous" /> - </xsd:restriction> - </xsd:simpleType> - </xsd:element> - <xsd:element minOccurs="0" name="specification" type="LofarBeamMeasurementSpecificationAttributesType" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="LofarBeamMeasurementSpecificationAttributesType"> - <xsd:sequence> - <xsd:element name="targetName" type="xsd:string" /> - <xsd:element name="ra" type="xsd:double" /> - <xsd:element name="dec" type="xsd:double" /> - <xsd:element name="equinox" type="EquinoxType" /> - <xsd:element name="duration" type="xsd:duration" /> - <xsd:element name="subbandsSpecification" type="LofarSubbandsSpecificationType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="LofarSubbandsSpecificationType"> - <xsd:sequence> - <xsd:element name="bandWidth" type="mom2:Frequency" /> - <xsd:element name="centralFrequency" type="mom2:Frequency" /> - <xsd:element name="contiguous" type="xsd:boolean" /> - <xsd:element minOccurs="0" name="subbands" type="SubbandArrayType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="LofarCustomSubbandsSpecificationType" /> - <xsd:simpleType name="SubbandArrayType"> - <xsd:restriction base="xsd:string"> - <xsd:pattern value="\d{1,3}(,\d{1,3})*|\d{1,3}\.\.\d{1,3}" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="EquinoxType"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="J2000" /> - <xsd:enumeration value="B1950" /> - <xsd:enumeration value="Other" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:element name="uvDataProduct" substitutionGroup="mom2:anyDataProduct" type="UVDataProductType" /> - <xsd:element name="bfDataProduct" substitutionGroup="mom2:anyDataProduct" type="BFDataProductType" /> - <xsd:element name="tbbDataProduct" substitutionGroup="mom2:anyDataProduct" type="TBBDataProductType" /> - <xsd:element name="genericDataProduct" substitutionGroup="mom2:anyDataProduct" type="GenericDataProductType" /> -</xsd:schema> \ No newline at end of file diff --git a/SAS/OTB/MoM-OTDB-adapter/src/schemas/MoM2.xsd b/SAS/OTB/MoM-OTDB-adapter/src/schemas/MoM2.xsd deleted file mode 100644 index ee6596eb6f0e005a031e8a32ab196caaa58bccd8..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/src/schemas/MoM2.xsd +++ /dev/null @@ -1,703 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<xsd:schema xmlns:persistent="http://www.astron.nl/PersistentObjects" xmlns="http://www.astron.nl/MoM2" xmlns:user="http://www.astron.nl/useradmin" targetNamespace="http://www.astron.nl/MoM2" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <xsd:import schemaLocation="http://proposal.astron.nl/schemas/UserAdmin.xsd" namespace="http://www.astron.nl/useradmin" /> - <xsd:import schemaLocation="http://proposal.astron.nl/schemas/PersistentObjects.xsd" namespace="http://www.astron.nl/PersistentObjects" /> - <xsd:annotation> - <xsd:documentation> - XML Schema for the MoM2 datamodel - </xsd:documentation> - </xsd:annotation> - <xsd:element name="projects"> - <xsd:complexType> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" ref="project" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="project" type="ProjectType" /> - <xsd:complexType name="ProjectType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:extension base="CollectionType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="members" nillable="true" type="IndexedMemberListType" /> - <xsd:choice minOccurs="0"> - <xsd:element ref="allocation" /> - </xsd:choice> - <xsd:element minOccurs="0" name="releaseDate" type="xsd:date" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="ProjectRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectType"> - <!-- - Project reference is unique if either mom2Id or name is given NB exactly one of these should be provided but no - validation in the schema (fundamental schema definition problem)! - --> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedMemberListType"> - <xsd:sequence> - <xsd:element minOccurs="0" maxOccurs="unbounded" name="item"> - <xsd:complexType> - <xsd:choice> - <xsd:element name="registeredMember" type="RegisteredMemberType" /> - <xsd:element name="nonRegisteredMember" type="NonRegisteredMemberType" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="MemberType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="affilliation" type="xsd:string" /> - <xsd:element minOccurs="0" name="email" type="xsd:string" /> - <xsd:element minOccurs="0" name="country" type="xsd:string" /> - <xsd:element minOccurs="0" name="roles"> - <xsd:complexType> - <xsd:sequence maxOccurs="unbounded"> - <xsd:element ref="anyRole" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="ProjectRoleType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="ProjectRoleRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectRoleType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyRole" type="ProjectRoleRefType" /> - <xsd:element name="pi" substitutionGroup="anyRole"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectRoleRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="Pi" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="1" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="coi" substitutionGroup="anyRole"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectRoleRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="Co-I" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="2" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="friend" substitutionGroup="anyRole"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectRoleRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="Friend" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="3" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="contactAuthor" substitutionGroup="anyRole"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectRoleRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="Contact author" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="4" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="potentialObserver" substitutionGroup="anyRole"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="ProjectRoleRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="Potential observer" name="name" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="5" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="RegisteredMemberType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="MemberType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="user" type="user:UserRefType" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="NonRegisteredMemberType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="MemberType"> - <xsd:sequence /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="AllocationType"> - <xsd:sequence> - <xsd:choice minOccurs="0" maxOccurs="unbounded"> - <xsd:element ref="anyResource" /> - </xsd:choice> - </xsd:sequence> - </xsd:complexType> - <xsd:element abstract="true" name="allocation" type="AllocationType" /> - <xsd:complexType name="ResourceType" abstract="true"> - <xsd:simpleContent> - <xsd:extension base="xsd:double"> - <xsd:attribute name="name" type="xsd:string" /> - <xsd:attribute name="unit" type="xsd:string" /> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyResource" type="ResourceType" /> - <xsd:element name="observingTime" substitutionGroup="anyResource"> - <xsd:complexType> - <xsd:simpleContent> - <xsd:restriction base="ResourceType"> - <xsd:simpleType> - <xsd:restriction base="xsd:double" /> - </xsd:simpleType> - <xsd:attribute fixed="time" name="name" type="xsd:string" /> - <xsd:attribute fixed="seconds" name="unit" type="xsd:string" /> - </xsd:restriction> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="CollectionType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:extension base="Mom2ObjectType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="children" type="IndexedMom2ObjectListType" /> - <xsd:element minOccurs="0" name="references" type="IndexedMom2ObjectRefListType" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="CollectionRefType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="CollectionType"> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" use="required" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedMom2ObjectListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedMom2ObjectItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedMom2ObjectItemType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:IndexedListItemType"> - <xsd:choice> - <xsd:element ref="anyMom2Object" /> - </xsd:choice> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyMom2Object" type="Mom2ObjectType" /> - <xsd:complexType name="IndexedMom2ObjectRefListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedMom2ObjectRefItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedMom2ObjectRefItemType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:IndexedListItemType"> - <xsd:choice> - <xsd:element ref="anyMom2ObjectRef" /> - </xsd:choice> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyMom2ObjectRef" type="Mom2ObjectRefType" /> - <xsd:complexType name="Mom2ObjectType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - <xsd:element minOccurs="0" name="parent" type="CollectionRefType" /> - <xsd:element minOccurs="0" name="ownerProject" type="ProjectRefType" /> - <xsd:element minOccurs="0" name="statusHistory" type="StatusHistoryType" /> - <xsd:element minOccurs="0" name="currentStatus" type="CurrentStatusType" /> - <xsd:element minOccurs="0" name="generalRemarks" nillable="true" type="IndexedGeneralRemarkListType" /> - <xsd:element minOccurs="0" name="inspectionReports" nillable="true" type="IndexedInspectionReportListType" /> - <xsd:element minOccurs="0" name="specificationRemarks" nillable="true" type="IndexedSpecificationRemarkListType" /> - <xsd:element minOccurs="0" name="schedulingRemarks" nillable="true" type="IndexedSchedulingRemarkListType" /> - <xsd:element minOccurs="0" name="usedDataProducts" nillable="true" type="IndexedDataProductListType" /> - <xsd:element minOccurs="0" name="resultDataProducts" nillable="true" type="IndexedDataProductListType" /> - <xsd:choice minOccurs="0"> - <xsd:element ref="specificAttributes" /> - </xsd:choice> - </xsd:sequence> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="Mom2ObjectRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="Mom2ObjectType"> - <xsd:attribute name="mom2Id" type="xsd:nonNegativeInteger" use="required" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="Mom2ObjectStatusType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:all> - <xsd:element minOccurs="0" name="user" type="user:UserRefType" /> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="roles" type="xsd:string" /> - <xsd:element minOccurs="0" ref="anyStatus" /> - <xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime" /> - </xsd:all> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="Mom2ObjectStatusRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="persistent:PersistentObjectType"> - <xsd:attribute name="id" type="xsd:integer" use="required" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="StatusType" abstract="true"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:all> - <xsd:element minOccurs="0" name="code" type="xsd:string" /> - <xsd:element minOccurs="0" name="type" type="xsd:string" /> - <xsd:element minOccurs="0" name="description" type="xsd:string" /> - </xsd:all> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="StatusRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyStatus" type="StatusRefType" /> - <xsd:complexType name="StatusHistoryType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="StatusHistoryItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="StatusHistoryItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="IndexedMom2ObjectStatusItemType"> - <xsd:choice> - <xsd:element name="mom2ObjectStatus" type="Mom2ObjectStatusType" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedMom2ObjectStatusItemType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:IndexedListItemType"> - <xsd:choice> - <xsd:element minOccurs="0" name="mom2ObjectStatus" type="Mom2ObjectStatusType" /> - </xsd:choice> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="CurrentStatusType"> - <xsd:choice> - <xsd:element name="mom2ObjectStatus" type="Mom2ObjectStatusRefType" /> - <xsd:element name="statusHistoryItem" type="StatusHistoryRefType" /> - <xsd:element ref="anyStatus" /> - </xsd:choice> - </xsd:complexType> - <xsd:complexType name="StatusHistoryRefType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="IndexedMom2ObjectStatusItemType"> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" use="required" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="openedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="opened" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="1" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="describedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="described" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="2" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="preparedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="prepared" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="3" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="specifiedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="specified" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="4" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="scheduledStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="scheduled" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="5" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="activeStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="active" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="6" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="runningStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="running" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="7" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="holdStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="hold" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="8" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="suspendedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="suspended" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="9" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="finishedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="finished" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="10" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="abortedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="aborted" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="11" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="failedStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="failed" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="12" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="successfulStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="successful" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="13" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="notSchedulableStatus" substitutionGroup="anyStatus"> - <xsd:complexType> - <xsd:complexContent mixed="false"> - <xsd:restriction base="StatusRefType"> - <xsd:sequence> - <xsd:element minOccurs="0" fixed="not schedulable" name="code" type="xsd:string" /> - </xsd:sequence> - <xsd:attribute fixed="14" name="id" type="xsd:integer" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="IndexedGeneralRemarkListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedGeneralRemarkItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedGeneralRemarkItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="IndexedTextItemType"> - <xsd:choice> - <xsd:element ref="generalRemark" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedInspectionReportListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedInspectionReportItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedInspectionReportItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="IndexedTextItemType"> - <xsd:choice> - <xsd:element ref="inspectionReport" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedSpecificationRemarkListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedSpecificationRemarkItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedSpecificationRemarkItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="IndexedTextItemType"> - <xsd:choice> - <xsd:element ref="specificationRemark" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedSchedulingRemarkListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedSchedulingRemarkItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedSchedulingRemarkItemType"> - <xsd:complexContent mixed="false"> - <xsd:restriction base="IndexedTextItemType"> - <xsd:choice> - <xsd:element ref="schedulingRemark" /> - </xsd:choice> - <xsd:attribute name="index" type="xsd:nonNegativeInteger" /> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="IndexedTextItemType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:IndexedListItemType"> - <xsd:choice> - <xsd:element ref="anyText" /> - </xsd:choice> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="TextType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:all> - <xsd:element minOccurs="0" name="user" type="user:UserRefType" /> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="roles" type="xsd:string" /> - <xsd:element minOccurs="0" name="text" type="xsd:string" /> - <xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime" /> - </xsd:all> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="GeneralRemarkType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="TextType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="SchedulingRemarkType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="TextType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="SpecificationRemarkType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="TextType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="InspectionReportType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="TextType" /> - </xsd:complexContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyText" type="TextType" /> - <xsd:element name="generalRemark" substitutionGroup="anyText" type="GeneralRemarkType" /> - <xsd:element name="inspectionReport" substitutionGroup="anyText" type="InspectionReportType" /> - <xsd:element name="specificationRemark" substitutionGroup="anyText" type="SpecificationRemarkType" /> - <xsd:element name="schedulingRemark" substitutionGroup="anyText" type="SchedulingRemarkType" /> - <xsd:complexType name="IndexedDataProductListType"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" name="item" type="IndexedDataProductItemType" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="IndexedDataProductItemType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:IndexedListItemType"> - <xsd:choice> - <xsd:element ref="anyDataProduct" /> - </xsd:choice> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="DataProductType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:sequence> - <xsd:element minOccurs="0" name="name" type="xsd:string" /> - <xsd:element minOccurs="0" name="ownerMom2Object" type="Mom2ObjectRefType" /> - <xsd:choice> - <xsd:element minOccurs="0" name="uri" type="xsd:string" /> - <xsd:element minOccurs="0" name="locations"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="location" type="DataProductLocationType" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:choice> - <xsd:element minOccurs="0" name="fileFormat" type="xsd:string" /> - <xsd:element minOccurs="0" name="type" type="xsd:string" /> - <xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime" /> - <xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean" /> - <xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:complexType name="DataProductLocationType"> - <xsd:complexContent mixed="false"> - <xsd:extension base="persistent:PersistentObjectType"> - <xsd:sequence> - <xsd:element name="uri" type="xsd:string" /> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element abstract="true" name="anyDataProduct" type="DataProductType" /> - <xsd:element abstract="true" name="specificAttributes" type="SpecificAttributesType" /> - <xsd:complexType name="SpecificAttributesType" /> - <xsd:simpleType name="FrequencyUnit"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="Hz" /> - <xsd:enumeration value="kHz" /> - <xsd:enumeration value="MHz" /> - <xsd:enumeration value="GHz" /> - </xsd:restriction> - </xsd:simpleType> - <xsd:complexType name="Frequency"> - <xsd:simpleContent> - <xsd:extension base="xsd:double"> - <xsd:attribute name="unit" type="FrequencyUnit" use="required" /> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> -</xsd:schema> \ No newline at end of file diff --git a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepositoryTest.java b/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepositoryTest.java deleted file mode 100644 index 6531c90f116f1587f3659b381ee8364fc955312b..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/data/OTDBRepositoryTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.data; - -import java.util.Date; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.OTDBConfiguration; - -import org.junit.Before; -import org.junit.Test; - -public class OTDBRepositoryTest { - - private OTDBRepository repository; - @Before - public void setUp() throws Exception { - OTDBConfiguration config =new OTDBConfiguration(); - config.setRmiHost("lofar17"); - config.setRmiPort(10500); - config.setTemplateId(5001); - repository = new OTDBRepository(config); - } - - -// @Test -// public void testStore() throws RepositoryException{ -// LofarObservation lofarObservation = new LofarObservation(); -// lofarObservation.setMom2Id(3); -// lofarObservation.setStatus("being specified"); -// lofarObservation.setAntennaArray("HBA"); -// lofarObservation.setAntennaSet("HBA_TWO"); -// lofarObservation.setBandFilter("HBA_100_190"); -// lofarObservation.setClockMode("<<Clock200"); -// lofarObservation.setStationSet("Custom"); -// lofarObservation.setStations("[CS302, CS010]"); -// lofarObservation.setIntegrationInterval(3d); -// Beam beam = new Beam(lofarObservation); -// beam.setRa(85.650575); -// beam.setDec(49.852009); -// beam.setEquinox("J2000"); -// beam.setAngleTime(0); -// beam.setDuration(423); -// beam.setSubbands("[123,124]"); -// lofarObservation.getBeams().add(beam); -// beam = new Beam(lofarObservation); -// beam.setRa(85.650575); -// beam.setDec(49.852009); -// beam.setEquinox("J2000"); -// beam.setAngleTime(423); -// beam.setDuration(42); -// beam.setSubbands("[1,2,3,4]"); -// lofarObservation.getBeams().add(beam); -// repository.store(lofarObservation); -// -// } - - @Test - public void testGetLatestChanges() throws RepositoryException { - Date startDate = new Date(); - startDate.setMonth(4); - Date endDate = new Date(); - repository.getLatestChanges(startDate, endDate); - - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Client.java b/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Client.java deleted file mode 100644 index ad41f110a492a7340e632b0975de7161d3cf8330..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Client.java +++ /dev/null @@ -1,58 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.net.URL; -import java.security.KeyStore; - -import nl.astron.util.http.client.AstronHttpClient; -import nl.astron.util.http.client.HttpClientConfig; -import nl.astron.util.http.client.handler.StringResponseHandler; -import nl.astron.util.http.exception.AstronHttpException; - -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.entity.StringEntity; -import org.apache.http.params.BasicHttpParams; - -public class Client { - - /** - * @param args - * @throws AstronHttpException - */ - public static void main(String[] args) throws Exception { - ClassLoader cl = Client.class.getClassLoader(); - URL url = cl.getResource("keystore-client.jks"); - KeyStore keystore = KeyStore.getInstance("jks"); - keystore.load(url.openStream(), "client".toCharArray()); - - SSLSocketFactory socketFactory = new SSLSocketFactory(keystore, "client", keystore); - - HttpClientConfig config = new HttpClientConfig("https://localhost/adsf", socketFactory); - AstronHttpClient client = new AstronHttpClient(config); - BufferedReader in = new BufferedReader(new FileReader("c:/observation.xml")); - StringBuilder builder = new StringBuilder(); - String line = null; - while ((line = in.readLine()) != null){ - builder.append(line) ; - } - StringEntity entity = new StringEntity(builder.toString()); - entity.setContentType("text/xml"); -//// reqEntity.setChunked(true); -// // It may be more appropriate to use FileEntity class in this particular -// // instance but we are using a more generic InputStreamEntity to demonstrate -// // the capability to stream out data from any arbitrary source -// // -// // FileEntity entity = new FileEntity(file, "binary/octet-stream"); -// -// httppost.setEntity(entity); - - BasicHttpParams params = new BasicHttpParams(); -// System.out.println("POST: " + builder.toString()); -// params.setParameter("observation", builder.toString()); - System.out.println(client.doPost("https://localhost/CRAFT/user/setUpIssueList.do", entity, new StringResponseHandler())); - - - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServerTest.java b/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServerTest.java deleted file mode 100644 index 048440b79ce49ecfba129edaa67ec5cfe47f5b07..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/HttpServerTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - - -public class HttpServerTest { - - - /** - * @param args -// */ -// public static void main(String[] args) throws Exception { -// Mom2HttpRequestHandler handler = new Mom2HttpRequestHandler(); -// HttpServer server = new HttpServer(443, handler); -// server.start(); -// -// } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2OtdbConverterTest.java b/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2OtdbConverterTest.java deleted file mode 100644 index 5eca6dc1b1726ec077795d1c8528cf0259529a31..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/Mom2OtdbConverterTest.java +++ /dev/null @@ -1,78 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - -import nl.astron.lofar.odtb.mom2otdbadapter.util.Mom2OtdbConverter; - -import org.junit.Assert; -import org.junit.Test; - -public class Mom2OtdbConverterTest { - - - //LBA_INNER|LBA_OUTER|LBA_SPARSE|LBA_X|LBA_Y|HBA_ONE|HBA_TWO|HBA_BOTH;- - @Test - public void testGetOTDBClockMode(){ - Assert.assertEquals("<<Clock200", Mom2OtdbConverter.getOTDBClockMode(200.00d)); - Assert.assertEquals("<<Clock160", Mom2OtdbConverter.getOTDBClockMode(160.0d)); - - } - - @Test - public void testGetOTDBStatus() { - Assert.assertEquals("being specified", Mom2OtdbConverter.getOTDBStatus("described")); - Assert.assertEquals("approved", Mom2OtdbConverter.getOTDBStatus("specified")); - } - - @Test - public void getOTDBAntennaArray(){ - Assert.assertEquals("HBA", Mom2OtdbConverter.getOTDBAntennaArray("HBA One")); - Assert.assertEquals("HBA", Mom2OtdbConverter.getOTDBAntennaArray("HBA Two")); - Assert.assertEquals("HBA", Mom2OtdbConverter.getOTDBAntennaArray("HBA Both")); - Assert.assertEquals("LBA", Mom2OtdbConverter.getOTDBAntennaArray("LBA Outer")); - Assert.assertEquals("LBA", Mom2OtdbConverter.getOTDBAntennaArray("LBA Inner")); - Assert.assertEquals("LBA", Mom2OtdbConverter.getOTDBAntennaArray("LBA Sparse")); - Assert.assertEquals("LBA", Mom2OtdbConverter.getOTDBAntennaArray("LBA X")); - Assert.assertEquals("LBA", Mom2OtdbConverter.getOTDBAntennaArray("LBA Y")); - - } - @Test - public void getOTDBAntennaSet(){ - Assert.assertEquals("HBA_ONE", Mom2OtdbConverter.getOTDBAntennaSet("HBA One")); - Assert.assertEquals("HBA_TWO", Mom2OtdbConverter.getOTDBAntennaSet("HBA Two")); - Assert.assertEquals("HBA_BOTH", Mom2OtdbConverter.getOTDBAntennaSet("HBA Both")); - Assert.assertEquals("LBA_OUTER", Mom2OtdbConverter.getOTDBAntennaSet("LBA Outer")); - Assert.assertEquals("LBA_INNER", Mom2OtdbConverter.getOTDBAntennaSet("LBA Inner")); - Assert.assertEquals("LBA_SPARSE", Mom2OtdbConverter.getOTDBAntennaSet("LBA Sparse")); - Assert.assertEquals("LBA_X", Mom2OtdbConverter.getOTDBAntennaSet("LBA X")); - Assert.assertEquals("LBA_Y", Mom2OtdbConverter.getOTDBAntennaSet("LBA Y")); - } - @Test - public void getOTDBBandFilter(){ - Assert.assertEquals("LBA_10_90", Mom2OtdbConverter.getOTDBBandFilter("10-90 MHz","LBA")); - Assert.assertEquals("LBA_30_80", Mom2OtdbConverter.getOTDBBandFilter("30-80 MHz","LBA")); - Assert.assertEquals("HBA_110_190", Mom2OtdbConverter.getOTDBBandFilter("110-190 MHz","HBA")); - Assert.assertEquals("HBA_170_230", Mom2OtdbConverter.getOTDBBandFilter("170-230 MHz","HBA")); - Assert.assertEquals("HBA_210_250", Mom2OtdbConverter.getOTDBBandFilter("210-250 MHz","HBA")); - - } - @Test - public void getMom2Antenna(){ - Assert.assertEquals("HBA One", Mom2OtdbConverter.getMom2Antenna("HBA_ONE")); - Assert.assertEquals("HBA Two", Mom2OtdbConverter.getMom2Antenna("HBA_TWO")); - Assert.assertEquals("HBA Both", Mom2OtdbConverter.getMom2Antenna("HBA_BOTH")); - Assert.assertEquals("LBA Outer", Mom2OtdbConverter.getMom2Antenna("LBA_OUTER")); - Assert.assertEquals("LBA Inner", Mom2OtdbConverter.getMom2Antenna("LBA_INNER")); - Assert.assertEquals("LBA Sparse", Mom2OtdbConverter.getMom2Antenna("LBA_SPARSE")); - Assert.assertEquals("LBA X", Mom2OtdbConverter.getMom2Antenna("LBA_X")); - Assert.assertEquals("LBA Y", Mom2OtdbConverter.getMom2Antenna("LBA_Y")); - } - - @Test - public void getMom2InstrumentFilter(){ - Assert.assertEquals("10-90 MHz", Mom2OtdbConverter.getMom2InstrumentFilter("LBA_10_90")); - Assert.assertEquals("30-80 MHz", Mom2OtdbConverter.getMom2InstrumentFilter("LBA_30_80")); - Assert.assertEquals("110-190 MHz", Mom2OtdbConverter.getMom2InstrumentFilter("HBA_110_190")); - Assert.assertEquals("170-230 MHz", Mom2OtdbConverter.getMom2InstrumentFilter("HBA_170_230")); - Assert.assertEquals("210-250 MHz", Mom2OtdbConverter.getMom2InstrumentFilter("HBA_210_250")); - - } -} diff --git a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParserTest.java b/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParserTest.java deleted file mode 100644 index 3a4d016a517eccc7c920b14176f4b9a2e378b023..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/mom2listener/XMLParserTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.mom2listener; - -import java.io.File; -import java.io.FileInputStream; -import java.io.StringWriter; -import java.util.Date; -import java.util.List; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.Mom2Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.config.OTDBConfiguration; -import nl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation; -import nl.astron.lofar.odtb.mom2otdbadapter.data.OTDBRepository; -import nl.astron.lofar.odtb.mom2otdbadapter.data.StubRepository; -import nl.astron.lofar.odtb.mom2otdbadapter.otdblistener.XMLGenerator; -import nl.astron.util.XMLConverter; - -import org.junit.Test; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; - -public class XMLParserTest { - - @Test - public void testGetLofarObservationStub() throws Exception { - FileInputStream st = new FileInputStream(new File("examples/output.xml")); - InputSource inputSource = new InputSource(st); - Document document = XMLConverter.convertXMLToDocument(inputSource); - LofarObservation lofarObservation = XMLParser.getLofarObservation(document); - - StubRepository repository = new StubRepository(); - repository.store(lofarObservation); - Date startDate = new Date(); - startDate.setMonth(4); - Date endDate = new Date(); - Mom2Configuration config = new Mom2Configuration(); - config.setMom2SchemasUrl("http://localhost:8080/mom2lofar/schemas/"); - List<LofarObservation> observations = repository.getLatestChanges(startDate, endDate); - for (LofarObservation observation: observations){ - System.out.println(XMLGenerator.getObservationXml(observation, config)); - } - System.out.println("YES"); - } - - @Test - public void testGetLofarObservation() throws Exception { - FileInputStream st = new FileInputStream(new File("examples/observation-64-specified.xml")); - InputSource inputSource = new InputSource(st); - Document document = XMLConverter.convertXMLToDocument(inputSource); - LofarObservation lofarObservation = XMLParser.getLofarObservation(document); - OTDBConfiguration config =new OTDBConfiguration(); - config.setRmiHost("lofar17"); - config.setRmiPort(10399); - config.setTemplateId(5001); - OTDBRepository repository = new OTDBRepository(config); - repository.store(lofarObservation); - System.out.println("YES"); - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGeneratorTest.java b/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGeneratorTest.java deleted file mode 100644 index 48c87825cf61073bead7fd44ae276f7b51d6139e..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/test/nl/astron/lofar/odtb/mom2otdbadapter/otdblistener/XMLGeneratorTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package nl.astron.lofar.odtb.mom2otdbadapter.otdblistener; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.TimeZone; - -import javax.xml.parsers.ParserConfigurationException; - -import junit.framework.Assert; - -import nl.astron.lofar.odtb.mom2otdbadapter.config.Mom2Configuration; -import nl.astron.lofar.odtb.mom2otdbadapter.config.OTDBConfiguration; -import nl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation; -import nl.astron.lofar.odtb.mom2otdbadapter.data.OTDBRepository; -import nl.astron.lofar.odtb.mom2otdbadapter.data.RepositoryException; -import nl.astron.util.AstronConverter; - -import org.junit.Test; - -public class XMLGeneratorTest { - - @Test - public void testGetObservationXml() throws IOException, ParserConfigurationException, RepositoryException { - Locale.setDefault(Locale.US); - OTDBConfiguration config = new OTDBConfiguration(); - config.setRmiHost("lofar17"); - config.setRmiPort(10399); - config.setTemplateId(5001); - OTDBRepository repository = new OTDBRepository(config); - Date startDate = new Date(); - startDate.setMonth(4); - Date endDate = new Date(); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - List<LofarObservation> lofarObservations = repository.getLatestChanges(startDate, endDate); - for (int i = 0; i < lofarObservations.size(); i++){ - LofarObservation lofarObservation = lofarObservations.get(i); - Mom2Configuration mom2Config = new Mom2Configuration(); - mom2Config.setMom2SchemasUrl("http://localhost:8080/mom2lofar/schemas/"); - String xml = XMLGenerator.getObservationXml(lofarObservation, mom2Config); - File file = new File("examples/obs-" + lofarObservation.getMom2Id() + "-" + lofarObservation.getStatus() + ".xml"); - PrintWriter writer = new PrintWriter(file); - writer.print(xml); - writer.flush(); - writer.close(); - } - //2009-Oct-02 08:51:23 "yyyy-MMM-dd HH:mm:ss" - } - -} diff --git a/SAS/OTB/MoM-OTDB-adapter/uml/MoM-OTDB-adapter.usd b/SAS/OTB/MoM-OTDB-adapter/uml/MoM-OTDB-adapter.usd deleted file mode 100644 index c90d975ab883583d24e587bf8acc28dcdcdb7d1f..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/uml/MoM-OTDB-adapter.usd +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<editmodel:SequenceDiagramEditModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editmodel="editmodel.xmi" xmlns:options="options.xmi" name="MoM-OTDB-adapter" size="894,646" metadata="uml2-1.0" initialized="true" tag="1000" key="32303037303533312D31303030204D6F4D2D4F5444422D616461707465722F766572686F6566"> - <children xsi:type="editmodel:InstanceEditModel" name="MomOtdbAdapter" location="210,20" size="133,427" id="nl.astron.lofar.odtb.mom2otdbadapter/MomOtdbAdapter"> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.1/@children.0/@sourceConnections.0" location="58,111" size="16,206" sequenceItemContainer="//@children.0" recursiveChildren="//@children.0/@children.1" length="206"> - <sourceConnections xsi:type="editmodel:SelfSequenceMessageEditModel" name="showSyntax" id="nl.astron.lofar.odtb.mom2otdbadapter/MomOtdbAdapter#showSyntax()" source="//@children.0/@children.0" target="//@children.0/@children.1" targetEnd="//@children.0/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.0/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manhattan" associatedMethod="showSyntax()" associatedSequenceNumber="1.1"> - <children xsi:type="editmodel:SequenceEndEditModel" location="6,64" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="showSyntax()" size="70,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1.1" size="15,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" location="16,0" anchorKind="FixedAtEdge" userLabel="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - <children xsi:type="editmodel:RecursiveActivationEditModel" targetConnections="//@children.0/@children.0/@sourceConnections.0" location="66,185" size="16,40" sequenceItemContainer="//@children.0" associatedActivation="//@children.0/@children.0" relativeLocation="8,74"/> - </children> - <children xsi:type="editmodel:ActorEditModel" location="38,20" size="100,427" itemName="Administrator"> - <children xsi:type="editmodel:ActivationEditModel" location="42,111" size="16,206" sequenceItemContainer="//@children.1" length="206"> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" name="main" id="nl.astron.lofar.odtb.mom2otdbadapter/MomOtdbAdapter#main([Ljava.lang.String;)" source="//@children.1/@children.0" target="//@children.0/@children.0" targetEnd="//@children.1/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.1/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual" associatedMethod="main(String)" associatedSequenceNumber="1"> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="main(String)" size="58,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1" size="6,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:FrameEditModel" location="228,147" size="110,107" type="opt"> - <children xsi:type="editmodel:FrameCompartmentEditModel" location="1,20" size="108,87" condition="invalid syntax"/> - </children> - <diagramOptions xsi:type="options:SequenceDiagramOptions" level="0" autoName="false"/> - <boardSetting snapToGeometry="true" gridEnabled="true" gridSpacing="15,15" gridOrigin="0,0" rulerUnit="pixel" gridVisibility="false"> - <leftRuler/> - <topRuler/> - </boardSetting> - <sequenceDiagramPreferences showPopupBars="true" showConnectionHandles="true"/> -</editmodel:SequenceDiagramEditModel> diff --git a/SAS/OTB/MoM-OTDB-adapter/uml/momlistener.usd b/SAS/OTB/MoM-OTDB-adapter/uml/momlistener.usd deleted file mode 100644 index 2ba4420fb34f4855bd503d613598083013659375..0000000000000000000000000000000000000000 --- a/SAS/OTB/MoM-OTDB-adapter/uml/momlistener.usd +++ /dev/null @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<editmodel:SequenceDiagramEditModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editmodel="editmodel.xmi" xmlns:options="options.xmi" name="momlistener" size="1312,594" metadata="uml2-1.0" initialized="true" tag="1000" key="32303037303533312D31303030204D6F4D2D4F5444422D616461707465722F766572686F6566"> - <children xsi:type="editmodel:InstanceEditModel" name="Mom2HttpRequestHandler" location="345,20" size="173,459" id="nl.astron.lofar.odtb.mom2otdbadapter.mom2listener/Mom2HttpRequestHandler"> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.1/@children.0/@sourceConnections.0 //@children.5/@children.0/@sourceConnections.0 //@children.3/@children.0/@sourceConnections.0 //@children.4/@children.0/@sourceConnections.0" location="78,93" size="16,256" sequenceItemContainer="//@children.0" length="256"> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" name="convertXMLToDocument" id="nl.astron.util/XMLConverter#convertXMLToDocument(Lorg.xml.sax.InputSource;Ljava.util.List;)" source="//@children.0/@children.0" target="//@children.5/@children.0" targetEnd="//@children.0/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.0/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual" associatedMethod="convertXMLToDocument(InputSource,List<URL>): Document" associatedSequenceNumber="1.1.1" associatedReturnArrow="//@children.5/@children.0/@sourceConnections.0" shouldShowReturnArrow="true"> - <children xsi:type="editmodel:SequenceEndEditModel" location="6,13" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="convertXMLToDocument(InputSource,List<URL>): Document" size="290,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1.1.1" size="24,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" name="getLofarObservation" id="nl.astron.lofar.odtb.mom2otdbadapter.mom2listener/XMLParser#getLofarObservation(Lorg.w3c.dom.Document;)" source="//@children.0/@children.0" target="//@children.3/@children.0" targetEnd="//@children.0/@children.0/@sourceConnections.1/@children.1" sourceEnd="//@children.0/@children.0/@sourceConnections.1/@children.0" connectionRouterKind="Manual" associatedMethod="getLofarObservation(Document): LofarObservation" associatedSequenceNumber="1.1.2" associatedReturnArrow="//@children.3/@children.0/@sourceConnections.0" shouldShowReturnArrow="true"> - <children xsi:type="editmodel:SequenceEndEditModel" location="6,83" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.0/@children.0/@sourceConnections.1/@children.0/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.1/@children.0/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.1/@children.0/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.1/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="getLofarObservation(Document): LofarObservation" size="247,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1.1.2" size="24,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.0/@children.0/@sourceConnections.1/@children.1/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.1/@children.1/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.1/@children.1/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.1/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" name="store" id="nl.astron.lofar.odtb.mom2otdbadapter.data/Repository#store(Lnl.astron.lofar.odtb.mom2otdbadapter.data.LofarObservation;)" source="//@children.0/@children.0" target="//@children.4/@children.0" targetEnd="//@children.0/@children.0/@sourceConnections.2/@children.1" sourceEnd="//@children.0/@children.0/@sourceConnections.2/@children.0" connectionRouterKind="Manual" associatedMethod="store(LofarObservation)" associatedSequenceNumber="1.1.3" associatedReturnArrow="//@children.4/@children.0/@sourceConnections.0" shouldShowReturnArrow="true"> - <children xsi:type="editmodel:SequenceEndEditModel" location="5,201" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.0/@children.0/@sourceConnections.2/@children.0/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.2/@children.0/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.2/@children.0/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.2/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="store(LofarObservation)" size="118,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1.1.3" size="24,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.0/@children.0/@sourceConnections.2/@children.1/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.2/@children.1/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.2/@children.1/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.2/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - <sourceConnections xsi:type="editmodel:ReturnArrowEditModel" source="//@children.0/@children.0" target="//@children.1/@children.0" targetEnd="//@children.0/@children.0/@sourceConnections.3/@children.1" sourceEnd="//@children.0/@children.0/@sourceConnections.3/@children.0" connectionRouterKind="Manual"> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,256" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.0/@children.0/@sourceConnections.3/@children.0/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.3/@children.0/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.3/@children.0/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.3/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,256" anchorKind="FixedAtEdge" userLabel="//@children.0/@children.0/@sourceConnections.3/@children.1/@children.0" methodLabel="//@children.0/@children.0/@sourceConnections.3/@children.1/@children.1" sequenceNumberLabel="//@children.0/@children.0/@sourceConnections.3/@children.1/@children.2" statementExpression="//@children.0/@children.0/@sourceConnections.3/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:InstanceEditModel" name="HttpServer" location="105,20" size="101,459" id="nl.astron.lofar.odtb.mom2otdbadapter.mom2listener/HttpServer"> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.2/@children.0/@sourceConnections.0 //@children.0/@children.0/@sourceConnections.3" location="42,93" size="16,256" sequenceItemContainer="//@children.1" length="256"> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" name="handle" id="org.apache.http.protocol/HttpRequestHandler#handle(Lorg.apache.http.HttpRequest;Lorg.apache.http.HttpResponse;Lorg.apache.http.protocol.HttpContext;)" source="//@children.1/@children.0" target="//@children.0/@children.0" targetEnd="//@children.1/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.1/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual" associatedMethod="handle(HttpRequest,HttpResponse,HttpContext)" associatedSequenceNumber="1.1" associatedReturnArrow="//@children.0/@children.0/@sourceConnections.3" shouldShowReturnArrow="true"> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.1/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="handle(HttpRequest,HttpResponse,HttpContext)" size="229,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1.1" size="15,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.1/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - <sourceConnections xsi:type="editmodel:ReturnArrowEditModel" source="//@children.1/@children.0" target="//@children.2/@children.0" targetEnd="//@children.1/@children.0/@sourceConnections.1/@children.1" sourceEnd="//@children.1/@children.0/@sourceConnections.1/@children.0" connectionRouterKind="Manual"> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,256" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.1/@children.0/@sourceConnections.1/@children.0/@children.0" methodLabel="//@children.1/@children.0/@sourceConnections.1/@children.0/@children.1" sequenceNumberLabel="//@children.1/@children.0/@sourceConnections.1/@children.0/@children.2" statementExpression="//@children.1/@children.0/@sourceConnections.1/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,256" anchorKind="FixedAtEdge" userLabel="//@children.1/@children.0/@sourceConnections.1/@children.1/@children.0" methodLabel="//@children.1/@children.0/@sourceConnections.1/@children.1/@children.1" sequenceNumberLabel="//@children.1/@children.0/@sourceConnections.1/@children.1/@children.2" statementExpression="//@children.1/@children.0/@sourceConnections.1/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:ActorEditModel" location="20,20" size="100,459" itemName="MoM"> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.1/@children.0/@sourceConnections.1" location="42,93" size="16,256" sequenceItemContainer="//@children.2" length="256"> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" source="//@children.2/@children.0" target="//@children.1/@children.0" targetEnd="//@children.2/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.2/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual" associatedMethod="" associatedSequenceNumber="1" associatedReturnArrow="//@children.1/@children.0/@sourceConnections.1" shouldShowReturnArrow="true"> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.2/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.2/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.2/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.2/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="96,14" labelValue="post described XML"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1" size="6,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.2/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.2/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.2/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.2/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:InstanceEditModel" name="XMLParser" location="870,20" size="102,459" id="nl.astron.lofar.odtb.mom2otdbadapter.mom2listener/XMLParser"> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.0/@children.0/@sourceConnections.1" location="43,176" size="16,91" sequenceItemContainer="//@children.3" length="91"> - <sourceConnections xsi:type="editmodel:ReturnArrowEditModel" source="//@children.3/@children.0" target="//@children.0/@children.0" targetEnd="//@children.3/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.3/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual"> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,91" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.3/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.3/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.3/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.3/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,174" anchorKind="FixedAtEdge" userLabel="//@children.3/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.3/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.3/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.3/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:InstanceEditModel" name="OTDBRepository" location="915,20" size="129,459" id="nl.astron.lofar.odtb.mom2otdbadapter.data/OTDBRepository"> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.0/@children.0/@sourceConnections.2" location="56,294" size="16,55" sequenceItemContainer="//@children.4" length="55"> - <sourceConnections xsi:type="editmodel:ReturnArrowEditModel" source="//@children.4/@children.0" target="//@children.0/@children.0" targetEnd="//@children.4/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.4/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual"> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,55" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.4/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.4/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.4/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.4/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,256" anchorKind="FixedAtEdge" userLabel="//@children.4/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.4/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.4/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.4/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - <sourceConnections xsi:type="editmodel:SequenceMessageEditModel" name="copyTemplateTree" id="nl.astron.lofar.sas.otb.jotdb2/jTreeMaintenanceInterface#copyTemplateTree(I)" source="//@children.4/@children.0" target="//@children.6/@children.0" targetEnd="//@children.4/@children.0/@sourceConnections.1/@children.1" sourceEnd="//@children.4/@children.0/@sourceConnections.1/@children.0" connectionRouterKind="Manual" associatedMethod="copyTemplateTree(int): int" associatedSequenceNumber="1.1.3.1"> - <children xsi:type="editmodel:SequenceEndEditModel" location="4,15" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.4/@children.0/@sourceConnections.1/@children.0/@children.0" methodLabel="//@children.4/@children.0/@sourceConnections.1/@children.0/@children.1" sequenceNumberLabel="//@children.4/@children.0/@sourceConnections.1/@children.0/@children.2" statementExpression="//@children.4/@children.0/@sourceConnections.1/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" name="copyTemplateTree(int): int" size="125,14"/> - <children xsi:type="editmodel:LabelEditModel" name="1.1.3.1" size="33,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" anchorKind="FixedAtEdge" userLabel="//@children.4/@children.0/@sourceConnections.1/@children.1/@children.0" methodLabel="//@children.4/@children.0/@sourceConnections.1/@children.1/@children.1" sequenceNumberLabel="//@children.4/@children.0/@sourceConnections.1/@children.1/@children.2" statementExpression="//@children.4/@children.0/@sourceConnections.1/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:InstanceEditModel" name="XMLConverter" location="720,20" size="118,459" id="nl.astron.util/XMLConverter" itemName=""> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.0/@children.0/@sourceConnections.0" location="51,106" size="16,40" sequenceItemContainer="//@children.5"> - <sourceConnections xsi:type="editmodel:ReturnArrowEditModel" source="//@children.5/@children.0" target="//@children.0/@children.0" targetEnd="//@children.5/@children.0/@sourceConnections.0/@children.1" sourceEnd="//@children.5/@children.0/@sourceConnections.0/@children.0" connectionRouterKind="Manual"> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,40" anchorKind="FixedAtEdge" attachSource="true" userLabel="//@children.5/@children.0/@sourceConnections.0/@children.0/@children.0" methodLabel="//@children.5/@children.0/@sourceConnections.0/@children.0/@children.1" sequenceNumberLabel="//@children.5/@children.0/@sourceConnections.0/@children.0/@children.2" statementExpression="//@children.5/@children.0/@sourceConnections.0/@children.0/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - <children xsi:type="editmodel:SequenceEndEditModel" location="0,53" anchorKind="FixedAtEdge" userLabel="//@children.5/@children.0/@sourceConnections.0/@children.1/@children.0" methodLabel="//@children.5/@children.0/@sourceConnections.0/@children.1/@children.1" sequenceNumberLabel="//@children.5/@children.0/@sourceConnections.0/@children.1/@children.2" statementExpression="//@children.5/@children.0/@sourceConnections.0/@children.1/@children.3"> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:LabelEditModel" size="0,14"/> - <children xsi:type="editmodel:MessageLabelEditModel" size="0,14"/> - </children> - </sourceConnections> - </children> - </children> - <children xsi:type="editmodel:InstanceEditModel" name="jTreeMaintenanceInterface" location="1105,20" size="177,459" id="nl.astron.lofar.sas.otb.jotdb2/jTreeMaintenanceInterface" itemName=""> - <children xsi:type="editmodel:ActivationEditModel" targetConnections="//@children.4/@children.0/@sourceConnections.1" location="80,309" size="16,40" sequenceItemContainer="//@children.6"/> - </children> - <diagramOptions xsi:type="options:SequenceDiagramOptions" level="0" autoName="false"/> - <boardSetting snapToGeometry="true" gridEnabled="true" gridSpacing="15,15" gridOrigin="0,0" rulerUnit="pixel" gridVisibility="false"> - <leftRuler/> - <topRuler/> - </boardSetting> - <sequenceDiagramPreferences showPopupBars="true" showConnectionHandles="true"/> -</editmodel:SequenceDiagramEditModel> diff --git a/SAS/OTB/jOTDB2/.cvsignore b/SAS/OTB/jOTDB2/.cvsignore deleted file mode 100644 index 8c4f1886b8afae365031e6549295602d9a3642f5..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -.svn -build -dist diff --git a/SAS/OTB/jOTDB2/CMakeLists.txt b/SAS/OTB/jOTDB2/CMakeLists.txt deleted file mode 100644 index fb330b85a3db6b28312061537155204939762afd..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# $Id$ - -lofar_package(jOTDB2 1.0 DEPENDS Common OTDB) - -include(LofarFindPackage) -lofar_find_package(Boost REQUIRED COMPONENTS date_time) -lofar_find_package(PQXX REQUIRED) - -# Don't use lofar_find_package(JNI), because we don't need to link in the -# JNI libraries; we only need the JNI header files. -find_package(JNI REQUIRED) -include_directories(${JNI_INCLUDE_DIRS}) - -add_subdirectory(include/jOTDB2) -add_subdirectory(src) -#add_subdirectory(test) diff --git a/SAS/OTB/jOTDB2/How_to_build_jOTDB2.txt b/SAS/OTB/jOTDB2/How_to_build_jOTDB2.txt deleted file mode 100644 index a3aad78b177f15f518a1f271c70c5c2a421743c4..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/How_to_build_jOTDB2.txt +++ /dev/null @@ -1,69 +0,0 @@ -#prepare pre settings: - -// set base dir where LOFAR starts -export LOFARBASE=~ -cd ${LOFARBASE} - -export CLASSPATH=${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes:[pathto log4jloggerclasses] -export LD_LIBRARY_PATH=${LOFARBASE}/LOFAR/installed/gnu_debug/lib:/lib:/usr/lib:usr/local/lib -export JAVAHOME=/usr/local/jdk1.5.0_04/ -export PATH=/usr/local/jdk1.5.0_04/bin:$PATH - - -#checkout the package from cvs: -cvs co LOFAR/SAS/OTB/jOTDB2 - -#go to - -cd ${LOFARBASE}LOFAR/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2 - -#build the java files: - -javac -d ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes *.java - -cd ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/src - -# build the rmi stubs: - -rmic -d ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes nl.astron.lofar.sas.otb.jotdb2.jConverterAdapter -rmic -d ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes nl.astron.lofar.sas.otb.jotdb2.jOTDBadapter -rmic -d ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes nl.astron.lofar.sas.otb.jotdb2.jTreeMaintenanceAdapter -rmic -d ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes nl.astron.lofar.sas.otb.jotdb2.jTreeValueAdapter - - -# in this case, to be able to use the jar file we need to include the -# external packages in the same jar file: - -cd ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/classes - - -jar xvf /usr/local/netbeans-4.1/ide5/modules/ext/AbsoluteLayout.jar -jar xvf /home/coolen/logging-log4j-1.2.13/dist/lib/log4j-1.2.13.jar - -#place the Manifest file here -cp ../../src/nl/astron/lofar/sas/otb/jotdb2/Manifest.txt . - -# build the jarfile -jar -cvfm ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/build/lib/jotdb2.jar ../../src/nl/astron/lofar/sas/otb/jotdb2/Manifest.txt * - - -#the .h files in include and the .cc files in src can be build by rub the normal way. - -# the jOTDB2.log_prop should be placed somewhere ?in the directory wher you run the files - - -#The test directory: - - -cd ${LOFARBASE}/LOFAR/SAS/OTB/jOTDB2/test -javac *.java - -#to run the tests - -java tConnection -java tConverter -java tRemoteConnection -java tRemoteConverter -java tTreeMaintenance - -#the last 3 should have the server running also.... diff --git a/SAS/OTB/jOTDB2/build.xml b/SAS/OTB/jOTDB2/build.xml deleted file mode 100644 index 0c32b38430ac48e92930385d53474178203c2796..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/build.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- You may freely edit this file. See commented blocks below for --> -<!-- some examples of how to customize the build. --> -<!-- (If you delete it and reopen the project it will be recreated.) --> -<project name="jOTDB2" default="default" basedir="."> - <description>Builds, tests, and runs the project jOTBD2.</description> - <import file="nbproject/build-impl.xml"/> - <!-- - - There exist several targets which are by default empty and which can be - used for execution of your tasks. These targets are usually executed - before and after some main targets. They are: - - -pre-init: called before initialization of project properties - -post-init: called after initialization of project properties - -pre-compile: called before javac compilation - -post-compile: called after javac compilation - -pre-compile-single: called before javac compilation of single file - -post-compile-single: called after javac compilation of single file - -pre-compile-test: called before javac compilation of JUnit tests - -post-compile-test: called after javac compilation of JUnit tests - -pre-compile-test-single: called before javac compilation of single JUnit test - -post-compile-test-single: called after javac compilation of single JUunit test - -pre-jar: called before JAR building - -post-jar: called after JAR building - -post-clean: called after cleaning build products - - (Targets beginning with '-' are not intended to be called on their own.) - - Example of inserting an obfuscator after compilation could look like this: - - <target name="-post-compile"> - <obfuscate> - <fileset dir="${build.classes.dir}"/> - </obfuscate> - </target> - - For list of available properties check the imported - nbproject/build-impl.xml file. - - - Another way to customize the build is by overriding existing main targets. - The targets of interest are: - - -init-macrodef-javac: defines macro for javac compilation - -init-macrodef-junit: defines macro for junit execution - -init-macrodef-debug: defines macro for class debugging - -init-macrodef-java: defines macro for class execution - -do-jar-with-manifest: JAR building (if you are using a manifest) - -do-jar-without-manifest: JAR building (if you are not using a manifest) - run: execution of project - -javadoc-build: Javadoc generation - test-report: JUnit report generation - - An example of overriding the target for project execution could look like this: - - <target name="run" depends="OTB-impl.jar"> - <exec dir="bin" executable="launcher.exe"> - <arg file="${dist.jar}"/> - </exec> - </target> - - Notice that the overridden target depends on the jar target and not only on - the compile target as the regular run target does. Again, for a list of available - properties which you can use, check the target you are overriding in the - nbproject/build-impl.xml file. - - --> - - <target name="-post-compile"> - <rmic base="${build.dir}/classes" classname="nl.astron.lofar.sas.otb.jotdb2.jConverterAdapter"/> - <rmic base="${build.dir}/classes" classname="nl.astron.lofar.sas.otb.jotdb2.jOTDBadapter"/> - <rmic base="${build.dir}/classes" classname="nl.astron.lofar.sas.otb.jotdb2.jTreeMaintenanceAdapter"/> - <rmic base="${build.dir}/classes" classname="nl.astron.lofar.sas.otb.jotdb2.jTreeValueAdapter"/> - <rmic base="${build.dir}/classes" classname="nl.astron.lofar.sas.otb.jotdb2.jCampaignAdapter"/> - - </target> -</project> diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/CMakeLists.txt b/SAS/OTB/jOTDB2/include/jOTDB2/CMakeLists.txt deleted file mode 100644 index 7212e699436d59b97b01e909fe2b44c7302c3494..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ - -# List of header files that will be installed. -set(inst_HEADERS - nl_astron_lofar_sas_otb_jotdb2_jCampaign.h - nl_astron_lofar_sas_otb_jotdb2_jClassifConv.h - nl_astron_lofar_sas_otb_jotdb2_jCommon.h - nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.h - nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h - nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.h - nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.h - nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.h - nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.h - nl_astron_lofar_sas_otb_jotdb2_jTreeValue.h - nl_astron_lofar_sas_otb_jotdb2_jUnitConv.h) - -# Create symbolic link to include directory. -execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/include/${PACKAGE_NAME}) - -# Install header files. -install(FILES ${inst_HEADERS} DESTINATION include/${PACKAGE_NAME}) diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCampaign.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCampaign.h deleted file mode 100644 index 6506dbdd118a7f34e7dafb8c7f122297be375b19..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCampaign.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jCampaign */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jCampaign -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jCampaign -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: initCampaign - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_initCampaign - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: getCampaign - * Signature: (Ljava/lang/String;)Lnl/astron/lofar/sas/otb/jotdb2/jCampaignInfo; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_getCampaign__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: getCampaign - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb2/jCampaignInfo; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_getCampaign__I - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: getCampaignList - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_getCampaignList - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: saveCampaign - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jCampaignInfo;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_saveCampaign - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_errorMsg - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.h deleted file mode 100644 index 028a37f17ab883b70bd8c9ecf5033d3eff4f5e83..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jClassifConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jClassifConv -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jClassifConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: initClassifConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_initClassifConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h deleted file mode 100644 index a60f56f4addaeffd9f49e0f95109f384c411f24a..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h +++ /dev/null @@ -1,65 +0,0 @@ -//# jCommon.h: Holds a static OTDBconnection. -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -#ifndef LOFAR_JOTDB_COMMON_H -#define LOFAR_JOTDB_COMMON_H - -// \file -// Hold a static OTDBconnection, to be -// shared between the different JNI implementation -// Also holds the Class converters for this connection -// -//# Never #include <config.h> or #include <lofar_config.h> in a header file! -//# Includes -#include <jni.h> -#include <OTDB/OTDBconnection.h> -#include <OTDB/OTDBnode.h> -#include <OTDB/OTDBvalue.h> -#include <OTDB/OTDBtree.h> -#include <OTDB/Campaign.h> -#include <OTDB/OTDBparam.h> -#include <OTDB/TreeState.h> -#include <OTDB/TreeValue.h> -#include <OTDB/VICnodeDef.h> -#include <OTDB/CampaignInfo.h> -#include <OTDB/TreeMaintenance.h> - -using namespace LOFAR::OTDB; - -jobject convertOTDBnode (JNIEnv *env, OTDBnode aNode); -jobject convertOTDBvalue (JNIEnv *env, OTDBvalue aValue); -jobject convertOTDBtree (JNIEnv *env, OTDBtree aTree); -jobject convertTreeState (JNIEnv *env, TreeState aTreeState); -jobject convertVICnodeDef (JNIEnv *env, VICnodeDef aNodeDef); -jobject convertOTDBparam (JNIEnv *env, OTDBparam aParam); -jobject convertCampaignInfo (JNIEnv *env, CampaignInfo aCampaignInfo); - -OTDBnode convertjOTDBnode (JNIEnv *env, jobject jNode); -VICnodeDef convertjVICnodeDef (JNIEnv *env, jobject jNode); -OTDBparam convertjOTDBparam (JNIEnv *env, jobject jParam); -OTDBvalue convertjOTDBvalue (JNIEnv *env, jobject jvalue); -CampaignInfo convertjCampaignInfo (JNIEnv *env, jobject jCampaignInfo); - -// Used in TreeValue -void setTreeValConnection(JNIEnv *env, jobject callerObject); -void setErrorMsg(JNIEnv *env, jobject callerObject); - -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.h deleted file mode 100644 index c6f88ac1bec5aebd2a7b93ce0fef28917ae49b69..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger - * Method: initLogger - * Signature: (Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger_initLogger - (JNIEnv *, jobject, jstring); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h deleted file mode 100644 index 8b25a9fa46fce844b6f5b2e116d3b93fae2654dd..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h +++ /dev/null @@ -1,85 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: initOTDBconnection - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_initOTDBconnection - (JNIEnv *, jobject, jstring, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: isConnected - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_isConnected - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: connect - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_connect - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: getTreeInfo - * Signature: (IZ)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBtree; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getTreeInfo - (JNIEnv *, jobject, jint, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: getStateList - * Signature: (IZLjava/lang/String;Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getStateList - (JNIEnv *, jobject, jint, jboolean, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: getTreeList - * Signature: (SS)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getTreeList - (JNIEnv *, jobject, jshort, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_errorMsg - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: getAuthToken - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getAuthToken - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection - * Method: getDBName - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getDBName - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.h deleted file mode 100644 index 7981b5a1df55fa066e5d0178af4ea62f5041a6bd..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: initParamTypeConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_initParamTypeConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.h deleted file mode 100644 index 90b56232e171226caf26b556d1a752f2f469b478..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.h +++ /dev/null @@ -1,309 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: initTreeMaintenance - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_initTreeMaintenance - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: loadMasterFile - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_loadMasterFile - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: loadComponentFile - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_loadComponentFile - (JNIEnv *, jobject, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getComponentList - * Signature: (Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getComponentList - (JNIEnv *, jobject, jstring, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getComponentNode - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb2/jVICnodeDef; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getComponentNode - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getComponentParams - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getComponentParams - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveComponentNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jVICnodeDef;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveComponentNode - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: isTopComponent - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_isTopComponent - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteComponentNode - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteComponentNode - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getFullComponentName - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jVICnodeDef;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getFullComponentName - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: buildTemplateTree - * Signature: (IS)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_buildTemplateTree - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: newTemplateTree - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_newTemplateTree - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: copyTemplateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_copyTemplateTree - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getNode - * Signature: (II)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getNode - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getParam - * Signature: (II)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getParam__II - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getParam - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode;)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getParam__Lnl_astron_lofar_sas_otb_jotdb2_jOTDBnode_2 - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveParam - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBparam;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveParam - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getItemList - * Signature: (III)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getItemList__III - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getItemList - * Signature: (ILjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getItemList__ILjava_lang_String_2 - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: dupNode - * Signature: (IIS)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_dupNode - (JNIEnv *, jobject, jint, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: addComponent - * Signature: (IIILjava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_addComponent - (JNIEnv *, jobject, jint, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveNode - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveNodeList - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteNode - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteNodeList - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: checkTreeConstraints - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_checkTreeConstraints - (JNIEnv *, jobject, jint, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: instanciateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_instanciateTree - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: pruneTree - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_pruneTree - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: exportTree - * Signature: (IILjava/lang/String;IZ)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_exportTree - (JNIEnv *, jobject, jint, jint, jstring, jint, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteTree - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteTree - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getTopNode - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getTopNode - (JNIEnv *, jobject, jint); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setMomInfo - * Signature: (IILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setMomInfo - (JNIEnv *, jobject, jint, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setClassification - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setClassification - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setTreeState - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setTreeState - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setDescription - * Signature: (ILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setDescription - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setSchedule - * Signature: (ILjava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setSchedule - (JNIEnv *, jobject, jint, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_errorMsg - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.h deleted file mode 100644 index a176c88b197a28795897839791b86db3bd9508ef..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: initTreeStateConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_initTreeStateConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.h deleted file mode 100644 index 6e927ccad4c40d3ce6a2a82a2ae728e7989126a0..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: initTreeTypeConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_initTreeTypeConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.h deleted file mode 100644 index c1dc38f41818107793b8dddba71d1221e93d8578..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.h +++ /dev/null @@ -1,54 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jTreeValue */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeValue -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jTreeValue -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: addKVT - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_addKVT__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv *, jobject, jstring, jstring, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: addKVT - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBvalue;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_addKVT__Lnl_astron_lofar_sas_otb_jotdb2_jOTDBvalue_2 - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: addKVTlist - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_addKVTlist - (JNIEnv *, jobject, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: searchInPeriod - * Signature: (IILjava/lang/String;Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_searchInPeriod - (JNIEnv *, jobject, jint, jint, jstring, jstring, jboolean); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: getSchedulableItems - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_getSchedulableItems - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.h b/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.h deleted file mode 100644 index 67ba050f9318f176318855e37494dee81fd289ac..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/include/jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class nl_astron_lofar_sas_otb_jotdb2_jUnitConv */ - -#ifndef _Included_nl_astron_lofar_sas_otb_jotdb2_jUnitConv -#define _Included_nl_astron_lofar_sas_otb_jotdb2_jUnitConv -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: initUnitConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_initUnitConv - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_get__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_get__S - (JNIEnv *, jobject, jshort); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_getTypes - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_top - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_next - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB2/make_jar.sh b/SAS/OTB/jOTDB2/make_jar.sh deleted file mode 100755 index 0eb3ab3fc15b36ca867e05c6209d73db6ae880ef..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/make_jar.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -/usr/local/jdk1.5.0_04/bin/jar xvf /usr/local/netbeans-4.1/ide5/modules/ext/AbsoluteLayout.jar; -/usr/local/jdk1.5.0_04/bin/jar xvf /home/coolen/logging-log4j-1.2.13/dist/lib/log4j-1.2.13.jar; -/usr/local/jdk1.5.0_04/bin/jar uf jotdb2.jar org; - diff --git a/SAS/OTB/jOTDB2/manifest.mf b/SAS/OTB/jOTDB2/manifest.mf deleted file mode 100644 index 328e8e5bc3b7f1f7bad2bc0751a933e00c801983..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/SAS/OTB/jOTDB2/package.dox b/SAS/OTB/jOTDB2/package.dox deleted file mode 100644 index a85438c9a36ade8d8925d963ecd1bc07ada43f01..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/package.dox +++ /dev/null @@ -1,2 +0,0 @@ -// \ingroup OTB -// \defgroup jOTDB2 jOTDB2 Description diff --git a/SAS/OTB/jOTDB2/src/CMakeLists.txt b/SAS/OTB/jOTDB2/src/CMakeLists.txt deleted file mode 100644 index ab15baf43ec31d9971601feb4af468cd49924676..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# $Id$ - -include(LofarPackageVersion) - -lofar_add_library(jotdb2 SHARED - Package__Version.cc - nl_astron_lofar_sas_otb_jotdb2_jCommon.cc - nl_astron_lofar_sas_otb_jotdb2_jCampaign.cc - nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.cc - nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.cc - nl_astron_lofar_sas_otb_jotdb2_jClassifConv.cc - nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.cc - nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.cc - nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.cc - nl_astron_lofar_sas_otb_jotdb2_jUnitConv.cc - nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.cc - nl_astron_lofar_sas_otb_jotdb2_jTreeValue.cc) - -lofar_add_bin_program(versionjotdb2 versionjotdb2.cc) - diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/Manifest.txt b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/Manifest.txt deleted file mode 100644 index 83f2ffcfc43bef129bfc583c9dbe23fe64041608..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/Manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -Main-Class: nl.astron.lofar.sas.otb.jotdb2.jOTDBserver - diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaign.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaign.java deleted file mode 100644 index de2f6545006de27c43df040a69bb7bdd2b69a847..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaign.java +++ /dev/null @@ -1,54 +0,0 @@ -//# Campaign.java: Interface for access to the campaign record -//# -//# Copyright (C) 2010 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.Vector; - -public class jCampaign -{ - - public jCampaign () - { - try { - initCampaign (); - } catch (Exception ex) { - System.out.println("Error during jCampaign init : " +ex); - } - } - - private native void initCampaign () throws Exception; - - // Get one campaign record. - public native jCampaignInfo getCampaign(String name) throws Exception; - public native jCampaignInfo getCampaign(int ID) throws Exception; - - // Get all campaign records - public native Vector<jCampaignInfo> getCampaignList() throws Exception; - - // Update or insert a campaign record - public native int saveCampaign(jCampaignInfo aCampaign) throws Exception; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public native String errorMsg() throws Exception; - - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignAdapter.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignAdapter.java deleted file mode 100644 index 34d5911f0d8dbfe416c50cff5a02f4339b17307e..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignAdapter.java +++ /dev/null @@ -1,110 +0,0 @@ -//# jCampaignAdapter.java: The RMI adapter of the Campaign database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; -import org.apache.log4j.Logger; - - - -public class jCampaignAdapter extends UnicastRemoteObject implements jCampaignInterface -{ - - // Create a Log4J logger instance - static Logger logger = Logger.getLogger(jCampaignAdapter.class); - - // Constructor - public jCampaignAdapter (jCampaign adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - // Get one campaign record. - public jCampaignInfo getCampaign(String name) throws RemoteException { - jCampaignInfo aC=null; - try { - aC = adaptee.getCampaign (name); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getCampaign(name)",ex); - throw anEx; - } - return aC; - } - - public jCampaignInfo getCampaign(int ID) throws RemoteException { - jCampaignInfo aC=null; - try { - aC = adaptee.getCampaign (ID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getCampaign(ID)",ex); - throw anEx; - } - return aC; - } - - // Get all campaign records - public Vector<jCampaignInfo> getCampaignList() throws RemoteException { - Vector<jCampaignInfo> aV=null; - try { - aV = adaptee.getCampaignList(); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getCampaignList() error",ex); - throw anEx; - } - return aV; - - } - - // Update or insert a campaign record - public int saveCampaign(jCampaignInfo aCampaign) throws RemoteException { - int anI; - try { - anI = adaptee.saveCampaign(aCampaign); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI saveCampaign error",ex); - throw anEx; - } - return anI; - - } - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() throws RemoteException { - String aS=null; - try { - aS = adaptee.errorMsg(); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI errorMsg error",ex); - throw anEx; - } - return aS; - } - - protected jCampaign adaptee; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInfo.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInfo.java deleted file mode 100644 index ada4fa593cb9fa247ea9103e55c2d498c254e937..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInfo.java +++ /dev/null @@ -1,64 +0,0 @@ -//# CampaignInfo.h: Structure containing a campaign -//# -//# Copyright (C) 2010 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -package nl.astron.lofar.sas.otb.jotdb2; -// A CampaignInfo struct describes one item/element of the OTDB. An item can -// be node or an parameter. -// Note: it does NOT contain the value of the item. - -public class jCampaignInfo implements java.io.Serializable -{ - public jCampaignInfo () - { - itsID = 0; - } - - public jCampaignInfo (int id) - { - itsID = id; - } - - - - public jCampaignInfo (String name, String title, String PI, String CO_I, String contact) - { - itsName = name; - itsTitle = title; - itsPI = PI; - itsCO_I = CO_I; - itsContact = contact; - } - - - public int ID() - { - return (itsID); - } - - - public String itsName; - public String itsTitle; - public String itsPI; - public String itsCO_I; - public String itsContact; - private int itsID; - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInterface.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInterface.java deleted file mode 100644 index d527abfc6ebbec474935270d4d01c1072c715027..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jCampaignInterface.java +++ /dev/null @@ -1,49 +0,0 @@ -//# jCampaignInterface.java: The RMI interface to the Campaign database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Vector; - -public interface jCampaignInterface extends Remote -{ - // Constants - public static final String SERVICENAME = "jCampaign"; - - - // Get one campaign record. - public jCampaignInfo getCampaign(String name) throws RemoteException; - public jCampaignInfo getCampaign(int ID) throws RemoteException; - - // Get all campaign records - public Vector<jCampaignInfo> getCampaignList() throws RemoteException; - - // Update or insert a campaign record - public int saveCampaign(jCampaignInfo aCampaign) throws RemoteException; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() throws RemoteException; - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jClassifConv.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jClassifConv.java deleted file mode 100644 index 53d968fbea9838f632b763145247ef333b69273c..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jClassifConv.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jClassifConv.java : Classif converter -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.HashMap; - -public class jClassifConv { - - public jClassifConv () - { - try { - initClassifConv(); - } catch (Exception ex) { - System.out.println("Error during init: "+ex); - } - } - - private native void initClassifConv() throws Exception; - public native short get(String jarg1) throws Exception; - public native String get(short jarg1) throws Exception; - - // java doesn't implement reference arguments, so the - // initial call bool get(long type, string typename) - // can't be made easily here/ Choice has been made to gather the complete - // list in the c++ wrapper and return it completely here. - public native HashMap<Short,String> getTypes() throws Exception; - public native void top() throws Exception; - public native boolean next() throws Exception; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverter.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverter.java deleted file mode 100644 index e91522e100685940c64a540bd60eeed198bc88c3..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverter.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * jConverter.java - * - * Created on February 17, 2006, 2:13 PM - * - * To change this template, choose Tools | Options and locate the template under - * the Source Creation and Management node. Right-click the template and choose - * Open. You can then make changes to the template in the Source Editor. - */ - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.rmi.RemoteException; -import java.util.HashMap; - -/** - * - * @author coolen - */ -public class jConverter { - private jClassifConv itsCC; - private jParamTypeConv itsPTC; - private jTreeStateConv itsTSC; - private jTreeTypeConv itsTTC; - private jUnitConv itsUC; - - /** Creates a new instance of jConverter */ - public jConverter() { - initConverter() ; - } - - private void initConverter() { - // instantiate all possible converters - itsCC = new jClassifConv(); - itsPTC = new jParamTypeConv(); - itsTSC = new jTreeStateConv(); - itsTTC = new jTreeTypeConv(); - itsUC = new jUnitConv(); - } - - public short getClassif(String aConv) throws RemoteException{ - short aS; - try { - aS=itsCC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getClassif(String) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public String getClassif(short aConv) throws RemoteException { - String aS=null; - try { - aS=itsCC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getClassif(Short) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getClassif() throws RemoteException { - HashMap<Short,String> aM=null; - try { - aM = itsCC.getTypes(); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getClassif() error"); - anEx.initCause(ex); - throw anEx; - } - return aM; - } - - public short getParamType(String aConv) throws RemoteException { - short aS; - try { - aS = itsPTC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getParamType(String) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public String getParamType(short aConv) throws RemoteException { - String aS=null; - try { - aS = itsPTC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getParamType(Short) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getParamType() throws RemoteException { - HashMap<Short,String> aM=null; - try { - aM = itsPTC.getTypes(); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getClassif() error"); - anEx.initCause(ex); - throw anEx; - } - return aM; - } - public short getTreeState(String aConv) throws RemoteException { - short aS; - try { - aS = itsTSC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getTreeState(String) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public String getTreeState(short aConv) throws RemoteException { - String aS=null; - try { - aS = itsTSC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getTreeState(short) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getTreeState() throws RemoteException { - HashMap<Short,String> aM=null; - try { - aM = itsTSC.getTypes(); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getTreeState() error"); - anEx.initCause(ex); - throw anEx; - } - return aM; - } - public short getTreeType(String aConv) throws RemoteException { - short aS; - try { - aS = itsTTC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getTreeType(String) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public String getTreeType(short aConv) throws RemoteException { - String aS=null; - try { - aS = itsTTC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getTreeType(short) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getTreeType() throws RemoteException { - HashMap<Short,String> aM=null; - try { - aM =itsTTC.getTypes(); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getTreeType() error"); - anEx.initCause(ex); - throw anEx; - } - return aM; - } - public short getUnit(String aConv) throws RemoteException { - short aS; - try { - aS = itsUC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getUnit(String) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public String getUnit(short aConv) throws RemoteException { - String aS=null; - try { - aS =itsUC.get(aConv); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getUnit(short) error"); - anEx.initCause(ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getUnit() throws RemoteException { - HashMap<Short,String> aM=null; - try { - aM =itsUC.getTypes(); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getUnit() error"); - anEx.initCause(ex); - throw anEx; - } - return aM; - } - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverterAdapter.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverterAdapter.java deleted file mode 100644 index efec29a5c07bc43803892a26d59dfa9ede12c685..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverterAdapter.java +++ /dev/null @@ -1,238 +0,0 @@ -//# jConverterAdapter.java: -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; -import java.util.HashMap; -import org.apache.log4j.Logger; - -public class jConverterAdapter extends UnicastRemoteObject implements jConverterInterface -{ - // Create a Log4J logger instance - static Logger logger = Logger.getLogger(jTreeMaintenanceAdapter.class); - - // Constructor - public jConverterAdapter (jConverter adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - public short getClassif (String aConv) throws RemoteException - { - short aS; - try { - aS=adaptee.getClassif (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getClassif(String) error",ex); - throw anEx; - } - return aS; - } - - public String getClassif (short aConv) throws RemoteException - { - String aS=""; - try { - aS = adaptee.getClassif (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getClassif(short) error",ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getClassif() throws RemoteException - { - HashMap<Short,String> aM=null; - try { - aM = adaptee.getClassif(); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getClassif() error",ex); - throw anEx; - } - return aM; - } - - public short getParamType (String aConv) throws RemoteException - { - short aS; - try { - aS = adaptee.getParamType (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getParamType(String) error",ex); - throw anEx; - } - return aS; - } - - public String getParamType (short aConv) throws RemoteException - { - String aS=""; - try { - aS = adaptee.getParamType (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getParamType(short) error",ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getParamType() throws RemoteException - { - HashMap<Short,String> aM=null; - try { - aM = adaptee.getParamType(); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getParamType() error",ex); - throw anEx; - } - return aM; - } - - public short getTreeState (String aConv) throws RemoteException - { - short aS; - try { - aS = adaptee.getTreeState (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeState(String) error",ex); - throw anEx; - } - return aS; - } - - public String getTreeState (short aConv) throws RemoteException - { - String aS=""; - try { - aS = adaptee.getTreeState (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeState(short) error",ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getTreeState() throws RemoteException - { - HashMap<Short,String> aM=null; - try { - aM = adaptee.getTreeState(); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeState() error",ex); - throw anEx; - } - return aM; - } - - public short getTreeType (String aConv) throws RemoteException - { - short aS; - try { - aS = adaptee.getTreeType (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeType(String) error",ex); - throw anEx; - } - return aS; - } - - public String getTreeType (short aConv) throws RemoteException - { - String aS=""; - try { - aS = adaptee.getTreeType (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeType(short) error",ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getTreeType() throws RemoteException - { - HashMap<Short,String> aM=null; - try { - aM = adaptee.getTreeType(); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeType() error",ex); - throw anEx; - } - return aM; - } - - public short getUnit (String aConv) throws RemoteException - { - short aS; - try { - aS = adaptee.getUnit (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getUnit(String) error",ex); - throw anEx; - } - return aS; - } - - public String getUnit (short aConv) throws RemoteException - { - String aS=""; - try { - aS = adaptee.getUnit (aConv); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getUnit(short) error",ex); - throw anEx; - } - return aS; - } - - public HashMap<Short,String> getUnit() throws RemoteException - { - HashMap<Short,String> aM=null; - try { - aM = adaptee.getUnit(); - } catch (RemoteException ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getUnit() error",ex); - throw anEx; - } - return aM; - } - - - protected jConverter adaptee; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverterInterface.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverterInterface.java deleted file mode 100644 index 3d3de02b50e88f737e27c8e7d0182187c413a5f9..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jConverterInterface.java +++ /dev/null @@ -1,52 +0,0 @@ -//# jConverterInterface.java: The RMI interface to the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.HashMap; - -public interface jConverterInterface extends Remote -{ - // Constants - public static final String SERVICENAME = "jConverter"; - - public short getClassif (String aConv) throws RemoteException; - public String getClassif (short aConv) throws RemoteException; - public HashMap<Short,String> getClassif() throws RemoteException; - - public short getParamType (String aConv) throws RemoteException; - public String getParamType (short aConv) throws RemoteException; - public HashMap<Short,String> getParamType() throws RemoteException; - - public short getTreeState (String aConv) throws RemoteException; - public String getTreeState (short aConv) throws RemoteException; - public HashMap<Short,String> getTreeState() throws RemoteException; - - public short getTreeType (String aConv) throws RemoteException; - public String getTreeType (short aConv) throws RemoteException; - public HashMap<Short,String> getTreeType() throws RemoteException; - - public short getUnit (String aConv) throws RemoteException; - public String getUnit (short aConv) throws RemoteException; - public HashMap<Short,String> getUnit() throws RemoteException; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jInitCPPLogger.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jInitCPPLogger.java deleted file mode 100644 index 5c2b083b7c1265a6c15073f981a59a76245f3f36..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jInitCPPLogger.java +++ /dev/null @@ -1,41 +0,0 @@ -//# jInitCPPLogger.java: Hooks the c++ logger to the java interface -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.rmi.RemoteException; - - -public class jInitCPPLogger { - public jInitCPPLogger(String logName) throws RemoteException{ - try { - initLogger(logName); - } catch (Exception ex) { - RemoteException anEx=new RemoteException("JNI getNames error"); - anEx.initCause(ex); - throw anEx; - } - } - - private native void initLogger(String logName) throws Exception; -} - diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDB2.log_prop b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDB2.log_prop deleted file mode 100755 index d1654137267e2ab9257809faad80a5a160d914b6..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDB2.log_prop +++ /dev/null @@ -1,27 +0,0 @@ -log4j.rootLogger=TRACE, STDOUT, FILE -log4j.additivity.ASTRON=FALSE - -log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender -log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout -log4j.appender.STDOUT.layout.ConversionPattern=%d [%t] %-5p (%F:%L) %m%n - -log4j.appender.FILE=org.apache.log4j.RollingFileAppender -log4j.appender.FILE.File=jOTDB2.log -log4j.appender.FILE.MaxFileSize=10MB -log4j.appender.FILE.MaxBackupIndex=10 -log4j.appender.FILE.layout=org.apache.log4j.PatternLayout -log4j.appender.FILE.layout.ConversionPattern=%d [%t] %-5p (%F:%L) %m%n - -log4j.appender.DUMP=org.apache.log4j.NullAppender - -# Configure the rootLogger -log4cplus.rootLogger=DEBUG, STDOUT -# Define the STDOUT appender -log4cplus.appender.STDOUT=log4cplus::ConsoleAppender -log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout -log4cplus.appender.STDOUT.layout.ConversionPattern=%-5p [%x]%c{3} - %m%n -log4cplus.appender.STDOUT.ImmediateFlush=true - -# Define TRC at level INFO -log4cplus.logger.TRC=TRACE3 -#log4cplus.logger.TRC=INFO diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBadapter.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBadapter.java deleted file mode 100644 index 9e9c69ed34e9c61496e60259efc7b8883cc929dd..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBadapter.java +++ /dev/null @@ -1,145 +0,0 @@ -//# jOTDBadapter.java: The RMI adapter of the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; -import org.apache.log4j.Logger; - -public class jOTDBadapter extends UnicastRemoteObject implements jOTDBinterface { - - // Create a Log4J logger instance - static Logger logger = Logger.getLogger(jTreeMaintenanceAdapter.class); - - // Constructor - public jOTDBadapter (jOTDBconnection adaptee) throws RemoteException { - this.adaptee = adaptee; - } - - // To test if we are (still) connected. - public boolean isConnected () throws RemoteException { - boolean aB=false; - try { - aB=adaptee.isConnected (); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI isConnected error",ex); - throw anEx; - } - return aB; - } - - // To connect or reconnect in case the connection was lost - public boolean connect () throws RemoteException { - boolean aB=false; - try { - aB = adaptee.connect (); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI connect error",ex); - throw anEx; - } - return aB; - } - - // get OTDBtree of one specific tree - public jOTDBtree getTreeInfo (int atreeID,boolean isMomID) throws RemoteException { - jOTDBtree aT=null; - try { - aT = adaptee.getTreeInfo (atreeID,isMomID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeInfo error",ex); - throw anEx; - } - return aT; - - } - - - - // To get a list of all StateChanges - public Vector<jTreeState> getStateList (int treeID, boolean isMomID, String beginDate, String endDate) throws RemoteException { - Vector<jTreeState> aV=null; - try { - aV = adaptee.getStateList (treeID, isMomID, beginDate, endDate); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getStateList error",ex); - throw anEx; - } - return aV; - } - - // To get a list of all OTDB trees available in the database. - public Vector<jOTDBtree> getTreeList (short treeType, short classifiType) throws RemoteException { - Vector<jOTDBtree> aV=null; - try { - aV = adaptee.getTreeList (treeType, classifiType); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTreeList error",ex); - throw anEx; - } - return aV; - } - - public String errorMsg () throws RemoteException { - String aS=null; - try { - aS = adaptee.errorMsg (); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI errorMsg error",ex); - throw anEx; - } - return aS; - } - - public int getAuthToken () throws RemoteException { - int anI; - try { - anI = adaptee.getAuthToken (); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getAuthToken error",ex); - throw anEx; - } - return anI; - } - - public String getDBName () throws RemoteException { - String aS=null; - try { - aS = adaptee.getDBName (); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getDBName error",ex); - throw anEx; - } - return aS; - } - - protected jOTDBconnection adaptee; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBconnection.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBconnection.java deleted file mode 100644 index 481d1616706babf47f71db3dc6252708dd97c963..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBconnection.java +++ /dev/null @@ -1,71 +0,0 @@ -//# jOTDBconnection.java: Manages the connection with the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.Vector; - -public class jOTDBconnection -{ - // Just creates an object and registers the connection parameters. - public jOTDBconnection (String username, String passwd, String database, String hostname) - { - try { - initOTDBconnection (username, passwd, database, hostname); - } catch (Exception ex) { - System.out.println("Error during connection init :" + ex); - } - } - - public jOTDBconnection() - { - try { - initOTDBconnection("paulus", "boskabouter", "otdbtest" , "dop50.astron.nl"); - } catch (Exception ex) { - System.out.println("Error during connection init :" + ex); - } - } - - - // Create a OTDBconnection instance - private native void initOTDBconnection (String username, String passwd, String database, String hostname) throws Exception; - - // To test if we are (still) connected. - public native boolean isConnected() throws Exception; - - // To connect or reconnect in case the connection was lost - public native boolean connect() throws Exception; - - // get OTDBtree of one specific tree - public native jOTDBtree getTreeInfo (int atreeID, boolean isMomID)throws Exception ; - - public native Vector<jTreeState> getStateList(int atreeID, boolean isMomID ,String beginDate, String endDate) throws Exception; - - - // To get a list of all OTDB trees available in the database. - public native Vector<jOTDBtree> getTreeList(short treeType, short classifiType) throws Exception; - - public native String errorMsg() throws Exception; - - public native int getAuthToken() throws Exception; - - public native String getDBName() throws Exception; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBinterface.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBinterface.java deleted file mode 100644 index e3052e6963bd07d617a26ba27b29c46107ebc6e4..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBinterface.java +++ /dev/null @@ -1,55 +0,0 @@ -//# jOTDBinterface.java: The RMI interface to the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Vector; - -public interface jOTDBinterface extends Remote -{ - // Constants - public static final String SERVICENAME = "jOTDB"; - - // To test if we are (still) connected. - public boolean isConnected () throws RemoteException; - - // To connect or reconnect in case the connection was lost - public boolean connect () throws RemoteException; - - // get OTDBtree of one specific tree - public jOTDBtree getTreeInfo (int atreeID,boolean isMomID) throws RemoteException; - - // To get a list of all OTDB trees available in the database. - public Vector<jOTDBtree> getTreeList (short treeType, short classifiType) throws RemoteException; - - // To get a list of all OTDB trees available in the database. - public Vector<jTreeState> getStateList (int treeID, boolean isMomID, String beginDate, String endDate) throws RemoteException; - - public String errorMsg () throws RemoteException; - - public int getAuthToken () throws RemoteException; - - public String getDBName () throws RemoteException; - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBnode.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBnode.java deleted file mode 100644 index 41e07be61837512deeb6f8869cde406e3f8a28a7..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBnode.java +++ /dev/null @@ -1,69 +0,0 @@ -//# jOTDBnode.java: Structure containing a tree node. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -public class jOTDBnode implements java.io.Serializable -{ - public jOTDBnode (int treeID, int nodeID, int parentID, int paramDefID) - { - index = 0; - leaf = false; - instances = 0; - itsTreeID = treeID; - itsNodeID = nodeID; - itsParentID = parentID; - itsParamDefID = paramDefID; - } - - public int treeID() - { - return (itsTreeID); - } - - public int nodeID() - { - return (itsNodeID); - } - - public int parentID() - { - return (itsParentID); - } - - public int paramDefID() - { - return (itsParamDefID); - } - - public String name; - public short index; - public boolean leaf; - public short instances; //# only VICtemplate - public String limits; //# only VICtemplate - public String description; //# only VICtemplate - - // private members - private int itsTreeID; - private int itsNodeID; - private int itsParentID; - private int itsParamDefID; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBparam.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBparam.java deleted file mode 100644 index 76ae9d73b171bf87ec4a05da5eb443ae3aaba7cf..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBparam.java +++ /dev/null @@ -1,61 +0,0 @@ -//# jOTDBparam.java:Structure describing one parameter. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -public class jOTDBparam implements java.io.Serializable -{ - public jOTDBparam (int treeID, int paramID, int NodeID) - { - itsTreeID = treeID; - itsParamID = paramID; - itsNodeID = NodeID; - } - - public int treeID() - { - return (itsTreeID); - } - - public int paramID() - { - return (itsParamID); - } - - public int nodeID() - { - return (itsNodeID); - } - - public String name; - public short index; - public short type; // node / bool / int / long / float / etc. - public short unit; - public short pruning; - public short valMoment; - public boolean runtimeMod; - public String limits; - public String description; - - private int itsTreeID; - private int itsParamID; - private int itsNodeID; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBserver.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBserver.java deleted file mode 100644 index d6fa8833c67a826676d443f23c4094b93aa1ad56..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBserver.java +++ /dev/null @@ -1,195 +0,0 @@ -//# jOTDBserver.java: The RMI server of the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; -import java.rmi.registry.*; -import nl.astron.lofar.lofarutils.remoteFileAdapter; -import nl.astron.lofar.lofarutils.remoteFileInterface; -import org.apache.log4j.Logger; -import org.apache.log4j.PropertyConfigurator; - - - -public class jOTDBserver { - private static jOTDBconnection jOTDBconnAdaptee; - private static jOTDBadapter jOTDBconnAdapter; - private static jTreeMaintenance jTreeMainAdaptee; - private static jTreeMaintenanceAdapter jTreeMainAdapter; - private static jCampaign jCampaignAdaptee; - private static jCampaignAdapter jCampaignAdapter; - private static jTreeValue jTreeValueAdaptee; - private static jTreeValueAdapter jTreeValueAdapter; - private static jConverter jConverterAdaptee; - private static jConverterAdapter jConverterAdapter; - private static remoteFileAdapter remoteFileAdapter; - - static - { - System.loadLibrary("jotdb2"); - } - - static Logger logger = Logger.getLogger(jOTDBserver.class); - - public static void main(String[] args) { - try { - String logConfig = "jOTDB2.log_prop"; - - PropertyConfigurator.configure(logConfig); -// jInitCPPLogger aCPPLogger=new jInitCPPLogger(logConfig); - logger.info("jOTDBServer started. LogPropFile: "+ logConfig); - -// if (System.getSecurityManager () == null) -// { -// System.out.println ("No security mananger is running, will start one now..."); -// System.setSecurityManager (new RMISecurityManager ()); -// } - - if (args.length < 5) { - System.out.println("Usage: java -jar jOTDBserver.jar <username> <password> <database> <db-hostname> <hostname> <rmiportnumber-OPTIONAL> <rmi objects portnumber for firewall/tunneling purposes-OPTIONAL>"); - System.exit(0); - } - - - String aHostName = new String(args[4]); - - logger.info("Running on: "+aHostName); - System.setProperty("java.rmi.server.hostname", aHostName); - - - Registry localRegistry = null; - int objectPort = 0; - - if (args.length == 5){ - logger.info("jOTDBserver creating a local RMI registry on port "+Registry.REGISTRY_PORT+" ..."); - localRegistry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT); - }else if (args.length > 5) { - Integer rmiPort = new Integer(args[5]); - logger.info("jOTDBserver creating a local RMI registry on port "+rmiPort+" ..."); - localRegistry = LocateRegistry.createRegistry(rmiPort.intValue()); - if (args.length ==7){ - Integer rmiObjectsPort = new Integer(args[6]); - logger.info("jOTDBserver setting up RMI server objects on port "+rmiObjectsPort+" ..."); -// RMISocketFactory socketFactory = RMISocketFactory.getDefaultSocketFactory(); -// socketFactory.createServerSocket(rmiObjectsPort); - objectPort = rmiObjectsPort; - } - } - - logger.info("jOTDBserver creating local object and remote adapter..."); - - // Export jOTDBconnection - jOTDBconnAdaptee = new jOTDBconnection(args[0], args[1], args[2], args[3]); - jOTDBconnAdapter = new jOTDBadapter(jOTDBconnAdaptee); - //A custom port was specified, export the object using the port specified - if(objectPort!=0){ - jOTDBadapter.unexportObject(jOTDBconnAdapter,true); - jOTDBadapter.exportObject(jOTDBconnAdapter,objectPort); - } - logger.info("jOTDBserver publishing service " + jOTDBinterface.SERVICENAME + " in local registry..."); - - localRegistry.rebind(jOTDBinterface.SERVICENAME, jOTDBconnAdapter); - - logger.info("Published jOTDBinterface as service " + jOTDBinterface.SERVICENAME + ". Ready..."); - - // Export jTreeMaintenance - jTreeMainAdaptee = new jTreeMaintenance(); - jTreeMainAdapter = new jTreeMaintenanceAdapter(jTreeMainAdaptee); - //A custom port was specified, export the object using the port specified - if(objectPort!=0){ - jTreeMaintenanceAdapter.unexportObject(jTreeMainAdapter,true); - jTreeMaintenanceAdapter.exportObject(jTreeMainAdapter,objectPort); - } - logger.info("jOTDBserver publishing service " + jTreeMaintenanceInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind(jTreeMaintenanceInterface.SERVICENAME, jTreeMainAdapter); - - // Export jCampaign - jCampaignAdaptee = new jCampaign(); - jCampaignAdapter = new jCampaignAdapter(jCampaignAdaptee); - //A custom port was specified, export the object using the port specified - if(objectPort!=0){ - jCampaignAdapter.unexportObject(jCampaignAdapter,true); - jCampaignAdapter.exportObject(jCampaignAdapter,objectPort); - } - logger.info("jOTDBserver publishing service " + jCampaignInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind(jCampaignInterface.SERVICENAME, jCampaignAdapter); - - // Export jTreeValue - jTreeValueAdaptee = new jTreeValue(); - jTreeValueAdapter = new jTreeValueAdapter(jTreeValueAdaptee); - //A custom port was specified, export the object using the port specified - if(objectPort!=0){ - jTreeValueAdapter.unexportObject(jTreeValueAdapter,true); - jTreeValueAdapter.exportObject(jTreeValueAdapter,objectPort); - } - logger.info("jOTDBserver publishing service " + jTreeValueInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind(jTreeValueInterface.SERVICENAME, jTreeValueAdapter); - - logger.info("Published jTreeValueInterface as service " + jTreeValueInterface.SERVICENAME + ". Ready..."); - - // Export jConverter - jConverterAdaptee = new jConverter(); - jConverterAdapter = new jConverterAdapter(jConverterAdaptee); - //A custom port was specified, export the object using the port specified - if(objectPort!=0){ - jConverterAdapter.unexportObject(jConverterAdapter,true); - jConverterAdapter.exportObject(jConverterAdapter,objectPort); - } - logger.info("jOTDBserver publishing service " + jConverterInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind(jConverterInterface.SERVICENAME, jConverterAdapter); - - logger.info("Published jConverterInterface as service " + jConverterInterface.SERVICENAME + ". Ready..."); - - // Export remoteFile - remoteFileAdapter = new remoteFileAdapter(remoteFileInterface.SERVICENAME); - //A custom port was specified, export the object using the port specified - if(objectPort!=0){ - remoteFileAdapter.unexportObject(remoteFileAdapter,true); - remoteFileAdapter.exportObject(remoteFileAdapter,objectPort); - } - logger.info("jOTDBserver publishing service " + remoteFileInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind(remoteFileInterface.SERVICENAME, remoteFileAdapter); - - logger.info("Published remoteFileInterface as service " + remoteFileInterface.SERVICENAME + ". Ready..."); - - - - - - String statusmessage = "jOTDBserver is ready for incoming calls"; - if (args.length > 5) { - Integer rmiPort = new Integer(args[5]); - statusmessage += " on rmi registry port "+rmiPort; - if (args.length ==7){ - Integer rmiObjectsPort = new Integer(args[6]); - statusmessage += " and rmi server object port "+rmiObjectsPort +". Please tunnel/forward both ports for your client to work"; - } - } - statusmessage+="..."; - - logger.info(statusmessage); - } - - catch (Exception e) { - //e.printStackTrace(); - logger.fatal("jOTDB server failed: " + e); - } - } -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBtree.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBtree.java deleted file mode 100644 index cbdd392552cda909c6867f4ae42935a846e39063..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBtree.java +++ /dev/null @@ -1,70 +0,0 @@ -//# jOTDBconnection.java: Manages the connection with the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -public class jOTDBtree implements java.io.Serializable -{ - public jOTDBtree () - { - itsTreeID = 0; - itsMomID=0; - } - - public jOTDBtree (int treeID) - { - itsTreeID = treeID; - itsMomID = 0; - } - - public jOTDBtree (int treeID, int momID) - { - itsTreeID = treeID; - itsMomID = momID; - } - - - public int treeID() - { - return (itsTreeID); - } - - public int momID() - { - return (itsMomID); - } - - public short classification; // development / test / operational - public String creator; - public String creationDate; - public short type; // hardware / VItemplate / VHtree - public short state; // idle / configure / ... / active / ... - public String description; // free text - - // -- VIC only -- - public int originalTree; - public String campaign; - public String starttime; - public String stoptime; - private int itsTreeID; - private int itsMomID; - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBvalue.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBvalue.java deleted file mode 100644 index 7636d8655886040837726dbdd63761eae2a04b9b..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jOTDBvalue.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jOTDBvalue.java: -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -public class jOTDBvalue implements java.io.Serializable -{ - public jOTDBvalue (int nodeID) - { - itsNodeID = nodeID; - } - - public jOTDBvalue (String aName, String aValue, String aTime) - { - name = aName; - value = aValue; - time = aTime; - } - - public int nodeID () - { - return itsNodeID; - } - - public String name; - public String value; - public String time; - - private int itsNodeID; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jParamTypeConv.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jParamTypeConv.java deleted file mode 100644 index 927d9b9d5dd41f30df263b629103dd4b8bc10b36..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jParamTypeConv.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jParamTypeConv.java : ParamType converter -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.HashMap; - -public class jParamTypeConv { - - public jParamTypeConv () - { - try { - initParamTypeConv(); - } catch (Exception ex) { - System.out.println("Error during init :"+ex); - } - } - - private native void initParamTypeConv() throws Exception; - public native short get(String jarg1) throws Exception; - public native String get(short jarg1) throws Exception; - - // java doesn't implement reference arguments, so the - // initial call bool get(long type, string typename) - // can't be made easily here/ Choice has been made to gather the complete - // list in the c++ wrapper and return it completely here. - public native HashMap<Short,String> getTypes() throws Exception; - public native void top() throws Exception; - public native boolean next() throws Exception; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenance.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenance.java deleted file mode 100644 index 4970e49090d2e05aeee7489ada4eefc28fac9c68..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenance.java +++ /dev/null @@ -1,173 +0,0 @@ -//# jOTDBtreeMaintenance.java: Maintenance on complete trees. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.Vector; - -public class jTreeMaintenance -{ - - public jTreeMaintenance () - { - try { - initTreeMaintenance (); - } catch (Exception ex) { - System.out.println("Error during jTreeMaintenance init : " +ex); - } - } - - private native void initTreeMaintenance () throws Exception; - - //# --- PIC maintenance --- - // Once in a while a new PIC tree will be loaded from PVSS which manages - // the master PIC. The master PIC will be in a exported ASCII file, with - // loadMasterFile this file can be added. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public native int loadMasterFile (String filename) throws Exception; - - //# --- VIC maintenance : Components --- - // A VIC tree is build up from single components. The definitions of the - // components can loaded from a file with this call - public native int loadComponentFile (String filename,String forcedVersionNr,String forcedQualifier) throws Exception; - - // Find the top-components in the components table. - public native Vector<jVICnodeDef> getComponentList (String name , boolean topOnly) throws Exception; - - // Get the node definition of a VC node - public native jVICnodeDef getComponentNode(int aNodeID) throws Exception; - - // Get parameterlist of the component - public native Vector<jOTDBparam> getComponentParams(int aNodeID) throws Exception; - - // Save new node or update the limits and description fields of the node - public native boolean saveComponentNode(jVICnodeDef aNode) throws Exception; - - // test if component is a top-component - public native boolean isTopComponent(int aNodeID) throws Exception; - - // delete a component node - public native boolean deleteComponentNode(int aNodeID) throws Exception; - - // get full component name (including version in name) - public native String getFullComponentName(jVICnodeDef aNode) throws Exception; - - //# --- VIC maintenance : Templates --- - // From a component tree a template tree can be constructed. In a template - // tree only the structure of the tree is created, there is no replication - // of nodes on the same level. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - // ABOUT TO BECOME OBSOLETE WHEN OTB IS READY - public native int buildTemplateTree (int topNodeID, short aClassif) throws Exception; - - - // Create a new OTDBtree record for an Template tree in the database - // and return its treeID. - public native int newTemplateTree() throws Exception; - - // Make a copy of an existing template tree. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public native int copyTemplateTree (int aTreeID) throws Exception; - - // Get a single node from the VIC template tree - public native jOTDBnode getNode (int aTreeID, int aNodeID) throws Exception; - - // Get the parameter definition of a node - public native jOTDBparam getParam(int aTreeID,int aParamID) throws Exception; - - // Get the parameter definition of a node. Will recursively follow the - // references in the limits field. - public native jOTDBparam getParam(jOTDBnode aNode) throws Exception; - - // Save the parameter definition - public native boolean saveParam(jOTDBparam aParam) throws Exception; - - // Get a number of levels of children. - public native Vector<jOTDBnode> getItemList (int aTreeID, int topNode, int depth) throws Exception; - - // Get a list of nodes based on a namefragment. Use '%' as wildchar. - public native Vector<jOTDBnode> getItemList (int aTreeID, String aNameFragment) throws Exception; - - // Duplicates the given node (and its parameters and children) - // in the template database. The duplicate gets the new index. - public native int dupNode (int aTreeID, int orgNodeID, short newIndex) throws Exception; - - // Adds the given VIC Component under the given parent of a - // template tree. - public native int addComponent (int compID,int treeID,int parentID, String newName) throws Exception; - - // Updates the (vector of) OTDBnodes to the database. - public native boolean saveNode (jOTDBnode aNode) throws Exception; - public native boolean saveNodeList (Vector aNodeList) throws Exception; - - // Updates the (vector of) OTDBnodes to the database. - public native boolean deleteNode (jOTDBnode aNode) throws Exception; - public native boolean deleteNodeList (Vector aNodeList) throws Exception; - - // Evaluate the constraints from a (sub)tree. - public native boolean checkTreeConstraints (int aTreeID, int topNode) throws Exception; - - - //# --- VIC maintenance : Hierarchical trees --- - // From a template tree a fully instanciated tree can be build. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public native int instanciateTree (int baseTree) throws Exception; - - // Prune an instanciated tree to get loss of depricated values. - public native boolean pruneTree (int aTreeID, short pruningLevel) throws Exception; - - // Export a VIC (sub)tree to a file. The user may choose in which format - // the tree is exported: HTML, KeyValue List. - public native boolean exportTree (int aTreeID,int topItem,String filename, - int outputFormat,boolean folded) throws Exception; - - - //# --- Finally some general tree maintenance --- - // Delete a tree (of any kind) from the database. - public native boolean deleteTree (int aTreeID) throws Exception; - - // Retrieve the topNode of any tree - public native jOTDBnode getTopNode (int aTreeID) throws Exception; - - // save modified OTDBtree information - public native boolean setMomInfo(int aTreeID, int momID, String campaign) throws Exception; - - // Set the classification of any tree. - public native boolean setClassification (int aTreeID, short aClassification) throws Exception; - - // Set the state of any tree. When changing the state of a tree all - // constraints/validations for the current type must be fulfilled. - // When errors occur these can be retrieved with the errorMsg function. - public native boolean setTreeState (int aTreeID, short aState) throws Exception; - - - // Update the description of a tree. - public native boolean setDescription(int aTreeID,String aDescription) throws Exception; - - // Set the scheduling times of the tree - public native boolean setSchedule(int aTreeID, String aStartTime,String aStopTime) throws Exception; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public native String errorMsg() throws Exception; - - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenanceAdapter.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenanceAdapter.java deleted file mode 100644 index 67122e1a604a59091f51adf66e7cc256cb5da674..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenanceAdapter.java +++ /dev/null @@ -1,533 +0,0 @@ -//# jTreeMaintenanceAdapter.java: The RMI adapter of the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; -import org.apache.log4j.Logger; - -public class jTreeMaintenanceAdapter extends UnicastRemoteObject implements jTreeMaintenanceInterface -{ - - // Create a Log4J logger instance - static Logger logger = Logger.getLogger(jTreeMaintenanceAdapter.class); - - // Constructor - public jTreeMaintenanceAdapter (jTreeMaintenance adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - - - //# --- PIC maintenance --- - // Once in a while a new PIC tree will be loaded from PVSS which manages - // the master PIC. The master PIC will be in a exported ASCII file, with - // loadMasterFile this file can be added. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int loadMasterFile (String filename) throws RemoteException { - int anI; - try { - anI = adaptee.loadMasterFile(filename); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI loadMasterFile error",ex); - throw anEx; - } - return anI; - } - - //# --- VIC maintenance : Components --- - // A VIC tree is build up from single components. The definitions of the - // components can loaded from a file with this call - public int loadComponentFile (String filename,String forcedVersionNr, String forcedQualifier) throws RemoteException { - int anI; - try { - anI = adaptee.loadComponentFile(filename,forcedVersionNr,forcedQualifier); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI loadComponentFile error",ex); - throw anEx; - } - return anI; - } - - // Find the top-components in the components table. - public Vector<jVICnodeDef> getComponentList (String name , boolean topOnly) throws RemoteException { - Vector<jVICnodeDef> aV=null; - try { - aV = adaptee.getComponentList(name,topOnly); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getComponentList error",ex); - throw anEx; - } - return aV; - } - - // Get the node definition of a VC node - public jVICnodeDef getComponentNode(int aNodeID) throws RemoteException { - jVICnodeDef aN=null; - try { - aN = adaptee.getComponentNode(aNodeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getComponentNode error",ex); - throw anEx; - } - return aN; - } - - // Get parameterlist of the component - public Vector<jOTDBparam> getComponentParams(int aNodeID) throws RemoteException { - Vector<jOTDBparam> aP=null; - try { - aP = adaptee.getComponentParams(aNodeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getComponentsParam error",ex); - throw anEx; - } - return aP; - } - - // Save new node or update the limits and description fields of the node - public boolean saveComponentNode(jVICnodeDef aNode) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.saveComponentNode(aNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI saveComponentNode error",ex); - throw anEx; - } - return aB; - } - - // test if component is a top-component - public boolean isTopComponent(int aNodeID) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.isTopComponent(aNodeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI isTopComponent error",ex); - throw anEx; - } - return aB; - } - - // delete a component node - public boolean deleteComponentNode(int aNodeID) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.deleteComponentNode(aNodeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI deleteComponentNode error",ex); - throw anEx; - } - return aB; - } - - // get full Component Name - public String getFullComponentName(jVICnodeDef aNode) throws RemoteException { - String aS=""; - try { - aS = adaptee.getFullComponentName(aNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getFullComponentName error",ex); - throw anEx; - } - return aS; - } - - //# --- VIC maintenance : Templates --- - // From a component tree a template tree can be constructed. In a template - // tree only the structure of the tree is created, there is no replication - // of nodes on the same level. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int buildTemplateTree (int topNodeID, short aClassif) throws RemoteException { - int anI; - try { - anI = adaptee.buildTemplateTree (topNodeID, aClassif); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI buildTemplateTree error",ex); - throw anEx; - } - return anI; - } - - // Create a new OTDBtree record for an Template tree in the database - // and return its treeID. - public int newTemplateTree() throws RemoteException { - int anI; - try { - anI = adaptee.newTemplateTree(); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI newTemplateTree error",ex); - throw anEx; - } - return anI; - } - - // Make a copy of an existing template tree. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int copyTemplateTree (int aTreeID) throws RemoteException { - int anI; - try { - anI = adaptee.copyTemplateTree (aTreeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI copyTemplateTree error",ex); - throw anEx; - } - return anI; - } - - // Get a single node from the VIC template tree - public jOTDBnode getNode (int aTreeID, int aNodeID) throws RemoteException { - jOTDBnode aN=null; - try { - aN = adaptee.getNode (aTreeID, aNodeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getNode error",ex); - throw anEx; - } - return aN; - } - - // Get the parameter definition of a node - public jOTDBparam getParam(int aTreeID,int aParamID) throws RemoteException { - jOTDBparam aP=null; - try { - aP = adaptee.getParam(aTreeID,aParamID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getParam error",ex); - throw anEx; - } - return aP; - } - - // Get the parameter definition of a node. Will recursively follow the - // references in the limits field. - public jOTDBparam getParam(jOTDBnode aNode) throws RemoteException { - jOTDBparam aP=null; - try { - aP = adaptee.getParam(aNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getParam(OTDBnode) error",ex); - throw anEx; - } - return aP; - } - - // Save the parameter definition - public boolean saveParam(jOTDBparam aParam) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.saveParam(aParam); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI saveParam error",ex); - throw anEx; - } - return aB; - } - - // Get a number of levels of children. - public Vector<jOTDBnode> getItemList (int aTreeID, int topNode, int depth) throws RemoteException { - Vector<jOTDBnode> aV=null; - try { - aV = adaptee.getItemList (aTreeID, topNode, depth); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getItemList error",ex); - throw anEx; - } - return aV; - } - - // Get a list of nodes based on a namefragment. Use '%' as wildchar. - public Vector<jOTDBnode> getItemList (int aTreeID, String aNameFragment) throws RemoteException { - Vector<jOTDBnode> aV=null; - try { - aV = adaptee.getItemList (aTreeID, aNameFragment); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getItemList error",ex); - throw anEx; - } - return aV; - } - - // Duplicates the given node (and its parameters and children) - // in the template database. The duplicate gets the new index. - public int dupNode (int aTreeID, int orgNodeID, short newIndex) throws RemoteException { - int anI; - try { - anI = adaptee.dupNode (aTreeID, orgNodeID, newIndex); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI dupNode error",ex); - throw anEx; - } - return anI; - } - - // Adds the given VIC Component under the given parent of a - // template tree. - public int addComponent (int compID,int treeID,int parentID, String newName) throws RemoteException { - int anI; - try { - anI = adaptee.addComponent(compID,treeID,parentID, newName); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI addComponent error",ex); - throw anEx; - } - return anI; - } - - // Updates the (vector of) OTDBnodes to the database. - public boolean saveNode (jOTDBnode aNode) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.saveNode (aNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI saveNode error",ex); - throw anEx; - } - return aB; - - } - - public boolean saveNodeList (Vector aNodeList) throws RemoteException { - boolean aB = false; - try { - aB = adaptee.saveNodeList (aNodeList); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI saveNodeList error",ex); - throw anEx; - } - return aB; - } - - // Updates the (vector of) OTDBnodes to the database. - public boolean deleteNode (jOTDBnode aNode) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.deleteNode (aNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI deleteNode error",ex); - throw anEx; - } - return aB; - } - - public boolean deleteNodeList (Vector aNodeList) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.deleteNodeList (aNodeList); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI deleteNodeList error",ex); - throw anEx; - } - return aB; - } - - // Evaluate the constraints from a (sub)tree. - public boolean checkTreeConstraints (int aTreeID, int topNode) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.checkTreeConstraints (aTreeID, topNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI checkTreeConstraints error",ex); - throw anEx; - } - return aB; - } - - //# --- VIC maintenance : Hierarchical trees --- - // From a template tree a fully instanciated tree can be build. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int instanciateTree (int baseTree) throws RemoteException { - int anI; - try { - anI = adaptee.instanciateTree (baseTree); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI instantiateTree error",ex); - throw anEx; - } - return anI; - } - - // Prune an instanciated tree to get loss of depricated values. - public boolean pruneTree (int aTreeID, short pruningLevel) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.pruneTree (aTreeID, pruningLevel); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI pruneTree error",ex); - throw anEx; - } - return aB; - } - - // Export a VIC (sub)tree to a file. The user may choose in which format - // the tree is exported: HTML, KeyValue List. - public boolean exportTree (int aTreeID,int topItem,String filename,int outputFormat,boolean folded) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.exportTree(aTreeID,topItem,filename,outputFormat,folded); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI exportTree error",ex); - throw anEx; - } - return aB; - } - - //# --- Finally some general tree maintenance --- - // Delete a tree (of any kind) from the database. - public boolean deleteTree (int aTreeID) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.deleteTree (aTreeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI deleteTree error",ex); - throw anEx; - } - return aB; - } - - // Retrieve the topNode of any tree - public jOTDBnode getTopNode (int aTreeID) throws RemoteException { - jOTDBnode aN=null; - try { - aN = adaptee.getTopNode (aTreeID); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getTopNode error",ex); - throw anEx; - } - return aN; - } - - public boolean setMomInfo(int aTreeID, int momID, String campaign) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.setMomInfo(aTreeID, momID, campaign); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI setMomInfo error",ex); - throw anEx; - } - return aB; - } - - // Set the classification of any tree. - public boolean setClassification (int aTreeID, short aClassification) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.setClassification (aTreeID, aClassification); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI setClassification error",ex); - throw anEx; - } - return aB; - } - - // Set the state of any tree. When changing the state of a tree all - // constraints/validations for the current type must be fulfilled. - // When errors occur these can be retrieved with the errorMsg function. - public boolean setTreeState (int aTreeID, short aState) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.setTreeState (aTreeID, aState); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI setTreeState error",ex); - throw anEx; - } - return aB; - } - - - // Update the description of a tree. - public boolean setDescription(int aTreeID,String aDescription) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.setDescription( aTreeID,aDescription); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI setDescription error",ex); - throw anEx; - } - return aB; - } - - // Set the scheduling times of the tree - public boolean setSchedule(int aTreeID, String aStartTime,String aStopTime) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.setSchedule(aTreeID,aStartTime,aStopTime); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI setSchedule error",ex); - throw anEx; - } - return aB; - } - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() throws RemoteException { - String aS=null; - try { - aS = adaptee.errorMsg(); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI errorMsg error",ex); - throw anEx; - } - return aS; - } - - protected jTreeMaintenance adaptee; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenanceInterface.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenanceInterface.java deleted file mode 100644 index 82c5d332a82e8ff046510570705f8a5e17753a61..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeMaintenanceInterface.java +++ /dev/null @@ -1,163 +0,0 @@ -//# jTreeMaintenanceInterface.java: The RMI interface to the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Vector; - -public interface jTreeMaintenanceInterface extends Remote -{ - // Constants - public static final String SERVICENAME = "jTreeMaintenance"; - - - //# --- PIC maintenance --- - // Once in a while a new PIC tree will be loaded from PVSS which manages - // the master PIC. The master PIC will be in a exported ASCII file, with - // loadMasterFile this file can be added. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int loadMasterFile (String filename) throws RemoteException; - - //# --- VIC maintenance : Components --- - // A VIC tree is build up from single components. The definitions of the - // components can loaded from a file with this call - public int loadComponentFile (String filename,String forcedVersionNr, String forcedQualifier) throws RemoteException; - - // Find the top-components in the components table. - public Vector<jVICnodeDef> getComponentList (String name , boolean topOnly) throws RemoteException; - - // Get the node definition of a VC node - public jVICnodeDef getComponentNode(int aNodeID) throws RemoteException; - - // Get parameterlist of the component - public Vector<jOTDBparam> getComponentParams(int aNodeID) throws RemoteException; - - // Save new node or update the limits and description fields of the node - public boolean saveComponentNode(jVICnodeDef aNode) throws RemoteException; - - // test if component is a top-component - public boolean isTopComponent(int aNodeID) throws RemoteException; - - // delete component node - public boolean deleteComponentNode(int aNodeID) throws RemoteException; - - // get full component name - public String getFullComponentName(jVICnodeDef aNode) throws RemoteException; - - //# --- VIC maintenance : Templates --- - // From a component tree a template tree can be constructed. In a template - // tree only the structure of the tree is created, there is no replication - // of nodes on the same level. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int buildTemplateTree (int topNodeID, short aClassif) throws RemoteException; - - // Create a new OTDBtree record for an Template tree in the database - // and return its treeID. - public int newTemplateTree() throws RemoteException; - - // Make a copy of an existing template tree. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int copyTemplateTree (int aTreeID) throws RemoteException; - - - // Get a single node from the VIC template tree - public jOTDBnode getNode (int aTreeID, int aNodeID) throws RemoteException; - - // Get the parameter definition of a node - public jOTDBparam getParam(int aTreeID,int aParamID) throws RemoteException; - - // Get the parameter definition of a node. Will recursively follow the - // references in the limits field. - public jOTDBparam getParam(jOTDBnode aNode) throws RemoteException; - -// Save the parameter definition - public boolean saveParam(jOTDBparam aParam) throws RemoteException; - - // Get a number of levels of children. - public Vector<jOTDBnode> getItemList (int aTreeID, int topNode, int depth) throws RemoteException; - - // Get a list of nodes based on a namefragment. Use '%' as wildchar. - public Vector<jOTDBnode> getItemList (int aTreeID, String aNameFragment) throws RemoteException; - - // Duplicates the given node (and its parameters and children) - // in the template database. The duplicate gets the new index. - public int dupNode (int aTreeID, int orgNodeID, short newIndex) throws RemoteException; - - // Adds the given VIC Component under the given parent of a - // template tree. - public int addComponent (int compID,int treeID,int parentID, String newName) throws RemoteException; - - // Updates the (vector of) OTDBnodes to the database. - public boolean saveNode (jOTDBnode aNode) throws RemoteException; - public boolean saveNodeList (Vector aNodeList) throws RemoteException; - - // Updates the (vector of) OTDBnodes to the database. - public boolean deleteNode (jOTDBnode aNode) throws RemoteException; - public boolean deleteNodeList (Vector aNodeList) throws RemoteException; - - // Evaluate the constraints from a (sub)tree. - public boolean checkTreeConstraints (int aTreeID, int topNode) throws RemoteException; - - //# --- VIC maintenance : Hierarchical trees --- - // From a template tree a fully instanciated tree can be build. - // Returns 0 on failure, otherwise the ID of the new tree is returned. - public int instanciateTree (int baseTree) throws RemoteException; - - // Prune an instanciated tree to get loss of depricated values. - public boolean pruneTree (int aTreeID, short pruningLevel) throws RemoteException; - - // Export a VIC (sub)tree to a file. The user may choose in which format - // the tree is exported: HTML, KeyValue List. - public boolean exportTree (int aTreeID,int topItem,String filename,int outputFormat,boolean folded) throws RemoteException; - - //# --- Finally some general tree maintenance --- - // Delete a tree (of any kind) from the database. - public boolean deleteTree (int aTreeID) throws RemoteException; - - // Retrieve the topNode of any tree - public jOTDBnode getTopNode (int aTreeID) throws RemoteException; - - public boolean setMomInfo(int aTreeID, int momID, String campaign) throws RemoteException; - - - // Set the classification of any tree. - public boolean setClassification (int aTreeID, short aClassification) throws RemoteException; - - // Set the state of any tree. When changing the state of a tree all - // constraints/validations for the current type must be fulfilled. - // When errors occur these can be retrieved with the errorMsg function. - public boolean setTreeState (int aTreeID, short aState) throws RemoteException; - - // Update the description of a tree. - public boolean setDescription(int aTreeID,String aDescription) throws RemoteException; - - // Set the scheduling times of the tree - public boolean setSchedule(int aTreeID, String aStartTime,String aStopTime) throws RemoteException; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() throws RemoteException; - - -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeState.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeState.java deleted file mode 100644 index 1b11b440f7c92c10225e46907b7c0986103ce435..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeState.java +++ /dev/null @@ -1,36 +0,0 @@ -//# jTreeState.java: Manages the connection with the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -public class jTreeState implements java.io.Serializable -{ - - public jTreeState() - { - treeID = 0; - } - public int treeID; - public int momID; - public short newState; - public String username; - public String timestamp; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeStateConv.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeStateConv.java deleted file mode 100644 index 39f42b73f57b6a0c20cf970c4c1fa012cb20a80b..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeStateConv.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jTreeStateConv.java : TreeState converter -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.HashMap; - -public class jTreeStateConv { - - public jTreeStateConv () - { - try { - initTreeStateConv(); - } catch (Exception ex) { - System.out.println("Error during TreeStateConv init :" + ex); - } - } - - private native void initTreeStateConv() throws Exception; - public native short get(String jarg1) throws Exception; - public native String get(short jarg1) throws Exception; - - // java doesn't implement reference arguments, so the - // initial call bool get(long type, string typename) - // can't be made easily here/ Choice has been made to gather the complete - // list in the c++ wrapper and return it completely here. - public native HashMap<Short,String> getTypes() throws Exception; - public native void top() throws Exception; - public native boolean next() throws Exception; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeTypeConv.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeTypeConv.java deleted file mode 100644 index f383730f3bef68931868b598c933ea2c8ae75e20..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeTypeConv.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jTreeTypeConv.java : TreeType converter -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.HashMap; - -public class jTreeTypeConv { - - public jTreeTypeConv () - { - try { - initTreeTypeConv(); - } catch (Exception ex) { - System.out.println("Error during TreeTypeConv init :"+ex); - } - } - - private native void initTreeTypeConv() throws Exception; - public native short get(String jarg1) throws Exception; - public native String get(short jarg1) throws Exception; - - // java doesn't implement reference arguments, so the - // initial call bool get(long type, string typename) - // can't be made easily here/ Choice has been made to gather the complete - // list in the c++ wrapper and return it completely here. - public native HashMap<Short,String> getTypes() throws Exception; - public native void top() throws Exception; - public native boolean next() throws Exception; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValue.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValue.java deleted file mode 100644 index d63c08c7e1aed401c3e11d71152a08c6dbafa2ae..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValue.java +++ /dev/null @@ -1,80 +0,0 @@ -//# jTreeValue.java: Interface for access to the tree (KVT) values -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.util.Vector; - -public class jTreeValue -{ - - public String itsErrorMsg; - public int itsTreeID; - - public jTreeValue () - { - itsErrorMsg=""; - itsTreeID=0; - } - - public void setTreeID(int aTreeID) { - itsTreeID=aTreeID; - } - - // PVSS will continuously add value-changes to the offline PIC. - // There two ways PVSS can do this. - // The function returns false if the PIC node can not be found. - public native boolean addKVT( String key, String value, String time) throws Exception; - public native boolean addKVT(jOTDBvalue aKVT) throws Exception; - - // Note: This form will probably be used by SAS and OTB when committing - // a list of modified node. - public native boolean addKVTlist(Vector<jOTDBvalue> aValueList) throws Exception; - // public native boolean addKVTparamSet(jParamterSet aPS) throws Exception; - - //# SHM queries - // With searchInPeriod a list of all valuechanges in the OTDB tree can - // be retrieved from the database. - // By chosing the topItem right one node or a sub tree of the whole tree - // (you probably don't want this!) can be retrieved. - // When the endDate is not specified all value changes from beginDate - // till 'now' are retrieved, otherwise the selection is limited to - // [beginDate..endDate>. - public native Vector<jOTDBvalue> searchInPeriod (int topNode, - int depth, - String beginDate, - String endDate, - boolean mostRecentlyOnly) throws Exception; - - //# SAS queries - // For scheduling the VIC tree on the OTDB tree SAS must know what - // resources exist in the OTDB tree. This list can be retrieved with - // this function. - // TBW: Is this realy what SAS needs??? - public native Vector<jOTDBvalue> getSchedulableItems (int topNode) throws Exception; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() { - return itsErrorMsg; - } -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValueAdapter.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValueAdapter.java deleted file mode 100644 index c1c44403c8f11d8d550c9fcb84495fdd121c7aae..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValueAdapter.java +++ /dev/null @@ -1,132 +0,0 @@ -//# jTreeValueAdapter.java: -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; -import org.apache.log4j.Logger; - -public class jTreeValueAdapter extends UnicastRemoteObject implements jTreeValueInterface -{ - - // Create a Log4J logger instance - static Logger logger = Logger.getLogger(jTreeMaintenanceAdapter.class); - - // Constructor - public jTreeValueAdapter (jTreeValue adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - public void setTreeID(int aTreeID) throws RemoteException - { - adaptee.setTreeID(aTreeID); - } - - public boolean addKVT( String key, String value, String time) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.addKVT( key, value, time) ; - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI addKVT error",ex); - throw anEx; - } - return aB; - } - - public boolean addKVT(jOTDBvalue aKVT) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.addKVT(aKVT); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI addKVT error",ex); - throw anEx; - } - return aB; - } - - public boolean addKVTlist(Vector<jOTDBvalue> aValueList) throws RemoteException { - boolean aB=false; - try { - aB = adaptee.addKVTlist(aValueList); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI addKVTlist error",ex); - throw anEx; - } - return aB; - } - // public boolean addKVTparamSet(jParamterSet aPS) throws RemoteException { - // boolean aB=false; - // try { - // aB = adaptee.addKVTparamSet(aPS); - // } catch (Exception ex) { - // RemoteException anEx=new RemoteException("JNI addKVTparamSet error"); - // anEx.initCause(ex); - // throw anEx; - // } - // return aB; - // } - - - public Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate, - String endDate, boolean mostRecentlyOnly) throws RemoteException { - Vector<jOTDBvalue> aV=null; - try { - aV = adaptee.searchInPeriod (topNode, depth, beginDate, endDate, mostRecentlyOnly); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI searchInPeriod error",ex); - throw anEx; - } - return aV; - } - - public Vector<jOTDBvalue> getSchedulableItems (int topNode) throws RemoteException { - Vector<jOTDBvalue> aV=null; - try { - aV = adaptee.getSchedulableItems(topNode); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI getSchedulableItems error",ex); - throw anEx; - } - return aV; - } - - public String errorMsg() throws RemoteException { - String aS=null; - try { - aS = errorMsg(); - } catch (Exception ex) { - logger.error(ex); - RemoteException anEx=new RemoteException("JNI errorMsg error",ex); - throw anEx; - } - return aS; - } - - protected jTreeValue adaptee; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValueInterface.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValueInterface.java deleted file mode 100644 index ad2679c2575e1521fe84a1b885f242f3ff7953f7..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jTreeValueInterface.java +++ /dev/null @@ -1,51 +0,0 @@ -//# jTreeValueInterface.java: The RMI interface to the OTDB database. -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Vector; - -public interface jTreeValueInterface extends Remote -{ - // Constants - public static final String SERVICENAME = "jTreeValue"; - - public void setTreeID(int aTreeID) throws RemoteException; - - public boolean addKVT( String key, String value, String time) throws RemoteException; - - public boolean addKVT(jOTDBvalue aKVT) throws RemoteException; - - public boolean addKVTlist(Vector<jOTDBvalue> aValueList) throws RemoteException; - - // public boolean addKVTparamSet(jParamterSet aPS) throws RemoteException; - - public Vector<jOTDBvalue> searchInPeriod (int topNode, int depth, String beginDate, - String endDate, boolean mostRecentlyOnly) throws RemoteException; - - - public Vector<jOTDBvalue> getSchedulableItems (int topNode) throws RemoteException; - - public String errorMsg() throws RemoteException; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jUnitConv.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jUnitConv.java deleted file mode 100644 index d4612fb04218f38b59536daf51e6417b71e8bdca..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jUnitConv.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jUnitConv.java : Unit converter -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -import java.util.HashMap; - -public class jUnitConv { - - public jUnitConv () - { - try { - initUnitConv(); - } catch (Exception ex) { - System.out.println("Error during UnitConv init :"+ex); - } - } - - private native void initUnitConv() throws Exception; - public native short get(String jarg1) throws Exception; - public native String get(short jarg1) throws Exception; - - // java doesn't implement reference arguments, so the - // initial call bool get(long type, string typename) - // can't be made easily here/ Choice has been made to gather the complete - // list in the c++ wrapper and return it completely here. - public native HashMap<Short,String> getTypes() throws Exception; - public native void top() throws Exception; - public native boolean next() throws Exception; -} diff --git a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jVICnodeDef.java b/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jVICnodeDef.java deleted file mode 100644 index 70b9cee97c87c1a97edc05cab45f94dea569be6a..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl/astron/lofar/sas/otb/jotdb2/jVICnodeDef.java +++ /dev/null @@ -1,42 +0,0 @@ -//# jOTDBVICnodeDef.java: Structure containing a VIC node definition -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -package nl.astron.lofar.sas.otb.jotdb2; - -public class jVICnodeDef implements java.io.Serializable -{ - public jVICnodeDef() - { - itsNodeID = 0; - } - - public int nodeID() - { - return itsNodeID; - } - - public String name; - public int version; - public short classif; - public String constraints; - public String description; - public int itsNodeID; -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCampaign.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCampaign.cc deleted file mode 100644 index 3b1a7d98922277a2ff6a7b75ae4361ad8f071e91..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCampaign.cc +++ /dev/null @@ -1,179 +0,0 @@ -//# jCampaign.cc: Maintenance on CampaihnInfo. -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCampaign.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h> -#include <OTDB/Campaign.h> -#include <OTDB/CampaignInfo.h> -#include <iostream> -#include <string> - -using namespace LOFAR::OTDB; -using namespace std; - -extern OTDBconnection* theirConn; -Campaign* theirCampaign; - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: initCampaign - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_initCampaign (JNIEnv *env, jobject) { - - try { - theirCampaign = new Campaign(theirConn); - } catch (exception &ex) { - cout << "Exception during new Campaign"<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: getCampaign - * Signature: (Ljava/lang/String;)Lnl/astron/lofar/sas/otb/jotdb2/jCampaignInfo; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_getCampaign__Ljava_lang_String_2 - (JNIEnv *env, jobject, jstring aName) { - const char* name; - CampaignInfo aCampaignInfo; - jboolean isCopy; - - try { - name = env->GetStringUTFChars (aName, &isCopy); - aCampaignInfo = theirCampaign->getCampaign(name); - env->ReleaseStringUTFChars (aName, name); - } catch (exception &ex) { - cout << "Exception during Campaign::getCampaign(" << aName << ") " << ex.what() << endl; - env->ReleaseStringUTFChars (aName, name); - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - - return convertCampaignInfo (env, aCampaignInfo); -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: getCampaign - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb2/jCampaignInfo; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_getCampaign__I - (JNIEnv *env, jobject, jint anId) { - CampaignInfo aCampaignInfo; - try { - aCampaignInfo = theirCampaign->getCampaign(anId); - } catch (exception &ex) { - cout << "Exception during Campaign::getCampaign(" << anId << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return convertCampaignInfo (env, aCampaignInfo); -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: getCampaignList - * Signature: ()Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_getCampaignList - (JNIEnv *env, jobject){ - jobject itemVector; - try { - vector<CampaignInfo> itemList = theirCampaign->getCampaignList(); - - vector<CampaignInfo>::iterator itemIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (itemIterator = itemList.begin(); itemIterator != itemList.end(); itemIterator++) - env->CallObjectMethod(itemVector, mid_Vector_add, convertCampaignInfo (env, *itemIterator)); - } catch (exception &ex) { - cout << "Exception during Campaign::getCampaignList() " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return itemVector; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: saveCampaign - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jCampaignInfo;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_saveCampaign - (JNIEnv *env, jobject, jobject jCampaignInfo){ - jint retVal; - - try { - CampaignInfo aCampaignInfo = convertjCampaignInfo (env, jCampaignInfo); - retVal = theirCampaign->saveCampaign(aCampaignInfo); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::saveCampaign" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return retVal; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_errorMsg - (JNIEnv *, jobject); - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jCampaign - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jCampaign_errorMsg(JNIEnv *env, jobject) { - jstring aS; - try { - aS = env->NewStringUTF(theirConn->errorMsg().c_str()); - } catch (exception &ex) { - cout << "Exception during Campaign::errorMsg" << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return aS; - -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.cc deleted file mode 100644 index 7d22048906ce8d83ac3d00b684cfc8e4d4ed4a63..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.cc +++ /dev/null @@ -1,187 +0,0 @@ -//# jClassifConv.cc: -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jClassifConv.h> -#include <OTDB/OTDBtypes.h> -#include <string> -#include <iostream> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <OTDB/ClassifConv.h> - -using namespace LOFAR::OTDB; -using namespace std; - - -static ClassifConv* classifConv; -extern OTDBconnection* theirConn; - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: initClassifConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_initClassifConv(JNIEnv *env, jobject) { - - try { - classifConv = new ClassifConv(theirConn); - } catch (exception &ex) { - cout << "Exception during new ClassifConv " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_get__Ljava_lang_String_2(JNIEnv *env, jobject, jstring aConv) { - - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - short ret; - try { - ret = classifConv->get (str); - env->ReleaseStringUTFChars (aConv, chars); - } catch (exception &ex) { - cout << "Exception during ClassifConv::get("<< str << ") " << ex.what() << endl; - - env->ReleaseStringUTFChars (aConv, chars); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return ret; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_get__S(JNIEnv *env, jobject, jshort aConv) { - - jstring jstr; - try { - jstr = env->NewStringUTF (classifConv->get(aConv).c_str()); - } catch (exception &ex) { - cout << "Exception during ClassifConv::get("<< aConv << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return jstr; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_getTypes(JNIEnv *env, jobject) { - - - // Construct java Map - jobject result; - jclass mapClass, shortClass; - jmethodID mapInit, put, shortInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - - shortClass = env->FindClass("java/lang/Short"); - shortInit = env->GetMethodID(shortClass, "<init>", "(S)V"); - - - - if ( env->ExceptionOccurred() ) - return 0; - - put= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - if ( env->ExceptionOccurred() ) - return 0; - - try { - classifConv->top(); - do { - classifType key; - string value; - - if (classifConv->get(key, value)) { - env->CallObjectMethod(result, put, env->NewObject(shortClass, - shortInit, - (jshort)key), - env->NewStringUTF(value.c_str())); - - if ( env->ExceptionOccurred() ) - return 0; - } - } while (classifConv->next()); - } catch (exception &ex) { - cout << "Exception during ClassifConv::getTypes " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return result; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_top(JNIEnv *env, jobject) { - try { - classifConv->top(); - } catch (exception &ex) { - cout << "Exception during ClassifConv::top" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jClassifConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jClassifConv_next(JNIEnv *env, jobject) { - jboolean aBool; - try { - aBool=classifConv->next(); - } catch (exception &ex) { - cout << "Exception during ClassifConv::next" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return aBool; -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCommon.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCommon.cc deleted file mode 100644 index b5c3f69e1078ca34ecfc1c98acac0f4d17198542..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jCommon.cc +++ /dev/null @@ -1,468 +0,0 @@ -//# jCommon.cc : Holds static OTDB connection, and coded the class converters -//# -//# Copyright (C) 2002-2006 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <boost/date_time/posix_time/time_formatters.hpp> -#include <string> -#include <iostream> - -using namespace boost::posix_time; -using namespace LOFAR::OTDB; -using namespace std; - -extern TreeMaintenance* theirTM; -extern OTDBconnection* theirConn; -extern TreeValue* theirVal; -extern Campaign* theirCampaign; - - -// -// C++ classes ----> java classes -// - - - -jobject convertOTDBnode (JNIEnv *env, OTDBnode aNode) -{ - jobject jNode; - jclass class_jOTDBnode = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jOTDBnode"); - jmethodID mid_jOTDBnode_cons = env->GetMethodID (class_jOTDBnode, "<init>", "(IIII)V"); - jNode = env->NewObject (class_jOTDBnode, mid_jOTDBnode_cons, aNode.treeID (), aNode.nodeID (), - aNode.parentID (), aNode.paramDefID ()); - - jfieldID fid_jOTDBnode_name = env->GetFieldID (class_jOTDBnode, "name", "Ljava/lang/String;"); - jfieldID fid_jOTDBnode_index = env->GetFieldID (class_jOTDBnode, "index", "S"); - jfieldID fid_jOTDBnode_leaf = env->GetFieldID (class_jOTDBnode, "leaf", "Z"); - jfieldID fid_jOTDBnode_instances = env->GetFieldID (class_jOTDBnode, "instances", "S"); - jfieldID fid_jOTDBnode_limits = env->GetFieldID (class_jOTDBnode, "limits", "Ljava/lang/String;"); - jfieldID fid_jOTDBnode_description = env->GetFieldID (class_jOTDBnode, "description", "Ljava/lang/String;"); - - env->SetObjectField (jNode, fid_jOTDBnode_name, env->NewStringUTF (aNode.name.c_str ())); - env->SetShortField (jNode, fid_jOTDBnode_index, aNode.index); - env->SetBooleanField (jNode, fid_jOTDBnode_leaf, aNode.leaf); - env->SetShortField (jNode, fid_jOTDBnode_instances, aNode.instances); - env->SetObjectField (jNode, fid_jOTDBnode_limits, env->NewStringUTF (aNode.limits.c_str ())); - env->SetObjectField (jNode, fid_jOTDBnode_description, env->NewStringUTF (aNode.description.c_str ())); - - return jNode; -} - - -jobject convertOTDBtree(JNIEnv *env, OTDBtree aTree) { - jobject jTree; - jclass class_jOTDBtree = env->FindClass("nl/astron/lofar/sas/otb/jotdb2/jOTDBtree"); - - jmethodID mid_jOTDBtree_cons = env->GetMethodID (class_jOTDBtree, "<init>", "(II)V"); - - jTree = env->NewObject (class_jOTDBtree, mid_jOTDBtree_cons,aTree.treeID (),aTree.momID ()); - - - jfieldID fid_jOTDBtree_classification = env->GetFieldID (class_jOTDBtree, "classification", "S"); - jfieldID fid_jOTDBtree_creator = env->GetFieldID (class_jOTDBtree, "creator", "Ljava/lang/String;"); - jfieldID fid_jOTDBtree_creationDate = env->GetFieldID (class_jOTDBtree, "creationDate", "Ljava/lang/String;"); - jfieldID fid_jOTDBtree_type = env->GetFieldID (class_jOTDBtree, "type", "S"); - jfieldID fid_jOTDBtree_state = env->GetFieldID (class_jOTDBtree, "state", "S"); - jfieldID fid_jOTDBtree_originalTree = env->GetFieldID (class_jOTDBtree, "originalTree", "I"); - jfieldID fid_jOTDBtree_campaign = env->GetFieldID (class_jOTDBtree, "campaign", "Ljava/lang/String;"); - jfieldID fid_jOTDBtree_starttime = env->GetFieldID (class_jOTDBtree, "starttime","Ljava/lang/String;"); - jfieldID fid_jOTDBtree_stoptime = env->GetFieldID (class_jOTDBtree, "stoptime", "Ljava/lang/String;"); - jfieldID fid_jOTDBtree_description = env->GetFieldID (class_jOTDBtree, "description", "Ljava/lang/String;"); - - env->SetShortField (jTree, fid_jOTDBtree_classification, aTree.classification); - env->SetObjectField (jTree, fid_jOTDBtree_creator, env->NewStringUTF (aTree.creator.c_str ())); - env->SetObjectField (jTree, fid_jOTDBtree_creationDate, env->NewStringUTF (to_iso_extended_string(aTree.creationDate).c_str ())); - env->SetShortField (jTree, fid_jOTDBtree_type, aTree.type); - env->SetShortField (jTree, fid_jOTDBtree_state, aTree.state); - env->SetIntField (jTree, fid_jOTDBtree_originalTree, aTree.originalTree); - env->SetObjectField (jTree, fid_jOTDBtree_campaign, env->NewStringUTF (aTree.campaign.c_str ())); - env->SetObjectField (jTree, fid_jOTDBtree_starttime, env->NewStringUTF(to_iso_extended_string(aTree.starttime).c_str ())); - env->SetObjectField (jTree, fid_jOTDBtree_stoptime, env->NewStringUTF (to_iso_extended_string(aTree.stoptime).c_str ())); - env->SetObjectField (jTree, fid_jOTDBtree_description, env->NewStringUTF (aTree.description.c_str())); - - return jTree; -} - -jobject convertTreeState (JNIEnv *env, TreeState aTreeState) -{ - jobject jTreeState; - jclass class_jTreeState = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jTreeState"); - jmethodID mid_jTreeState_cons = env->GetMethodID (class_jTreeState, "<init>", "()V"); - jTreeState = env->NewObject (class_jTreeState, mid_jTreeState_cons); - - jfieldID fid_jTreeState_treeID = env->GetFieldID (class_jTreeState, "treeID", "I"); - jfieldID fid_jTreeState_momID = env->GetFieldID (class_jTreeState, "momID", "I"); - jfieldID fid_jTreeState_newState = env->GetFieldID (class_jTreeState,"newState", "S"); - jfieldID fid_jTreeState_username = env->GetFieldID (class_jTreeState, "username", "Ljava/lang/String;"); - jfieldID fid_jTreeState_timestamp = env->GetFieldID (class_jTreeState, "timestamp", "Ljava/lang/String;"); - - env->SetIntField (jTreeState, fid_jTreeState_treeID, aTreeState.treeID); - env->SetIntField (jTreeState, fid_jTreeState_momID, aTreeState.momID); - env->SetShortField (jTreeState, fid_jTreeState_newState, aTreeState.newState); - env->SetObjectField (jTreeState, fid_jTreeState_username, env->NewStringUTF(aTreeState.username.c_str())); - env->SetObjectField (jTreeState, fid_jTreeState_timestamp, env->NewStringUTF(to_iso_extended_string(aTreeState.timestamp).c_str())); - return jTreeState; -} - -jobject convertVICnodeDef (JNIEnv *env, VICnodeDef aNodeDef) -{ - - jobject jVICNodeDef; - jclass class_jVICnodeDef = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jVICnodeDef"); - jmethodID mid_jVICnodeDef_cons = env->GetMethodID (class_jVICnodeDef, "<init>", "()V"); - jVICNodeDef = env->NewObject (class_jVICnodeDef, mid_jVICnodeDef_cons); - - jfieldID fid_jVICnodeDef_name = env->GetFieldID (class_jVICnodeDef, "name", "Ljava/lang/String;"); - jfieldID fid_jVICnodeDef_version = env->GetFieldID (class_jVICnodeDef, "version", "I"); - jfieldID fid_jVICnodeDef_classif = env->GetFieldID (class_jVICnodeDef, "classif", "S"); - jfieldID fid_jVICnodeDef_constraints = env->GetFieldID (class_jVICnodeDef, "constraints", "Ljava/lang/String;"); - jfieldID fid_jVICnodeDef_description = env->GetFieldID (class_jVICnodeDef, "description", "Ljava/lang/String;"); - jfieldID fid_jVICnodeDef_itsNodeID = env->GetFieldID (class_jVICnodeDef, "itsNodeID", "I"); - - env->SetObjectField (jVICNodeDef, fid_jVICnodeDef_name, env->NewStringUTF (aNodeDef.name.c_str())); - env->SetIntField (jVICNodeDef, fid_jVICnodeDef_version, aNodeDef.version); - env->SetShortField (jVICNodeDef, fid_jVICnodeDef_classif, aNodeDef.classif); - env->SetObjectField (jVICNodeDef, fid_jVICnodeDef_constraints, env->NewStringUTF (aNodeDef.constraints.c_str())); - env->SetObjectField (jVICNodeDef, fid_jVICnodeDef_description, env->NewStringUTF (aNodeDef.description.c_str())); - env->SetIntField (jVICNodeDef, fid_jVICnodeDef_itsNodeID, aNodeDef.nodeID()); - - return jVICNodeDef; -} - -jobject convertOTDBparam (JNIEnv *env, OTDBparam aParam) -{ - - jobject jOTDBparam; - jclass class_jOTDBparam = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jOTDBparam"); - jmethodID mid_jOTDBparam_cons = env->GetMethodID (class_jOTDBparam, "<init>", "(III)V"); - jOTDBparam = env->NewObject (class_jOTDBparam, mid_jOTDBparam_cons,aParam.treeID(),aParam.paramID(),aParam.nodeID()); - - jfieldID fid_jOTDBparam_name = env->GetFieldID (class_jOTDBparam, "name", "Ljava/lang/String;"); - jfieldID fid_jOTDBparam_index = env->GetFieldID (class_jOTDBparam, "index", "S"); - jfieldID fid_jOTDBparam_type = env->GetFieldID (class_jOTDBparam, "type", "S"); - jfieldID fid_jOTDBparam_unit = env->GetFieldID (class_jOTDBparam, "unit", "S"); - jfieldID fid_jOTDBparam_pruning = env->GetFieldID (class_jOTDBparam, "pruning", "S"); - jfieldID fid_jOTDBparam_valMoment = env->GetFieldID (class_jOTDBparam, "valMoment", "S"); - jfieldID fid_jOTDBparam_runtimeMod = env->GetFieldID (class_jOTDBparam, "runtimeMod", "Z"); - jfieldID fid_jOTDBparam_limits = env->GetFieldID (class_jOTDBparam, "limits", "Ljava/lang/String;"); - jfieldID fid_jOTDBparam_description = env->GetFieldID (class_jOTDBparam, "description", "Ljava/lang/String;"); - - - - env->SetObjectField (jOTDBparam, fid_jOTDBparam_name, env->NewStringUTF (aParam.name.c_str())); - env->SetShortField (jOTDBparam, fid_jOTDBparam_index, aParam.index); - env->SetShortField (jOTDBparam, fid_jOTDBparam_type, aParam.type); - env->SetShortField (jOTDBparam, fid_jOTDBparam_unit, aParam.unit); - env->SetShortField (jOTDBparam, fid_jOTDBparam_pruning, aParam.pruning); - env->SetShortField (jOTDBparam, fid_jOTDBparam_valMoment, aParam.valMoment); - env->SetBooleanField (jOTDBparam, fid_jOTDBparam_runtimeMod, aParam.runtimeMod); - env->SetObjectField (jOTDBparam, fid_jOTDBparam_limits, env->NewStringUTF (aParam.limits.c_str())); - env->SetObjectField (jOTDBparam, fid_jOTDBparam_description, env->NewStringUTF (aParam.description.c_str())); - - return jOTDBparam; -} - -jobject convertOTDBvalue (JNIEnv *env, OTDBvalue aValue) -{ - jobject jvalue; - jclass class_jOTDBvalue = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jOTDBvalue"); - jmethodID mid_jOTDBvalue_cons = env->GetMethodID (class_jOTDBvalue, "<init>", "(I)V"); - jvalue = env->NewObject (class_jOTDBvalue, mid_jOTDBvalue_cons, aValue.nodeID ()); - - jfieldID fid_jOTDBvalue_name = env->GetFieldID (class_jOTDBvalue, "name", "Ljava/lang/String;"); - jfieldID fid_jOTDBvalue_value = env->GetFieldID (class_jOTDBvalue, "value", "Ljava/lang/String;"); - jfieldID fid_jOTDBvalue_time = env->GetFieldID (class_jOTDBvalue, "time", "Ljava/lang/String;"); - - env->SetObjectField (jvalue, fid_jOTDBvalue_name, env->NewStringUTF (aValue.name.c_str ())); - env->SetObjectField (jvalue, fid_jOTDBvalue_value, env->NewStringUTF (aValue.value.c_str ())); - env->SetObjectField (jvalue, fid_jOTDBvalue_time, env->NewStringUTF (to_iso_extended_string(aValue.time).c_str ())); - - return jvalue; -} - -jobject convertCampaignInfo (JNIEnv *env, CampaignInfo aCampaignInfo) -{ - jobject jCampaignInfo; - jclass class_jCampaignInfo = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jCampaignInfo"); - jmethodID mid_jCampaignInfo_cons = env->GetMethodID (class_jCampaignInfo, "<init>", "(I)V"); - jCampaignInfo = env->NewObject (class_jCampaignInfo, mid_jCampaignInfo_cons, aCampaignInfo.ID()); - - jfieldID fid_jCampaignInfo_itsName = env->GetFieldID (class_jCampaignInfo, "itsName", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsTitle = env->GetFieldID (class_jCampaignInfo, "itsTitle", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsPI = env->GetFieldID (class_jCampaignInfo, "itsPI", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsCO_I = env->GetFieldID (class_jCampaignInfo, "itsCO_I", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsContact = env->GetFieldID (class_jCampaignInfo, "itsContact", "Ljava/lang/String;"); - - env->SetObjectField (jCampaignInfo, fid_jCampaignInfo_itsName, env->NewStringUTF (aCampaignInfo.name.c_str ())); - env->SetObjectField (jCampaignInfo, fid_jCampaignInfo_itsTitle, env->NewStringUTF (aCampaignInfo.title.c_str ())); - env->SetObjectField (jCampaignInfo, fid_jCampaignInfo_itsPI, env->NewStringUTF (aCampaignInfo.PI.c_str ())); - env->SetObjectField (jCampaignInfo, fid_jCampaignInfo_itsCO_I, env->NewStringUTF (aCampaignInfo.CO_I.c_str ())); - env->SetObjectField (jCampaignInfo, fid_jCampaignInfo_itsContact, env->NewStringUTF (aCampaignInfo.contact.c_str ())); - - - return jCampaignInfo; -} - -// -// java classes ----> c++ classes -// - -CampaignInfo convertjCampaignInfo(JNIEnv *env, jobject jCampaignInfo) -{ - jclass class_jCampaignInfo = env->GetObjectClass (jCampaignInfo); - jfieldID fid_jCampaignInfo_itsName = env->GetFieldID (class_jCampaignInfo, "itsName", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsTitle = env->GetFieldID (class_jCampaignInfo, "itsTitle", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsPI = env->GetFieldID (class_jCampaignInfo, "itsPI", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsCO_I = env->GetFieldID (class_jCampaignInfo, "itsCO_I", "Ljava/lang/String;"); - jfieldID fid_jCampaignInfo_itsContact = env->GetFieldID (class_jCampaignInfo, "itsContact", "Ljava/lang/String;"); - jmethodID mid_jCampaignInfo_ID = env->GetMethodID (class_jCampaignInfo, "ID", "()I"); - - // Get original CampaignInfo - CampaignInfo aCampaignInfo = theirCampaign->getCampaign (env->CallIntMethod (jCampaignInfo, mid_jCampaignInfo_ID)); - - jboolean isCopy; - - // name - jstring str = (jstring)env->GetObjectField (jCampaignInfo, fid_jCampaignInfo_itsName); - const char* n = env->GetStringUTFChars (str, &isCopy); - const string name (n); - aCampaignInfo.name = name; - env->ReleaseStringUTFChars (str, n); - - // Title - jstring tstr = (jstring)env->GetObjectField (jCampaignInfo, fid_jCampaignInfo_itsTitle); - const char* t = env->GetStringUTFChars (tstr, &isCopy); - const string title (t); - aCampaignInfo.title = title; - env->ReleaseStringUTFChars (tstr, t); - - // PI - jstring pstr = (jstring)env->GetObjectField (jCampaignInfo, fid_jCampaignInfo_itsPI); - const char* p = env->GetStringUTFChars (pstr, &isCopy); - const string pi (p); - aCampaignInfo.PI = pi; - env->ReleaseStringUTFChars (pstr, p); - - // CO_I - jstring cstr = (jstring)env->GetObjectField (jCampaignInfo, fid_jCampaignInfo_itsCO_I); - const char* c = env->GetStringUTFChars (cstr, &isCopy); - const string co_i (c); - aCampaignInfo.CO_I = co_i; - env->ReleaseStringUTFChars (cstr, c); - - // Contact - jstring costr = (jstring)env->GetObjectField (jCampaignInfo, fid_jCampaignInfo_itsContact); - const char* co = env->GetStringUTFChars (costr, &isCopy); - const string contact (co); - aCampaignInfo.contact = contact; - env->ReleaseStringUTFChars (costr, co); - - return aCampaignInfo; -} - -OTDBnode convertjOTDBnode (JNIEnv *env, jobject jNode) -{ - jclass class_jOTDBnode = env->GetObjectClass (jNode); - jfieldID fid_jOTDBnode_name = env->GetFieldID (class_jOTDBnode, "name", "Ljava/lang/String;"); - jfieldID fid_jOTDBnode_index = env->GetFieldID (class_jOTDBnode, "index", "S"); - jfieldID fid_jOTDBnode_leaf = env->GetFieldID (class_jOTDBnode, "leaf", "Z"); - jfieldID fid_jOTDBnode_instances = env->GetFieldID (class_jOTDBnode, "instances", "S"); - jfieldID fid_jOTDBnode_limits = env->GetFieldID (class_jOTDBnode, "limits", "Ljava/lang/String;"); - jfieldID fid_jOTDBnode_description = env->GetFieldID (class_jOTDBnode, "description", "Ljava/lang/String;"); - jmethodID mid_jOTDBnode_treeID = env->GetMethodID (class_jOTDBnode, "treeID", "()I"); - jmethodID mid_jOTDBnode_nodeID = env->GetMethodID (class_jOTDBnode, "nodeID", "()I"); - - // Get original OTDB node - OTDBnode aNode = theirTM->getNode (env->CallIntMethod (jNode, mid_jOTDBnode_treeID), - env->CallIntMethod (jNode, mid_jOTDBnode_nodeID)); - - - // name - jstring str = (jstring)env->GetObjectField (jNode, fid_jOTDBnode_name); - jboolean isCopy; - const char* n = env->GetStringUTFChars (str, &isCopy); - const string name (n); - aNode.name = name; - env->ReleaseStringUTFChars (str, n); - - // index - aNode.index = (short)env->GetShortField (jNode, fid_jOTDBnode_index); - - // leaf - aNode.leaf = (bool)env->GetBooleanField (jNode, fid_jOTDBnode_leaf); - - // instances - aNode.instances = (short)env->GetShortField (jNode, fid_jOTDBnode_instances); - - // limits - str = (jstring)env->GetObjectField (jNode, fid_jOTDBnode_limits); - const char* l = env->GetStringUTFChars (str, &isCopy); - const string limits (l); - aNode.limits = limits; - env->ReleaseStringUTFChars (str, l); - - // description - str = (jstring)env->GetObjectField (jNode, fid_jOTDBnode_description); - const char* d = env->GetStringUTFChars (str, &isCopy); - const string description (d); - aNode.description = description; - env->ReleaseStringUTFChars (str, d); - - return aNode; -} - - -VICnodeDef convertjVICnodeDef (JNIEnv *env, jobject jNode) -{ - jclass class_jVICnodeDef = env->GetObjectClass (jNode); - jfieldID fid_jVICnodeDef_name = env->GetFieldID (class_jVICnodeDef, "name", "Ljava/lang/String;"); - jfieldID fid_jVICnodeDef_version = env->GetFieldID (class_jVICnodeDef, "version", "I"); - jfieldID fid_jVICnodeDef_classif = env->GetFieldID (class_jVICnodeDef, "classif", "S"); - jfieldID fid_jVICnodeDef_constraints = env->GetFieldID (class_jVICnodeDef, "constraints", "Ljava/lang/String;"); - jfieldID fid_jVICnodeDef_description = env->GetFieldID (class_jVICnodeDef, "description", "Ljava/lang/String;"); - jmethodID mid_jVICnodeDef_nodeID = env->GetMethodID (class_jVICnodeDef, "nodeID", "()I"); - - - // Get original VICnodeDef - VICnodeDef aNode = theirTM->getComponentNode(env->CallIntMethod (jNode, mid_jVICnodeDef_nodeID)); - - // name - jstring str = (jstring)env->GetObjectField (jNode, fid_jVICnodeDef_name); - jboolean isCopy; - const char* n = env->GetStringUTFChars (str, &isCopy); - const string name (n); - aNode.name = name; - env->ReleaseStringUTFChars (str, n); - - // version - aNode.version = (int)env->GetIntField (jNode, fid_jVICnodeDef_version); - - // classif - aNode.classif = (short)env->GetShortField (jNode, fid_jVICnodeDef_classif); - - // constraints - str = (jstring)env->GetObjectField (jNode, fid_jVICnodeDef_constraints); - const char* l = env->GetStringUTFChars (str, &isCopy); - const string constraints (l); - aNode.constraints = constraints; - env->ReleaseStringUTFChars (str, l); - - // description - str = (jstring)env->GetObjectField (jNode, fid_jVICnodeDef_description); - const char* d = env->GetStringUTFChars (str, &isCopy); - const string description (d); - aNode.description = description; - env->ReleaseStringUTFChars (str, d); - - return aNode; -} - -OTDBparam convertjOTDBparam (JNIEnv *env, jobject jParam) { - jclass class_jOTDBparam = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jOTDBparam"); - jfieldID fid_jOTDBparam_name = env->GetFieldID (class_jOTDBparam, "name", "Ljava/lang/String;"); - jfieldID fid_jOTDBparam_index = env->GetFieldID (class_jOTDBparam, "index", "S"); - jfieldID fid_jOTDBparam_type = env->GetFieldID (class_jOTDBparam, "type", "S"); - jfieldID fid_jOTDBparam_unit = env->GetFieldID (class_jOTDBparam, "unit", "S"); - jfieldID fid_jOTDBparam_pruning = env->GetFieldID (class_jOTDBparam, "pruning", "S"); - jfieldID fid_jOTDBparam_valMoment = env->GetFieldID (class_jOTDBparam, "valMoment", "S"); - jfieldID fid_jOTDBparam_runtimeMod = env->GetFieldID (class_jOTDBparam, "runtimeMod", "Z"); - jfieldID fid_jOTDBparam_limits = env->GetFieldID (class_jOTDBparam, "limits", "Ljava/lang/String;"); - jfieldID fid_jOTDBparam_description = env->GetFieldID (class_jOTDBparam, "description", "Ljava/lang/String;"); - jmethodID mid_jOTDBparam_treeID = env->GetMethodID (class_jOTDBparam, "treeID", "()I"); - jmethodID mid_jOTDBparam_paramID = env->GetMethodID (class_jOTDBparam, "paramID", "()I"); - - // Get original OTDB param - OTDBparam aParam = theirTM->getParam (env->CallIntMethod (jParam, mid_jOTDBparam_treeID), - env->CallIntMethod (jParam, mid_jOTDBparam_paramID)); - - // name - jstring str = (jstring)env->GetObjectField (jParam, fid_jOTDBparam_name); - jboolean isCopy; - const char* n = env->GetStringUTFChars (str, &isCopy); - const string name (n); - aParam.name = name; - env->ReleaseStringUTFChars (str, n); - - aParam.index = (short)env->GetShortField (jParam, fid_jOTDBparam_index); - aParam.type = (short)env->GetShortField (jParam, fid_jOTDBparam_type); - aParam.unit = (short)env->GetShortField (jParam, fid_jOTDBparam_unit); - aParam.pruning = (short)env->GetShortField (jParam, fid_jOTDBparam_pruning); - aParam.valMoment = (short)env->GetShortField (jParam, fid_jOTDBparam_valMoment); - aParam.runtimeMod = (short)env->GetBooleanField (jParam, fid_jOTDBparam_runtimeMod); - - // limits - str = (jstring)env->GetObjectField (jParam, fid_jOTDBparam_limits); - const char* l = env->GetStringUTFChars (str, &isCopy); - const string limits (l); - aParam.limits = limits; - env->ReleaseStringUTFChars (str, l); - - // description - str = (jstring)env->GetObjectField (jParam, fid_jOTDBparam_description); - const char* d = env->GetStringUTFChars (str, &isCopy); - const string description (d); - aParam.description = description; - env->ReleaseStringUTFChars (str, d); - - return aParam; -} - -OTDBvalue convertjOTDBvalue (JNIEnv *env, jobject jvalue) -{ - jclass class_jOTDBvalue = env->GetObjectClass (jvalue); - jfieldID fid_jOTDBvalue_name = env->GetFieldID (class_jOTDBvalue, "name", "Ljava/lang/String;"); - jfieldID fid_jOTDBvalue_value = env->GetFieldID (class_jOTDBvalue, "value", "Ljava/lang/String;"); - jfieldID fid_jOTDBvalue_time = env->GetFieldID (class_jOTDBvalue, "time", "Ljava/lang/String;"); - // jmethodID mid_jOTDBvalue_nodeID = env->GetMethodID (class_jOTDBvalue, "nodeID", "()I"); - - // Get original OTDB node - OTDBvalue aValue;// = new OTDBvalue(); - - // name - jstring nstr = (jstring)env->GetObjectField (jvalue, fid_jOTDBvalue_name); - const char* n = env->GetStringUTFChars (nstr, 0); - const string name (n); - aValue.name = name; - env->ReleaseStringUTFChars (nstr, n); - - // value - jstring vstr = (jstring)env->GetObjectField (jvalue, fid_jOTDBvalue_value); - const char* v = env->GetStringUTFChars (vstr, 0); - const string value (v); - aValue.value = value; - env->ReleaseStringUTFChars (vstr, v); - - // time - jstring tstr = (jstring)env->GetObjectField (jvalue, fid_jOTDBvalue_time); - const char* t = env->GetStringUTFChars (tstr, 0); - const string time (t); - const ptime apt (time_from_string(time)); - aValue.time = apt; - env->ReleaseStringUTFChars (tstr, t); - - return aValue; -} - diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.cc deleted file mode 100644 index cf847451c9b7c96f8a452c9f17486e1e6996f094..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.cc +++ /dev/null @@ -1,44 +0,0 @@ -//# jInitCPPLogger.cc: Initialize the c++ logger for OTDB -//# -//# Copyright (C) 2002-2006 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -# -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -//#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger.h> - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger - * Method: initLogger - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jInitCPPLogger_initLogger(JNIEnv * env, jobject, jstring aLogName) { - jboolean isCopy; - const char* logname = env->GetStringUTFChars(aLogName, &isCopy); - INIT_LOGGER(logname); - env->ReleaseStringUTFChars (aLogName,logname); -} - diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.cc deleted file mode 100644 index c9d4c8d92a738b43e763ff40f3521e02034277fd..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.cc +++ /dev/null @@ -1,212 +0,0 @@ -//# jOTDB_jOTDBconnection.cc: Manages the connection with the OTDB database. -//# -//# Copyright (C) 2002-2004 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -# -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h> -#include <OTDB/OTDBconnection.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <boost/date_time/posix_time/time_formatters.hpp> -#include <string> -#include <iostream> - - -using namespace boost::posix_time; -using namespace LOFAR::OTDB; -using namespace std; - -OTDBconnection* theirConn; - -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_initOTDBconnection(JNIEnv *env, jobject, jstring username, jstring passwd, jstring database, jstring hostname) { - const char* user = env->GetStringUTFChars(username, 0); - const char* pass = env->GetStringUTFChars(passwd, 0); - const char* db = env->GetStringUTFChars(database, 0); - const char* hn = env->GetStringUTFChars(hostname, 0); - const string u (user); - const string p (pass); - const string d (db); - const string h (hn); - - try { - theirConn = new OTDBconnection(u, p, d, h); - env->ReleaseStringUTFChars(username, user); - env->ReleaseStringUTFChars(passwd, pass); - env->ReleaseStringUTFChars(database, db); - env->ReleaseStringUTFChars(hostname, hn); - } catch (exception &ex) { - cout << "Exception during new OTDBconnection(" << u << "," << p << "," << d << "," << h << ") : "<< ex.what() << endl; - - env->ReleaseStringUTFChars(username, user); - env->ReleaseStringUTFChars(passwd, pass); - env->ReleaseStringUTFChars(database, db); - env->ReleaseStringUTFChars(hostname, hn); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_isConnected(JNIEnv *env, jobject) { - jboolean connected; - try { - connected = theirConn->isConnected(); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::connected "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return connected; -} - - -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_connect(JNIEnv *env, jobject) { - jboolean connected; - try { - connected = (jboolean)theirConn->connect(); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::connect "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return connected; -} - - -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getTreeInfo(JNIEnv *env, jobject, jint treeID, jboolean isMomID) { - OTDBtree aTree; - try { - aTree = theirConn->getTreeInfo((int)treeID, isMomID); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::getTreeInfo(" << treeID << "," << isMomID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return convertOTDBtree(env, aTree); -} - - -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getStateList(JNIEnv *env, jobject, jint treeID, jboolean isMomID, jstring beginDate, jstring endDate) { - const char* bd = env->GetStringUTFChars (beginDate, 0); - const char* ed = env->GetStringUTFChars (endDate, 0); - - jobject statesVector; - try { - - vector<TreeState> states = theirConn->getStateList(treeID, isMomID,time_from_string(bd), time_from_string(ed)); - vector<TreeState>::iterator statesIterator; - - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - statesVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (statesIterator = states.begin(); statesIterator != states.end(); statesIterator++) { - env->CallObjectMethod(statesVector, mid_Vector_add,convertTreeState(env, *statesIterator )); - } - - env->ReleaseStringUTFChars(beginDate, bd); - env->ReleaseStringUTFChars(endDate, ed); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::getStateList(" << treeID << "," << isMomID << "," << - time_from_string(bd) << "," << time_from_string(ed) << ") "<< ex.what() << endl; - - env->ReleaseStringUTFChars(beginDate, bd); - env->ReleaseStringUTFChars(endDate, ed); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return(statesVector); -} - - -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getTreeList(JNIEnv *env, jobject, jshort treeType, jshort classifType) { - - jobject itemVector; - try { - vector<OTDBtree> trees = theirConn->getTreeList(treeType, classifType); - vector<OTDBtree>::iterator treeIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - - for (treeIterator = trees.begin(); treeIterator != trees.end(); treeIterator++) { - env->CallObjectMethod(itemVector, mid_Vector_add, convertOTDBtree(env, *treeIterator)); - } - } catch (exception &ex) { - cout << "Exception during OTDBconnection::getTreeList(" << treeType << "," << classifType << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - - } - - return(itemVector); -} - - -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_errorMsg(JNIEnv *env, jobject) { - jstring jstr; - try { - jstr = env->NewStringUTF(theirConn->errorMsg().c_str()); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::errorMsg " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return jstr; -} - - -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getAuthToken(JNIEnv *env, jobject) { - jint token; - try { - token = (jint)theirConn->getAuthToken(); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::getAuthToken " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return token; -} - -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection_getDBName(JNIEnv *env, jobject) { - jstring jstr; - try { - jstr = env->NewStringUTF(theirConn->getDBName().c_str()); - } catch (exception &ex) { - cout << "Exception during OTDBconnection::getDBName " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return jstr; -} - - diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.cc deleted file mode 100644 index a8dbf20b456d436020fa98095ca4785ff651088e..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.cc +++ /dev/null @@ -1,192 +0,0 @@ -//# jParamTypeConv.cc: -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv.h> -#include <OTDB/OTDBtypes.h> -#include <string> -#include <iostream> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <OTDB/ParamTypeConv.h> - -using namespace LOFAR::OTDB; -using namespace std; - - -static ParamTypeConv* paramTypeConv; -extern OTDBconnection* theirConn; - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: initParamTypeConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_initParamTypeConv(JNIEnv *env , jobject) { - - try { - paramTypeConv = new ParamTypeConv(theirConn); - } catch (exception &ex) { - cout << "Exception during new ParamTypeConv) : "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_get__Ljava_lang_String_2(JNIEnv *env, jobject, jstring aConv) { - - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - short ret; - - try { - ret = paramTypeConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - } catch (exception &ex) { - cout << "Exception during ParamTypeConv::get(" << str << ") "<< ex.what() << endl; - - env->ReleaseStringUTFChars(aConv,chars); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return ret; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_get__S(JNIEnv *env, jobject, jshort aConv) { - - jstring jstr; - try { - jstr = env->NewStringUTF (paramTypeConv->get(aConv).c_str()); - } catch (exception &ex) { - cout << "Exception during ParamTypeConv::get(" << aConv << ") "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return jstr; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_getTypes(JNIEnv *env, jobject) { - - - // Construct java Map - jobject result; - jclass mapClass, shortClass; - jmethodID mapInit, put, shortInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - - shortClass = env->FindClass("java/lang/Short"); - shortInit = env->GetMethodID(shortClass, "<init>", "(S)V"); - - - - if ( env->ExceptionOccurred() ) - return 0; - - put= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - if ( env->ExceptionOccurred() ) - return 0; - - try { - paramTypeConv->top(); - do { - paramType key; - string value; - - if (paramTypeConv->get(key, value)) { - env->CallObjectMethod(result, put, env->NewObject(shortClass, - shortInit, - (jshort)key), - env->NewStringUTF(value.c_str())); - - if ( env->ExceptionOccurred() ) - return 0; - } - } while (paramTypeConv->next()); - } catch (exception &ex) { - cout << "Exception during ParamTypeConv::getTypes "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return result; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_top(JNIEnv *env, jobject) { - try { - paramTypeConv->top(); - } catch (exception &ex) { - cout << "Exception during ParamTypeConv::top "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jParamTypeConv_next(JNIEnv *env, jobject) { - jboolean aBool; - try { - aBool=paramTypeConv->next(); - } catch (exception &ex) { - cout << "Exception during ParamTypeConv::next "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aBool; -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.cc deleted file mode 100644 index 179af41390395310b267f307a46b987d06166eb4..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.cc +++ /dev/null @@ -1,862 +0,0 @@ -//# jTreeMaintenance.cc: Maintenance on complete trees. -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h> -#include <OTDB/TreeMaintenance.h> -#include <OTDB/VICnodeDef.h> -#include <OTDB/OTDBnode.h> -#include <OTDB/OTDBparam.h> -#include <iostream> -#include <string> - -using namespace LOFAR::OTDB; -using namespace std; - -extern OTDBconnection* theirConn; -TreeMaintenance* theirTM; - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: initTreeMaintenance - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_initTreeMaintenance (JNIEnv *env, jobject) { - - try { - theirTM = new TreeMaintenance (theirConn); - } catch (exception &ex) { - cout << "Exception during new TreeMaintenance "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: loadMasterFile - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_loadMasterFile(JNIEnv *env, jobject, jstring aName) { - - jint retVal; - const char* name; - try { - - jboolean isCopy; - name = env->GetStringUTFChars (aName, &isCopy); - retVal = theirTM->loadMasterFile(name); - env->ReleaseStringUTFChars (aName, name); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::loadMasterFile(" << name << ") " << ex.what() << endl; - env->ReleaseStringUTFChars (aName, name); - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - - return retVal; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: loadComponentFile - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_loadComponentFile(JNIEnv *env, jobject, jstring aName, jstring aForcedVersionNr, jstring aForcedQualifier) { - - jint retVal; - const char* name; - const char* forcedVersionNr; - const char* forcedQualifier; - try { - jboolean isCopy; - name = env->GetStringUTFChars (aName, &isCopy); - forcedVersionNr = env->GetStringUTFChars (aForcedVersionNr, &isCopy); - forcedQualifier = env->GetStringUTFChars (aForcedQualifier, &isCopy); - retVal = theirTM->loadComponentFile(name,forcedVersionNr,forcedQualifier); - env->ReleaseStringUTFChars (aName, name); - env->ReleaseStringUTFChars (aForcedVersionNr, forcedVersionNr); - env->ReleaseStringUTFChars (aForcedQualifier, forcedQualifier); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::loadComponentFile(" << name << "," << forcedVersionNr << "," << forcedQualifier <<") " << ex.what() << endl; - env->ReleaseStringUTFChars (aName, name); - env->ReleaseStringUTFChars (aForcedVersionNr, forcedVersionNr); - env->ReleaseStringUTFChars (aForcedQualifier, forcedQualifier); - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return retVal; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getComponentList - * Signature: (Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getComponentList(JNIEnv *env, jobject, jstring aName , jboolean topOnly) { - - jobject itemVector; - const char* name; - try { - jboolean isCopy; - name = env->GetStringUTFChars (aName, &isCopy); - vector<VICnodeDef> itemList = theirTM->getComponentList(name, topOnly); - env->ReleaseStringUTFChars (aName, name); - - vector<VICnodeDef>::iterator itemIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (itemIterator = itemList.begin(); itemIterator != itemList.end(); itemIterator++) - env->CallObjectMethod(itemVector, mid_Vector_add, convertVICnodeDef (env, *itemIterator)); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getComponentList(" << name << "," << topOnly << ") " << ex.what() << endl; - env->ReleaseStringUTFChars (aName, name); - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return itemVector; -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getComponentNode - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb2/jVICnodeDef; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getComponentNode(JNIEnv *env, jobject, jint aNodeID) { - - VICnodeDef aNodeDef; - try { - aNodeDef = theirTM->getComponentNode (aNodeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getComponentNode(" << aNodeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return convertVICnodeDef (env, aNodeDef); -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getComponentParams - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getComponentParams(JNIEnv *env, jobject, jint aNodeID) { - - jobject itemVector; - try { - vector<OTDBparam> itemList = theirTM->getComponentParams(aNodeID); - vector<OTDBparam>::iterator itemIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (itemIterator = itemList.begin(); itemIterator != itemList.end(); itemIterator++) - env->CallObjectMethod(itemVector, mid_Vector_add, convertOTDBparam(env, *itemIterator)); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getComponentParams(" << aNodeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return itemVector; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveComponentNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jVICnodeDef;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveComponentNode(JNIEnv *env, jobject, jobject jVICnodeDef) { - - jboolean succes; - - try { - VICnodeDef aVICnodeDef = convertjVICnodeDef (env, jVICnodeDef); - succes = theirTM->saveComponentNode(aVICnodeDef); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::saveComponentNode" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: isTopComponent - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_isTopComponent(JNIEnv *env, jobject, jint aNodeID){ - - jboolean succes; - try { - succes = theirTM->isTopComponent(aNodeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::isTopComponent(" << aNodeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteComponentNode - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteComponentNode (JNIEnv *env, jobject, jint aNodeID) { - jboolean succes; - try { - succes = theirTM->deleteComponentNode(aNodeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::deleteComponentNode(" << aNodeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getFullComponentName - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jVICnodeDef;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getFullComponentName (JNIEnv *env, jobject, jobject jVICnodeDef) { - - jstring jstr; - try { - VICnodeDef aVICnodeDef = convertjVICnodeDef (env, jVICnodeDef); - jstr = env->NewStringUTF(theirTM->getFullComponentName(aVICnodeDef).c_str()); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getFullComponentName" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return jstr; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: buildTemplateTree - * Signature: (IS)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_buildTemplateTree(JNIEnv *env, jobject, jint topNodeID, jshort aClassif) { - - jint treeID; - try { - treeID = theirTM->buildTemplateTree (topNodeID, aClassif); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::buildTemplateTree(" << topNodeID << "," << aClassif << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return treeID; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: newTemplateTree - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_newTemplateTree(JNIEnv *env, jobject) { - - jint treeID; - try { - treeID = theirTM->newTemplateTree(); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::newTemplateTree" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return treeID; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: copyTemplateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_copyTemplateTree(JNIEnv *env, jobject, jint aTreeID) { - - jint treeID; - try { - treeID = theirTM->copyTemplateTree (aTreeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::copyTemplateTree(" << aTreeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return treeID; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getNode - * Signature: (II)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getNode(JNIEnv *env, jobject, jint aTreeID, jint aNodeID) { - - OTDBnode aNode; - try { - aNode = theirTM->getNode (aTreeID, aNodeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getNode(" << aTreeID << "," << aNodeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return convertOTDBnode (env, aNode); -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getParam - * Signature: (II)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getParam__II(JNIEnv *env, jobject, jint treeID, jint paramID ) { - - OTDBparam aParam; - try { - aParam = theirTM->getParam (treeID, paramID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getParam(" << treeID << "," << paramID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return convertOTDBparam (env, aParam); -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getParam - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode;)Lnl/astron/lofar/sas/o -tb/jotdb2/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getParam__Lnl_astron_lofar_sas_otb_jotdb2_jOTDBnode_2 (JNIEnv *env , jobject, jobject jOTDBnode) { - - OTDBparam aParam; - OTDBnode aNode = convertjOTDBnode (env, jOTDBnode); - try { - aParam = theirTM->getParam(aNode); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getParam(OTDBnode) " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - - return convertOTDBparam (env, aParam); -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveParam - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBparam;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveParam(JNIEnv *env, jobject, jobject jParam) { - - jboolean succes; - try { - OTDBparam aParam = convertjOTDBparam(env,jParam); - succes = theirTM->saveParam (aParam); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::saveParam " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getItemList - * Signature: (III)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getItemList__III(JNIEnv *env, jobject, jint aTreeID, jint topNode, jint depth) { - - jobject itemVector; - try { - vector<OTDBnode> itemList = theirTM->getItemList (aTreeID, topNode, depth); - vector<OTDBnode>::iterator itemIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (itemIterator = itemList.begin(); itemIterator != itemList.end(); itemIterator++) - env->CallObjectMethod(itemVector, mid_Vector_add, convertOTDBnode (env, *itemIterator)); - - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getItemList(" << aTreeID << "," << topNode << "," << depth << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return itemVector; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getItemList - * Signature: (ILjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getItemList__ILjava_lang_String_2(JNIEnv *env, jobject, jint aTreeID, jstring aNameFragment) { - - jobject itemVector; - - const char* nf = env->GetStringUTFChars (aNameFragment, 0); - const string nameFragment (nf); - - try { - vector<OTDBnode> itemList = theirTM->getItemList (aTreeID, nameFragment); - vector<OTDBnode>::iterator itemIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (itemIterator = itemList.begin(); itemIterator != itemList.end(); itemIterator++) - env->CallObjectMethod(itemVector, mid_Vector_add, convertOTDBnode (env, *itemIterator)); - - env->ReleaseStringUTFChars (aNameFragment, nf); - - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getItemList(" << aTreeID << "," << nameFragment << ") " << ex.what() << endl; - - env->ReleaseStringUTFChars (aNameFragment, nf); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return itemVector; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: dupNode - * Signature: (IIS)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_dupNode(JNIEnv *env, jobject, jint aTreeID, jint orgNodeID, jshort newIndex) { - - jint anID; - try { - anID = theirTM->dupNode (aTreeID, orgNodeID, newIndex); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::dupNode(" << aTreeID << "," << orgNodeID << "," << newIndex << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return anID; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: addComponent - * Signature: (IIILjava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_addComponent(JNIEnv *env, jobject, jint compID, jint treeID, jint nodeID, jstring newName) { - - jint anID; - - const char* nN = env->GetStringUTFChars (newName, 0); - const string newNameForComponent (nN); - - - try { - anID=theirTM->addComponent(compID,treeID,nodeID,newNameForComponent); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::addComponent(" << compID << "," << treeID << "," << nodeID << "," << newNameForComponent << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return anID; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveNode(JNIEnv *env, jobject, jobject jNode) { - - jboolean aB; - try { - OTDBnode aNode = convertjOTDBnode (env, jNode); - aB=theirTM->saveNode (aNode); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::saveNode" << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aB; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: saveNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_saveNodeList(JNIEnv *env, jobject, jobject aNodeList) { - - jboolean succes; - - try { - OTDBnode aNode; - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_elementAt = env->GetMethodID(class_Vector, "elementAt", "(I)Ljava/lang/Object;"); - jmethodID mid_Vector_size = env->GetMethodID(class_Vector, "size", "()I"); - - for (int i = 0; i < env->CallIntMethod (aNodeList, mid_Vector_size); i++) { - aNode = convertjOTDBnode (env, env->CallObjectMethod (aNodeList, mid_Vector_elementAt, i)); - succes = theirTM->saveNode (aNode); - if (!succes) - return succes; - } - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::saveNodeList" << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteNode - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteNode(JNIEnv *env, jobject, jobject jNode) { - - jboolean aB ; - try { - jclass class_jOTDBnode = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jOTDBnode"); - jfieldID fid_jOTDBnode_itsTreeID = env->GetFieldID (class_jOTDBnode, "itsTreeID", "I"); - jfieldID fid_jOTDBnode_itsNodeID = env->GetFieldID (class_jOTDBnode, "itsNodeID", "I"); - - // Get original OTDB node - OTDBnode aNode = theirTM->getNode (env->GetIntField (jNode, fid_jOTDBnode_itsTreeID), env->GetIntField (jNode, fid_jOTDBnode_itsNodeID)); - aB=theirTM->deleteNode(aNode); - - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::deleteNode" << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aB; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteNodeList(JNIEnv *env, jobject, jobject jNodeList) { - jboolean succes; - try { - OTDBnode aNode; - // Construct java Vector - jobject jNode; - jclass class_Vector = env->FindClass ("java/util/Vector"); - jmethodID mid_Vector_elementAt = env->GetMethodID (class_Vector, "elementAt", "(I)Ljava/lang/Object;"); - jmethodID mid_Vector_size = env->GetMethodID (class_Vector, "size", "()I"); - - jclass class_jOTDBnode = env->FindClass ("nl/astron/lofar/sas/otb/jotdb2/jOTDBnode"); - jfieldID fid_jOTDBnode_itsTreeID = env->GetFieldID (class_jOTDBnode, "itsTreeID", "I"); - jfieldID fid_jOTDBnode_itsNodeID = env->GetFieldID (class_jOTDBnode, "itsNodeID", "I"); - - for (int i = 0; i < env->CallIntMethod (jNodeList, mid_Vector_size); i++) { - jNode = env->CallObjectMethod (jNodeList, mid_Vector_elementAt, i); - // Get original OTDB node - aNode = theirTM->getNode (env->GetIntField (jNode, fid_jOTDBnode_itsTreeID), env->GetIntField (jNode, fid_jOTDBnode_itsNodeID)); - succes = theirTM->deleteNode (aNode); - if (!succes) - return succes; - } - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::deleteNodeList" << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: checkTreeConstraints - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeaintenance_checkTreeConstraints(JNIEnv *env, jobject, jint aTreeID, jint topNode) { - jboolean aB; - try { - // aB=theirTM->checkTreeConstraints (aTreeID, topNode); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::checkTreeConstraints(" << aTreeID << "," << topNode << ") "<< ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aB; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: instanciateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_instanciateTree(JNIEnv *env, jobject, jint baseTree) { - jint anID; - try { - anID= theirTM->instanciateTree (baseTree); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::instantiateTree(" << baseTree << ") " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return anID; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMantenance - * Method: pruneTree - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_pruneTree(JNIEnv *env, jobject, jint aTreeID, jshort pruningLevel) { - - jboolean aB; - try { - aB= theirTM->pruneTree (aTreeID, pruningLevel); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::pruneTree(" << aTreeID << "," << pruningLevel << ") " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aB; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: exportTree - * Signature: (IILjava/lang/String;IZ)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_exportTree(JNIEnv *env, jobject, jint treeID, jint topItem, jstring aName, jint outputFormat, jboolean folded) { - - jboolean isCopy; - jboolean succes; - const char* name = env->GetStringUTFChars (aName, &isCopy); - try { - succes = theirTM->exportTree (treeID, topItem, name, (TreeMaintenance::formatType)outputFormat , folded); - env->ReleaseStringUTFChars (aName, name); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::exportTree(" << treeID << "," << topItem << "," << name << "," << (TreeMaintenance::formatType)outputFormat << "," << folded << ") "<< ex.what() << endl; - env->ReleaseStringUTFChars (aName, name); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: deleteTree - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_deleteTree(JNIEnv *env, jobject, jint aTreeID) { - jboolean succes; - try { - succes=theirTM->deleteTree (aTreeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::deleteTree(" << aTreeID << ") " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: getTopNode - * Signature: (I)Lnl/astron/lofar/sas/otb/jotdb2/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_getTopNode(JNIEnv *env, jobject, jint aTreeID) { - - OTDBnode aNode; - try { - aNode = theirTM->getTopNode (aTreeID); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::getTopNode(" << aTreeID << ") " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return convertOTDBnode (env, aNode); -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setMomInfo - * Signature: (IILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setMomInfo(JNIEnv *env, jobject, jint aTreeID, jint aMomID, jstring aCampaign) { - jboolean isCopy; - jboolean succes; - const char* name = env->GetStringUTFChars (aCampaign, &isCopy); - try { - succes = theirTM->setMomInfo (aTreeID, aMomID, name); - env->ReleaseStringUTFChars (aCampaign, name); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::setMomInfo(" << aTreeID << "," << aMomID << "," << name << ") " << ex.what() << endl; - env->ReleaseStringUTFChars (aCampaign, name); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setClassification - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setClassification(JNIEnv *env, jobject, jint aTreeID, jshort aClassification) { - jboolean succes; - try { - succes=theirTM->setClassification (aTreeID, aClassification); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::setClassification(" << aTreeID << "," << aClassification << ") " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setTreeState - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setTreeState(JNIEnv *env, jobject, jint aTreeID, jshort aState) { - jboolean aB; - try { - theirTM->setTreeState (aTreeID, aState); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::setTreeState(" << aTreeID << "," << aState << ") " << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return aB; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setDescription - * Signature: (ILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setDescription(JNIEnv *env, jobject, jint aTreeID, jstring aDesc) { - jboolean isCopy; - jboolean succes; - const char* desc = env->GetStringUTFChars (aDesc, &isCopy); - try { - succes = theirTM->setDescription (aTreeID, desc); - env->ReleaseStringUTFChars (aDesc, desc); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::setDescription(" << aTreeID << "," << desc << ") " << ex.what() << endl; - env->ReleaseStringUTFChars (aDesc, desc); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: setSchedule - * Signature: (ILjava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_setSchedule(JNIEnv *env, jobject, jint treeID, jstring aStartTime, jstring anEndTime) { - const char* bd = env->GetStringUTFChars (aStartTime, 0); - const char* ed = env->GetStringUTFChars (anEndTime, 0); - const string startTime (bd); - const string endTime (ed); - const ptime ts (time_from_string (startTime)); - const ptime te (time_from_string (endTime)); - jboolean aB; - try { - aB= theirTM->setSchedule(treeID,ts,te); - env->ReleaseStringUTFChars (aStartTime, bd); - env->ReleaseStringUTFChars (anEndTime, ed); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::setSchedule(" << treeID << "," << ts << "," << te << ") " << ex.what() << endl; - env->ReleaseStringUTFChars (aStartTime, bd); - env->ReleaseStringUTFChars (anEndTime, ed); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return aB; -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeMaintenance_errorMsg(JNIEnv *env, jobject) { - jstring aS; - try { - aS = env->NewStringUTF(theirConn->errorMsg().c_str()); - } catch (exception &ex) { - cout << "Exception during TreeMaintenance::errorMsg" << ex.what() << endl; - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return aS; - -} - - diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.cc deleted file mode 100644 index d54ec932c5d57836883e7ab820d3d166d8273cc1..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.cc +++ /dev/null @@ -1,191 +0,0 @@ -//# jTreeStateConv.cc: -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv.h> -#include <OTDB/OTDBtypes.h> -#include <string> -#include <iostream> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <OTDB/TreeStateConv.h> - -using namespace LOFAR::OTDB; -using namespace std; - - -static TreeStateConv* treeStateConv; -extern OTDBconnection* theirConn; - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: initTreeStateConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_initTreeStateConv(JNIEnv *env, jobject) { - - try { - treeStateConv = new TreeStateConv(theirConn); - } catch (exception &ex) { - cout << "Exception during new TreeStateConv "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_get__Ljava_lang_String_2(JNIEnv *env, jobject, jstring aConv) { - - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret; - try { - ret= treeStateConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - } catch (exception &ex) { - cout << "Exception during TreeStateConv::get(" << str << ") " << ex.what() << endl; - - env->ReleaseStringUTFChars (aConv, chars); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return ret; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_get__S(JNIEnv *env, jobject, jshort aConv) { - jstring jstr; - try { - jstr= env->NewStringUTF (treeStateConv->get(aConv).c_str()); - } catch (exception &ex) { - cout << "Exception during TreeStateConv::get(" << aConv << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return jstr; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_getTypes(JNIEnv *env, jobject) { - - - // Construct java Map - jobject result; - jclass mapClass, shortClass; - jmethodID mapInit, put, shortInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - - shortClass = env->FindClass("java/lang/Short"); - shortInit = env->GetMethodID(shortClass, "<init>", "(S)V"); - - - try { - if ( env->ExceptionOccurred() ) - return 0; - - put= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - if ( env->ExceptionOccurred() ) - return 0; - - treeStateConv->top(); - do { - treeState key; - string value; - - if (treeStateConv->get(key, value)) { - env->CallObjectMethod(result, put, env->NewObject(shortClass, - shortInit, - (jshort)key), - env->NewStringUTF(value.c_str())); - - if ( env->ExceptionOccurred() ) - return 0; - } - } while (treeStateConv->next()); - } catch (exception &ex) { - cout << "Exception during TreeStateConv::getTypes" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return result; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_top(JNIEnv *env, jobject) { - try { - treeStateConv->top(); - } catch (exception &ex) { - cout << "Exception during TreeStateConv::top" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeStateConv_next(JNIEnv *env, jobject) { - jboolean aBool; - try { - aBool=treeStateConv->next(); - } catch (exception &ex) { - cout << "Exception during TreeStateConv::next" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aBool; -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.cc deleted file mode 100644 index 915a345a9764d4c18d276b664e677a5faeb708c7..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.cc +++ /dev/null @@ -1,192 +0,0 @@ -//# jTreeTypeConv.cc: -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv.h> -#include <OTDB/OTDBtypes.h> -#include <string> -#include <iostream> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <OTDB/TreeTypeConv.h> - -using namespace LOFAR::OTDB; -using namespace std; - - -static TreeTypeConv* treeTypeConv; -extern OTDBconnection* theirConn; - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: initTreeTypeConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_initTreeTypeConv(JNIEnv *env, jobject) { - try { - treeTypeConv = new TreeTypeConv(theirConn); - } catch (exception &ex) { - cout << "Exception during new TreeTypeConv::top" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_get__Ljava_lang_String_2(JNIEnv *env, jobject, jstring aConv) { - - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret; - try { - ret= treeTypeConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - } catch (exception &ex) { - cout << "Exception during TreeTypeConv::get(" << str << ") " << ex.what() << endl; - - env->ReleaseStringUTFChars (aConv, chars); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - - return ret; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_get__S(JNIEnv *env, jobject, jshort aConv) { - jstring jstr; - try { - jstr= env->NewStringUTF (treeTypeConv->get(aConv).c_str()); - } catch (exception &ex) { - cout << "Exception during TreeTypeConv::get(" << aConv << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return jstr; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_getTypes(JNIEnv *env, jobject) { - - - // Construct java Map - jobject result; - jclass mapClass, shortClass; - jmethodID mapInit, put, shortInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - - shortClass = env->FindClass("java/lang/Short"); - shortInit = env->GetMethodID(shortClass, "<init>", "(S)V"); - - - if ( env->ExceptionOccurred() ) - return 0; - - put= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - if ( env->ExceptionOccurred() ) - return 0; - - try { - - treeTypeConv->top(); - do { - treeType key; - string value; - - if (treeTypeConv->get(key, value)) { - env->CallObjectMethod(result, put, env->NewObject(shortClass, - shortInit, - (jshort)key), - env->NewStringUTF(value.c_str())); - - if ( env->ExceptionOccurred() ) - return 0; - } - } while (treeTypeConv->next()); - } catch (exception &ex) { - cout << "Exception during TreeTypeConv::getTypes(" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return result; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_top(JNIEnv *env, jobject) { - try { - treeTypeConv->top(); - } catch (exception &ex) { - cout << "Exception during TreeTypeConv::top(" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeTypeConv_next(JNIEnv *env, jobject) { - jboolean aBool; - try { - aBool=treeTypeConv->next(); - } catch (exception &ex) { - cout << "Exception during TreeTypeConv::next(" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aBool; -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.cc deleted file mode 100644 index 77f177483e0b45ce6cdc7bb1bb21c6e2db7e5514..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.cc +++ /dev/null @@ -1,280 +0,0 @@ -//# jTreeValue.cc: Get KVT valuess from database via JNI -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jOTDBconnection.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jTreeValue.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <boost/date_time/posix_time/time_formatters.hpp> -#include <boost/date_time/posix_time/time_parsers.hpp> -#include <string> -#include <iostream> - -using namespace boost::posix_time; -using namespace LOFAR::OTDB; -using namespace std; - -TreeValue* treeval; -extern OTDBconnection* theirConn; - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: addKVT - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_addKVT__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring key, jstring val, jstring time) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,obj); - - const char* ak = env->GetStringUTFChars (key, 0); - const char* av = env->GetStringUTFChars (val, 0); - const char* at = env->GetStringUTFChars (time, 0); - - const string aKey(ak); - const string aValue(av); - const string aT(at); - - const ptime aTime (time_from_string (aT)); - - jboolean succes; - try { - succes=treeval->addKVT(aKey,aValue,aTime); - - env->ReleaseStringUTFChars (key ,ak); - env->ReleaseStringUTFChars (val ,av); - env->ReleaseStringUTFChars (time ,at); - setErrorMsg(env,obj); - } catch (exception &ex) { - cout << "Exception during treeValue::addKVT(" << aKey << "," << aValue << "," << aTime << ") " << ex.what() << endl; - - env->ReleaseStringUTFChars (key ,ak); - env->ReleaseStringUTFChars (val ,av); - env->ReleaseStringUTFChars (time ,at); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: addKVT - * Signature: (Lnl/astron/lofar/sas/otb/jotdb2/jOTDBvalue;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_addKVT__Lnl_astron_lofar_sas_otb_jotdb2_jOTDBvalue_2(JNIEnv *env, jobject obj, jobject jOTDBval) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,obj); - - OTDBvalue anOTDBvalue = convertjOTDBvalue (env, jOTDBval); - jboolean succes; - try { - succes = treeval->addKVT(anOTDBvalue); - setErrorMsg(env,obj); - } catch (exception &ex) { - cout << "Exception during treeValue::addKVT" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: addKVTlist - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_addKVTlist(JNIEnv *env, jobject obj, jobject aValList ) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,obj); - - OTDBvalue aValue; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_elementAt = env->GetMethodID(class_Vector, "elementAt", - "(I)Ljava/lang/Object;"); - jmethodID mid_Vector_size = env->GetMethodID(class_Vector, "size", "()I"); - int size=env->CallIntMethod (aValList, mid_Vector_size); - - vector<OTDBvalue> aCValList(size); - - for (int i = 0; i < size; i++) { - aValue = convertjOTDBvalue (env, - env->CallObjectMethod (aValList, - mid_Vector_elementAt,i)); - aCValList[i]=aValue; - } - - setErrorMsg(env,obj); - - jboolean succes; - try { - succes=treeval->addKVTlist(aCValList); - } catch (exception &ex) { - cout << "Exception during treeValue::addKVTlist" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - return succes; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: searchInPeriod - * Signature: (IILjava/lang/String;Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_searchInPeriod(JNIEnv *env, jobject obj, jint topNode, jint depth, jstring beginDate, jstring endDate, jboolean mostRecentOnly) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,obj); - - - - - const char* bd = env->GetStringUTFChars (beginDate, 0); - const char* ed = env->GetStringUTFChars (endDate, 0); - const string beginTime (bd); - const string endTime (ed); - - - const ptime ts (time_from_string (beginTime)); - const ptime te (time_from_string (endTime)); - jobject valueVector; - - try { - vector<OTDBvalue> valueList = treeval->searchInPeriod (topNode, depth, ts, te, mostRecentOnly); - vector<OTDBvalue>::iterator valueIterator; - - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - valueVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (valueIterator = valueList.begin(); valueIterator != valueList.end(); valueIterator++) - env->CallObjectMethod(valueVector, mid_Vector_add, convertOTDBvalue (env, *valueIterator)); - - env->ReleaseStringUTFChars (beginDate, bd); - env->ReleaseStringUTFChars (endDate, ed); - - setErrorMsg(env,obj); - } catch (exception &ex) { - cout << "Exception during treeValue::searchInPeriod(" << topNode << "," - << depth << "," << ts << "," << mostRecentOnly << ") "<< ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - - } - return valueVector; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jTreeValue - * Method: getSchedulableItems - * Signature: (I)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jTreeValue_getSchedulableItems(JNIEnv *env, jobject obj, jint aNodeID) { - - // create the connection with the c++ TreeVal - setTreeValConnection(env,obj); - jobject itemVector; - - try { - vector<OTDBvalue> itemList = treeval->getSchedulableItems(aNodeID); - vector<OTDBvalue>::iterator itemIterator; - - // Construct java Vector - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - itemVector = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (itemIterator = itemList.begin(); itemIterator != itemList.end(); itemIterator++) - env->CallObjectMethod(itemVector, - mid_Vector_add, - convertOTDBvalue (env, *itemIterator)); - - setErrorMsg(env,obj); - } catch (exception &ex) { - cout << "Exception during treeValue::getSchedulableItems(" << aNodeID << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return itemVector; -} - - - -void setTreeValConnection(JNIEnv *env, jobject callerObject) { - // get the callerclass - jclass jTreeValue=env->GetObjectClass(callerObject); - - // get the methodID - jfieldID id_treeID = env->GetFieldID (jTreeValue, "itsTreeID","I"); - - // get the value - jint aTreeID = env->GetIntField(callerObject,id_treeID); - - // create the connection with the c++ TreeVal - try { - treeval = new TreeValue(theirConn,aTreeID); - } catch (exception &ex) { - cout << "Exception during new treeValue" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - -void setErrorMsg(JNIEnv *env, jobject callerObject) { - // get the callerclass - jclass jTreeValue=env->GetObjectClass(callerObject); - - // get the methodID - jfieldID id_errorMsg = env->GetFieldID (jTreeValue, "itsErrorMsg","Ljava/lang/String;"); - - // get the ErrorMsg - jstring errorMsg; - try { - errorMsg=env->NewStringUTF(theirConn->errorMsg().c_str()); - } catch (exception &ex) { - cout << "Exception during errorMsg" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - // set the ErrorMsg in the jTreeValue - env->SetObjectField(callerObject,id_errorMsg,errorMsg); -} diff --git a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.cc b/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.cc deleted file mode 100644 index 26023a1284e85b46c493a22e07a36b804c671430..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/src/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.cc +++ /dev/null @@ -1,192 +0,0 @@ -//# jUnitConv.cc: -//# -//# Copyright (C) 2002-2007 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -//# Includes -#include <Common/LofarLogger.h> -#include <Common/StringUtil.h> -#include <jni.h> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jUnitConv.h> -#include <OTDB/OTDBtypes.h> -#include <string> -#include <iostream> -#include <jOTDB2/nl_astron_lofar_sas_otb_jotdb2_jCommon.h> -#include <OTDB/UnitConv.h> - -using namespace LOFAR::OTDB; -using namespace std; - - -static UnitConv* unitConv; -extern OTDBconnection* theirConn; - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: initUnitConv - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_initUnitConv(JNIEnv *env, jobject) { - - try { - unitConv = new UnitConv(theirConn); - } catch (exception &ex) { - cout << "Exception during new UnitConv" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: get - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_get__Ljava_lang_String_2(JNIEnv *env, jobject, jstring aConv) { - - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret; - try { - ret = unitConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - } catch (exception &ex) { - cout << "Exception during UnitConv::get(" << str << ") " << ex.what() << endl; - - env->ReleaseStringUTFChars (aConv, chars); - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return ret; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: get - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_get__S(JNIEnv *env, jobject, jshort aConv) { - jstring jstr; - try { - jstr= env->NewStringUTF (unitConv->get(aConv).c_str()); - } catch (exception &ex) { - cout << "Exception during UnitConv::get(" << aConv << ") " << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return jstr; -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: getTypes - * Signature: ()Ljava/util/HashMap; - */ -JNIEXPORT jobject JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_getTypes(JNIEnv *env, jobject) { - - - // Construct java Map - jobject result; - jclass mapClass, shortClass; - jmethodID mapInit, put, shortInit; - - mapClass = env->FindClass("java/util/HashMap"); - mapInit = env->GetMethodID(mapClass, "<init>", "()V"); - result = env->NewObject(mapClass, mapInit); - - shortClass = env->FindClass("java/lang/Short"); - shortInit = env->GetMethodID(shortClass, "<init>", "(S)V"); - - - if ( env->ExceptionOccurred() ) - return 0; - - put= env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - - if ( env->ExceptionOccurred() ) - return 0; - - try { - unitConv->top(); - do { - unitType key; - string value; - - if (unitConv->get(key, value)) { - env->CallObjectMethod(result, put, env->NewObject(shortClass, - shortInit, - (jshort)key), - env->NewStringUTF(value.c_str())); - - if ( env->ExceptionOccurred() ) - return 0; - } - } while (unitConv->next()); - } catch (exception &ex) { - cout << "Exception during UnitConv::getTypes" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - - return result; - -} - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: top - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_top(JNIEnv *env, jobject) { - - try { - unitConv->top(); - } catch (exception &ex) { - cout << "Exception during UnitConv::top" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } -} - - -/* - * Class: nl_astron_lofar_sas_otb_jotdb2_jUnitConv - * Method: next - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_nl_astron_lofar_sas_otb_jotdb2_jUnitConv_next(JNIEnv *env, jobject) { - jboolean aBool; - try { - aBool=unitConv->next(); - } catch (exception &ex) { - cout << "Exception during UnitConv::next" << ex.what() << endl; - - env->ThrowNew(env->FindClass("java/lang/Exception"),ex.what()); - } - - return aBool; -} diff --git a/SAS/OTB/jOTDB2/test/tCampaign.java b/SAS/OTB/jOTDB2/test/tCampaign.java deleted file mode 100644 index 26e5d63bfc5b1240fd6682d7538e7a72010ecf84..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tCampaign.java +++ /dev/null @@ -1,118 +0,0 @@ -import java.util.Vector; -import nl.astron.lofar.sas.otb.jotdb2.jCampaign; -import nl.astron.lofar.sas.otb.jotdb2.jCampaignInfo; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBconnection; -import nl.astron.lofar.sas.otb.jotdb2.jInitCPPLogger; - -class tCampaign -{ - static - { - System.loadLibrary ("jotdb2"); - } - - - public static void main (String[] args) - { - String logConfig="tCampaign.log_prop"; - try { - jInitCPPLogger aCPPLogger= new jInitCPPLogger(logConfig); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - tCampaign tCampaign = new tCampaign (); - tCampaign.test (); - } - - public void showCampaignList (Vector<jCampaignInfo> camps,jOTDBconnection conn) - { - - boolean firstLine=true; - jCampaignInfo aCampaignInfo; - for (int i = 0; i < camps.size (); ++i) - { - aCampaignInfo = camps.elementAt(i); - showCampaignInfo(aCampaignInfo,firstLine); - firstLine=false; - } - System.out.println (camps.size () + " records\n"); - } - - public void showCampaignInfo(jCampaignInfo aCampaignInfo, boolean firstLine) { - if (firstLine) { - System.out.println ("ID lname |title |PI |CO_I |contact"); - System.out.println ("----+----------+----------+---------------+---------------+------------------"); - } - - System.out.printf ("%4d|%-10.10s|%-10.10s|%-15.15s|%-15.15s\n", - aCampaignInfo.ID(), - aCampaignInfo.itsName, - aCampaignInfo.itsTitle, - aCampaignInfo.itsPI, - aCampaignInfo.itsCO_I, - aCampaignInfo.itsContact); - - } - - - - public void test () { - try { - // do the test - System.out.println ("Starting... "); - - // create a jOTDBconnection - jOTDBconnection conn = new jOTDBconnection("paulus","boskabouter","otdbtest","dop50.astron.nl"); - - System.out.println ("Trying to connect to the database"); - assert conn.connect () : "Connection failed"; - assert conn.isConnected () : "Connnection flag failed"; - - System.out.println ("Connection succesful!"); - - System.out.println ("Trying to construct a Campaign object"); - jCampaign camp = new jCampaign (); - assert camp==null : "Creation of Campaign Failed!"; - - - System.out.println ("Searching for campaigns"); - Vector<jCampaignInfo> campList = camp.getCampaignList(); - showCampaignList (campList, conn); - assert campList.size()!=0 : "No campaign list found!"; - - System.out.println("Adding my campaign"); - jCampaignInfo CI = new jCampaignInfo("my campaign", "campaign of me", "me", "no-one", "also me"); - System.out.println("new recordID = "+ camp.saveCampaign(CI)); - campList = camp.getCampaignList(); - showCampaignList (campList, conn); - assert campList.size()!=0 : "No campaign list found!"; - - System.out.println("Adding your campaign"); - jCampaignInfo YCI = new jCampaignInfo("your campaign", "campaign of you", "you", "no-one", "also you"); - System.out.println("new recordID = "+ camp.saveCampaign(YCI)); - campList = camp.getCampaignList(); - showCampaignList (campList, conn); - assert campList.size()!=0 : "No campaign list found!"; - - System.out.println("Changing my campaign"); - jCampaignInfo myCamp = camp.getCampaign("my campaign"); - myCamp.itsTitle ="my own campaign"; - myCamp.itsContact = "112"; - System.out.println("recordID = "+ camp.saveCampaign(myCamp)); - campList = camp.getCampaignList(); - showCampaignList (campList, conn); - assert campList.size()!=0 : "No campaign list found!"; - - - System.out.println ("Terminated succesfully: "); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } -} - - - - diff --git a/SAS/OTB/jOTDB2/test/tConnection.java b/SAS/OTB/jOTDB2/test/tConnection.java deleted file mode 100644 index f950f4f94e1fbfe7ed447c4d02827660d3adf487..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tConnection.java +++ /dev/null @@ -1,71 +0,0 @@ - -import nl.astron.lofar.sas.otb.jotdb2.jOTDBtree; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBconnection; -import java.util.Vector; - - -class tConnection -{ - - static - { - System.loadLibrary("jotdb2"); - } - - - public static void main(String[] args) - { - tConnection tconn = new tConnection(); - tconn.test(); - } - - public void test() { - try { - // do the test - System.out.println("Starting... "); - - // create a jOTDBconnection - jOTDBconnection conn = new jOTDBconnection("paulus","boskabouter","otdbtest","dop50.astron.nl"); - - System.out.println("Trying to connect to the database"); - assert conn.connect() : "Connection failed"; - assert conn.isConnected() : "Connnection flag failed"; - - System.out.println("Connection succesful!"); - - System.out.println("getTreeList(0,0)"); - Vector treeList; - treeList = conn.getTreeList((short)0, (short)0); - if (treeList.size() == 0) { - System.out.println("Error:" + conn.errorMsg()); - } else { - System.out.println("Collected tree list"); - //showTreeList(treeList); - } - - System.out.println("getTreeInfo(treeList.elementAt(1))"); - jOTDBtree tInfo = (jOTDBtree)treeList.elementAt(1); - if (tInfo.treeID()==0) { - System.out.println("NOT SUCH TREE FOUND!"); - } else { - System.out.println(tInfo.classification); - System.out.println(tInfo.creator); - System.out.println(tInfo.creationDate); - System.out.println(tInfo.type); - System.out.println(tInfo.state); - System.out.println(tInfo.originalTree); - System.out.println(tInfo.campaign); - System.out.println(tInfo.starttime); - System.out.println(tInfo.stoptime); - System.out.println(tInfo.treeID()); - } - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } - -} - - - diff --git a/SAS/OTB/jOTDB2/test/tConverter.java b/SAS/OTB/jOTDB2/test/tConverter.java deleted file mode 100644 index 757ca84f96f53aa318f2b7004ecbb014630f1da2..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tConverter.java +++ /dev/null @@ -1,144 +0,0 @@ -import nl.astron.lofar.sas.otb.jotdb2.jOTDBconnection; -import nl.astron.lofar.sas.otb.jotdb2.jClassifConv; -import nl.astron.lofar.sas.otb.jotdb2.jParamTypeConv; -import nl.astron.lofar.sas.otb.jotdb2.jTreeStateConv; -import nl.astron.lofar.sas.otb.jotdb2.jTreeTypeConv; -import nl.astron.lofar.sas.otb.jotdb2.jUnitConv; -import java.util.HashMap; -import java.util.Iterator; - - -class tConverter -{ - - private HashMap<Short,String> aM; - private Iterator it; - - private String dbName="otdbtest"; - - static - { - System.loadLibrary("jotdb2"); - } - - - public static void main(String[] args) - { - tConverter tconv = new tConverter(); - tconv.test(); - } - - public void test() { - try { - // do the test - System.out.println("Starting... using Database: "+dbName); - - // create a jOTDBconnection - jOTDBconnection conn = new jOTDBconnection("paulus","boskabouter",dbName,"dop50.astron.nl"); - - System.out.println("Trying to connect to the database"); - assert conn.connect() : "Connection failed"; - assert conn.isConnected() : "Connnection flag failed"; - - System.out.println("Connection succesful!"); - - System.out.println("Constructing a Classif-type converter"); - jClassifConv cf = new jClassifConv(); - - System.out.println("Converting 2: "+ cf.get((short)2)); - - System.out.println("Converting test: "+ cf.get("test")); - - System.out.println("Reset the list:"); - - System.out.println("getTypes Map"); - aM=cf.getTypes(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - System.out.println("Constructing a ParamType converter"); - jParamTypeConv ptf = new jParamTypeConv(); - - System.out.println("Converting 101: "+ ptf.get((short)101)); - - System.out.println("Converting text: "+ ptf.get("text")); - - System.out.println("Reset the list:"); - - ptf.top(); - System.out.println("getTypes Map"); - aM=ptf.getTypes(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - System.out.println("Constructing a TreeState-type converter"); - jTreeStateConv ts = new jTreeStateConv(); - - System.out.println("Converting 1100: "+ ts.get((short)1100)); - - System.out.println("Converting active: "+ ts.get("active")); - - System.out.println("Reset the list:"); - - ts.top(); - System.out.println("getTypes Map"); - aM=ts.getTypes(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - - System.out.println("Constructing a TreeType-type converter"); - jTreeTypeConv tt = new jTreeTypeConv(); - - System.out.println("Converting 30: "+ tt.get((short)30)); - - System.out.println("Converting hardware: "+ tt.get("hardware")); - - System.out.println("Reset the list:"); - - tt.top(); - System.out.println("getTypes Map"); - aM=tt.getTypes(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - - System.out.println("Constructing a Unit-type converter"); - jUnitConv ut = new jUnitConv(); - - System.out.println("Converting 7: "+ ut.get((short)7)); - - System.out.println("Converting RAM: "+ ut.get("RAM")); - - System.out.println("Reset the list:"); - - ut.top(); - System.out.println("getTypes Map"); - aM=ut.getTypes(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } -} - - - diff --git a/SAS/OTB/jOTDB2/test/tRemoteConnection.java b/SAS/OTB/jOTDB2/test/tRemoteConnection.java deleted file mode 100644 index 73ef455081326dcff645f7ef33450370580486cf..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tRemoteConnection.java +++ /dev/null @@ -1,67 +0,0 @@ -import java.rmi.Naming; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBtree; -//import jOTDB.jOTDBconnection; -import java.util.Vector; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBinterface; - - -class tRemoteConnection { - private static jOTDBinterface remoteOTDB; - public static String RMIServerName = "lofar17.astron.nl"; - public static String RMIServerPort = "1091"; - public static String RMIRegistryName = jOTDBinterface.SERVICENAME; - - public static void main (String[] args) { - try { -// if (args.length != 1) { -// System.out.println ("Usage: java tRemoteConnection <rmi-registry_hostname>"); -// System.exit(0); -// } - - System.out.println("Starting... "); - - // create a remote object -// Registry remoteRegistry = LocateRegistry.getRegistry (args[0]); -// remoteOTDB = (jOTDBinterface) remoteRegistry.lookup (jOTDBinterface.SERVICENAME); - String RMIRegHostName="rmi://"+RMIServerName+":"+RMIServerPort+"/"+RMIRegistryName; - remoteOTDB = (jOTDBinterface) Naming.lookup (RMIRegHostName); - System.out.println (remoteOTDB); - - // do the test - System.out.println("Trying to connect to the database"); - assert remoteOTDB.connect() : "Connection failed"; - assert remoteOTDB.isConnected() : "Connnection flag failed"; - - System.out.println("Connection succesful!"); - - System.out.println("getTreeList(0,0)"); - Vector treeList; - treeList = remoteOTDB.getTreeList((short)0, (short)0); - if (treeList.size() == 0) { - System.out.println("Error:" + remoteOTDB.errorMsg()); - System.exit (0); - } else { - System.out.println("Collected tree list"); - } - System.out.println("getTreeInfo(treeList.elementAt(1))"); - jOTDBtree tInfo = (jOTDBtree)treeList.elementAt(1); - if (tInfo.treeID()==0) { - System.out.println("NOT SUCH TREE FOUND!"); - } else { - System.out.println(tInfo.classification); - System.out.println(tInfo.creator); - System.out.println(tInfo.creationDate); - System.out.println(tInfo.type); - System.out.println(tInfo.state); - System.out.println(tInfo.originalTree); - System.out.println(tInfo.campaign); - System.out.println(tInfo.starttime); - System.out.println(tInfo.stoptime); - System.out.println(tInfo.treeID()); - } - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } -} diff --git a/SAS/OTB/jOTDB2/test/tRemoteConverter.java b/SAS/OTB/jOTDB2/test/tRemoteConverter.java deleted file mode 100644 index f89f0c35fb199c2a50c70ec26ebbafd62660543a..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tRemoteConverter.java +++ /dev/null @@ -1,109 +0,0 @@ -import java.rmi.Naming; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; -import nl.astron.lofar.sas.otb.jotdb2.jConverterInterface; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBinterface; -import nl.astron.lofar.sas.otb.jotdb2.jTreeMaintenanceInterface; - - -class tRemoteConverter -{ - private static jOTDBinterface conn; - private static jConverterInterface tc; - private static HashMap<Short,String> aM; - private static Iterator it; - public static String RMIServerName = "lofar17.astron.nl"; - public static String RMIServerPort = "1091"; - public static String RMIRegistryName = jOTDBinterface.SERVICENAME; - public static String RMIConverterName = jConverterInterface.SERVICENAME; - - public static void main (String[] args) - { - try { - - System.out.println("Starting... "); - - // create a remote object - conn = (jOTDBinterface) Naming.lookup ("rmi://"+RMIServerName+":"+RMIServerPort+"/"+RMIRegistryName); - // do the test - System.out.println ("Starting... "); - - System.out.println ("Trying to connect to the database"); - assert conn.connect () : "Connection failed"; - assert conn.isConnected () : "Connnection flag failed"; - - System.out.println ("Connection succesful!"); - - System.out.println ("Searching for a Template tree"); - Vector treeList; - treeList = conn.getTreeList ((short)20, (short)0); // 20 = template, 0 = all - if (treeList.size () == 0) { - System.out.println ("No template tree found!"); - System.exit (0); - } - - tc = (jConverterInterface) Naming.lookup ("rmi://"+RMIServerName+":"+RMIServerPort+"/"+RMIConverterName); - // Test converter - - // Classif - System.out.println("****** Classif testen ******"); - System.out.println("Converting 2: "+ tc.getClassif((short)2)); - System.out.println("Converting test: "+ tc.getClassif("test")); - aM=tc.getClassif(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - // ParamType - System.out.println("****** ParamType testen ******"); - System.out.println("Converting 101: "+ tc.getParamType((short)101)); - System.out.println("Converting text: "+ tc.getParamType("text")); - aM=tc.getParamType(); - - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - // TreeState - System.out.println("****** TreeState testen ******"); - System.out.println("Converting 1100: "+ tc.getTreeState((short)1100)); - System.out.println("Converting active: "+ tc.getTreeState("active")); - aM=tc.getTreeState(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - // TreeType - System.out.println("****** TreeType testen ******"); - System.out.println("Converting 30: "+ tc.getTreeType((short)30)); - System.out.println("Converting hardware: "+ tc.getTreeType("hardware")); - aM=tc.getTreeType(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - - // Unit - System.out.println("****** Unit testen ******"); - System.out.println("Converting 7: "+ tc.getUnit((short)7)); - System.out.println("Converting RAM: "+ tc.getUnit("RAM")); - aM=tc.getUnit(); - it = aM.keySet().iterator(); - while (it.hasNext()) { - Short key = (Short)it.next(); - System.out.println(key.toString() + " <-> " + aM.get(key)); - } - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } -} diff --git a/SAS/OTB/jOTDB2/test/tRemoteFile.java b/SAS/OTB/jOTDB2/test/tRemoteFile.java deleted file mode 100644 index 50d4136bc55be15bad19efb2a3df96b25eb0d0ce..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tRemoteFile.java +++ /dev/null @@ -1,61 +0,0 @@ - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.rmi.Naming; -import nl.astron.lofar.lofarutils.remoteFileInterface; - - -public class tRemoteFile { - - - public static String RMIRegistryName = remoteFileInterface.SERVICENAME; - - public static void main(String[] argv) { - if(argv.length != 3) { - System.out.println("Usage: java tRemoteFile fileName machineName machinePort"); - System.out.println("Where file is a file on the client."); - System.exit(0); - } - String aRF="rmi://"+argv[1]+":"+argv[2]+"/"+RMIRegistryName; - - try { - // do the test - System.out.println("Starting..."); - remoteFileInterface fi = (remoteFileInterface) Naming.lookup(aRF); - - System.out.println("Starting upload"); - File aFile = new File(argv[0]); - byte uldata[] = new byte[(int)aFile.length()]; - System.out.println("File opened: "+aFile.getName()+" bytesize: "+ uldata.length); - BufferedInputStream input = new BufferedInputStream(new FileInputStream(aFile)); - input.read(uldata,0,uldata.length); - input.close(); - if (fi.uploadFile(uldata,argv[0]+".uploaded")) { - System.out.println("upload finished"); - } else { - System.out.println("upload failed"); - } - - - System.out.println("Starting download"); - byte[] dldata = fi.downloadFile(argv[0]+".uploaded"); - File file = new File(argv[0]+".downloaded"); - System.out.println("opening File: "+file.getName()); - BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(file.getName())); - System.out.println("Received buffer length: "+dldata.length); - output.write(dldata,0,dldata.length); - output.flush(); - output.close(); - System.out.println("Download finished"); - } catch(Exception e) { - System.err.println("FileServer exception: "+ e.getMessage()); - e.printStackTrace(); - } - } -} - - - diff --git a/SAS/OTB/jOTDB2/test/tRemoteTreeMaintenance.java b/SAS/OTB/jOTDB2/test/tRemoteTreeMaintenance.java deleted file mode 100644 index 626e081afed904119fbacfa6487d0698b8e19ae6..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tRemoteTreeMaintenance.java +++ /dev/null @@ -1,304 +0,0 @@ -import java.rmi.Naming; -import java.util.Vector; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBinterface; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBparam; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBtree; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBvalue; -import nl.astron.lofar.sas.otb.jotdb2.jTreeMaintenanceInterface; -import nl.astron.lofar.sas.otb.jotdb2.jTreeValueInterface; - -class tRemoteTreeMaintenance -{ - private static jOTDBinterface conn; - private static jTreeMaintenanceInterface tm; - private static jTreeValueInterface tv; - public static String RMIServerName = "lofar17.astron.nl"; - public static String RMIServerPort = "1091"; - public static String RMIRegistryName = jOTDBinterface.SERVICENAME; - public static String RMIMaintenanceName = jTreeMaintenanceInterface.SERVICENAME; - public static String RMIValName = jTreeValueInterface.SERVICENAME; - - - public static void showTreeList (Vector trees) - { - try - { - System.out.println ("treeID|Classif|Creator |Creationdate |Type|Campaign|Starttime"); - System.out.println ("------+-------+----------+--------------------+----+--------+------------------"); - - jOTDBtree aTree; - Integer treeID; - - for (int i = 0; i < trees.size (); ++i) - { - aTree = (jOTDBtree)trees.elementAt(1); - System.out.printf ("%6d|%7d|%-10.10s|%-20.20s|%4d|%-8.8s|%s", aTree.treeID(), aTree.classification, - aTree.creator, aTree.creationDate, aTree.type, aTree.campaign, aTree.starttime); - System.out.println (); - } - System.out.println (trees.size () + " records\n"); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } - - public static void showNodeList (Vector nodes) - { - try - { - System.out.println ("treeID|nodeID|parent|name |index|leaf|inst|description"); - System.out.println ("------+------+------+---------------+-----+----+----+------------------"); - - jOTDBnode aNode; - - for (int i = 0; i < nodes.size (); ++i) - { - aNode = (jOTDBnode)nodes.elementAt (i); - System.out.printf ("%6d|%6d|%6d|%-15.15s|%5d|%s|%4d|%s", - aNode.treeID (), aNode.nodeID (), aNode.parentID (), aNode.name, aNode.index, - aNode.leaf, aNode.instances, aNode.description); - System.out.println (); - } - System.out.println (nodes.size () + " records\n"); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - - } - - public static void showValueList (Vector items) - { - try - { - System.out.println ("name |value |time"); - System.out.println ("---------------------------------------------+------+--------------------"); - - jOTDBvalue aValue; - - for (int i = 0; i < items.size(); ++i) - { - aValue = (jOTDBvalue)items.elementAt (i); - System.out.printf ("%-45.45s|%-7.7s|%s", aValue.name, aValue.value, aValue.time); - System.out.println (); - } - System.out.println (items.size() + " records\n"); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - - } - - - public static void main (String[] args) - { - try - { - - System.out.println("Starting... "); - - // create a remote object - conn = (jOTDBinterface) Naming.lookup ("rmi://"+RMIServerName+":"+RMIServerPort+"/"+RMIRegistryName); - tm = (jTreeMaintenanceInterface) Naming.lookup ("rmi://"+RMIServerName+":"+RMIServerPort+"/"+RMIMaintenanceName); - - // do the test - System.out.println ("Starting... "); - - System.out.println ("Trying to connect to the database"); - assert conn.connect () : "Connection failed"; - assert conn.isConnected () : "Connnection flag failed"; - - System.out.println ("Connection succesful!"); - - System.out.println ("Searching for a Template tree"); - Vector treeList; - treeList = conn.getTreeList ((short)20, (short)0); // 20 = template, 0 = all - showTreeList (treeList); - if (treeList.size () == 0) { - System.out.println ("No template tree found!"); - System.exit (0); - } - - jOTDBtree treeInfo = (jOTDBtree)treeList.elementAt(treeList.size()-1); - Integer VTtreeID = treeInfo.treeID(); - System.out.println ("Using tree " + VTtreeID + " for the tests."); - if (treeInfo.treeID () == 0) { - System.out.println ("No such tree found!"); - System.exit (0); - } - - System.out.println("Trying to get the topnode of the tree"); - jOTDBnode topNode = tm.getTopNode (treeInfo.treeID()); - System.out.println (topNode.name); - - System.out.println("Trying to get a collection of items on depth=1"); - Vector nodeList = tm.getItemList (VTtreeID.intValue (), topNode.nodeID(), 1); - showNodeList (nodeList); - - System.out.println("Trying to get a collection of items on depth=2"); - nodeList = tm.getItemList (VTtreeID.intValue (), topNode.nodeID(), 2); - showNodeList (nodeList); - - int elemNr = nodeList.size () - 1; - System.out.println ("Zooming in on last element"); - jOTDBnode aNode = tm.getNode (VTtreeID.intValue (), elemNr); - System.out.println (aNode.name); - - System.out.println ("Trying to classify the tree to operational"); - boolean actionOK = tm.setClassification (VTtreeID.intValue (), (short)2); // 2 - operational - assert actionOK : "Setting classification was NOT succesful"; - treeInfo = conn.getTreeInfo (VTtreeID.intValue (), false); - System.out.println ("Classification of tree: " + treeInfo.classification); - - short aTreeState = 400; - System.out.println ("Trying to change the state of the tree to active"); - actionOK = tm.setTreeState (VTtreeID.intValue (), aTreeState); // 400 = active - assert actionOK : "Changing the state to active should have NOT have failed!"; - treeInfo = conn.getTreeInfo (VTtreeID.intValue (),false); - System.out.println ("State of tree: " + treeInfo.state); - - System.out.println ("========== Testing manipulation of nodes =========="); - - System.out.println ("Searching for node 'Virt Telescope'"); - Vector VtelCol = tm.getItemList (VTtreeID.intValue (), "%Telescope"); - System.out.println ("Found " + VtelCol.size () + " nodes"); - jOTDBnode VtelDef = (jOTDBnode)VtelCol.firstElement (); - assert VtelDef.nodeID () != 0 : "Node 'Virt Telescope' not found"; - System.out.println ("Found definition: " + VtelDef.name); - - // Test the manipulations on the VT - System.out.println ("Trying to duplicate the subtree"); - int nodeID = tm.dupNode (VTtreeID.intValue (), VtelDef.nodeID (), (short)1); - System.out.println ("New subtree starts at node: " + nodeID); - - System.out.println ("Trying to retrieve one node"); - aNode = tm.getNode (VTtreeID.intValue (), nodeID); - System.out.println (aNode.instances); - System.out.println (aNode.limits); - System.out.println ("Modifying the instances and limits"); - aNode.instances = 5; - aNode.limits = "no more limits"; - tm.saveNode (aNode); - System.out.println (aNode.instances); - System.out.println (aNode.limits); - - System.out.println ("Trying to retrieve one node"); - aNode = tm.getNode (VTtreeID.intValue (), nodeID); - System.out.println (aNode.name); - System.out.println ("Removing the just created subtree"); - System.out.println ("nodeID before removal: " + aNode.nodeID ()); - int orgNodeID = aNode.nodeID(); - tm.deleteNode (aNode); - System.out.println ("nodeID after removal : " + aNode.nodeID ()); - - System.out.println ("Trying to retrieve the deleted node"); - aNode = tm.getNode (VTtreeID.intValue (), orgNodeID); - System.out.println (aNode.nodeID ()); - - // Test the manipulations off the parameters - System.out.println ("Duplicating node Beamformer for index + 1"); - Vector BformCol = tm.getItemList (VTtreeID.intValue (), "Beamformer"); - jOTDBnode BformDef = (jOTDBnode)BformCol.lastElement (); - System.out.println ("Beamformer has ID " + BformDef.nodeID()); - System.out.println (VTtreeID.intValue () +" " + BformDef.nodeID ()); - int dupNodeID = BformDef.nodeID (); - System.out.println ("New subtree starts at node: " + dupNodeID); - - jOTDBnode node1 = tm.getNode (VTtreeID.intValue (), dupNodeID+2); - jOTDBnode node2 = tm.getNode (VTtreeID.intValue (), dupNodeID+3); - System.out.println ("Getting attributes info for " + node1.nodeID () + " and " + node2.nodeID ()); - System.out.println (node1.name); - System.out.println (node2.name); - node1.limits = "1.33333"; - node2.limits = "---1---"; - System.out.println ("Changing node " + node1.name + " limits to " + node1.limits); - System.out.println ("Changing node " + node2.name + " limits to " + node2.limits); - tm.saveNode (node1); - tm.saveNode (node2); - - // Get parameters for a node - System.out.println ("Getting param info for " + node1.treeID () + ", " + node1.nodeID ()); - jOTDBparam param1 = tm.getParam (node1.treeID (), node1.paramDefID ()); - System.out.println (param1.name); - System.out.println (param1.type); - System.out.println (param1.pruning); - System.out.println (param1.unit); - param1.type = 104; - tm.saveParam (param1); - - // Setting nr instances to some nice values - System.out.println ("Setting up tree counts"); - Vector aNodeCol = tm.getItemList (VTtreeID.intValue (), "RFI dete%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 40; - tm.saveNode (aNode); - System.out.println ("RFI detectors : 40"); - aNodeCol = tm.getItemList (VTtreeID.intValue (), "Correlator%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 130; - tm.saveNode (aNode); - System.out.println ("Correlators : 130"); - aNodeCol = tm.getItemList (VTtreeID.intValue (), "Storage"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 86; - tm.saveNode (aNode); - System.out.println ("Storage : 86"); - aNodeCol = tm.getItemList (VTtreeID.intValue (), "Visua%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 24; - tm.saveNode (aNode); - System.out.println ("Visualisation : 24"); - aNodeCol = tm.getItemList (VTtreeID.intValue (), "Virt Tel%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 8; - tm.saveNode (aNode); - System.out.println ("Virt.Telescopes: 8"); - aNodeCol = tm.getItemList (VTtreeID.intValue (), "Beamfor%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 4; - tm.saveNode (aNode); - System.out.println ("Beamformers : 4"); - - // Test copying a template - System.out.println ("Trying to copy the template tree"); - int secondVTtreeID = tm.copyTemplateTree (VTtreeID); - System.out.println ("ID of new tree is " + secondVTtreeID); - if (secondVTtreeID == 0) { - System.out.println (tm.errorMsg()); - } - jOTDBtree VTtree = conn.getTreeInfo (secondVTtreeID,false); - System.out.println (VTtree.creator); - - // Test creating a full tree of the template tree - System.out.println ("Trying to instanciate the copied tree"); - int VHtreeID = tm.instanciateTree (secondVTtreeID); - System.out.println ("ID of new tree is " + VHtreeID); - if (VHtreeID == 0) { - System.out.println (tm.errorMsg()); - } - jOTDBtree VHtree = conn.getTreeInfo (VHtreeID,false); - System.out.println (VHtree.creator); - - // Test values - tv = (jTreeValueInterface) Naming.lookup ("rmi://"+RMIServerName+":"+RMIServerPort+"/"+RMIValName); - tv.setTreeID(4); - Vector valueList = tv.searchInPeriod (1868, 0, - "2001-12-31 00:00:00", "2005-12-31 23:59:59", false); - if (valueList.size() == 0) { - System.out.println ("No items found"); - } - else { - showValueList (valueList); - } - - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - - - } -} diff --git a/SAS/OTB/jOTDB2/test/tTreeMaintenance.in b/SAS/OTB/jOTDB2/test/tTreeMaintenance.in deleted file mode 100644 index 157e071252d5ec5d961059a1e51d82d41c32c766..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tTreeMaintenance.in +++ /dev/null @@ -1,145 +0,0 @@ -# -# EXPERIMENTAL version of a Parameter Template -# -# name name of the node -# version version of this node specification -# quality stable | test | development -# constraint python script to check multiparameter constrains -# may return OK, NotOK, Unknown -# description What this module does. -# -# Note 1: to seperate the parameterlines from the Node lines each node line -# begins with the label 'Node'. -# Note 2: To define dependancies between nodes the label 'Uses' is used. -# A + sign may be added to the versionnr to indicate that the given -# versionnr is the minimal version the module schould have. -# - -# -- RFI detector -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node 'RFI detector' 1.0.0 test 'node constraint' 'Detection of RFI' - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par 'Ram usage' I int RAM 10 0 240 - 'description' -par GFLOPS I flt GFLOP 10 0 1.3 - 'description' -par NodeType I int - 10 0 1 - 'description' -par Sharable I bool - 10 0 FALSE - 'description' - - -# -- Correlator -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node Correlator 1.0.0 test 'node constraint' 'BG correlator' - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par 'Ram usage' I int RAM 10 0 240 - 'description' -par GFLOPS I flt GFLOP 10 0 2.4 - 'description' -par NodeType I int - 10 0 2 - 'description' -par Sharable I bool - 10 0 FALSE - 'description' -par MatrixSize I int - 10 0 2..512 - The size of the correlation matrix in elements. - - -# -- Storage -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node Storage 1.0.0 test 'node constraint' 'Data storage' - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par 'Ram usage' I int RAM 10 0 240 - 'description' -par GFLOPS I flt GFLOP 10 0 2.4 - 'description' -par NodeType I int - 10 0 2 - 'description' -par Sharable I bool - 10 0 FALSE - 'description' -par MB/sec I int MB/s 10 0 480 - 'description' -par Capacity I int - 10 0 320 - 'description' - - -# -- Visualisation -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node Visualisation 1.0.0 test 'node constraint' "Makes the pictures" - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par 'Ram usage' I int RAM 10 0 240 - 'description' -par GFLOPS I flt GFLOP 10 0 2.4 - 'description' -par NodeType I int - 10 0 2 - 'description' -par Sharable I bool - 10 0 FALSE - 'description' -par Duration I int time4 10 0 0 - 'description' - - -# -- Receptor Group -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node "Rec Group" 1.0.0 test 'node constraint' "Receptor group" - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par 'Ram usage' I int RAM 10 0 240 - 'description' -par GFLOPS I flt GFLOP 10 0 2.4 - 'description' -par NodeType I int - 10 0 2 - 'description' -par Sharable I bool - 10 0 FALSE - 'description' -par 'Freq bands' I int - 10 0 0 - 'description' -par 'Sample Freq.' I int MHz 10 0 0 - 'description' - - -# -- BeamFormer -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node Beamformer 1.0.0 test 'node constraint' Constructs the beam - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par 'Ram usage' I int RAM 10 0 240 - 'description' -par GFLOPS I flt GFLOP 10 0 2.4 - 'description' -par NodeType I int - 10 0 2 - 'description' -par Sharable I bool - 10 0 FALSE - 'description' -par Declination I dbl time6 10 0 0 - 'description' -par Angle I dbl time6 10 0 0 - 'description' -#, 'Declination', 105, 4, 10, 0, TRUE, '', 'description'); -#, 'Angle', 105, 4, 10, 0, TRUE, '', 'description'); - - -# -- Virtual backend -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node "Virt Backend" 1.0.0 test 'node constraint' Backend processing - -# name vers qual instances -#------------------------------------------------------------------------------ -uses 'RFI detector' 1.0.0 test 0+ -uses Correlator 1.0.0 test 0..6144 -uses Storage 1.0.0 test 0..1024 -uses Visualisation 1.0.0 test 0..128 - - -# -- Virtual telescope -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node "Virt Telescope" 1.0.0 test 'node constraint' Looks like ... - -# name vers qual instances -#------------------------------------------------------------------------------ -uses 'Rec Group' 1.0.0 test 1..4 -uses Beamformer 1.0.0 test 1..8 - - -# -- Observation -- -# name vers qual constr. descr. -#------------------------------------------------------------------------------ -node Observation 1.0.0 test 'node constraint' Toplevel node - -# name dir. type unit prun. vm value constr. descr. -#------------------------------------------------------------------------------ -par ObservationNr I int - 0 0 1+ - 'description' - -# name vers qual instances -#------------------------------------------------------------------------------ -uses 'Virt.Backend' 1.0.0 test 0..1 -uses Virt.Telescope 1.0.0 test 0..8 - - - diff --git a/SAS/OTB/jOTDB2/test/tTreeMaintenance.java b/SAS/OTB/jOTDB2/test/tTreeMaintenance.java deleted file mode 100644 index e04d72e57a9eb2cca8b3d943c4c04d8e38410535..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tTreeMaintenance.java +++ /dev/null @@ -1,310 +0,0 @@ -import java.rmi.RemoteException; -import java.util.Vector; -import nl.astron.lofar.sas.otb.jotdb2.jClassifConv; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBconnection; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBtree; -import nl.astron.lofar.sas.otb.jotdb2.jTreeMaintenance; -import nl.astron.lofar.sas.otb.jotdb2.jTreeStateConv; -import nl.astron.lofar.sas.otb.jotdb2.jTreeTypeConv; -import nl.astron.lofar.sas.otb.jotdb2.jInitCPPLogger; - -class tTreeMaintenance -{ - static - { - System.loadLibrary ("jotdb2"); - } - - - public static void main (String[] args) - { - String logConfig="tTreeMaintenance.log_prop"; - try { - jInitCPPLogger aCPPLogger= new jInitCPPLogger(logConfig); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - tTreeMaintenance ttreemain = new tTreeMaintenance (); - ttreemain.test (); - } - - public void showTreeList (Vector trees, jOTDBconnection conn) - { - - jOTDBtree aTree; - Integer treeID; - boolean firstLine=true; - - for (int i = 0; i < trees.size (); ++i) - { - aTree = (jOTDBtree)trees.elementAt(1); - showTree(aTree,firstLine); - firstLine=false; - } - System.out.println (trees.size () + " records\n"); - } - - public void showTree(jOTDBtree aTree, boolean firstLine) { - if (firstLine) { - System.out.println ("treeID|Classif|Creator |Creationdate |Type|Campaign|Starttime |State|Description"); - System.out.println ("------+-------+----------+--------------------+----+--------+------------------+-----+--------------------"); - } - - System.out.printf ("%6d|%7d|%-10.10s|%-20.20s|%4d|%-8.8s|%s-18.18s|%5d|%s", aTree.treeID(), aTree.classification, - aTree.creator, aTree.creationDate, aTree.type, aTree.campaign, aTree.starttime, aTree.state, aTree.description); - System.out.println (); - } - - public void showNodeList (Vector nodes) - { - boolean firstLine=true; - jOTDBnode aNode; - - for (int i = 0; i < nodes.size (); ++i) - { - aNode = (jOTDBnode)nodes.elementAt (i); - showNode(aNode,firstLine); - firstLine=false; - } - System.out.println (nodes.size () + " records\n"); - } - - public void showNode(jOTDBnode aNode,boolean firstLine) { - if (firstLine) { - System.out.println ("treeID|nodeID|parent|name |index|leaf|inst|description"); - System.out.println ("------+------+------+---------------+-----+----+----+------------------"); - } - System.out.printf ("%6d|%6d|%6d|%-15.15s|%5d|%s|%4d|%s", - aNode.treeID (), aNode.nodeID (), aNode.parentID (), aNode.name, aNode.index, - aNode.leaf, aNode.instances, aNode.description); - System.out.println (); - } - - - public void test () { - try { - // do the test - System.out.println ("Starting... "); - - // create a jOTDBconnection - jOTDBconnection conn = new jOTDBconnection ("paulus","boskabouter","otdbtest","dop50.astron.nl"); - - System.out.println ("Trying to connect to the database"); - assert conn.connect () : "Connection failed"; - assert conn.isConnected () : "Connnection flag failed"; - - System.out.println ("Connection succesful!"); - - System.out.println ("Trying to construct a TreeMaintenance object"); - jTreeMaintenance tm = new jTreeMaintenance (); - assert tm!=null : "Creation of treeMaintenance Failed!"; - - // used Converters: - jTreeTypeConv TTconv = new jTreeTypeConv(); - jTreeStateConv TSconv = new jTreeStateConv(); - jClassifConv CTconv = new jClassifConv(); - - System.out.println ("Trying to load the componentfile: tVTtree.in"); - int topNodeID = tm.loadComponentFile ("tTreeMaintenance.in","",""); - assert topNodeID!=0 : "Loading of componentfile failed"; - - - System.out.println("Building a template tree"); - int treeID = tm.buildTemplateTree(topNodeID,CTconv.get("test")); - assert treeID!=0 : "Creation of template tree failed"; - System.out.println("TreeID = " + treeID); - - System.out.println ("Searching for a Template tree"); - Vector treeList = conn.getTreeList (TTconv.get("VItemplate"), CTconv.get("test")); - showTreeList (treeList, conn); - assert treeList.size()!=0 : "No template tree found!"; - - int VTtreeID=((jOTDBtree)treeList.elementAt(treeList.size()-1)).treeID(); - System.out.println("Using tree " + VTtreeID + " for the tests"); - jOTDBtree treeInfo = conn.getTreeInfo(VTtreeID,false); - showTree(treeInfo,true); - - System.out.println("Changing the description to 'test_tree'"); - tm.setDescription(VTtreeID, "test_tree"); - treeInfo = conn.getTreeInfo(VTtreeID, false); - showTree(treeInfo,true); - - System.out.println("Trying to get the topnode of the tree"); - jOTDBnode topNode = tm.getTopNode (treeInfo.treeID()); - showNode(topNode,true); - - System.out.println("Trying to get a collection of items on depth=1"); - Vector nodeList = tm.getItemList (VTtreeID, topNode.nodeID(), 1); - showNodeList (nodeList); - - System.out.println("Trying to get a collection of items on depth=2"); - nodeList = tm.getItemList (VTtreeID, topNode.nodeID(), 2); - showNodeList (nodeList); - - int elemNr = nodeList.size () - 1; - System.out.println ("Zooming in on last element : "+ elemNr); - jOTDBnode aNode = tm.getNode (VTtreeID, ((jOTDBnode)nodeList.elementAt(elemNr)).nodeID()); - showNode(aNode, true); - - System.out.println ("Trying to classify the tree to: "+CTconv.get("operational")); - boolean actionOK =tm.setClassification(VTtreeID,CTconv.get("operational")); - if (actionOK) { - System.out.println("Setting classification was succesful"); - } else { - System.out.println("Setting classification was NOT succesful"); - } - treeInfo = conn.getTreeInfo(VTtreeID,false); - showTree(treeInfo,true); - - short aTreeState = TSconv.get("active"); - System.out.println ("Trying to change the state of the tree to "+ aTreeState); - actionOK = tm.setTreeState (VTtreeID, aTreeState); - assert actionOK : "Changing the state to active should have NOT have failed!"; - treeInfo = conn.getTreeInfo (VTtreeID, false); - showTree(treeInfo,true); - - System.out.println ("========== Testing manipulation of nodes =========="); - - System.out.println ("Searching for node 'Virt Telescope'"); - Vector VtelCol = tm.getItemList (VTtreeID, "%Telescope"); - System.out.println ("Found " + VtelCol.size () + " nodes"); - jOTDBnode VtelDef = (jOTDBnode)VtelCol.firstElement (); - assert VtelDef.nodeID () != 0 : "Node 'Virt Telescope' not found"; - System.out.println ("Found definition: " ); - showNode(VtelDef,true); - - // Test the manipulations on the VT - System.out.println ("Trying to duplicate the subtree"); - int nodeID = tm.dupNode (VTtreeID, VtelDef.nodeID (), (short)1); - System.out.println ("New subtree starts at node: " + nodeID); - - System.out.println ("Trying to retrieve one node"); - aNode = tm.getNode (VTtreeID, nodeID); - showNode(aNode,true); - System.out.println ("Modifying the instances and limits"); - aNode.instances = 5; - aNode.limits = "no more limits"; - tm.saveNode (aNode); - showNode(aNode,true); - - System.out.println ("Trying to retrieve one node"); - aNode = tm.getNode (VTtreeID, nodeID); - showNode(aNode, true); - System.out.println ("Removing the just created subtree"); - System.out.println ("nodeID before removal: " + aNode.nodeID ()); - int orgNodeID = aNode.nodeID(); - tm.deleteNode (aNode); - System.out.println ("nodeID after removal : " + aNode.nodeID ()); - - System.out.println ("Trying to retrieve the deleted node"); - aNode = tm.getNode (VTtreeID, orgNodeID); - showNode(aNode,true); - - // Test the manipulations off the parameters - System.out.println ("Duplicating node Beamformer for index=3"); - Vector BformCol = tm.getItemList (VTtreeID, "Beamformer"); - jOTDBnode BformDef = (jOTDBnode)BformCol.firstElement (); - System.out.println ("Beamformer has ID " + BformDef.nodeID()); - System.out.println (VTtreeID +" " + BformDef.nodeID ()); - int dupNodeID = tm.dupNode (VTtreeID, BformDef.nodeID (), (short)3); - System.out.println ("New subtree starts at node: " + dupNodeID); - - System.out.println ("Getting param info for " + dupNodeID+2 + " and " + dupNodeID+3); - jOTDBnode param1 = tm.getNode (VTtreeID, dupNodeID+2); - jOTDBnode param2 = tm.getNode (VTtreeID, dupNodeID+3); - showNode(param1,true); - showNode(param2,true); - param1.limits = "1.33333"; - param2.limits = "---1---"; - System.out.println ("Changing param " + param1.name + " to " + param1.limits); - System.out.println ("Changing param " + param2.name + " to " + param2.limits); - tm.saveNode (param1); - tm.saveNode (param2); - - // Setting nr instances to some nice values - System.out.println ("Setting up tree counts"); - Vector aNodeCol = tm.getItemList (VTtreeID, "RFI dete%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 40; - tm.saveNode (aNode); - System.out.println ("RFI detectors : 40"); - aNodeCol = tm.getItemList (VTtreeID, "Correlator%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 130; - tm.saveNode (aNode); - System.out.println ("Correlators : 130"); - aNodeCol = tm.getItemList (VTtreeID, "Storage"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 86; - tm.saveNode (aNode); - System.out.println ("Storage : 86"); - aNodeCol = tm.getItemList (VTtreeID, "Visua%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 24; - tm.saveNode (aNode); - System.out.println ("Visualisation : 24"); - aNodeCol = tm.getItemList (VTtreeID, "Virt Tel%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 8; - tm.saveNode (aNode); - System.out.println ("Virt.Telescopes: 8"); - aNodeCol = tm.getItemList (VTtreeID, "Beamfor%"); - aNode = (jOTDBnode)aNodeCol.firstElement (); - aNode.instances = 4; - tm.saveNode (aNode); - System.out.println ("Beamformers : 4"); - - // Test copying a template - System.out.println ("Trying to copy the template tree"); - int secondVTtreeID = tm.copyTemplateTree (VTtreeID); - System.out.println ("ID of new tree is " + secondVTtreeID); - if (secondVTtreeID == 0) { - System.out.println (tm.errorMsg()); - } - jOTDBtree VTtree = conn.getTreeInfo (secondVTtreeID,false); - showTree(VTtree,true); - - // Test creating a full tree of the template tree - System.out.println ("Trying to instanciate the copied tree"); - int VHtreeID = tm.instanciateTree (secondVTtreeID); - System.out.println ("ID of new tree is " + VHtreeID); - if (VHtreeID == 0) { - System.out.println (tm.errorMsg()); - } - jOTDBtree VHtree = conn.getTreeInfo (VHtreeID,false); - showTree(VHtree,true); - - - // Test deleting an active tree - System.out.println("Trying to delete original template tree " + VTtreeID); - try { - tm.deleteTree(VTtreeID); - assert false : "DELETING AN ACTIVE TREE IS NOT ALLOWED!"; - } catch (Exception e) { - System.out.println("EXPECTED exception: " + e); - } - - aTreeState = TSconv.get("obsolete"); - System.out.println("Trying to change the state of the tree to " +aTreeState); - actionOK = tm.setTreeState(VTtreeID, aTreeState); - assert actionOK : "Changing the state to " + aTreeState + " should have NOT have failed!"; - - - // Test deleting a tree - System.out.println("Retrying to delete original template tree " + VTtreeID); - assert tm.deleteTree(VTtreeID) : "Deletion of original tree went wrong:" + tm.errorMsg(); - System.out.println("Deletion of original tree was succesful"); - - System.out.println ("Terminated succesfully: "); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } -} - - - - diff --git a/SAS/OTB/jOTDB2/test/tTreeMaintenance.log_prop b/SAS/OTB/jOTDB2/test/tTreeMaintenance.log_prop deleted file mode 100644 index 5bf406ab481f50d6b45ba1627a6d3debec29edc2..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/tTreeMaintenance.log_prop +++ /dev/null @@ -1,17 +0,0 @@ -# Property file to be use with the demo program testLogger. - -# Configure the rootLogger -log4cplus.rootLogger=DEBUG, STDOUT -# Define the STDOUT appender -log4cplus.appender.STDOUT=log4cplus::ConsoleAppender -log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout -log4cplus.appender.STDOUT.layout.ConversionPattern=%-5p [%x]%c{3} - %m%n -log4cplus.appender.STDOUT.ImmediateFlush=true - -# Define TRC at level INFO -log4cplus.logger.TRC=TRACE3 -#log4cplus.logger.TRC=INFO - - - - diff --git a/SAS/OTB/jOTDB2/test/testStates.java b/SAS/OTB/jOTDB2/test/testStates.java deleted file mode 100644 index e2cfe71ed529d1da140cdad5af2668967e67fc28..0000000000000000000000000000000000000000 --- a/SAS/OTB/jOTDB2/test/testStates.java +++ /dev/null @@ -1,39 +0,0 @@ - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.util.Vector; -import nl.astron.lofar.sas.otb.jotdb2.jOTDBinterface; -import nl.astron.lofar.sas.otb.jotdb2.jTreeState; - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -/** - * - * @author coolen - */ -public class testStates { - public static void main(String[] args) - { - testStates tconn = new testStates(); - tconn.test(); - } - - public void test() { - try { - // do the test - System.out.println("Starting... "); - String sd="2009-05-01 11:42:52.000"; - String ed="2009-10-01 11:42:52.000"; - Registry remoteRegistry = LocateRegistry.getRegistry("lofar17", 10500); - jOTDBinterface jotdbInterface = (jOTDBinterface) remoteRegistry.lookup(jOTDBinterface.SERVICENAME); - jotdbInterface.connect(); - Vector<jTreeState> stateList = jotdbInterface.getStateList(0,false, sd, ed); - } catch (Exception ex) { - System.out.println("Error: "+ ex); - ex.printStackTrace(); - } - } -}