From 2d0d96b3bb2a753aae26fce2c69636204de907dc Mon Sep 17 00:00:00 2001 From: Arthur Coolen <coolen@astron.nl> Date: Wed, 14 Jun 2006 09:12:03 +0000 Subject: [PATCH] BugID: 604 jOTDB2 is the new improved OTBServer. This module can be placed on the attic --- .gitattributes | 2 - SAS/OTB/jOTDB/Makefile.am | 3 - SAS/OTB/jOTDB/bootstrap | 3 - SAS/OTB/jOTDB/build.xml | 53 -- SAS/OTB/jOTDB/configure.in | 69 --- SAS/OTB/jOTDB/package.dox | 2 - SAS/OTB/jOTDB/src/Makefile.am | 48 -- SAS/OTB/jOTDB/src/jOTDB/Manifest.txt | 1 - SAS/OTB/jOTDB/src/jOTDB/jConverter.java | 47 -- .../jOTDB/src/jOTDB/jConverterAdapter.java | 88 ---- .../jOTDB/src/jOTDB/jConverterInterface.java | 47 -- SAS/OTB/jOTDB/src/jOTDB/jOTDBadapter.java | 86 ---- SAS/OTB/jOTDB/src/jOTDB/jOTDBconnection.java | 62 --- SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.jar | Bin 2925 -> 0 bytes SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.java | 52 -- SAS/OTB/jOTDB/src/jOTDB/jOTDBnode.java | 69 --- SAS/OTB/jOTDB/src/jOTDB/jOTDBparam.java | 61 --- SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.jar | Bin 3654 -> 0 bytes SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.java | 131 ----- SAS/OTB/jOTDB/src/jOTDB/jOTDBtree.java | 48 -- SAS/OTB/jOTDB/src/jOTDB/jOTDBvalue.java | 48 -- SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenance.java | 111 ----- .../src/jOTDB/jTreeMaintenanceAdapter.java | 184 ------- .../src/jOTDB/jTreeMaintenanceInterface.java | 110 ----- SAS/OTB/jOTDB/src/jOTDB/jTreeState.java | 31 -- SAS/OTB/jOTDB/src/jOTDB/jTreeValue.java | 39 -- .../jOTDB/src/jOTDB/jTreeValueAdapter.java | 46 -- .../jOTDB/src/jOTDB/jTreeValueInterface.java | 36 -- SAS/OTB/jOTDB/src/jOTDB/jVICnodeDef.java | 42 -- SAS/OTB/jOTDB/src/jOTDB_jConverter.cc | 162 ------- SAS/OTB/jOTDB/src/jOTDB_jConverter.h | 105 ---- SAS/OTB/jOTDB/src/jOTDB_jOTDBcommon.h | 51 -- SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.cc | 257 ---------- SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.h | 87 ---- SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.cc | 452 ------------------ SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.h | 204 -------- SAS/OTB/jOTDB/src/jOTDB_jTreeValue.cc | 113 ----- SAS/OTB/jOTDB/src/jOTDB_jTreeValue.h | 36 -- SAS/OTB/jOTDB/test/Makefile.am | 15 - SAS/OTB/jOTDB/test/tConnection.java | 68 --- SAS/OTB/jOTDB/test/tRemoteConnection.java | 79 --- SAS/OTB/jOTDB/test/tRemoteConverter.java | 74 --- .../jOTDB/test/tRemoteTreeMaintenance.java | 308 ------------ SAS/OTB/jOTDB/test/tTreeMaintenance.java | 241 ---------- 44 files changed, 3771 deletions(-) delete mode 100644 SAS/OTB/jOTDB/Makefile.am delete mode 100755 SAS/OTB/jOTDB/bootstrap delete mode 100644 SAS/OTB/jOTDB/build.xml delete mode 100644 SAS/OTB/jOTDB/configure.in delete mode 100644 SAS/OTB/jOTDB/package.dox delete mode 100644 SAS/OTB/jOTDB/src/Makefile.am delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/Manifest.txt delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jConverter.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jConverterAdapter.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jConverterInterface.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBadapter.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBconnection.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.jar delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBnode.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBparam.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.jar delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBtree.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jOTDBvalue.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenance.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceAdapter.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceInterface.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeState.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeValue.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeValueAdapter.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jTreeValueInterface.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB/jVICnodeDef.java delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jConverter.cc delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jConverter.h delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jOTDBcommon.h delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.cc delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.h delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.cc delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.h delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jTreeValue.cc delete mode 100644 SAS/OTB/jOTDB/src/jOTDB_jTreeValue.h delete mode 100644 SAS/OTB/jOTDB/test/Makefile.am delete mode 100644 SAS/OTB/jOTDB/test/tConnection.java delete mode 100644 SAS/OTB/jOTDB/test/tRemoteConnection.java delete mode 100644 SAS/OTB/jOTDB/test/tRemoteConverter.java delete mode 100644 SAS/OTB/jOTDB/test/tRemoteTreeMaintenance.java delete mode 100644 SAS/OTB/jOTDB/test/tTreeMaintenance.java diff --git a/.gitattributes b/.gitattributes index 1c07fd725b1..a61a679d3b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -783,8 +783,6 @@ SAS/OTB/MoM-OTDB-adapter/lib/log4j-1.2.8.jar -text SAS/OTB/MoM-OTDB-adapter/lib/xercesImpl.jar -text SAS/OTB/MoM-OTDB-adapter/lib/xml-apis.jar -text SAS/OTB/MoM-OTDB-adapter/sharedlib/jotdb.jar -text -SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.jar -text svneol=unset#unset -SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.jar -text svneol=unset#unset SAS/OTB/jOTDB2/.cvsignore -text SAS/OTB/jOTDB2/How_to_build_jOTDB2.doc -text SAS/OTB/jOTDB2/make_jar.sh -text svneol=native#application/octet-stream diff --git a/SAS/OTB/jOTDB/Makefile.am b/SAS/OTB/jOTDB/Makefile.am deleted file mode 100644 index a014c15b3e0..00000000000 --- a/SAS/OTB/jOTDB/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS=src - -include $(top_srcdir)/Makefile.common diff --git a/SAS/OTB/jOTDB/bootstrap b/SAS/OTB/jOTDB/bootstrap deleted file mode 100755 index 06f18cde1db..00000000000 --- a/SAS/OTB/jOTDB/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../autoconf_share/bootstrap ../../../autoconf_share diff --git a/SAS/OTB/jOTDB/build.xml b/SAS/OTB/jOTDB/build.xml deleted file mode 100644 index 88944006ab7..00000000000 --- a/SAS/OTB/jOTDB/build.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0"?> - -<!-- build.xml - a simple Ant buildfile --> -<project name="jOTDB Buildfile" default="compile" basedir="."> - - <!-- The directory containing source code --> - <property name="src.dir" value="src/jOTDB"/> - - <!-- Temporary build directories --> - <property name="build.dir" value="build"/> - <property name="build.classes" value="${build.dir}/classes"/> - <property name="build.lib" value="${build.dir}/lib"/> - - <!-- Target to create the build directories prior to the --> - <!-- compile target. --> - <target name="prepare"> - <mkdir dir="${build.dir}"/> - <mkdir dir="${build.classes}"/> - <mkdir dir="${build.lib}"/> - </target> - - <target name="clean" description="Remove all generated files."> - <delete dir="${build.classes}"/> - <delete dir="${build.lib}"/> - </target> - - <target name="compile" depends="prepare" - description="Compiles all source code."> - <javac srcdir="${src.dir}" destdir="${build.classes}"/> - <rmic base="${build.classes}" classname="jOTDB.jConverterAdapter"/> - <rmic base="${build.classes}" classname="jOTDB.jOTDBadapter"/> - <rmic base="${build.classes}" classname="jOTDB.jTreeMaintenanceAdapter"/> - <rmic base="${build.classes}" classname="jOTDB.jTreeValueAdapter"/> - </target> - - <target name="jar" depends="compile" - description="Generates jotdb.jar in the 'dist' directory."> - <!-- Exclude unit tests from the final JAR file --> - <jar jarfile="${build.lib}/jotdb.jar" - basedir="${build.classes}" - excludes="**/*Test.class" - manifest="${src.dir}/Manifest.txt"/> - </target> - - <target name="all" depends="clean,jar" - description="Cleans, compiles, then builds the JAR file."/> - - <target name="install" depends="jar" - description="Copies the generated jotdb.jar to the installation directory."> - <copy file="${build.lib}/jotdb.jar" todir="../../../installed/gnu_debug/lib/"/> - </target> - -</project> diff --git a/SAS/OTB/jOTDB/configure.in b/SAS/OTB/jOTDB/configure.in deleted file mode 100644 index b5c95713e22..00000000000 --- a/SAS/OTB/jOTDB/configure.in +++ /dev/null @@ -1,69 +0,0 @@ -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -AC_INIT -dnl AC_CONFIG_AUX_DIR(config) -dnl AM_CONFIG_HEADER(config/config.h) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(jOTDB, 1.0, no-define) - -dnl Initialize for LOFAR (may set compilers) -lofar_INIT - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_YACC -AC_PROG_CC -AC_PROG_CXX -AM_PROG_LEX -AC_PROG_INSTALL -AC_PROG_LN_S -dnl AC_DISABLE_SHARED -AC_PROG_LIBTOOL - -dnl Checks for libraries. - -dnl dnl Replace `main' with a function in -lfl: -dnl AC_CHECK_LIB(fl, main) -dnl dnl Replace `main' with a function in -lcosev_r: -dnl AC_CHECK_LIB(cosev_r, main) -dnl dnl Replace `main' with a function in -lcosnm_r: -dnl AC_CHECK_LIB(cosnm_r, main) -dnl dnl Replace `main' with a function in -lorb_r: -dnl AC_CHECK_LIB(orb_r, main) -dnl dnl Replace `main' with a function in -lpthread: -dnl AC_CHECK_LIB(pthread, main) -dnl dnl Replace `main' with a function in -lvport_r: -dnl AC_CHECK_LIB(vport_r, main) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_VPRINTF - -dnl -dnl Check for LOFAR specific things -dnl -lofar_GENERAL -dnl lofar_BLITZ -dnl lofar_MPI -lofar_INTERNAL(LCS/Common,Common,,1,Common/LofarTypedefs.h,,) -lofar_INTERNAL(SAS/OTDB,OTDB,,1,OTDB/OTDBnode.h,,) -lofar_INTERNAL(LCS/ACC/APS,APS,,1,APS/ParameterSet.h,,) -lofar_EXTERNAL(boost,1.32,boost/date_time/date.hpp, boost_date_time-gcc) -lofar_EXTERNAL(pqxx,2.5.0,pqxx/pqxx, pqxx) -lofar_EXTERNAL(pq,,libpq-fe.h,) -dnl -dnl Output Makefiles -dnl -AC_OUTPUT( -src/Makefile -dnl test/Makefile -Makefile -) diff --git a/SAS/OTB/jOTDB/package.dox b/SAS/OTB/jOTDB/package.dox deleted file mode 100644 index c484741f60a..00000000000 --- a/SAS/OTB/jOTDB/package.dox +++ /dev/null @@ -1,2 +0,0 @@ -// \ingroup OTB -// \defgroup jOTDB jOTDB Description diff --git a/SAS/OTB/jOTDB/src/Makefile.am b/SAS/OTB/jOTDB/src/Makefile.am deleted file mode 100644 index 64e7ad12e08..00000000000 --- a/SAS/OTB/jOTDB/src/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# if HAVE_SHMEM -# SUBDIRS = shmem . -# endif - -INSTHDRS = jOTDB_jOTDBconnection.h \ - jOTDB_jTreeMaintenance.h \ - jOTDB_jOTDBcommon.h \ - jOTDB_jTreeValue.h \ - jOTDB_jConverter.h - -NOINSTHDRS = - -TCCHDRS = - -nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS) - -noinst_HEADERS = $(NOINSTHDRS) - -DOCHDRS = $(INSTHDRS) $(NOINSTHDRS) - -lib_LTLIBRARIES = libjotdb.la - -libjotdb_la_SOURCES = $(DOCHDRS) \ - jOTDB_jOTDBconnection.cc \ - jOTDB_jTreeMaintenance.cc \ - jOTDB_jTreeValue.cc \ - jOTDB_jConverter.cc - -# AM_YFLAGS = -d -p KeyParse -# AM_LFLAGS = -PKeyTokenize -# LEX_OUTPUT_ROOT = lex.KeyTokenize - -# if HAVE_SHMEM -# libjotdb_la_LIBADD = shmem/libshmem.la -# endif - -bin_PROGRAMS = - -glishdir = $(libexecdir)/glish -dist_glish_SCRIPTS = - -pythondir = $(bindir) -dist_python_SCRIPTS = - -scriptdir = $(bindir) -dist_script_SCRIPTS = - -include $(top_srcdir)/Makefile.common diff --git a/SAS/OTB/jOTDB/src/jOTDB/Manifest.txt b/SAS/OTB/jOTDB/src/jOTDB/Manifest.txt deleted file mode 100644 index 49cdda77211..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/Manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Main-Class: jOTDB.jOTDBserver diff --git a/SAS/OTB/jOTDB/src/jOTDB/jConverter.java b/SAS/OTB/jOTDB/src/jOTDB/jConverter.java deleted file mode 100644 index 15b8417ce5c..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jConverter.java +++ /dev/null @@ -1,47 +0,0 @@ -//# jConverter.java: Logging. -//# -//# 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 -//# - -package jOTDB; - -public class jConverter -{ - public jConverter () - { - initConverter (); - } - - private native void initConverter (); - - public native short getClassif (String aConv); - public native String getClassif (short aConv); - - public native short getParamType (String aConv); - public native String getParamType (short aConv); - - public native short getTreeState (String aConv); - public native String getTreeState (short aConv); - - public native short getTreeType (String aConv); - public native String getTreeType (short aConv); - - public native short getUnit (String aConv); - public native String getUnit (short aConv); -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jConverterAdapter.java b/SAS/OTB/jOTDB/src/jOTDB/jConverterAdapter.java deleted file mode 100644 index 1f3587554d0..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jConverterAdapter.java +++ /dev/null @@ -1,88 +0,0 @@ -//# jConverterAdapter.java: -//# -//# 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 -//# - -package jOTDB; - -import jOTDB.jConverter; -import jOTDB.jConverterInterface; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; - -public class jConverterAdapter extends UnicastRemoteObject implements jConverterInterface -{ - // Constructor - public jConverterAdapter (jConverter adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - public short getClassif (String aConv) throws RemoteException - { - return adaptee.getClassif (aConv); - } - - public String getClassif (short aConv) throws RemoteException - { - return adaptee.getClassif (aConv); - } - - public short getParamType (String aConv) throws RemoteException - { - return adaptee.getParamType (aConv); - } - - public String getParamType (short aConv) throws RemoteException - { - return adaptee.getParamType (aConv); - } - - public short getTreeState (String aConv) throws RemoteException - { - return adaptee.getTreeState (aConv); - } - - public String getTreeState (short aConv) throws RemoteException - { - return adaptee.getTreeState (aConv); - } - - public short getTreeType (String aConv) throws RemoteException - { - return adaptee.getTreeType (aConv); - } - - public String getTreeType (short aConv) throws RemoteException - { - return adaptee.getTreeType (aConv); - } - - public short getUnit (String aConv) throws RemoteException - { - return adaptee.getUnit (aConv); - } - - public String getUnit (short aConv) throws RemoteException - { - return adaptee.getUnit (aConv); - } - - protected jConverter adaptee; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jConverterInterface.java b/SAS/OTB/jOTDB/src/jOTDB/jConverterInterface.java deleted file mode 100644 index e438bf60e76..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jConverterInterface.java +++ /dev/null @@ -1,47 +0,0 @@ -//# jConverterInterface.java: The RMI interface to the OTDB database. -//# -//# 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 -//# - -package jOTDB; - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Vector; - -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 short getParamType (String aConv) throws RemoteException; - public String getParamType (short aConv) throws RemoteException; - - public short getTreeState (String aConv) throws RemoteException; - public String getTreeState (short aConv) throws RemoteException; - - public short getTreeType (String aConv) throws RemoteException; - public String getTreeType (short aConv) throws RemoteException; - - public short getUnit (String aConv) throws RemoteException; - public String getUnit (short aConv) throws RemoteException; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBadapter.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBadapter.java deleted file mode 100644 index 4dab8a07b52..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBadapter.java +++ /dev/null @@ -1,86 +0,0 @@ -//# jOTDBadapter.java: The RMI adapter of 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 -//# - -package jOTDB; - -import jOTDB.jOTDBtree; -import jOTDB.jOTDBconnection; -import jOTDB.jOTDBinterface; -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; - -public class jOTDBadapter extends UnicastRemoteObject implements jOTDBinterface -{ - // Constructor - public jOTDBadapter (jOTDBconnection adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - // To test if we are (still) connected. - public boolean isConnected () throws RemoteException - { - return adaptee.isConnected (); - } - - // To connect or reconnect in case the connection was lost - public boolean connect () throws RemoteException - { - return adaptee.connect (); - } - - // get OTDBtree of one specific tree - public jOTDBtree getTreeInfo (int atreeID,boolean isMomID) throws RemoteException - { - return adaptee.getTreeInfo (atreeID,isMomID); - } - - - - // To get a list of all StateChanges - public Vector getStateList (int treeID, boolean isMomID, String beginDate, String endDate) throws RemoteException - { - try { - return adaptee.getStateList (treeID, isMomID, beginDate, endDate); - }catch (Exception e){ - throw new RemoteException(); - } - } - - // To get a list of all OTDB trees available in the database. - public Vector getTreeList (short treeType, short classifiType) throws RemoteException - { - return adaptee.getTreeList (treeType, classifiType); - } - - public String errorMsg () throws RemoteException - { - return adaptee.errorMsg (); - } - - public int getAuthToken () throws RemoteException - { - return adaptee.getAuthToken (); - } - - protected jOTDBconnection adaptee; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBconnection.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBconnection.java deleted file mode 100644 index bb50d25c6ba..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBconnection.java +++ /dev/null @@ -1,62 +0,0 @@ -//# jOTDBconnection.java: 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 -//# - -package jOTDB; - -import java.util.Vector; -import java.util.Date; - -public class jOTDBconnection -{ - // Just creates an object and registers the connection parameters. - public jOTDBconnection (String username, String passwd, String database) - { - initOTDBconnection (username, passwd, database); - } - - public jOTDBconnection() - { - initOTDBconnection("paulus", "boskabouter", "otdbtest"); - } - - - // Create a OTDBconnection instance - private native void initOTDBconnection (String username, String passwd, String database); - - // To test if we are (still) connected. - public native boolean isConnected(); - - // To connect or reconnect in case the connection was lost - public native boolean connect(); - - // get OTDBtree of one specific tree - public native jOTDBtree getTreeInfo (int atreeID, boolean isMomID); - - public native Vector getStateList(int atreeID, boolean isMomID ,String beginDate, String endDate); - - - // To get a list of all OTDB trees available in the database. - public native Vector getTreeList(short treeType, short classifiType); - - public native String errorMsg(); - - public native int getAuthToken(); -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.jar b/SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.jar deleted file mode 100644 index 89fc055d93396198bdf62b972c28755c2ee1c98e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2925 zcmWIWW@Zs#;9%fjn8|Er%zy+q8CV#6T|*poJ^kGD|D9rBU}gyLX6FE@U;+^g3=Ft6 zi!d-CH2XUGdAhj<hv@mbefB+b+Q(a0?;@|auGYCT=Qjr#Trqy|v`Ej(SI5)$V(BUt z&Ka*Hk4VqZ$Y7cNO!G&Yn)p-kaIxu2o{4E!JX3w0`Kjn*5hK_ksytT(+!+`cKsW&I z3r<E<Uq~@9Fl70MxH##9$;`Zx)S|S+<W#-noW$bd+=*xX4mpUlp8pX3#9ctZv6f-i z#=^5)8`XRrguEhltS(*AoSL;P`0?hQ9~f&i9xqk#Sk-Mkx#s(w;`3YL@5|3;SXY?& z;Ecn0hxrR%-TJ)Lc-wpT;MogJBdhc0iB=hHh*{gh)5i0)P$l`T=iV=eTBaBJ1uLm( z>|Fm-*tssj&LHGX`TYG^j!DeoJZ<}fCs;kGT4+)JL@Vh9k4*8VdAfP|Yrb5$BKfaN zO=;Q0cLz$(#?El*z7RDjaEV9QGcVUHDfVdP&--_n8cC`CsubK?Fte>#V~(`yspsWN zPk7#zte-Gz_0;E|SFh!~DVuWZyTq*h+G+i-zu5MQtnA(JtVTFfNc6I1TimkE|5a4k z+GIlKt?Fm$Dw+Nw|4G7vkOk!rJ3LxF8sBM6yd@uWys*vW!kG!eTa1?Uo>N?C<@>#? z9vlhcpS03!85tM^n2=KgdL)RVMnXwZDlGg1eEn}b2-Lo=nXzM?=VS-_OCJ>VGWmKZ zWaumK350fun6|s@&5sezeRAVsmE)rQo!mkkoy_(P@}XZVH(rvfnrZ&|+1WjFYybWI z!SX=hx7?{85zd^l;?{a)v2Qq85_LBF#I6XCnySW>r1YT8YLePjrrwKAaVP6^CRf%c zZSi_`oM~Tfu<ZmjA&uFuMHfzzjQ+JUta$2)idD+fk~B65o_gxF%JTa46_<{!P>q(J z=^3t{={r;BIzKzpRpF@`#aaQc>V6&k`uwH8mYKU&=e~Ho^ojFMMfxnu>SBDA5%i9) zc&E9ieyK!l@J^M8p5@J(W4>GNKkP27E6>YvCq4S_R)+=uzF+y6BiQP;AXRhfH}#2O zMq&Gl(%*dMKmFk72Z_}MKlkrpGwqIRT+ek+|AQ%0_iWewaSvuQNpFi!I_7SaxAE1% zM7D~(>>Y70<<70WnrF;*g-Lc_O1pH~$$dw6C#`cn^IU7MwT1cXiK|rkcWmkW{y)MZ zyZc+cPG82yR<Zb#bqQ}5{ACB_>X55XZ?-ZrFodGSW37t`N|7Lo8jp!7i3KI8Me)HU zrAd(dv^FfZKsZ$7-!|V}o)HUpm$q(m;MV;%eaj!KLkinib+;`wSt=lK$ZV(Qv}L<X zH*4CT>Td`Oa1i<b|Dxoai|tH)-DO+$ylCd%_p0Y{k3OHVoyES_E1u_>y)^T!yqH&X zZtwG&=QZEwRhw<U|M&0H>nGfW?aCf5;a(nN@%WIX__^H%uMU0Iiz$DoEGX_0Bl5AS zL)<k+s4((~sGxr54y{M2g6lhWs67f5T;Ev{dqi64p2){(9ot>^C_jo7eBW7dpO?R^ z;G>3kf8oW0NB#8VzAxaID_3#x=|LqutqX4ta=rPqK*Toh)4Q_E8Qa-EUwplg!=C^3 z=LE)Y6&pnU)@+%ce$$-)v|vH9<TvYyzfKp=TOrZ2O8L8<MSb6&kGIu-9^60Y`u_iE zCHL3c_gJkjiLtsHR{FL4`P2Hgb)NI3cF#@M|Mo}d-u+)2T9_p!eqa%2-)V8gbwc;y z7#`(Au07nX-4^1`LVe1b4_OWg&2tJlbh)N#R{y+%4K153lpaQ&5Sn**K?{FDh(q94 z0pp}73yDi1Q(JoyHZ$bkI#v>UdAHETgzkn(TMSS2xKDCh<1d|(Rj{_<sG0lxa}n)Q z7n@$E-L{_EA{djuS-W$ah&ngBIme0hYhMcl#6(}Obdj4_TNv5<>rdOd6&KGg+kAh@ zZ_6dk2D^XVimqK|qG9PMlcMJ1`}R#m^{H(;=6DFy6za(wz5aZ|ZJpcwtv5C-%vi;F zZyIw=g4oQtap@B+a&KNwz1DE;;r5^x&Ry%L^JcQ$wlTjmulo7{!B08&BF%5BCG6DA zZhEQgvwhO{O&vRn+}F-uJt=DceXj{7Q+BMMf5>#M(2i{_kGfV#M6-(IY-H;*(>=p- zW_hx=#HOq-r$4HkwVgRjg@wa<<?^B_yWiBAYV1Fs#Jc0}@lfSsJgP3<FSx(th%4}B zM9n$5YHL%IK>A9xX;%*9bWaHhX?`ha>7sEltMFFLu8k)pE`G_Y?6@;&@5an<lebBo zEi$U}Z_oK~m1{=&>(4JG-{*O)Nm&)NV1@FOPJwN9%b%HsZ&j<#UAnDq+Tl+ImQ8ia zmJ|3sq_XRrsbXC5>N0DdZ)p4CG`W_BQ##(;)81T|lx0!e#w7Oi#W%^9))|t4%Yvu- z-ri+u9BbXZ<kCl`%Li{U{!7uArnTs4tYLfktStt+x4!IH?z`9XYCziz-u&C^?U%hg z*2A;%d-1V<zmj&9g~)YmE_v}KS|h=8+R<ad6ARx4-rSh@Ij4A6`j+A<Ztv%BzJ2+Y z_A_X2z>L3(F8MDyx0s7_&54h7%hWR%tF3OmTp%nGl(~<8>Yu-=+l!o@y<XjO!fVd= zBvx4w<(6}YrY@A==AD%GGIjy$AE`5kZKfP_z0aTM&~Pr_)W*YZ*P@I!54TTQ$shG= z!qVnxb~#z%`+GG0&8XDhmAOvQ<+FO`H+3$b*L$Ngev0KyGFPZPYMsG%$E`d3#D6aC zV;ldOttw*vWYjQqC*x1a1FP;Zv^O&}{)x``G<(CVI|j=yH?951E)z5B!K^zEns{Em zl8)F=F4WBwcb(<cvb;;%8s$F<cX@LE`L&Jf;nGXbChD!opW$%Wce93G-PFlbe}`YT z_qp?a?f&Mi$#W-vV3RtwF^_3$aGIaGEw|_LE}aJ|hr&|$r_OLUyH?-l`*nMOs>tH6 z+&MZ9>4#&_$hW`We6CIN-%J<R1FzNo{nAWgmaUQW^4ZJtblEx=#g{C#vPS~_?gvY3 zsMw`5&#F6J_2ZWGifKJ(9fQ35J6E3enG~dSTFsKVvhVB~rAfMylNJ@`{Lr6m$)5I6 zW`W()z}Y(UvR+L(+W5y)g!PpAhlc$Uw|%ayJGOhmv0YNjf2h0OoUw4t!sSP<Y*kC; zl}Zbo*Pa#V)^W*k*VRR93ZtehowI4;tv-J39~&h2XTG`XTOMe6?XJmDd(Cglc&d$U zRhPx3Z!%AQtn=-n<?a+y(X!Y7uc-bI2Nn3zN^U00SQ!{Ta)T;vMkWyk)K(y@i3e&0 zLR))K3Z+dL;Ek$P6{%4MY6C*`FfcIK;%E^fn*eGzAh#%_5ZW0S7>=RVK4?ujbaRkv zG*J5kVU#x$N|O-L8bLM!RP`Z;5vb}z7$MApVgzPI7~svy22#$-z{(KJ$iTqD1>yk! DWXrwH diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.java deleted file mode 100644 index c7bbf65af0a..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBinterface.java +++ /dev/null @@ -1,52 +0,0 @@ -//# jOTDBinterface.java: The RMI interface to 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 -//# - -package jOTDB; - -import jOTDB.jOTDBtree; -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 getTreeList (short treeType, short classifiType) throws RemoteException; - - // To get a list of all OTDB trees available in the database. - public Vector getStateList (int treeID, boolean isMomID, String beginDate, String endDate) throws RemoteException; - - public String errorMsg () throws RemoteException; - - public int getAuthToken () throws RemoteException; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBnode.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBnode.java deleted file mode 100644 index f16137b5190..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBnode.java +++ /dev/null @@ -1,69 +0,0 @@ -//# jOTDBnode.java: Structure containing a tree node. -//# -//# 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 -//# - -package jOTDB; - -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/jOTDB/src/jOTDB/jOTDBparam.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBparam.java deleted file mode 100644 index 05b9b46d47f..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBparam.java +++ /dev/null @@ -1,61 +0,0 @@ -//# jOTDBparam.java:Structure describing one parameter. -//# -//# 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 -//# - -package jOTDB; - -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/jOTDB/src/jOTDB/jOTDBserver.jar b/SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.jar deleted file mode 100644 index a91aeda3aad5cdc19fd23af4d96a0768ea52391b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3654 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 diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.java deleted file mode 100644 index ef31d9da0c8..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBserver.java +++ /dev/null @@ -1,131 +0,0 @@ -//# jOTDBserver.java: The RMI server of 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 -//# - -package jOTDB; - -import jOTDB.jConverter; -import jOTDB.jConverterInterface; -import jOTDB.jConverterAdapter; -import jOTDB.jTreeValue; -import jOTDB.jTreeValueInterface; -import jOTDB.jTreeValueAdapter; -import jOTDB.jTreeMaintenance; -import jOTDB.jTreeMaintenanceInterface; -import jOTDB.jTreeMaintenanceAdapter; -import jOTDB.jOTDBconnection; -import jOTDB.jOTDBadapter; -import jOTDB.jOTDBinterface; -import java.rmi.Naming; -import java.rmi.registry.*; -import java.rmi.RMISecurityManager; -import java.net.InetAddress; - -public class jOTDBserver -{ - private static jOTDBconnection jOTDBconnAdaptee; - private static jOTDBadapter jOTDBconnAdapter; - private static jTreeMaintenance jTreeMainAdaptee; - private static jTreeMaintenanceAdapter jTreeMainAdapter; - private static jTreeValue jTreeValueAdaptee; - private static jTreeValueAdapter jTreeValueAdapter; - private static jConverter jConverterAdaptee; - private static jConverterAdapter jConverterAdapter; - - static - { - System.loadLibrary("jotdb"); - } - - - public static void main (String[] args) - { - try - { -// if (System.getSecurityManager () == null) -// { -// System.out.println ("No security mananger is running, will start one now..."); -// System.setSecurityManager (new RMISecurityManager ()); -// } - - if (args.length < 4) - { - System.out.println ("Usage: java -jar jOTDBserver.jar <username> <password> <database> <hostname> <portnumber-OPTIONAL>"); - System.exit(0); - } - - - String aHostName = new String(args[3]); - - System.out.println ("Running on: "+aHostName); - System.setProperty ("java.rmi.server.hostname", aHostName); - - System.out.println ("jOTDBserver creating a local RMI registry..."); - Registry localRegistry; - if (args.length == 4) - localRegistry = LocateRegistry.createRegistry (Registry.REGISTRY_PORT); - else { - Integer i = new Integer (args[4]); - localRegistry = LocateRegistry.createRegistry (i.intValue()); - } - - System.out.println ("jOTDBserver creating local object and remote adapter..."); - - // Export jOTDBconnection - jOTDBconnAdaptee = new jOTDBconnection (args[0], args[1], args[2]); - jOTDBconnAdapter = new jOTDBadapter (jOTDBconnAdaptee); - - System.out.println ("jOTDBserver publishing service " + jOTDBinterface.SERVICENAME + " in local registry..."); - localRegistry.rebind (jOTDBinterface.SERVICENAME, jOTDBconnAdapter); - - System.out.println ("Published jOTDBinterface as service " + jOTDBinterface.SERVICENAME + ". Ready..."); - - // Export jTreeMaintenance - jTreeMainAdaptee = new jTreeMaintenance (); - jTreeMainAdapter = new jTreeMaintenanceAdapter (jTreeMainAdaptee); - - System.out.println ("jOTDBserver publishing service " + jTreeMaintenanceInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind (jTreeMaintenanceInterface.SERVICENAME, jTreeMainAdapter); - - // Export jTreeValue - jTreeValueAdaptee = new jTreeValue (); - jTreeValueAdapter = new jTreeValueAdapter (jTreeValueAdaptee); - - System.out.println ("jOTDBserver publishing service " + jTreeValueInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind (jTreeValueInterface.SERVICENAME, jTreeValueAdapter); - - System.out.println ("Published jTreeValueInterface as service " + jTreeValueInterface.SERVICENAME + ". Ready..."); - - // Export jConverter - jConverterAdaptee = new jConverter (); - jConverterAdapter = new jConverterAdapter (jConverterAdaptee); - - System.out.println ("jOTDBserver publishing service " + jConverterInterface.SERVICENAME + " in local registry..."); - localRegistry.rebind (jConverterInterface.SERVICENAME, jConverterAdapter); - - System.out.println ("Published jConverterInterface as service " + jConverterInterface.SERVICENAME + ". Ready..."); - } - - catch (Exception e) - { - System.out.println ("jOTDB server failed: " + e); - } - } -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBtree.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBtree.java deleted file mode 100644 index cb736095346..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBtree.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jOTDBconnection.java: 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 -//# - -package jOTDB; - -public class jOTDBtree implements java.io.Serializable -{ - public jOTDBtree (int treeID) - { - itsTreeID = treeID; - } - - public int treeID() - { - return (itsTreeID); - } - - public int momID; - public short classification; // development / test / operational - public String creator; - public String creationDate; - public short type; // hardware / VItemplate / VHtree - public short state; // idle / configure / ... / active / ... - // -- VIC only -- - public int originalTree; - public String campaign; - public String starttime; - public String stoptime; - private int itsTreeID; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jOTDBvalue.java b/SAS/OTB/jOTDB/src/jOTDB/jOTDBvalue.java deleted file mode 100644 index e31ff8f93ba..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jOTDBvalue.java +++ /dev/null @@ -1,48 +0,0 @@ -//# jOTDBvalue.java: -//# -//# 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 -//# - -package jOTDB; - -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/jOTDB/src/jOTDB/jTreeMaintenance.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenance.java deleted file mode 100644 index 9785e715280..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenance.java +++ /dev/null @@ -1,111 +0,0 @@ -//# jOTDBtreeMaintenance.java: 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 -//# - -package jOTDB; - -import jOTDB.jVICnodeDef; -import jOTDB.jOTDBnode; -import jOTDB.jOTDBparam; -import java.util.Vector; - -public class jTreeMaintenance -{ - public jTreeMaintenance () - { - initTreeMaintenance (); - } - - private native void initTreeMaintenance (); - - // Get the node definition of a VC node - public native jVICnodeDef getNodeDef (int aNodeID); - - //# --- 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 native int buildTemplateTree (int topNodeID, short aClassif); - - // 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); - - // Get a single node from the VIC template tree - public native jOTDBnode getNode (int aTreeID, int aNodeID); - - public native boolean setMomInfo(int aTreeID, int momID, String campaign); - - // Get a number of levels of children. - public native Vector getItemList (int aTreeID, int topNode, int depth); - - // Get a list of nodes based on a namefragment. Use '%' as wildchar. - public native Vector getItemList (int aTreeID, String aNameFragment); - - // 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); - - // Updates the (vector of) OTDBnodes to the database. - public native boolean saveNode (jOTDBnode aNode); - public native boolean saveNodeList (Vector aNodeList); - - // Updates the (vector of) OTDBnodes to the database. - public native boolean deleteNode (jOTDBnode aNode); - public native boolean deleteNodeList (Vector aNodeList); - - // Evaluate the constraints from a (sub)tree. - public native boolean checkTreeConstraints (int aTreeID, int topNode); - - - //# --- 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); - - // Prune an instanciated tree to get loss of depricated values. - public native boolean pruneTree (int aTreeID, short pruningLevel); - - //# --- Finally some general tree maintenance --- - // Delete a tree (of any kind) from the database. - public native boolean deleteTree (int aTreeID); - - // Retrieve the topNode of any tree - public native jOTDBnode getTopNode (int aTreeID); - - // Set the classification of any tree. - public native boolean setClassification (int aTreeID, short aClassification); - - // 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); - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public native String errorMsg(); - - // Get the parameter definition of a node - public native jOTDBparam getParam (int aTreeID, int aNodeID); - - // Save the parameter definition - public native boolean saveParam (jOTDBparam aParam); -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceAdapter.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceAdapter.java deleted file mode 100644 index d29e92eaa1e..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceAdapter.java +++ /dev/null @@ -1,184 +0,0 @@ -//# jTreeMaintenanceAdapter.java: The RMI adapter of the OTDB database. -//# -//# 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 -//# - -package jOTDB; - -import jOTDB.jOTDBnode; -import jOTDB.jOTDBparam; -import jOTDB.jVICnodeDef; -import jOTDB.jTreeMaintenance; -import jOTDB.jTreeMaintenanceInterface; -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; - -public class jTreeMaintenanceAdapter extends UnicastRemoteObject implements jTreeMaintenanceInterface -{ - // Constructor - public jTreeMaintenanceAdapter (jTreeMaintenance adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - // Get the node definition of a VC node - public jVICnodeDef getNodeDef (int aNodeID) throws RemoteException - { - return adaptee.getNodeDef (aNodeID); - } - - - //# --- 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 - { - return adaptee.buildTemplateTree (topNodeID, aClassif); - } - - // 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 - { - return adaptee.copyTemplateTree (aTreeID); - } - - // Get a single node from the VIC template tree - public jOTDBnode getNode (int aTreeID, int aNodeID) throws RemoteException - { - return adaptee.getNode (aTreeID, aNodeID); - } - - public boolean setMomInfo(int aTreeID, int momID, String campaign) throws RemoteException - { - return adaptee.setMomInfo(aTreeID, momID, campaign); - } - - // Get a number of levels of children. - public Vector getItemList (int aTreeID, int topNode, int depth) throws RemoteException - { - return adaptee.getItemList (aTreeID, topNode, depth); - } - - // Get a list of nodes based on a namefragment. Use '%' as wildchar. - public Vector getItemList (int aTreeID, String aNameFragment) throws RemoteException - { - return adaptee.getItemList (aTreeID, aNameFragment); - } - - // 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 - { - return adaptee.dupNode (aTreeID, orgNodeID, newIndex); - } - - // Updates the (vector of) OTDBnodes to the database. - public boolean saveNode (jOTDBnode aNode) throws RemoteException - { - return adaptee.saveNode (aNode); - } - - public boolean saveNodeList (Vector aNodeList) throws RemoteException - { - return adaptee.saveNodeList (aNodeList); - } - - // Updates the (vector of) OTDBnodes to the database. - public boolean deleteNode (jOTDBnode aNode) throws RemoteException - { - return adaptee.deleteNode (aNode); - } - - public boolean deleteNodeList (Vector aNodeList) throws RemoteException - { - return adaptee.deleteNodeList (aNodeList); - } - - // Evaluate the constraints from a (sub)tree. - public boolean checkTreeConstraints (int aTreeID, int topNode) throws RemoteException - { - return adaptee.checkTreeConstraints (aTreeID, topNode); - } - - //# --- 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 - { - return adaptee.instanciateTree (baseTree); - } - - // Prune an instanciated tree to get loss of depricated values. - public boolean pruneTree (int aTreeID, short pruningLevel) throws RemoteException - { - return adaptee.pruneTree (aTreeID, pruningLevel); - } - - //# --- Finally some general tree maintenance --- - // Delete a tree (of any kind) from the database. - public boolean deleteTree (int aTreeID) throws RemoteException - { - return adaptee.deleteTree (aTreeID); - } - - // Retrieve the topNode of any tree - public jOTDBnode getTopNode (int aTreeID) throws RemoteException - { - return adaptee.getTopNode (aTreeID); - } - - // Set the classification of any tree. - public boolean setClassification (int aTreeID, short aClassification) throws RemoteException - { - return adaptee.setClassification (aTreeID, aClassification); - } - - // 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 - { - return adaptee.setTreeState (aTreeID, aState); - } - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() throws RemoteException - { - return adaptee.errorMsg(); - } - - // Get the parameter definition of a node - public jOTDBparam getParam (int aTreeID, int aNodeID) throws RemoteException - { - return adaptee.getParam (aTreeID, aNodeID); - } - - // Save the parameter definition - public boolean saveParam (jOTDBparam aParam) throws RemoteException - { - return adaptee.saveParam (aParam); - } - - protected jTreeMaintenance adaptee; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceInterface.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceInterface.java deleted file mode 100644 index 8da5384adac..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeMaintenanceInterface.java +++ /dev/null @@ -1,110 +0,0 @@ -//# jTreeMaintenanceInterface.java: The RMI interface to the OTDB database. -//# -//# 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 -//# - -package jOTDB; - -import jOTDB.jOTDBnode; -import jOTDB.jOTDBparam; -import jOTDB.jVICnodeDef; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Vector; - -public interface jTreeMaintenanceInterface extends Remote -{ - // Constants - public static final String SERVICENAME = "jTreeMaintenance"; - - // Get the node definition of a VC node - public jVICnodeDef getNodeDef (int aNodeID) 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; - - // 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; - - //Add momId to the tree metadata - public boolean setMomInfo(int aTreeID, int momID, String campaign) throws RemoteException; - - // Get a number of levels of children. - public Vector getItemList (int aTreeID, int topNode, int depth) throws RemoteException; - - // Get a list of nodes based on a namefragment. Use '%' as wildchar. - public Vector 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; - - // 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; - - //# --- 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; - - // 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; - - // Whenever an error occurs in one the OTDB functions the message can - // be retrieved with this function. - public String errorMsg() throws RemoteException; - - // Get the parameter definition of a node - public jOTDBparam getParam (int aTreeID, int aNodeID) throws RemoteException; - - // Save the parameter definition - public boolean saveParam (jOTDBparam aParam) throws RemoteException; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jTreeState.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeState.java deleted file mode 100644 index 4f77461d4ff..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeState.java +++ /dev/null @@ -1,31 +0,0 @@ -//# jTreeState.java: 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 -//# - -package jOTDB; - -public class jTreeState implements java.io.Serializable -{ - public int treeID; - public int momID; - public short newState; - public String username; - public String timestamp; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jTreeValue.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeValue.java deleted file mode 100644 index 87cfd409b80..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeValue.java +++ /dev/null @@ -1,39 +0,0 @@ -//# jTreeValue.java: Logging. -//# -//# 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 -//# - -package jOTDB; - -import jOTDB.jOTDBvalue; -import java.util.Vector; - -public class jTreeValue -{ - public jTreeValue () - { - initTreeValue (); - } - - private native void initTreeValue (); - - // Get the node definition of a VC node - public native Vector searchInPeriod (int aTreeID, int topNode, int depth, String beginDate, - String endDate, boolean mostRecentlyOnly); -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jTreeValueAdapter.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeValueAdapter.java deleted file mode 100644 index b393a2f0e15..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeValueAdapter.java +++ /dev/null @@ -1,46 +0,0 @@ -//# jTreeValueAdapter.java: -//# -//# 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 -//# - -package jOTDB; - -import jOTDB.jOTDBvalue; -import jOTDB.jTreeValue; -import jOTDB.jTreeValueInterface; -import java.util.Vector; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; - -public class jTreeValueAdapter extends UnicastRemoteObject implements jTreeValueInterface -{ - // Constructor - public jTreeValueAdapter (jTreeValue adaptee) throws RemoteException - { - this.adaptee = adaptee; - } - - public Vector searchInPeriod (int aTreeID, int topNode, int depth, String beginDate, - String endDate, boolean mostRecentlyOnly) throws RemoteException - { - return adaptee.searchInPeriod (aTreeID, topNode, depth, beginDate, endDate, mostRecentlyOnly); - } - - protected jTreeValue adaptee; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jTreeValueInterface.java b/SAS/OTB/jOTDB/src/jOTDB/jTreeValueInterface.java deleted file mode 100644 index 8ce4a13051e..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jTreeValueInterface.java +++ /dev/null @@ -1,36 +0,0 @@ -//# jTreeValueInterface.java: The RMI interface to the OTDB database. -//# -//# 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 -//# - -package jOTDB; - -import jOTDB.jOTDBvalue; -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 Vector searchInPeriod (int aTreeID, int topNode, int depth, String beginDate, - String endDate, boolean mostRecentlyOnly) throws RemoteException; -} diff --git a/SAS/OTB/jOTDB/src/jOTDB/jVICnodeDef.java b/SAS/OTB/jOTDB/src/jOTDB/jVICnodeDef.java deleted file mode 100644 index 557a81aff90..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB/jVICnodeDef.java +++ /dev/null @@ -1,42 +0,0 @@ -//# jOTDBVICnodeDef.java: Structure containing a VIC node definition -//# -//# 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 -//# - -package jOTDB; - -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/jOTDB/src/jOTDB_jConverter.cc b/SAS/OTB/jOTDB/src/jOTDB_jConverter.cc deleted file mode 100644 index 2bddffe4007..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jConverter.cc +++ /dev/null @@ -1,162 +0,0 @@ -//# jOTDB_jConverter.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 <jni.h> -#include <jOTDB/jOTDB_jConverter.h> -#include <string> -#include <iostream> -#include <jOTDB/jOTDB_jOTDBcommon.h> -#include <OTDB/ClassifConv.h> -#include <OTDB/ParamTypeConv.h> -#include <OTDB/TreeStateConv.h> -#include <OTDB/TreeTypeConv.h> -#include <OTDB/UnitConv.h> - -using namespace LOFAR::OTDB; - -static ClassifConv* classifConv; -static ParamTypeConv* paramTypeConv; -static TreeStateConv* treeStateConv; -static TreeTypeConv* treeTypeConv; -static UnitConv* unitConv; - -namespace LOFAR -{ - namespace jOTDB - { - JNIEXPORT void JNICALL Java_jOTDB_jConverter_initConverter - (JNIEnv *, jobject) - { - OTDBconn = getConnection (); - classifConv = new ClassifConv (OTDBconn); - paramTypeConv = new ParamTypeConv (OTDBconn); - treeStateConv = new TreeStateConv (OTDBconn); - treeTypeConv = new TreeTypeConv (OTDBconn); - unitConv = new UnitConv (OTDBconn); - } - - - JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getClassif__Ljava_lang_String_2 - (JNIEnv *env, jobject, jstring aConv) - { - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret = classifConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - - return ret; - } - - JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getClassif__S - (JNIEnv *env, jobject, jshort aConv) - { - jstring jstr = env->NewStringUTF (classifConv->get(aConv).c_str()); - return jstr; - } - - JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getParamType__Ljava_lang_String_2 - (JNIEnv *env, jobject, jstring aConv) - { - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret = paramTypeConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - - return ret; - } - - JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getParamType__S - (JNIEnv *env, jobject, jshort aConv) - { - jstring jstr = env->NewStringUTF (paramTypeConv->get(aConv).c_str()); - return jstr; - } - - JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getTreeState__Ljava_lang_String_2 - (JNIEnv *env, jobject, jstring aConv) - { - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret = treeStateConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - - return ret; - } - - JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getTreeState__S - (JNIEnv *env, jobject, jshort aConv) - { - jstring jstr = env->NewStringUTF (treeStateConv->get(aConv).c_str()); - return jstr; - } - - JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getTreeType__Ljava_lang_String_2 - (JNIEnv *env, jobject, jstring aConv) - { - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret = treeTypeConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - - return ret; - } - - JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getTreeType__S - (JNIEnv *env, jobject, jshort aConv) - { - jstring jstr = env->NewStringUTF (treeTypeConv->get(aConv).c_str()); - return jstr; - } - - JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getUnit__Ljava_lang_String_2 - (JNIEnv *env, jobject, jstring aConv) - { - const char* chars = env->GetStringUTFChars (aConv, 0); - const string str (chars); - - short ret = unitConv->get (str); - - env->ReleaseStringUTFChars (aConv, chars); - - return ret; - } - - JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getUnit__S - (JNIEnv *env, jobject, jshort aConv) - { - jstring jstr = env->NewStringUTF (unitConv->get(aConv).c_str()); - return jstr; - } - } // namespace jOTDB -} // namespace LOFAR diff --git a/SAS/OTB/jOTDB/src/jOTDB_jConverter.h b/SAS/OTB/jOTDB/src/jOTDB_jConverter.h deleted file mode 100644 index a5947c0bec4..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jConverter.h +++ /dev/null @@ -1,105 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class jOTDB_jConverter */ - -#ifndef _Included_jOTDB_jConverter -#define _Included_jOTDB_jConverter -#ifdef __cplusplus -extern "C" { -#endif - namespace LOFAR - { - namespace jOTDB { -/* - * Class: jOTDB_jConverter - * Method: initConverter - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_jOTDB_jConverter_initConverter - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jConverter - * Method: getClassif - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getClassif__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: jOTDB_jConverter - * Method: getClassif - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getClassif__S - (JNIEnv *, jobject, jshort); - -/* - * Class: jOTDB_jConverter - * Method: getParamType - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getParamType__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: jOTDB_jConverter - * Method: getParamType - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getParamType__S - (JNIEnv *, jobject, jshort); - -/* - * Class: jOTDB_jConverter - * Method: getTreeState - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getTreeState__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: jOTDB_jConverter - * Method: getTreeState - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getTreeState__S - (JNIEnv *, jobject, jshort); - -/* - * Class: jOTDB_jConverter - * Method: getTreeType - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getTreeType__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: jOTDB_jConverter - * Method: getTreeType - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getTreeType__S - (JNIEnv *, jobject, jshort); - -/* - * Class: jOTDB_jConverter - * Method: getUnit - * Signature: (Ljava/lang/String;)S - */ -JNIEXPORT jshort JNICALL Java_jOTDB_jConverter_getUnit__Ljava_lang_String_2 - (JNIEnv *, jobject, jstring); - -/* - * Class: jOTDB_jConverter - * Method: getUnit - * Signature: (S)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jConverter_getUnit__S - (JNIEnv *, jobject, jshort); - } - } -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB/src/jOTDB_jOTDBcommon.h b/SAS/OTB/jOTDB/src/jOTDB_jOTDBcommon.h deleted file mode 100644 index e94a1561db8..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jOTDBcommon.h +++ /dev/null @@ -1,51 +0,0 @@ -//# jOTDB_jOTDBcommon.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 - -//# Never #include <config.h> or #include <lofar_config.h> in a header file! -//# Includes -#include <OTDB/OTDBconnection.h> -#include <OTDB/OTDBnode.h> -#include <OTDB/OTDBvalue.h> - -using namespace LOFAR::OTDB; - -namespace LOFAR { - namespace jOTDB { - - static OTDBconnection* OTDBconn; - - jobject convertOTDBnode (JNIEnv *env, OTDBnode aNode); - OTDBnode convertjOTDBnode (JNIEnv *env, jobject jNode); - jobject convertOTDBvalue (JNIEnv *env, OTDBvalue aValue); - - OTDBconnection* getConnection (); - - } // end namespace LOFAR -} // end namespace jOTDB - -#endif diff --git a/SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.cc b/SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.cc deleted file mode 100644 index b1ad21972dc..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.cc +++ /dev/null @@ -1,257 +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 <jni.h> -#include <jOTDB/jOTDB_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> -#include <jOTDB/jOTDB_jOTDBcommon.h> - - -using namespace boost::posix_time; -using namespace LOFAR::OTDB; -using namespace std; - -namespace LOFAR -{ - namespace jOTDB - { - /* - * Class: jOTDB_jOTDBconnection - * Method: initOTDBconnection - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V - */ - JNIEXPORT void JNICALL Java_jOTDB_jOTDBconnection_initOTDBconnection - (JNIEnv *env, jobject, jstring username, jstring passwd, jstring database) - { - const char* user = env->GetStringUTFChars(username, 0); - const char* pass = env->GetStringUTFChars(passwd, 0); - const char* db = env->GetStringUTFChars(database, 0); - const string u (user); - const string p (pass); - const string d (db); - - OTDBconn = new OTDBconnection(u, p, d); - - env->ReleaseStringUTFChars(username, user); - env->ReleaseStringUTFChars(passwd, pass); - env->ReleaseStringUTFChars(database, db); - } - - /* - * Class: jOTDB_jOTDBconnection - * Method: isConnected - * Signature: ()Ljava/lang/Boolean; - */ - JNIEXPORT jboolean JNICALL Java_jOTDB_jOTDBconnection_isConnected - (JNIEnv *, jobject) - { - jboolean connected; - connected = OTDBconn->isConnected(); - return connected; - } - - /* - * Class: jOTDB_jOTDBconnection - * Method: connect - * Signature: ()Ljava/lang/Boolean; - */ - JNIEXPORT jboolean JNICALL Java_jOTDB_jOTDBconnection_connect - (JNIEnv *, jobject) - { - jboolean connected; - connected = (jboolean)OTDBconn->connect(); - return connected; - } - - /* - * Class: jOTDB_jOTDBconnection - * Method: getTreeInfo - * Signature: (Ljava/lang/String;)LjOTDB/jOTDBtree; - */ - JNIEXPORT jobject JNICALL Java_jOTDB_jOTDBconnection_getTreeInfo - (JNIEnv *env, jobject, jint treeID, jboolean isMomID) - { - OTDBtree aTree = OTDBconn->getTreeInfo((int)treeID, isMomID); - - // Create a jOTDBtree object - jobject myTree; - jclass class_jOTDBtree = env->FindClass("jOTDB/jOTDBtree"); - jmethodID mid_jOTDBtree_cons = env->GetMethodID(class_jOTDBtree, "<init>", "(I)V"); - myTree = env->NewObject(class_jOTDBtree, mid_jOTDBtree_cons, treeID); - - // Get members - jfieldID fid_jOTDBtree_momID = env->GetFieldID (class_jOTDBtree, "momID", "I"); - 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;"); - - // Fill members - env->SetIntField(myTree, fid_jOTDBtree_momID, (jint)aTree.momID); - env->SetShortField(myTree, fid_jOTDBtree_classification, (jint)aTree.classification); - env->SetObjectField(myTree, fid_jOTDBtree_creator, env->NewStringUTF(aTree.creator.c_str())); - env->SetObjectField(myTree, fid_jOTDBtree_creationDate, env->NewStringUTF(to_simple_string(aTree.creationDate).c_str())); - env->SetShortField(myTree, fid_jOTDBtree_type, aTree.type); - env->SetShortField(myTree, fid_jOTDBtree_state, aTree.state); - env->SetIntField(myTree, fid_jOTDBtree_originalTree, aTree.originalTree); - env->SetObjectField(myTree, fid_jOTDBtree_campaign, env->NewStringUTF(aTree.campaign.c_str())); - env->SetObjectField(myTree, fid_jOTDBtree_starttime, env->NewStringUTF(to_simple_string(aTree.starttime).c_str())); - env->SetObjectField(myTree, fid_jOTDBtree_stoptime, env->NewStringUTF(to_simple_string(aTree.stoptime).c_str())); - - return myTree; - } - - /* - * Class: jOTDB_jOTDBconnection - * Method: getTreeList - * Signature: ()Ljava/util/Vector; - */ - JNIEXPORT jobject JNICALL Java_jOTDB_jOTDBconnection_getTreeList - (JNIEnv *env, jobject, jshort treeType, jshort classifiType) - { - vector<OTDBtree> trees = OTDBconn->getTreeList(treeType, classifiType); - vector<OTDBtree>::iterator treesIterator; - - // Construct java Integer - jobject treeID; - jclass class_Integer = env->FindClass("java/lang/Integer"); - jmethodID mid_Integer_cons = env->GetMethodID(class_Integer, "<init>", "(I)V"); - - // Construct java Vector - jobject vecTreeIDs; - jclass class_Vector = env->FindClass("java/util/Vector"); - jmethodID mid_Vector_cons = env->GetMethodID(class_Vector, "<init>", "()V"); - vecTreeIDs = env->NewObject(class_Vector, mid_Vector_cons); - jmethodID mid_Vector_add = env->GetMethodID(class_Vector, "add", "(Ljava/lang/Object;)Z"); - - for (treesIterator = trees.begin(); treesIterator != trees.end(); treesIterator++) - { - treeID = env->NewObject(class_Integer, mid_Integer_cons, (jint)treesIterator->treeID()); - env->CallObjectMethod(vecTreeIDs, mid_Vector_add, treeID); - } - - return(vecTreeIDs); - } - - jobject convertTreeState (JNIEnv *env, TreeState aTreeState) - { - jobject jTreeState; - jclass class_jTreeState = env->FindClass ("jOTDB/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_simple_string(aTreeState.timestamp).c_str())); - - return jTreeState; - } - - /* - * Class: jOTDB_jOTDBconnection - * Method: getStateList - * Signature: (IZLjava/lang/String;)Ljava/util/Vector; - */ - JNIEXPORT jobject JNICALL Java_jOTDB_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); - - vector<TreeState> states = OTDBconn->getStateList(treeID, isMomID, - time_from_string(bd), time_from_string(ed)); - vector<TreeState>::iterator statesIterator; - - // Construct java Vector - jobject statesVector; - 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 )); - } - - return(statesVector); - } - - - /* - * Class: jOTDB_jOTDBconnection - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ - JNIEXPORT jstring JNICALL Java_jOTDB_jOTDBconnection_errorMsg - (JNIEnv *env, jobject) - { - jstring jstr = env->NewStringUTF(OTDBconn->errorMsg().c_str()); - return jstr; - } - - /* - * Class: jOTDB_jOTDBconnection - * Method: getAuthToken - * Signature: ()I - */ - JNIEXPORT jint JNICALL Java_jOTDB_jOTDBconnection_getAuthToken - (JNIEnv *, jobject) - { - jint token = (jint)OTDBconn->getAuthToken(); - return token; - } - - OTDBconnection* getConnection () - { - return OTDBconn; - } - - - - - } // namespace jOTDB -} // namespace LOFAR diff --git a/SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.h b/SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.h deleted file mode 100644 index e6936c0ac7c..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jOTDBconnection.h +++ /dev/null @@ -1,87 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class jOTDB_jOTDBconnection */ - -#ifndef _Included_jOTDB_jOTDBconnection -#define _Included_jOTDB_jOTDBconnection -#ifdef __cplusplus -extern "C" { -#endif - - namespace LOFAR - { - - namespace jOTDB - { - -/* - * Class: jOTDB_jOTDBconnection - * Method: initOTDBconnection - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_jOTDB_jOTDBconnection_initOTDBconnection - (JNIEnv *, jobject, jstring, jstring, jstring); - -/* - * Class: jOTDB_jOTDBconnection - * Method: isConnected - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jOTDBconnection_isConnected - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jOTDBconnection - * Method: connect - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jOTDBconnection_connect - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jOTDBconnection - * Method: getTreeInfo - * Signature: (IZ)LjOTDB/jOTDBtree; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jOTDBconnection_getTreeInfo - (JNIEnv *, jobject, jint, jboolean); - -/* - * Class: jOTDB_jOTDBconnection - * Method: getStateList - * Signature: (IZLjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jOTDBconnection_getStateList - (JNIEnv *, jobject, jint, jboolean, jstring, jstring); - -/* - * Class: jOTDB_jOTDBconnection - * Method: getTreeList - * Signature: (SS)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jOTDBconnection_getTreeList - (JNIEnv *, jobject, jshort, jshort); - -/* - * Class: jOTDB_jOTDBconnection - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jOTDBconnection_errorMsg - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jOTDBconnection - * Method: getAuthToken - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_jOTDB_jOTDBconnection_getAuthToken - (JNIEnv *, jobject); - - } - } - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.cc b/SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.cc deleted file mode 100644 index 9351953ec48..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.cc +++ /dev/null @@ -1,452 +0,0 @@ -//# jOTDB_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 <jni.h> -#include <jOTDB/jOTDB_jTreeMaintenance.h> -#include <jOTDB/jOTDB_jOTDBcommon.h> -#include <jOTDB/jOTDB_jOTDBconnection.h> -#include <OTDB/TreeMaintenance.h> -#include <OTDB/VICnodeDef.h> -#include <OTDB/OTDBnode.h> -#include <OTDB/OTDBparam.h> -#include <string> -#include <iostream> - -using namespace LOFAR::OTDB; - -TreeMaintenance *treemain; - -namespace LOFAR -{ - namespace jOTDB - { - JNIEXPORT void JNICALL Java_jOTDB_jTreeMaintenance_initTreeMaintenance - (JNIEnv *, jobject) - { - OTDBconn = getConnection (); - treemain = new TreeMaintenance (OTDBconn); - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getNodeDef - (JNIEnv *env, jobject, jint aNodeID) - { - VICnodeDef aNodeDef = treemain->getNodeDef (aNodeID); - - jobject jNodeDef; - jclass class_jVICnodeDef = env->FindClass ("jOTDB/jVICnodeDef"); - jmethodID mid_jVICnodeDef_cons = env->GetMethodID (class_jVICnodeDef, "<init>", "()V"); - jNodeDef = 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 (jNodeDef, fid_jVICnodeDef_name, env->NewStringUTF (aNodeDef.name.c_str())); - env->SetIntField (jNodeDef, fid_jVICnodeDef_version, aNodeDef.version); - env->SetShortField (jNodeDef, fid_jVICnodeDef_classif, aNodeDef.classif); - env->SetObjectField (jNodeDef, fid_jVICnodeDef_constraints, env->NewStringUTF (aNodeDef.constraints.c_str())); - env->SetObjectField (jNodeDef, fid_jVICnodeDef_description, env->NewStringUTF (aNodeDef.description.c_str())); - env->SetIntField (jNodeDef, fid_jVICnodeDef_itsNodeID, aNodeDef.nodeID()); - - return jNodeDef; - } - - JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_buildTemplateTree - (JNIEnv *, jobject, jint topNodeID, jshort aClassif) - { - jint treeID = treemain->buildTemplateTree (topNodeID, aClassif); - return treeID; - } - - JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_copyTemplateTree - (JNIEnv *, jobject, jint aTreeID) - { - jint treeID = treemain->copyTemplateTree (aTreeID); - return treeID; - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getNode - (JNIEnv *env, jobject, jint aTreeID, jint aNodeID) - { - OTDBnode aNode = treemain->getNode (aTreeID, aNodeID); - return convertOTDBnode (env, aNode); - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_setMomInfo - (JNIEnv *env, jobject, jint aTreeID, jint aMomID, jstring aCampaign) - { - jboolean isCopy; - const char* name = env->GetStringUTFChars (aCampaign, &isCopy); - jboolean succes = treemain->setMomInfo (aTreeID, aMomID, name); - env->ReleaseStringUTFChars (aCampaign, name); - - return succes; - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getItemList__III - (JNIEnv *env, jobject, jint aTreeID, jint topNode, jint depth) - { - vector<OTDBnode> itemList = treemain->getItemList (aTreeID, topNode, depth); - vector<OTDBnode>::iterator itemIterator; - - // Construct java Vector - jobject itemVector; - 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)); - - return itemVector; - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getItemList__ILjava_lang_String_2 - (JNIEnv *env, jobject, jint aTreeID, jstring aNameFragment) - { - const char* nf = env->GetStringUTFChars (aNameFragment, 0); - const string nameFragment (nf); - - vector<OTDBnode> itemList = treemain->getItemList (aTreeID, nameFragment); - vector<OTDBnode>::iterator itemIterator; - - // Construct java Vector - jobject itemVector; - 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); - - return itemVector; - } - - JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_dupNode - (JNIEnv *, jobject, jint aTreeID, jint orgNodeID, jshort newIndex) - { - jint nodeID = treemain->dupNode (aTreeID, orgNodeID, newIndex); - return nodeID; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_saveNode - (JNIEnv *env, jobject, jobject jNode) - { - OTDBnode aNode = convertjOTDBnode (env, jNode); - jboolean succes = treemain->saveNode (aNode); - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_saveNodeList - (JNIEnv *env, jobject, jobject aNodeList) - { - jboolean succes; - 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 = treemain->saveNode (aNode); - if (!succes) - return succes; - } - - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_deleteNode - (JNIEnv *env, jobject, jobject jNode) - { - jclass class_jOTDBnode = env->FindClass ("jOTDB/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 = treemain->getNode (env->GetIntField (jNode, fid_jOTDBnode_itsTreeID), env->GetIntField (jNode, fid_jOTDBnode_itsNodeID)); - - jboolean succes = treemain->deleteNode (aNode); - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_deleteNodeList - (JNIEnv *env, jobject, jobject jNodeList) - { - jboolean succes; - 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 ("jOTDB/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 = treemain->getNode (env->GetIntField (jNode, fid_jOTDBnode_itsTreeID), env->GetIntField (jNode, fid_jOTDBnode_itsNodeID)); - succes = treemain->deleteNode (aNode); - if (!succes) - return succes; - } - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_checkTreeConstraints - (JNIEnv *, jobject, jint aTreeID, jint topNode) - { - jboolean succes;// = treemain->checkTreeConstraints (aTreeID, topNode); - return succes; - } - - JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_instanciateTree - (JNIEnv *, jobject, jint baseTree) - { - jboolean succes = treemain->instanciateTree (baseTree); - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_pruneTree - (JNIEnv *, jobject, jint aTreeID, jshort pruningLevel) - { - jboolean succes = treemain->pruneTree (aTreeID, pruningLevel); - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_deleteTree - (JNIEnv *, jobject, jint aTreeID) - { - jboolean succes = treemain->deleteTree (aTreeID); - return succes; - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getTopNode - (JNIEnv *env, jobject, jint aTreeID) - { - OTDBnode aNode = treemain->getTopNode (aTreeID); - return convertOTDBnode (env, aNode); - } - - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_setClassification - (JNIEnv *, jobject, jint aTreeID, jshort aClassification) - { - jboolean succes = treemain->setClassification (aTreeID, aClassification); - return succes; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_setTreeState - (JNIEnv *, jobject, jint aTreeID, jshort aState) - { - jboolean succes = treemain->setTreeState (aTreeID, aState); - return succes; - } - - JNIEXPORT jstring JNICALL Java_jOTDB_jTreeMaintenance_errorMsg - (JNIEnv *env, jobject) - { - jstring jstr = env->NewStringUTF(OTDBconn->errorMsg().c_str()); - return jstr; - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getParam - (JNIEnv *env, jobject, jint aTreeID, jint aParamDefID) - { - OTDBparam aParam = treemain->getParam (aTreeID, aParamDefID); - - jobject jParam; - jclass class_jOTDBparam = env->FindClass ("jOTDB/jOTDBparam"); - jmethodID mid_jOTDBparam_cons = env->GetMethodID (class_jOTDBparam, "<init>", "(III)V"); - jParam = 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 (jParam, fid_jOTDBparam_name, env->NewStringUTF (aParam.name.c_str ())); - env->SetShortField (jParam, fid_jOTDBparam_index, aParam.index); - env->SetShortField (jParam, fid_jOTDBparam_type, aParam.type); - env->SetShortField (jParam, fid_jOTDBparam_unit, aParam.unit); - env->SetShortField (jParam, fid_jOTDBparam_pruning, aParam.pruning); - env->SetShortField (jParam, fid_jOTDBparam_valMoment, aParam.valMoment); - env->SetBooleanField (jParam, fid_jOTDBparam_runtimeMod, aParam.runtimeMod); - env->SetObjectField (jParam, fid_jOTDBparam_limits, env->NewStringUTF (aParam.limits.c_str ())); - env->SetObjectField (jParam, fid_jOTDBparam_description, env->NewStringUTF (aParam.description.c_str ())); - - return jParam; - } - - JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_saveParam - (JNIEnv *env, jobject, jobject jParam) - { - jboolean succes; - jclass class_jOTDBparam = env->FindClass ("jOTDB/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 = treemain->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); - - succes = treemain->saveParam (aParam); - return succes; - } - - jobject convertOTDBnode (JNIEnv *env, OTDBnode aNode) - { - jobject jNode; - jclass class_jOTDBnode = env->FindClass ("jOTDB/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; - } - - 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 = treemain->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; - } - - } // namespace jOTDB -} // namespace LOFAR diff --git a/SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.h b/SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.h deleted file mode 100644 index 8bf1fb98aad..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jTreeMaintenance.h +++ /dev/null @@ -1,204 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class jOTDB_jTreeMaintenance */ - -#ifndef _Included_jOTDB_jTreeMaintenance -#define _Included_jOTDB_jTreeMaintenance -#ifdef __cplusplus -extern "C" { -#endif - -namespace LOFAR { - namespace jOTDB { - -/* - * Class: jOTDB_jTreeMaintenance - * Method: initTreeMaintenance - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_jOTDB_jTreeMaintenance_initTreeMaintenance - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: getNodeDef - * Signature: (I)LjOTDB/jVICnodeDef; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getNodeDef - (JNIEnv *, jobject, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: buildTemplateTree - * Signature: (IS)I - */ -JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_buildTemplateTree - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: copyTemplateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_copyTemplateTree - (JNIEnv *, jobject, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: getNode - * Signature: (II)LjOTDB/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getNode - (JNIEnv *, jobject, jint, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: setMomInfo - * Signature: (IILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_setMomInfo - (JNIEnv *, jobject, jint, jint, jstring); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: getItemList - * Signature: (III)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getItemList__III - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: getItemList - * Signature: (ILjava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getItemList__ILjava_lang_String_2 - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: dupNode - * Signature: (IIS)I - */ -JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_dupNode - (JNIEnv *, jobject, jint, jint, jshort); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: saveNode - * Signature: (LjOTDB/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_saveNode - (JNIEnv *, jobject, jobject); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: saveNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_saveNodeList - (JNIEnv *, jobject, jobject); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: deleteNode - * Signature: (LjOTDB/jOTDBnode;)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_deleteNode - (JNIEnv *, jobject, jobject); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: deleteNodeList - * Signature: (Ljava/util/Vector;)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_deleteNodeList - (JNIEnv *, jobject, jobject); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: checkTreeConstraints - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_checkTreeConstraints - (JNIEnv *, jobject, jint, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: instanciateTree - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_jOTDB_jTreeMaintenance_instanciateTree - (JNIEnv *, jobject, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: pruneTree - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_pruneTree - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: deleteTree - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_deleteTree - (JNIEnv *, jobject, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: getTopNode - * Signature: (I)LjOTDB/jOTDBnode; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getTopNode - (JNIEnv *, jobject, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: setClassification - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_setClassification - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: setTreeState - * Signature: (IS)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_setTreeState - (JNIEnv *, jobject, jint, jshort); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: errorMsg - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_jOTDB_jTreeMaintenance_errorMsg - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: getParam - * Signature: (II)LjOTDB/jOTDBparam; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeMaintenance_getParam - (JNIEnv *, jobject, jint, jint); - -/* - * Class: jOTDB_jTreeMaintenance - * Method: saveParam - * Signature: (LjOTDB/jOTDBparam;)Z - */ -JNIEXPORT jboolean JNICALL Java_jOTDB_jTreeMaintenance_saveParam - (JNIEnv *, jobject, jobject); - - } -} - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB/src/jOTDB_jTreeValue.cc b/SAS/OTB/jOTDB/src/jOTDB_jTreeValue.cc deleted file mode 100644 index 2789fe29142..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jTreeValue.cc +++ /dev/null @@ -1,113 +0,0 @@ -//# jOTDB_jTreeValue.cc: Manages the connection with the OTDB database. -//# -//# 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 <jni.h> -#include <jOTDB/jOTDB_jOTDBconnection.h> -#include <OTDB/TreeValue.h> -#include <OTDB/OTDBvalue.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> -#include <jOTDB/jOTDB_jOTDBcommon.h> -#include <jOTDB/jOTDB_jTreeValue.h> - -using namespace boost::posix_time; -using namespace LOFAR::OTDB; - -TreeValue* treeval; - -namespace LOFAR -{ - namespace jOTDB - { - - JNIEXPORT void JNICALL Java_jOTDB_jTreeValue_initTreeValue - (JNIEnv *, jobject) - { - OTDBconn = getConnection (); - } - - JNIEXPORT jobject JNICALL Java_jOTDB_jTreeValue_searchInPeriod - (JNIEnv *env, jobject, jint aTreeID, jint topNode, jint depth, jstring beginDate, jstring endDate, jboolean mostRecentOnly) - { - // get treevalues - treeval = new TreeValue (OTDBconn, aTreeID); - - const char* bd = env->GetStringUTFChars (beginDate, 0); - const char* ed = env->GetStringUTFChars (endDate, 0); - const string beginTime (bd); - const string endTime (ed); - - // cout << beginTime << endl << endTime << endl; - - const ptime ts (time_from_string (beginTime)); - const ptime te (time_from_string (endTime)); - - // cout << topNode << endl << depth << endl << mostRecentOnly << endl; - - vector<OTDBvalue> valueList = treeval->searchInPeriod (topNode, depth, ts, te, mostRecentOnly); - vector<OTDBvalue>::iterator valueIterator; - - // cout << valueList.size () << endl; - - // Construct java Vector - jobject valueVector; - 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); - - return valueVector; - } - - jobject convertOTDBvalue (JNIEnv *env, OTDBvalue aValue) - { - jobject jvalue; - jclass class_jOTDBvalue = env->FindClass ("jOTDB/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_simple_string(aValue.time).c_str ())); - - return jvalue; - } - - } // namespace jOTDB -} // namespace LOFAR diff --git a/SAS/OTB/jOTDB/src/jOTDB_jTreeValue.h b/SAS/OTB/jOTDB/src/jOTDB_jTreeValue.h deleted file mode 100644 index 434589d53fe..00000000000 --- a/SAS/OTB/jOTDB/src/jOTDB_jTreeValue.h +++ /dev/null @@ -1,36 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class jOTDB_jTreeValue */ - -#ifndef _Included_jOTDB_jTreeValue -#define _Included_jOTDB_jTreeValue -#ifdef __cplusplus -extern "C" { -#endif -namespace LOFAR - { - namespace jOTDB - { - - /* - * Class: jOTDB_jTreeValue - * Method: initTreeValue - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_jOTDB_jTreeValue_initTreeValue - (JNIEnv *, jobject); - -/* - * Class: jOTDB_jTreeValue - * Method: getSchedulableItems - * Signature: (IILjava/lang/String;Ljava/lang/String;Z)Ljava/util/Vector; - */ -JNIEXPORT jobject JNICALL Java_jOTDB_jTreeValue_searchInPeriod - (JNIEnv *, jobject, jint, jint, jint, jstring, jstring, jboolean); - } - } - -#ifdef __cplusplus -} -#endif -#endif diff --git a/SAS/OTB/jOTDB/test/Makefile.am b/SAS/OTB/jOTDB/test/Makefile.am deleted file mode 100644 index 80b078babfc..00000000000 --- a/SAS/OTB/jOTDB/test/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -check_PROGRAMS = - -# programs to run through supplied checktools -CHECKTOOLPROGS = -#ENDCHECKTOOLPROGS - -TESTS = - -XFAIL_TESTS = - - -TESTS_ENVIRONMENT = lofar_sharedir=$(lofar_sharedir) - - -include $(top_srcdir)/Makefile.common diff --git a/SAS/OTB/jOTDB/test/tConnection.java b/SAS/OTB/jOTDB/test/tConnection.java deleted file mode 100644 index d17066f4545..00000000000 --- a/SAS/OTB/jOTDB/test/tConnection.java +++ /dev/null @@ -1,68 +0,0 @@ -import jOTDB.jOTDBtree; -import jOTDB.jOTDBconnection; -import java.util.Vector; -import java.lang.Integer; - -class tConnection -{ - static - { - System.loadLibrary("jotdb"); - } - - - public static void main(String[] args) - { - tConnection tconn = new tConnection(); - tconn.test(); - } - - public void test() - { - // do the test - System.out.println("Starting... "); - - // create a jOTDBconnection - jOTDBconnection conn = new jOTDBconnection("paulus","boskabouter","otdbtest"); - - 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))"); - Integer i = new Integer((Integer)treeList.elementAt(1)); - jOTDBtree tInfo = conn.getTreeInfo(i.intValue()); - 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()); - } - } - -} - - - diff --git a/SAS/OTB/jOTDB/test/tRemoteConnection.java b/SAS/OTB/jOTDB/test/tRemoteConnection.java deleted file mode 100644 index 5fb64741953..00000000000 --- a/SAS/OTB/jOTDB/test/tRemoteConnection.java +++ /dev/null @@ -1,79 +0,0 @@ -import jOTDB.jOTDBtree; -//import jOTDB.jOTDBconnection; -import java.util.Vector; -import java.lang.Integer; -import java.rmi.registry.*; -import jOTDB.jOTDBinterface; -import java.rmi.RMISecurityManager; - -class tRemoteConnection -{ - private static jOTDBinterface remoteOTDB; - - 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); - - 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"); - //showTreeList(treeList); - } - - System.out.println("getTreeInfo(treeList.elementAt(1))"); - Integer i = new Integer((Integer)treeList.elementAt(1)); - jOTDBtree tInfo = remoteOTDB.getTreeInfo(i.intValue()); - if (tInfo.treeID()==0) - { - System.out.println("No 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 e) - { - System.out.println ("Remote OTDB via RMI and JNI failed: " + e); - } - - } -} diff --git a/SAS/OTB/jOTDB/test/tRemoteConverter.java b/SAS/OTB/jOTDB/test/tRemoteConverter.java deleted file mode 100644 index 0687be73624..00000000000 --- a/SAS/OTB/jOTDB/test/tRemoteConverter.java +++ /dev/null @@ -1,74 +0,0 @@ -import java.rmi.registry.*; -import jOTDB.jOTDBinterface; -import jOTDB.jConverterInterface; -import java.util.Vector; - -class tRemoteConverter -{ - private static jOTDBinterface conn; - private static jConverterInterface tc; - - public static void main (String[] args) - { - try - { - if (args.length != 1) - { - System.out.println ("Usage: java tRemoteTreeMaintenance <rmi-registry_hostname>"); - System.exit(0); - } - - System.out.println("Starting... "); - - // create a remote object - Registry remoteRegistry = LocateRegistry.getRegistry (args[0]); - conn = (jOTDBinterface) remoteRegistry.lookup (jOTDBinterface.SERVICENAME); - - // 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); - } - - // Test converter - tc = (jConverterInterface) remoteRegistry.lookup (jConverterInterface.SERVICENAME); - System.out.println (tc.getClassif ((short)1)); - System.out.println (tc.getClassif ("development")); - System.out.println (tc.getClassif ((short)2)); - System.out.println (tc.getClassif ("test")); - System.out.println (tc.getClassif ((short)3)); - System.out.println (tc.getClassif ("operational")); - - System.out.println (tc.getParamType ((short)0)); - System.out.println (tc.getParamType ("node")); - System.out.println (tc.getParamType ((short)101)); - System.out.println (tc.getParamType ((short)102)); - System.out.println (tc.getParamType ((short)6)); - System.out.println (tc.getParamType ((short)20)); - - System.out.println (tc.getUnit ((short)1)); - System.out.println (tc.getUnit ((short)2)); - System.out.println (tc.getUnit ((short)3)); - System.out.println (tc.getUnit ((short)4)); - System.out.println (tc.getUnit ((short)5)); - System.out.println (tc.getUnit ((short)6)); - - } - catch (Exception e) - { - System.out.println ("Remote OTDB via RMI and JNI failed: " + e); - } - - } -} diff --git a/SAS/OTB/jOTDB/test/tRemoteTreeMaintenance.java b/SAS/OTB/jOTDB/test/tRemoteTreeMaintenance.java deleted file mode 100644 index 193537333b8..00000000000 --- a/SAS/OTB/jOTDB/test/tRemoteTreeMaintenance.java +++ /dev/null @@ -1,308 +0,0 @@ -import jOTDB.jOTDBtree; -import jOTDB.jOTDBnode; -import jOTDB.jOTDBvalue; -import jOTDB.jOTDBparam; -import jOTDB.jVICnodeDef; -import java.util.Vector; -import java.lang.Integer; -import java.rmi.registry.*; -import jOTDB.jOTDBinterface; -import jOTDB.jTreeMaintenanceInterface; -import jOTDB.jTreeValueInterface; -import java.rmi.RMISecurityManager; - -class tRemoteTreeMaintenance -{ - private static jOTDBinterface conn; - private static jTreeMaintenanceInterface tm; - private static jTreeValueInterface tv; - - 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) - { - treeID = (Integer)trees.elementAt (i); - aTree = (jOTDBtree)conn.getTreeInfo(treeID.intValue ()); - 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 e) - { - System.out.println ("Remote OTDB via RMI and JNI failed: " + e); - } - } - - 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 e) - { - System.out.println ("Remote OTDB via RMI and JNI failed: " + e); - } - } - - 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 e) - { - System.out.println ("Remote OTDB via RMI and JNI failed: " + e); - } - } - - - public static void main (String[] args) - { - try - { - if (args.length != 1) - { - System.out.println ("Usage: java tRemoteTreeMaintenance <rmi-registry_hostname>"); - System.exit(0); - } - - System.out.println("Starting... "); - - // create a remote object - Registry remoteRegistry = LocateRegistry.getRegistry (args[0]); - conn = (jOTDBinterface) remoteRegistry.lookup (jOTDBinterface.SERVICENAME); - tm = (jTreeMaintenanceInterface) remoteRegistry.lookup (jTreeMaintenanceInterface.SERVICENAME); - - // 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); - } - - Integer VTtreeID = new Integer ((Integer)treeList.elementAt (treeList.size () - 1)); - System.out.println ("Using tree " + VTtreeID + " for the tests."); - jOTDBtree treeInfo = conn.getTreeInfo (VTtreeID.intValue ()); - 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 (VTtreeID.intValue ()); - 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 ()); - 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 ()); - 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); - 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); - System.out.println (VHtree.creator); - - // Test values - tv = (jTreeValueInterface) remoteRegistry.lookup (jTreeValueInterface.SERVICENAME); - Vector valueList = tv.searchInPeriod (4, 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 e) - { - System.out.println ("Remote OTDB via RMI and JNI failed: " + e); - } - - } -} diff --git a/SAS/OTB/jOTDB/test/tTreeMaintenance.java b/SAS/OTB/jOTDB/test/tTreeMaintenance.java deleted file mode 100644 index 320618b381e..00000000000 --- a/SAS/OTB/jOTDB/test/tTreeMaintenance.java +++ /dev/null @@ -1,241 +0,0 @@ -import jOTDB.jOTDBnode; -import jOTDB.jVICnodeDef; -import jOTDB.jTreeMaintenance; -import jOTDB.jOTDBconnection; -import jOTDB.jOTDBtree; -import java.util.Vector; -import java.lang.Integer; - -class tTreeMaintenance -{ - static - { - System.loadLibrary ("jotdb"); - } - - - public static void main (String[] args) - { - tTreeMaintenance ttreemain = new tTreeMaintenance (); - ttreemain.test (); - } - - public void showTreeList (Vector trees, jOTDBconnection conn) - { - 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) - { - treeID = (Integer)trees.elementAt (i); - aTree = (jOTDBtree)conn.getTreeInfo(treeID.intValue ()); - 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"); - } - - public void showNodeList (Vector nodes) - { - 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"); - } - - - public void test () - { - // do the test - System.out.println ("Starting... "); - - // create a jOTDBconnection - jOTDBconnection conn = new jOTDBconnection ("paulus","boskabouter","gerdes"); - - 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 (); - - System.out.println ("Searching for a Template tree"); - Vector treeList; - treeList = conn.getTreeList ((short)20, (short)0); // 20 = template, 0 = all - showTreeList (treeList, conn); - if (treeList.size () == 0) { - System.out.println ("No template tree found!"); - System.exit (0); - } - - Integer VTtreeID = new Integer ((Integer)treeList.elementAt (treeList.size () - 1)); - System.out.println ("Using tree " + VTtreeID + " for the tests."); - jOTDBtree treeInfo = conn.getTreeInfo (VTtreeID.intValue ()); - 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 (VTtreeID.intValue ()); - 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 ()); - 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 ()); - 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=3"); - Vector BformCol = tm.getItemList (VTtreeID.intValue (), "Beamformer"); - jOTDBnode BformDef = (jOTDBnode)BformCol.firstElement (); - System.out.println ("Beamformer has ID " + BformDef.nodeID()); - System.out.println (VTtreeID.intValue () +" " + BformDef.nodeID ()); - int dupNodeID = tm.dupNode (VTtreeID.intValue (), BformDef.nodeID (), (short)4); - 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.intValue (), dupNodeID+2); - jOTDBnode param2 = tm.getNode (VTtreeID.intValue (), dupNodeID+3); - System.out.println (param1.name); - System.out.println (param2.name); - 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.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); - 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); - System.out.println (VHtree.creator); - } -} - - - - -- GitLab