Index: lib/srbrmi/SrbJavaGlue.java
===================================================================
--- lib/srbrmi/SrbJavaGlue.java	(revision 525)
+++ lib/srbrmi/SrbJavaGlue.java	(revision 526)
@@ -10,6 +10,41 @@
  *
  *     Version: '$Id$'
  */
+/**************************************************************************
+Copyright ^�Ó General Atomics, 1995-1999
+All Rights Reserved
+ 
+This file contains Original Code and/or Modifications of Original Code as
+defined in and that are subject to the General Atomics Storage Resource
+Broker Academic and Research Use  License (the 'License'). This license is
+for academic and research use only. You may not use, copy, modify or
+distribute SRB for commercial purposes, nor incorporate the SRB into
+commercial products without the express written permission of General
+Atomics nor may you distribute SRB to any third party.
+ 
+You may not use this software except in compliance with the License. Please
+obtain a copy of the License at http://www.npaci.edu/DICE/SRB/License and
+read it before using this file.
+ 
+The Original Code and all software distributed under the License are
+distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND GENERAL ATOMICS AND THE SAN DIEGO SUPERCOMPUTER
+CENTER HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION,
+ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+NON-INFRINGEMENT OF ANY COPYRIGHT, PATENT , TRADEMARK OR OTHER RIGHTS.
+GENERAL ATOMICS AND THE SAN DIEGO SUPERCOMPUTER CENTER FURTHER  HAVE NO
+OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCMENTS OR
+MODIFICATIONS.. Please see the License for the specific language governing
+rights and limitations under the License."
+ 
+Please read the terms of this license carefully. By using the SRB software,
+you are accepting and agreeing to the terms of this license with General
+Atomics. If you are agreeing to this license on behalf of a company, or
+other institution, you represent that you are authorized to bind the
+company/institution to such a license. If you do not meet this criterion or
+you do not agree to any of the terms of this license, you are not
+authorized to use the software.
+**************************************************************************/
 
  /* Note: Based on Java code originally produced at SDSC
  * Copyright   1999   The Regents of the University of California
@@ -23,6 +58,8 @@
  *
  * @version 1.1 6/8/00
  * @author Dan Higgins - NCEAS
+ * @version 1.0 10/23/97
+ * @author John Moreland
  */
  
  import java.rmi.*;
@@ -31,10 +68,10 @@
  
  
 public class SrbJavaGlue extends UnicastRemoteObject implements SrbJavaGlueInterface
+
 {
  byte[] ByteData;
  String FileName;
- boolean previouslyConnected = false;
     
 	// JNI (Java Native Interface) Glue Routines for the SRB client library.
 
@@ -42,179 +79,162 @@
                   super();
               }
 
-	public synchronized native int clConnectJ( String host, String port, String auth );
-	
-	public synchronized int rmiConnectJ(String host, String port, String auth, String user ) {
-	    if (previouslyConnected) {
-	        return -1;
-	    }
-	    else {
-	        writeMdasEnv(user);
-	        int res = clConnectJ(host, port, auth );
-	        if (res>0) {previouslyConnected = true;}
-	        return res;
-	        
-	    }
-	}
+	public native int clConnectJ( String host, String port, String auth,
+	 String user, String domain );
 
