kward       2002/06/09 19:07:57

  Modified:    java/scratchpad/src/org/apache/xindice/server/rpc/messages
                        Query.java
  Log:
  added parameter checking
  
  Revision  Changes    Path
  1.3       +13 -1     
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/Query.java
  
  Index: Query.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/Query.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Query.java        4 Apr 2002 01:17:20 -0000       1.2
  +++ Query.java        10 Jun 2002 02:07:57 -0000      1.3
  @@ -56,7 +56,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * $Id: Query.java,v 1.2 2002/04/04 01:17:20 kward Exp $
  + * $Id: Query.java,v 1.3 2002/06/10 02:07:57 kward Exp $
    */
   
   import java.util.Enumeration;
  @@ -79,6 +79,18 @@
   public class Query extends RPCDefaultMessage {   
      
      public Hashtable execute(Hashtable message) throws Exception {
  +
  +      if(!message.containsKey(COLLECTION)) {
  +         throw new Exception("Collection parameter not specified");
  +      }
  +
  +      if(!message.containsKey(TYPE)) {
  +         throw new Exception("Type parameter not specified");
  +      }
  +
  +      if(!message.containsKey(QUERY)) {
  +         throw new Exception("Query parameter not specified");
  +      }
   
         Collection col = getCollection( (String) message.get(COLLECTION) );
         NodeSet ns = null;
  
  
  

Reply via email to