Index: lib/srbProps.properties
===================================================================
--- lib/srbProps.properties	(revision 526)
+++ lib/srbProps.properties	(revision 527)
@@ -1,9 +1,9 @@
-#---No Comment---
-#Wed Mar 01 11:16:53 PST 2000
-RMIhost=penelope.nceas.ucsb.edu
-user=higgins
-password=<PUT YOUR PASSWORD HERE>
-host=penelope.nceas.ucsb.edu
+#
+# Properties file defining options for establishing connection to SRB at LTER, NM
+# SDSC, Jivka Bojilova
+# '$Id$'
+#
+host=lorax.lternet.edu
 port=
-defaultResource=test-unix-nceas
-homeCollection=/home/jones.bioinfo
+domain=lter
+
Index: src/edu/ucsb/nceas/metacat/AuthMcat.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AuthMcat.java	(revision 526)
+++ src/edu/ucsb/nceas/metacat/AuthMcat.java	(revision 527)
@@ -23,7 +23,6 @@
 import java.util.Vector;
 import java.rmi.*;
 import SrbJavaGlueInterface;
-import RMIControllerInterface;
 import java.util.PropertyResourceBundle;
 
 /**
@@ -45,8 +44,7 @@
   // JNI (Java Native Interface) routines for SRB
   static String srbHost;
   static String srbPort;
-  static String RMIhost;
-  static RMIControllerInterface rmicon;
+  static String srbDomain;
   static SrbJavaGlueInterface srbJG;
   static {
     try { 
@@ -57,11 +55,9 @@
            PropertyResourceBundle.getBundle("edu.ucsb.nceas.metacat.srbProps");
       srbHost = (String)SRBProps.handleGetObject("host");
       srbPort = (String)SRBProps.handleGetObject("port");
+      srbDomain = (String)SRBProps.handleGetObject("domain");
       // should handle missing RMIhost name here
-      RMIhost = (String)SRBProps.handleGetObject("RMIhost");
-      String name = "//" + RMIhost + "/RMIController";
-      rmicon = (RMIControllerInterface)Naming.lookup(name);
-      name = "//" + RMIhost + "/SrbJavaGlue";
+      String name = "//" + srbHost + "/SrbJavaGlue";
       srbJG = (SrbJavaGlueInterface)Naming.lookup(name);
     } catch (Exception e) {
       System.err.println("AuthMcat static: " + e.getMessage());
@@ -226,50 +222,31 @@
   private int srbConnect(String username, String password)
                                  throws RemoteException  { 
 
-    int srbconn = 0;
+    synchronized(this) {
+      int srbconn = 0;
 
-    // look up for SRBJavaGlue
-    try {
-      String name = "//" + RMIhost + "/SrbJavaGlue";
-      srbJG = (SrbJavaGlueInterface)Naming.lookup(name);
-    } catch (Exception e) {
+      // try SRB RMI Connection
+      // integer value of the SBR Connection ID is returned only
       try {
-        rmicon.restart();
-      } catch (Exception rmie) {}
-      // The SRB server is not running or it is busy now
-      throw new 
-      RemoteException("AuthMcat look up for SrbJavaGlue failed");
-    }
+        String name = "//" + srbHost + "/SrbJavaGlue";
+        srbJG = (SrbJavaGlueInterface)Naming.lookup(name);
+        srbconn=srbJG.clConnectJ(srbHost,srbPort,password,username,srbDomain);
+      } catch (Exception e) {
+        throw new
+        RemoteException("AuthMcat.srbConnect():" + e.getMessage());
+      }
 
-    // try SRB RMI Connection
-    // integer value of the SBR Connection ID is returned only
-    try { 
-      srbconn = srbJG.rmiConnectJ( srbHost, srbPort, password, username );
-    } catch (RemoteException e) {
-      try {
-        rmicon.restart();
-      } catch (Exception rmie) {}
-      throw new RemoteException("AuthMcat.userAuth() - " +
-                                "Error on rmiConnectJ(): " + e.getMessage());
-    }
-      
-    // check if successfull
-    if ( srbconn == 0 ) {
-      throw new 
-      RemoteException("The SRB Server is not running or it is busy now");
-    } else if ( srbconn < 0 ) {
-      try {
-        rmicon.restart();
-      } catch (Exception rmie) {}
-      if ( srbconn == -1003 ) {
+      // check if successfull
+      if ( srbconn == 0 ) {
         throw new 
-        RemoteException("SrbJavaGlue.c: Connection to srbMaster failed.");
+        RemoteException("The SRB Server is not running or it is busy now");
+      } else if ( srbconn < 0 ) {
+        return srbconn;
       }
-      return srbconn;
-    }
 
-    return srbconn; 
+      return srbconn; 
 
+    } // end of synchronized(this)
   }
 
   /**
@@ -278,7 +255,7 @@
   private void srbDisconnect(int srbconn) throws RemoteException
   { 
     try {
-      int err = srbJG.rmiFinishJ( srbconn );
+      int err = srbJG.clFinishJ( srbconn );
     } catch (RemoteException e) {}
 
   }
@@ -442,7 +419,7 @@
 
     boolean isValid = false;
     try {
-  //    isValid = authservice.authenticate(user, password);
+      isValid = authservice.authenticate(user, password);
       if (isValid) {
         System.out.println("Authentication successful for: " + user );
         System.out.println(" ");
