You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by ks...@apache.org on 2002/07/12 05:06:17 UTC

cvs commit: xml-xindice/java/src/org/apache/xindice/server/services APIService.java

kstaken     2002/07/11 20:06:17

  Modified:    java/src/org/apache/xindice/client/xmldb DatabaseImpl.java
                        ResourceSetImpl.java
               java/src/org/apache/xindice/client/xmldb/xmlrpc
                        CollectionImpl.java
               java/src/org/apache/xindice/client/xmldb/xmlrpc/services
                        CollectionManagementServiceImpl.java
               java/src/org/apache/xindice/core FaultCodes.java
  Removed:     java/src/org/apache/xindice/server/services APIService.java
  Log:
  CORBA is banished and now the server actually works.
  
  Revision  Changes    Path
  1.6       +1 -7      xml-xindice/java/src/org/apache/xindice/client/xmldb/DatabaseImpl.java
  
  Index: DatabaseImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/client/xmldb/DatabaseImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DatabaseImpl.java	11 Jul 2002 23:25:28 -0000	1.5
  +++ DatabaseImpl.java	12 Jul 2002 03:06:16 -0000	1.6
  @@ -59,16 +59,10 @@
    * $Id$
    */
   
  -import org.omg.CORBA.ORB;
  -
   import java.util.*;
   import java.io.*;
  -import java.net.*;
  -import javax.naming.*;
   
   import org.xmldb.api.base.*;
  -
  -import org.apache.xindice.client.xmldb.corba.*;
   
   /**
    * DatabaseImpl is the XML:DB driver implementation for Xindice. It is the entry
  
  
  
  1.3       +2 -4      xml-xindice/java/src/org/apache/xindice/client/xmldb/ResourceSetImpl.java
  
  Index: ResourceSetImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/client/xmldb/ResourceSetImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ResourceSetImpl.java	11 Jul 2002 03:17:07 -0000	1.2
  +++ ResourceSetImpl.java	12 Jul 2002 03:06:17 -0000	1.3
  @@ -59,12 +59,10 @@
    * $Id$
    */
   
  -import org.apache.xindice.client.corba.db.*;
  -
   import org.apache.xindice.client.xmldb.resources.*;
   
   // TODO: This is shouldn't be here for this class to be generic.
  -import org.apache.xindice.client.xmldb.corba.CollectionImpl;
  +import org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl;
   
   import org.xmldb.api.base.*;
   import org.xmldb.api.modules.*;
  
  
  
  1.3       +3 -4      xml-xindice/java/src/org/apache/xindice/client/xmldb/xmlrpc/CollectionImpl.java
  
  Index: CollectionImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/client/xmldb/xmlrpc/CollectionImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CollectionImpl.java	11 Jul 2002 23:25:28 -0000	1.2
  +++ CollectionImpl.java	12 Jul 2002 03:06:17 -0000	1.3
  @@ -383,7 +383,7 @@
        *
        * @return the collection path
        */
  -    public String getPath() {
  +    public String getCanonicalName() {
           
           return collPath;
       }
  @@ -709,8 +709,7 @@
              
              return getChildCollection(name);
           }
  -        catch (Exception e) {
  -e.printStackTrace();           
  +        catch (Exception e) {         
              throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                       "Cannot create child collection: " + e.getMessage());
           }
  
  
  
  1.3       +2 -2      xml-xindice/java/src/org/apache/xindice/client/xmldb/xmlrpc/services/CollectionManagementServiceImpl.java
  
  Index: CollectionManagementServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/client/xmldb/xmlrpc/services/CollectionManagementServiceImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CollectionManagementServiceImpl.java	11 Jul 2002 23:25:28 -0000	1.2
  +++ CollectionManagementServiceImpl.java	12 Jul 2002 03:06:17 -0000	1.3
  @@ -176,7 +176,7 @@
        */
       public String getCanonicalName() throws XMLDBException {
          try {
  -          return ((CollectionImpl) coll).getPath();
  +          return ((CollectionImpl) coll).getCanonicalName();
          }
          catch (Exception e) {
             throw FaultCodes.createXMLDBException(e);
  
  
  
  1.3       +329 -20   xml-xindice/java/src/org/apache/xindice/core/FaultCodes.java
  
  Index: FaultCodes.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/core/FaultCodes.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FaultCodes.java	11 Jul 2002 08:37:11 -0000	1.2
  +++ FaultCodes.java	12 Jul 2002 03:06:17 -0000	1.3
  @@ -60,7 +60,6 @@
    */
   
   import java.util.*;
  -import org.apache.xindice.client.corba.db.*;
   import org.apache.xindice.util.*;
   
   import org.xmldb.api.base.*;
  @@ -70,9 +69,327 @@
    * messages.
    */
   
  -public abstract class FaultCodes implements org.apache.xindice.client.corba.db.FaultCodes {
  +public abstract class FaultCodes {
      private static final Map FaultMsg = new HashMap();
  -
  +   //
  +   // Constant value
  +   //
  +   public static final int GEN = ( int ) ( 0l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ = ( int ) ( 100l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL = ( int ) ( 200l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX = ( int ) ( 300l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int TRX = ( int ) ( 400l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int DBE = ( int ) ( 500l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int QRY = ( int ) ( 600l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int SEC = ( int ) ( 700l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int URI = ( int ) ( 800l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int JAVA = ( int ) ( 2000l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int GEN_UNKNOWN = ( int ) ( 0l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int GEN_GENERAL_ERROR = ( int ) ( 40l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int GEN_CRITICAL_ERROR = ( int ) ( 70l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int GEN_FATAL_ERROR = ( int ) ( 90l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_OBJECT_NOT_FOUND = ( int ) ( 100l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_METHOD_NOT_FOUND = ( int ) ( 101l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_NULL_RESULT = ( int ) ( 140l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_INVALID_RESULT = ( int ) ( 141l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_DUPLICATE_OBJECT = ( int ) ( 142l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_RUNTIME_EXCEPTION = ( int ) ( 170l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_CLASS_FORMAT_ERROR = ( int ) ( 171l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_INVALID_CONTEXT = ( int ) ( 172l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int OBJ_CANNOT_CREATE = ( int ) ( 173l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_COLLECTION_NOT_FOUND = ( int ) ( 200l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_DOCUMENT_NOT_FOUND = ( int ) ( 201l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_DUPLICATE_COLLECTION = ( int ) ( 240l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_NULL_RESULT = ( int ) ( 241l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_NO_FILER = ( int ) ( 242l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_NO_INDEXMANAGER = ( int ) ( 242l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_DOCUMENT_MALFORMED = ( int ) ( 243l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_CANNOT_STORE = ( int ) ( 244l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_CANNOT_RETRIEVE = ( int ) ( 245l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_COLLECTION_READ_ONLY = ( int ) ( 246l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_COLLECTION_CLOSED = ( int ) ( 247l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_CANNOT_CREATE = ( int ) ( 270l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int COL_CANNOT_DROP = ( int ) ( 271l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_VALUE_NOT_FOUND = ( int ) ( 300l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_INDEX_NOT_FOUND = ( int ) ( 301l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_MATCHES_NOT_FOUND = ( int ) ( 340l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_DUPLICATE_INDEX = ( int ) ( 341l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_NOT_SUPPORTED = ( int ) ( 370l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_STYLE_NOT_FOUND = ( int ) ( 371l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_CORRUPTED = ( int ) ( 372l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int IDX_CANNOT_CREATE = ( int ) ( 373l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int TRX_DOC_LOCKED = ( int ) ( 400l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int TRX_NO_CONTEXT = ( int ) ( 440l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int TRX_NOT_ACTIVE = ( int ) ( 441l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int TRX_NOT_SUPPORTED = ( int ) ( 470l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int DBE_NO_PARENT = ( int ) ( 500l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int DBE_CANNOT_DROP = ( int ) ( 570l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int DBE_CANNOT_CREATE = ( int ) ( 571l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int QRY_NULL_RESULT = ( int ) ( 600l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int QRY_COMPILATION_ERROR = ( int ) ( 640l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int QRY_PROCESSING_ERROR = ( int ) ( 641l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int QRY_NOT_SUPPORTED = ( int ) ( 670l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int QRY_STYLE_NOT_FOUND = ( int ) ( 671l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int SEC_INVALID_USER = ( int ) ( 770l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int SEC_INVALID_GROUP = ( int ) ( 771l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int SEC_INVALID_ACCESS = ( int ) ( 772l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int SEC_INVALID_CREDENTIALS = ( int ) ( 773l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int URI_EMPTY = ( int ) ( 800l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int URI_NULL = ( int ) ( 801l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int URI_PARSE_ERROR = ( int ) ( 820l );
  +
  +   //
  +   // Constant value
  +   //
  +   public static final int JAVA_RUNTIME_ERROR = ( int ) ( 2070l );
      private FaultCodes() {}
   
      static {
  @@ -174,9 +491,9 @@
       * @param code The Fault Code
       * @return An APIException instance
       */
  -   public static APIException createAPIException(int code) {
  +   /*public static APIException createAPIException(int code) {
         return new APIException(code, getMessage(code), "");
  -   }
  +   }*/
   
      /**
       * createAPIException creates an APIException instance based
  @@ -186,9 +503,9 @@
       * @param message A specific message to associate
       * @return An APIException instance
       */
  -   public static APIException createAPIException(int code, String message) {
  +   /*public static APIException createAPIException(int code, String message) {
         return new APIException(code, getMessage(code), message);
  -   }
  +   }*/
   
      /**
       * createAPIException creates an APIException instance based
  @@ -199,7 +516,7 @@
       * @param e The Exception to use
       * @return An APIException instance
       */
  -   public static APIException createAPIException(Exception e) {
  +   /*public static APIException createAPIException(Exception e) {
         if ( e instanceof APIException )
            return (APIException)e;
         else {
  @@ -220,7 +537,7 @@
            else
               return new APIException(GEN_UNKNOWN, getMessage(GEN_UNKNOWN), m);
         }
  -   }
  +   }*/
   
      /**
       * createXMLDBException creates an XMLDBException instance based
  @@ -238,10 +555,6 @@
            DBException d = (DBException)e;
            return new XMLDBException(ErrorCodes.VENDOR_ERROR, d.faultCode, getMessage(d.faultCode));
         }
  -      else if ( e instanceof APIException ) {
  -         APIException a = (APIException)e;
  -         return new XMLDBException(ErrorCodes.VENDOR_ERROR, a.faultCode, a.faultMessage);
  -      }
         else {
            String m = e.getMessage();
            if ( m == null )
  @@ -265,8 +578,7 @@
         int code = 0;
         if ( e instanceof DBException )
            code = ((DBException)e).faultCode;
  -      else if ( e instanceof APIException )
  -         code = ((APIException)e).faultCode;
  +      
         // Strip it to the General series
         code = code % 100;
         // Narrow to a General value
  @@ -287,8 +599,7 @@
         int code = 0;
         if ( e instanceof DBException )
            code = ((DBException)e).faultCode;
  -      else if ( e instanceof APIException )
  -         code = ((APIException)e).faultCode;
  +      
         // Strip it to the series
         code = code - ( code % 100 );
         return code;
  @@ -304,8 +615,6 @@
      public static int getFaultCode(Exception e) {
         if ( e instanceof DBException )
            return ((DBException)e).faultCode;
  -      else if ( e instanceof APIException )
  -         return ((APIException)e).faultCode;
         else
            return 0;
      }