kward       2002/06/09 19:05:45

  Modified:    java/scratchpad/src/org/apache/xindice/server/rpc/messages
                        CreateIndexer.java
  Log:
  added parameter checking
  
  Revision  Changes    Path
  1.2       +14 -1     
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateIndexer.java
  
  Index: CreateIndexer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateIndexer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CreateIndexer.java        2 Apr 2002 22:57:05 -0000       1.1
  +++ CreateIndexer.java        10 Jun 2002 02:05:45 -0000      1.2
  @@ -56,7 +56,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * $Id: CreateIndexer.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
  + * $Id: CreateIndexer.java,v 1.2 2002/06/10 02:05:45 kward Exp $
    */
   
   import java.util.Hashtable;
  @@ -75,6 +75,19 @@
   public class CreateIndexer extends RPCDefaultMessage {
         
      public Hashtable execute(Hashtable message) throws Exception {
  +
  +      if(!message.containsKey(COLLECTION)) {
  +         throw new Exception("Collection parameter not specified");
  +      }
  +
  +      if(!message.containsKey(NAME)) {
  +         throw new Exception("Name parameter not specified");
  +      }
  +
  +      if(!message.containsKey(PATTERN)) {
  +         throw new Exception("Pattern parameter not specified");
  +      }
  +
         Document doc = new DocumentImpl();
   
         // Create the index element to hold attributes
  
  
  

Reply via email to