Index: /trunk/java-client/Makefile
===================================================================
--- /trunk/java-client/Makefile	(revision 2076)
+++ /trunk/java-client/Makefile	(revision 2077)
@@ -7,5 +7,6 @@
 
 org/nzdl/corba/gsdlInterface/corbaiface.java: corbaiface.idl
-	idlj -pkgPrefix gsdlInterface org.nzdl.corba corbaiface.idl
+	idlj -fclient -pkgPrefix gsdlInterface org.nzdl.corba corbaiface.idl
+	idlj -fserver -pkgPrefix gsdlInterface org.nzdl.corba corbaiface.idl
 	javac org/nzdl/corba/gsdlInterface/*.java
 
Index: /trunk/java-client/org/nzdl/gsdl/Makefile
===================================================================
--- /trunk/java-client/org/nzdl/gsdl/Makefile	(revision 2076)
+++ /trunk/java-client/org/nzdl/gsdl/Makefile	(revision 2077)
@@ -16,5 +16,6 @@
 	(cd util && make all)
 	(cd service && make all)
-	make SimpleClient.class
+	make SimpleClient.class SimpleServer.class
+
 
 clean:
Index: /trunk/java-client/org/nzdl/gsdl/SimpleServer.java
===================================================================
--- /trunk/java-client/org/nzdl/gsdl/SimpleServer.java	(revision 2077)
+++ /trunk/java-client/org/nzdl/gsdl/SimpleServer.java	(revision 2077)
@@ -0,0 +1,225 @@
+/*
+ *    SimpleServer.java
+ *    Copyright (C) 2000 Stuart Yeates 
+ *
+ *    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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+// the package we're in
+package org.nzdl;
+
+// java standard library classes used
+import java.io.IOException;
+import java.io.Serializable;
+import java.lang.Cloneable;
+import java.util.*;
+
+// HelloServer will use the naming service.
+import org.omg.CosNaming.*;
+// The package containing special exceptions thrown by the name service.
+//import org.omg.CosNaming.NamingContextPackage.*;
+// All CORBA applications need these classes.
+import org.omg.CORBA.ORB;
+
+// local libraries
+import org.nzdl.corba.gsdlInterface.*;
+import org.nzdl.service.NzdlCollectionInfo; 
+import org.nzdl.service.NzdlQuery;
+import org.nzdl.service.NzdlRequest;
+import org.nzdl.service.NzdlResponse;
+import org.nzdl.service.NzdlResultSet;
+import org.nzdl.service.NzdlService;
+import org.nzdl.util.NzdlCorbaFactory;
+
+
+/**
+ * SimpleServer
+ *
+ * Based on algorithms in ...
+ *
+ * @author stuart yeates (say1@cs.waikato.ac.nz)
+ * @version $Revision$
+ * @see
+ * @see
+ * @see
+ * 
+ */
+
+
+public class SimpleServer
+{
+  /**
+   * Tests...
+   *
+   *
+   * @exception java.io.IOException when ...
+   * @param args the arguments ...
+   */
+  public static void main(String args[])
+  {
+    try{
+    
+      ORB orb = ORB.init(args, null);
+      
+      // Create the servant and register it with the ORB
+      NzdlServer simpleRef = new NzdlServer();
+      orb.connect(simpleRef);
+      
+      // Get the root naming context
+      org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
+      NamingContext ncRef = NamingContextHelper.narrow(objRef);
+      
+      // Bind the object reference in naming
+      NameComponent nc = new NameComponent("Hello", "");
+      NameComponent path[] = {nc};
+      ncRef.rebind(path, simpleRef);
+      
+      // Wait for invocations from clients
+      java.lang.Object sync = new java.lang.Object();
+      synchronized(sync){
+        sync.wait();
+      }
+      
+    } catch(Exception e) {
+      System.err.println("ERROR: " + e);
+      e.printStackTrace(System.out);
+    }  
+  }
+}
+
+  /**
+   * Tests...
+   *
+   *
+   * @exception java.io.IOException when ...
+   * @param args the arguments ...
+   */
+
+
+class NzdlServer extends _corbaifaceImplBase {
+
+  NzdlService nzdl = null;
+  
+  NzdlServer(NzdlService service) {
+    nzdl = service;
+  }
+  
+  NzdlServer() {
+    nzdl = null;
+  }
+
+  public boolean initialise () {
+    // TODO should map the anything in NzdlService?
+    return true;
+  }
+  public void configure (corbatext_t key, 
+		  corbatext_t[] cfgline) {
+//      m_nzdlServer.configure( NzdlCorbaFactory.toCorbaText( _key ),
+//  			    NzdlCorbaFactory.toCorbaTextArray( _values ));
+
+    nzdl.configure( NzdlCorbaFactory.toString(key),
+		    NzdlCorbaFactory.toSet(cfgline));
+  }
+
+  public void collectionList (corbatext_tarrayHolder collist) {
+    //corbatext_tarrayHolder c_collSet = NzdlCorbaFactory.createCorbaTextArrayHolder();
+    //m_nzdlServer.collectionList(c_collSet);
+    //Set collSet = new HashSet();
+    //for (int i=0; i<c_collSet.value.length; i++) {
+    //  collSet.add( NzdlCorbaFactory.toString( c_collSet.value[i] ) );
+    //}
+    //return collSet ;
+    Set set = nzdl.getCollectionSet();
+
+    Iterator itr = set.iterator();
+    int i = 0;
+    while (itr.hasNext()) {
+      String s = (String) itr.next();
+       collist.value[i++] = NzdlCorbaFactory.toCorbaText(s);
+    }
+
+    return;
+  }
+  public void hasCollection (corbatext_t corbaCollection,
+		      org.omg.CORBA.BooleanHolder has, 
+		      corbaComErrorHolder error) {
+//      corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+//      org.omg.CORBA.BooleanHolder c_has = new org.omg.CORBA.BooleanHolder();
+//      m_nzdlServer.hasCollection( NzdlCorbaFactory.toCorbaText(_name), c_has, c_err );
+//      if (c_err.value.value() != 0)
+//        System.err.println("hasCollection error " + c_err.value.value());
+//      return c_has.value;
+    String name = NzdlCorbaFactory.toString(corbaCollection);
+    has.value  = nzdl.hasCollection(name);
+    return;
+  }
+  public boolean ping (corbatext_t collection, 
+		corbaComErrorHolder error) {
+    String name = NzdlCorbaFactory.toString(collection);
+    return  nzdl.hasCollection(name);
+  }
+  public void getDocument (corbatext_t collection, 
+		    corbaDocRequestHolder request, 
+		    corbaDocResponseHolder response, 
+		    corbaComErrorHolder error) {
+//      corbatext_t c_name = NzdlCorbaFactory.toCorbaText( _name );
+//      corbaDocRequestHolder c_request = NzdlCorbaFactory.createDocRequestHolder( _docID );
+//      corbaDocResponseHolder c_response = NzdlCorbaFactory.createDocResponseHolder( );
+//      corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+//      m_nzdlServer.getDocument( c_name, c_request, c_response, c_err );
+//      if (c_err.value.value() != 0)
+//        System.err.println("getDocument() error " + c_err.value.value());
+//      return NzdlCorbaFactory.toString( c_response.value.doc );
+    String collectionName = NzdlCorbaFactory.toString(collection);
+    String documentID = NzdlCorbaFactory.toString(request.value.OID);
+    String doc = nzdl.getDocument( collectionName, documentID );
+    response.value.doc = NzdlCorbaFactory.toCorbaText(doc);
+    return;
+  }
+  public void getCollectInfo (corbatext_t collection, 
+		       corbaColInfoResponseHolder response, 
+		       corbaComErrorHolder error) {
+//      corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+//      corbaColInfoResponseHolder c_info = NzdlCorbaFactory.createColInfoResponseHolder();
+//      m_nzdlServer.getCollectInfo( NzdlCorbaFactory.toCorbaText(_name), c_info, c_err );
+//      if (c_err.value.value() != 0)
+//        System.err.println("getCollectionInfo() error " + c_err.value.value());
+//      return new NzdlCollectionInfo( c_info.value );
+    String collectionName = NzdlCorbaFactory.toString(collection);
+    NzdlCollectionInfo info = nzdl.getCollectionInfo( collectionName );
+    response.value = info.getInfo();
+    return;
+  }
+  public void getFilterInfo (corbatext_t collection, 
+		      corbatext_tarrayHolder filterNames, 
+		      corbaComErrorHolder error) {
+
+    return;
+  }
+  public void getFilterOptions (corbatext_t collection, 
+			 corbatext_t option, 
+			 corbaFilterOptionsResponseHolder response, 
+			 corbaComErrorHolder error) {
+    return;
+      }
+  public  void filter (corbatext_t collection, 
+	       corbaFilterRequest request, 
+	       corbaFilterResponseHolder response, 
+	       corbaComErrorHolder error) {
+    return;
+  }
+}
+
+
Index: /trunk/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java
===================================================================
--- /trunk/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java	(revision 2076)
+++ /trunk/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java	(revision 2077)
@@ -13,4 +13,8 @@
   public NzdlCollectionInfo( corbaColInfoResponse _info ) {
     m_Info = _info;
+  }
+
+  public corbaColInfoResponse getInfo(){
+    return m_Info;
   }
 
Index: /trunk/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java
===================================================================
--- /trunk/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java	(revision 2076)
+++ /trunk/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java	(revision 2077)
@@ -44,4 +44,12 @@
     corbatext_tarrayHolder arrayHolder = new corbatext_tarrayHolder( array );
     return arrayHolder;
+  }
+
+  public static Set  toSet( corbatext_t [] _configLines ) {
+    HashSet set = new HashSet();
+      for (int i=0; i<_configLines.length; i++) {
+	set.add(NzdlCorbaFactory.toString(_configLines[i]));
+      }
+      return set;
   }
 
