ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r226902 - in /webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query: InvalidQueryExpressionException.java impl/XmlBeansQueryExpression.java
Date Mon, 01 Aug 2005 22:49:46 GMT
Author: ips
Date: Mon Aug  1 15:49:43 2005
New Revision: 226902

URL: http://svn.apache.org/viewcvs?rev=226902&view=rev
Log:
now throws an appropriate fault if the query expression has no Dialect attribute

Modified:
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/InvalidQueryExpressionException.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/XmlBeansQueryExpression.java

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/InvalidQueryExpressionException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/InvalidQueryExpressionException.java?rev=226902&r1=226901&r2=226902&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/InvalidQueryExpressionException.java
(original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/InvalidQueryExpressionException.java
Mon Aug  1 15:49:43 2005
@@ -19,34 +19,34 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.util.i18n.Messages;
 
-
 /**
  * Indicates the given Query Expression is not valid within the QueryExpression language
identified by the dialect
  * attribute.
  */
 public class InvalidQueryExpressionException
-   extends Exception
+        extends Exception
 {
-   private QueryExpression m_queryExpr;
-   public static final Messages MSG = MessagesImpl.getInstance();
-   /**
-    * Creates a new {@link InvalidQueryExpressionException} object.
-    *
-    * @param queryExpr DOCUMENT_ME
-    */
-   public InvalidQueryExpressionException( QueryExpression queryExpr )
-   {
-      super( MSG.getMessage( Keys.INVALID_EXPRESSION,queryExpr ));
-      m_queryExpr = queryExpr;
-   }
+    private QueryExpression m_queryExpr;
+    public static final Messages MSG = MessagesImpl.getInstance();
+
+    /**
+     * Creates a new {@link InvalidQueryExpressionException} object.
+     *
+     * @param queryExpr the query expression that is invalid
+     */
+    public InvalidQueryExpressionException( QueryExpression queryExpr )
+    {
+        super( MSG.getMessage( Keys.INVALID_EXPRESSION, queryExpr ) );
+        m_queryExpr = queryExpr;
+    }
 
-   /**
-    * DOCUMENT_ME
-    *
-    * @return DOCUMENT_ME
-    */
-   public QueryExpression getQueryExpression(  )
-   {
-      return m_queryExpr;
-   }
+    /**
+     * DOCUMENT_ME
+     *
+     * @return DOCUMENT_ME
+     */
+    public QueryExpression getQueryExpression()
+    {
+        return m_queryExpr;
+    }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/XmlBeansQueryExpression.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/XmlBeansQueryExpression.java?rev=226902&r1=226901&r2=226902&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/XmlBeansQueryExpression.java
(original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/XmlBeansQueryExpression.java
Mon Aug  1 15:49:43 2005
@@ -19,9 +19,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.XmlObjectWrapper;
+import org.apache.ws.Soap1_1Constants;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.query.QueryExpression;
+import org.apache.ws.resource.faults.FaultException;
 import org.apache.ws.util.XmlBeanUtils;
 import org.apache.ws.util.i18n.Messages;
 import org.apache.ws.util.xml.NamespaceContext;
@@ -33,9 +35,9 @@
 import java.net.URISyntaxException;
 
 /**
- * LOG-DONE
+ * A QueryExpression impl that wraps a QueryExpressionType XMLBean.
  *
- * @author Ian P. Springer
+ * @author Ian Springer
  */
 public class XmlBeansQueryExpression
         implements QueryExpression, XmlObjectWrapper
@@ -96,26 +98,34 @@
     private static URI getDialect(
             org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSResourceProperties12Draft05.QueryExpressionType
queryExprElem )
     {
+        if ( ! queryExprElem.isSetDialect() )
+        {
+            throw new FaultException( Soap1_1Constants.FAULT_CLIENT, "The Dialect attribute
is required by the WSRF-RP QueryExpressionType." );
+        }
         try
         {
             return new URI( queryExprElem.getDialect() );
         }
         catch ( URISyntaxException urise )
         {
-            throw new RuntimeException( MSG.getMessage( Keys.FAILED_INIT_DIALECT, urise )
);
+            throw new FaultException( Soap1_1Constants.FAULT_CLIENT, "The Dialect attribute
of the WSRF-RP QueryExpressionType must be a valid URI." );
         }
     }
 
     private static URI getDialect(
             org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryExpressionType
queryExprElem )
     {
+        if ( ! queryExprElem.isSetDialect() )
+        {
+            throw new FaultException( Soap1_1Constants.FAULT_CLIENT, "The Dialect attribute
is required by the WSRF-RP QueryExpressionType." );
+        }
         try
         {
             return new URI( queryExprElem.getDialect() );
         }
         catch ( URISyntaxException urise )
         {
-            throw new RuntimeException( MSG.getMessage( Keys.FAILED_INIT_DIALECT, urise )
);
+            throw new FaultException( Soap1_1Constants.FAULT_CLIENT, "The Dialect attribute
of the WSRF-RP QueryExpressionType must be a valid URI." );
         }
     }
 



Mime
View raw message