-	public synchronized native int srbListCollectJ( int conn, int catType,
+	public native int srbListCollectJ( int conn, int catType,
 		String collectionName, String flag, int types[] );
 
-	public synchronized native String getFileListItem( int index );
+	public native String getFileListItem( int index );
 
-	public synchronized native int clFinishJ( int conn );
-	
-	public synchronized int rmiFinishJ(int conn) {
-	    Reset();
-	    return clFinishJ(conn);
-	}
+	public native int clFinishJ( int conn );
 
-	public synchronized native int srbObjCopyNewJ( String srcDir, String srcFile,
+	public native int srbObjCopyNewJ( String srcDir, String srcFile,
 		String dstDir, String dstFile, String dstRes );
 
-	public synchronized native int srbListResourceJ( int bs );
+	public native int srbListResourceJ( int bs );
 
-	public synchronized native String getResListItem( int index );
+	public native String getResListItem( int index );
 
-	public synchronized native String getDefCollection();
+	public native String getDefCollection();
 
-	public synchronized native String getDefResource();
+	public native String getDefResource();
 
-	public synchronized native String getUser();
+	public native String getUser();
 
-	public synchronized native String getDomain();
+	public native String getDomain();
 
-	public synchronized native String getLocalCacheDir();
+	public native String getLocalCacheDir();
 
-	public synchronized native int srbObjReplicateJ(int conn, int catType,
+	public native int srbObjReplicateJ(int conn, int catType,
 	  String objID, String replNum, String collection, String resource);
 
-	public synchronized native int srbCollReplicateJ(int conn, int catType,
+	public native int srbCollReplicateJ(int conn, int catType,
 	  String collection, String resource);
 
-	public synchronized native int queryDataInCollJ (int conn, int catType, 
+	public native int queryDataInCollJ (int conn, int catType, 
 	  String parColl);
 
-	public synchronized native int queryDataJ (int conn, int catType, String objID,
+	public native int queryDataJ (int conn, int catType, String objID,
 	  String parColl);
 
-	public synchronized native int querySubCollInCollJ (int conn, int catType, 
+	public native int querySubCollInCollJ (int conn, int catType, 
 	  String parColl);
 
-	public synchronized native String getDataResultJ( int metaIndex, int rowIndex );
+	public native String getDataResultJ( int metaIndex, int rowIndex );
 
-	public synchronized native String getCollResultJ( int metaIndex, int rowIndex );
+	public native String getCollResultJ( int metaIndex, int rowIndex );
 
-	public synchronized native String getGenQueResultJ( int metaIndex, int rowIndex );
+	public native String getGenQueResultJ( int metaIndex, int rowIndex );
 
-	public synchronized native int getNCollAttriJ ();
+	public native int getNCollAttriJ ();
 
-	public synchronized native int getNDataAttriJ ();
+	public native int getNDataAttriJ ();
 
-	public synchronized native int srbObjUnlinkJ (int conn,  int catType, 
+	public native int srbObjUnlinkJ (int conn,  int catType, 
 	  String objID, String replNum, String parColl);
 
-	public synchronized native int srbCreateCollectJ (int conn,  int catType, 
+	public native int srbCreateCollectJ (int conn,  int catType, 
 	  String parColl, String newColl);
 
-	public synchronized native int srbModifyDatasetMetaDJ (int conn,  int catType,
+	public native int srbModifyDatasetMetaDJ (int conn,  int catType,
 	  String objID, String collection, 
 	   String newValue1, String newValue2, int retractionType);
-	   
-	public synchronized native int srbModifyCollectMetaDJ (int conn,  int catType,
+	public native int srbModifyCollectMetaDJ (int conn,  int catType,
 	  String collection, String newValue1, String newValue2, 
 	   String newValue3, int retractionType);
-	   
-	public synchronized native int importToOldObjJ (int conn,  int catType, 
+	public native int importToOldObjJ (int conn,  int catType, 
 	  String objID, String replNum, String parColl, String resource,
 	   String localFile, String container);
 
-	public synchronized native int importToNewObjJ (int conn,  int catType, 
+	public native int importToNewObjJ (int conn,  int catType, 
 	 String objID, String parColl, String resource, String localFile,
 	  String container);
 
-	public synchronized native int importDirJ (int conn,  int catType, 
+	public native int importDirJ (int conn,  int catType, 
 	  String parColl, String resource, String localDir, String container);
 
-	public synchronized native int srbRmCollJ (int conn, int catType, String parColl);
+	public native int srbRmCollJ (int conn, int catType, String parColl);
 
-	public synchronized native int srbUnregCollJ (int conn, int catType, String parColl);
+	public native int srbUnregCollJ (int conn, int catType, String parColl);
 
-	public synchronized native int copyToOldObjJ (int conn,  int catType, 
+	public native int copyToOldObjJ (int conn,  int catType, 
 	 String objID, String replNum, String srcColl, String targObj, 
 	  String targReplNum, String targColl, String targResource, 
 	   String container);
 
-	public synchronized native int copyDataToCollJ (int conn,  int catType, 
+	public native int copyDataToCollJ (int conn,  int catType, 
 	 String objID, String replNum, String srcColl,
 	  String dataType, String size, String targColl, String targResource,
 	   String container);
 
-	public synchronized native int copyCollToCollJ (int conn, int catType, 
+	public native int copyCollToCollJ (int conn, int catType, 
 	 String srcColl, String targColl, String targResource, 
 	  String container);
 
-	public synchronized native int exportToFileJ(int conn, int catType,
+	public native int exportToFileJ(int conn, int catType,
 	 String objID, String replNum, String srcColl,
 	  String targFile, int forceFlag);
 
-	public synchronized native int exportToDirJ(int conn, int catType,
+	public native int exportToDirJ(int conn, int catType,
 	 String objID, String replNum, String srcColl,
 	  String targDir);
 
-	public synchronized native int exportCollToDirJ(int conn, int catType,
+	public native int exportCollToDirJ(int conn, int catType,
 	 String srcColl, String targDir);
 
-	public synchronized native int srbGenQuery (int conn, int catType,
+	public native int srbGenQuery (int conn, int catType,
 	 String[] qval, int qvalInx[], int selVal[]);
 	
-        public synchronized native int srbRegisterDatasetJ(int conn, int catType,
+        public native int srbRegisterDatasetJ(int conn, int catType,
          String objID, String dataType, String resource, String collection,
 	  String pathName, int dataSize);
 
-	public synchronized native int srbUnregisterDatasetJ (int conn, int catType,
+	public native int srbUnregisterDatasetJ (int conn, int catType,
 	 String objID, String replNum, String collection);
 
-        public synchronized native int srbRegisterDirJ (int conn, int catType,
+        public native int srbRegisterDirJ (int conn, int catType,
 	 String srcDirPath, String targColl, String resource);
 
-        public synchronized native int getMoreDataRowsJ (int conn, int catType);
+        public native int getMoreDataRowsJ (int conn, int catType);
 
-        public synchronized native int getMoreCollRowsJ (int conn, int catType);
+        public native int getMoreCollRowsJ (int conn, int catType);
 
-        public synchronized native int getMoreGenQueRowsJ (int conn, int catType);
+        public native int getMoreGenQueRowsJ (int conn, int catType);
 	
-	public synchronized native int chmodInCollJ (int conn, int catType, 
+	public native int chmodInCollJ (int conn, int catType, 
 	 String collection, String user, String domain, String mode);
 
-	public synchronized native int ingestUserJ (int conn, int catType, 
+	public native int ingestUserJ (int conn, int catType, 
 	 String userName, String passwd, String domain, 
 	  String userType, String userAddr, String userPhone, String userEmail,
 	   String parentColl);
 
-	public synchronized native int ingestGroupJ (int conn, int catType, 
+	public native int ingestGroupJ (int conn, int catType, 
 	 String groupName, String passwd,
 	  String groupAddr, String groupPhone, String groupEMail);
 
-	public synchronized native int ingestLocJ (int conn, int catType, 
-	 String locName, String fullAddr, String parentLoc); 
+	public native int ingestLocJ (int conn, int catType, 
+	 String locName, String fullAddr, String parentLoc,
+	  String serverUser, String serverUserDomain); 
 
-        public synchronized native int ingestResourceJ (int conn, int catType,
-         String rescName, String rescType, String location, String phyPath);
+        public native int ingestResourceJ (int conn, int catType,
+         String rescName, String rescType, String location, String phyPath,
+	  String rscClass, int size);
 
-        public synchronized native int ingestLogRescJ (int conn, int catType,
+        public native int ingestLogRescJ (int conn, int catType,
          String logRescName, String phyResc, String phyPath);
 
-        public synchronized native int addLogRescJ (int conn, int catType,
+        public native int addLogRescJ (int conn, int catType,
          String logResc, String phyResc, String phyPath);
 
-        public synchronized native int modifyUserJ (int conn, int catType,
+        public native int modifyUserJ (int conn, int catType,
          int modOpr, String userName, String domain, String modValue);
 
-	public synchronized native int containerCreateJ (int conn, int catType,
+	public native int containerCreateJ (int conn, int catType,
 	 String contName, String dataType, String logResc, int size);
 
-	public synchronized native int containerDeleteJ (int conn, int catType,
+	public native int containerDeleteJ (int conn, int catType,
 	 String contName, int forceFlag);
 
         public native int containerSyncJ (int conn, int catType,
@@ -221,7 +241,7 @@
          String contName, int purgeFlag);
          
  //DFH 6/8/00
- public synchronized byte[] getByteData(String name) {
+ public byte[] getByteData(String name) {
     File tmp = new File("./tmp/");
     if (!tmp.exists()) { tmp.mkdir();}
   
@@ -242,7 +262,7 @@
     return ByteData;
  } 
  
- public synchronized void setByteData(String name, byte[] in) {
+ public void setByteData(String name, byte[] in) {
     ByteData = in;
     FileName = name;
     File tmp = new File("./tmp/");
@@ -257,49 +277,17 @@
         catch (Exception e) {;}
  }
  
- public synchronized void clearTmpFiles() {
+ public void clearTmpFiles() {
     File temp = new File("./tmp/"+FileName);
     if (temp.exists()) { temp.delete(); }
  }
  
- public synchronized void Reset() {
-      try{
-        String[] cmdarray = {"java", "-Djava.security.policy=mypolicy", "SrbJavaGlue"};
-	    Runtime.getRuntime().exec(cmdarray);
-        Runtime.getRuntime().exit(0);
-      }
-      catch (Exception e) {System.out.println("Could not run exec and exit"); }
- }
- 
- public synchronized void writeMdasEnv(String username) {
-	   try{
-	    String userhome = System.getProperty("user.home");
-	    File file = new File(userhome+"/.srb/.MdasEnv");
-		FileWriter fw = new FileWriter(file);
-		StringBuffer env = new StringBuffer();
-		env.append("mdasCollectionHome '/home/higgins.bioinfo'\n");
-		env.append("mdasDomainHome 'bioinfo'\n");
-		env.append("srbUser '"+username+"'\n");
-		env.append("srbHost 'penelope.nceas.ucsb.edu'\n");
-		env.append("defaultResource 'test-unix-nceas'\n");
-		env.append("SEA_OPT '0'");
-		StringReader sr = new StringReader(env.toString());
-		int c;
-		while ((c = sr.read()) != -1)
-                 {    
-                    fw.write(c);
-                 }
-		fw.close();
-		sr.close();
-	   }
-	   catch (Exception e) {}  
- }
- 
  // --
 
 	static
 	{
 		System.loadLibrary( "SrbJavaGlue" );
+
 	}
 	
 	    public static void main(String[] args) {
Index: lib/srbrmi/SrbJavaGlueInterface.java
===================================================================
--- lib/srbrmi/SrbJavaGlueInterface.java	(revision 525)
+++ lib/srbrmi/SrbJavaGlueInterface.java	(revision 526)
@@ -1,4 +1,47 @@
+/**************************************************************************
+Copyright ^�Ó General Atomics, 1995-1999
+All Rights Reserved
+ 
+This file contains Original Code and/or Modifications of Original Code as
+defined in and that are subject to the General Atomics Storage Resource
+Broker Academic and Research Use  License (the 'License'). This license is
+for academic and research use only. You may not use, copy, modify or
+distribute SRB for commercial purposes, nor incorporate the SRB into
+commercial products without the express written permission of General
+Atomics nor may you distribute SRB to any third party.
+ 
+You may not use this software except in compliance with the License. Please
+obtain a copy of the License at http://www.npaci.edu/DICE/SRB/License and
+read it before using this file.
+ 
+The Original Code and all software distributed under the License are
+distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND GENERAL ATOMICS AND THE SAN DIEGO SUPERCOMPUTER
+CENTER HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION,
+ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+NON-INFRINGEMENT OF ANY COPYRIGHT, PATENT , TRADEMARK OR OTHER RIGHTS.
+GENERAL ATOMICS AND THE SAN DIEGO SUPERCOMPUTER CENTER FURTHER  HAVE NO
+OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCMENTS OR
+MODIFICATIONS.. Please see the License for the specific language governing
+rights and limitations under the License."
+ 
+Please read the terms of this license carefully. By using the SRB software,
+you are accepting and agreeing to the terms of this license with General
+Atomics. If you are agreeing to this license on behalf of a company, or
+other institution, you represent that you are authorized to bind the
+company/institution to such a license. If you do not meet this criterion or
+you do not agree to any of the terms of this license, you are not
+authorized to use the software.
+**************************************************************************/
+
+
 /**
+ * SrbJavaGlue
+ *
+ * @version 1.0 10/23/97
+ * @author John Moreland
+ */
+/**
  *        Name: SrbJavaGlueInterface.java
  *     Purpose: Interface for RMI Implementation
  *   Copyright: 2000 Regents of the University of California and the
@@ -16,53 +59,49 @@
 public interface SrbJavaGlueInterface extends Remote
 {
     // Interface for JNI/RMI
-	// JNI (Java Native Interface) Glue Routines for the SRB client library.
-	
+    // JNI (Java Native Interface) Glue Routines for the SRB client library.
 
-	public int clConnectJ( String host, String port, String auth ) throws RemoteException;
+	public  int clConnectJ( String host, String port, String auth,
+	 String user, String domain )throws RemoteException;
 
-    public int rmiConnectJ(String host, String port, String auth, String user ) throws RemoteException;
-
 	public  int srbListCollectJ( int conn, int catType,
-		String collectionName, String flag, int types[] ) throws RemoteException;
+		String collectionName, String flag, int types[] )throws RemoteException;
 
 	public  String getFileListItem( int index ) throws RemoteException;
 
-	public  int clFinishJ( int conn ) throws RemoteException;
+	public  int clFinishJ( int conn )throws RemoteException ;
 
-	public  int rmiFinishJ( int conn ) throws RemoteException;
-
 	public  int srbObjCopyNewJ( String srcDir, String srcFile,
-		String dstDir, String dstFile, String dstRes ) throws RemoteException;
+		String dstDir, String dstFile, String dstRes ) throws RemoteException ;
 
-	public  int srbListResourceJ( int bs ) throws RemoteException;
+	public  int srbListResourceJ( int bs )throws RemoteException;
 
-	public  String getResListItem( int index ) throws RemoteException;
+	public  String getResListItem( int index )throws RemoteException;
 
-	public  String getDefCollection() throws RemoteException;
+	public  String getDefCollection()throws RemoteException;
 
-	public  String getDefResource() throws RemoteException;
+	public  String getDefResource()throws RemoteException;
 
-	public  String getUser() throws RemoteException;
+	public  String getUser()throws RemoteException;
 
-	public  String getDomain() throws RemoteException;
+	public  String getDomain()throws RemoteException;
 
-	public  String getLocalCacheDir() throws RemoteException;
+	public  String getLocalCacheDir()throws RemoteException;
 
 	public  int srbObjReplicateJ(int conn, int catType,
-	  String objID, String replNum, String collection, String resource) throws RemoteException;
+	  String objID, String replNum, String collection, String resource)throws RemoteException;
 
 	public  int srbCollReplicateJ(int conn, int catType,
-	  String collection, String resource) throws RemoteException;
+	  String collection, String resource)throws RemoteException;
 
 	public  int queryDataInCollJ (int conn, int catType, 
 	  String parColl) throws RemoteException;
 
 	public  int queryDataJ (int conn, int catType, String objID,
-	  String parColl) throws RemoteException;
+	  String parColl)throws RemoteException;
 
 	public  int querySubCollInCollJ (int conn, int catType, 
-	  String parColl) throws RemoteException;
+	  String parColl)throws RemoteException;
 
 	public  String getDataResultJ( int metaIndex, int rowIndex ) throws RemoteException;
 
@@ -158,10 +197,12 @@
 	  String groupAddr, String groupPhone, String groupEMail) throws RemoteException;
 
 	public  int ingestLocJ (int conn, int catType, 
-	 String locName, String fullAddr, String parentLoc) throws RemoteException; 
+	 String locName, String fullAddr, String parentLoc,
+	  String serverUser, String serverUserDomain) throws RemoteException; 
 
         public  int ingestResourceJ (int conn, int catType,
-         String rescName, String rescType, String location, String phyPath) throws RemoteException;
+         String rescName, String rescType, String location, String phyPath,
+	  String rscClass, int size) throws RemoteException;
 
         public  int ingestLogRescJ (int conn, int catType,
          String logRescName, String phyResc, String phyPath) throws RemoteException;
@@ -178,10 +219,11 @@
 	public  int containerDeleteJ (int conn, int catType,
 	 String contName, int forceFlag) throws RemoteException;
 
-        public  int containerSyncJ (int conn, int catType,
-         String contName, int purgeFlag) throws RemoteException;
-         
-  // additions June 2000 by DFH to allows file transfers to client side of RMI
+  public  int containerSyncJ (int conn, int catType,
+   String contName, int purgeFlag) throws RemoteException;
+
+
+ // additions June 2000 by DFH to allows file transfers to client side of RMI
   
   public byte[] getByteData(String fileName) throws RemoteException;
   
@@ -188,9 +230,5 @@
   public void setByteData(String fileName, byte[] byteData) throws RemoteException;
 
   public void clearTmpFiles() throws RemoteException;
-  
-  public void Reset() throws RemoteException;
-  
-  
+
 }
-
Index: lib/srbrmi/SrbJavaGlue_Stub.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/srbrmi/SrbJavaGlue_Skel.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/srbrmi/SrbJavaGlue.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/srbrmi/SrbJavaGlueInterface.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
