Skip to content
Snippets Groups Projects
Commit 2d0d96b3 authored by Arthur Coolen's avatar Arthur Coolen
Browse files

BugID: 604

jOTDB2 is the new improved OTBServer. This module can be placed on the attic
parent 2ddbad1d
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 872 deletions
...@@ -783,8 +783,6 @@ SAS/OTB/MoM-OTDB-adapter/lib/log4j-1.2.8.jar -text ...@@ -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/xercesImpl.jar -text
SAS/OTB/MoM-OTDB-adapter/lib/xml-apis.jar -text SAS/OTB/MoM-OTDB-adapter/lib/xml-apis.jar -text
SAS/OTB/MoM-OTDB-adapter/sharedlib/jotdb.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/.cvsignore -text
SAS/OTB/jOTDB2/How_to_build_jOTDB2.doc -text SAS/OTB/jOTDB2/How_to_build_jOTDB2.doc -text
SAS/OTB/jOTDB2/make_jar.sh -text svneol=native#application/octet-stream SAS/OTB/jOTDB2/make_jar.sh -text svneol=native#application/octet-stream
......
SUBDIRS=src
include $(top_srcdir)/Makefile.common
#!/bin/sh
../../../autoconf_share/bootstrap ../../../autoconf_share
<?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>
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
)
// \ingroup OTB
// \defgroup jOTDB jOTDB Description
# 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
Main-Class: jOTDB.jOTDBserver
//# 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);
}
//# 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;
}
//# 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;
}
//# 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;
}
//# 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();
}
File deleted
//# 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;
}
//# 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;
}
//# 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;
}
File deleted
//# 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);
}
}
}
//# 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment