You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/05/22 21:45:41 UTC
svn commit: r777674 - in /incubator/pivot/trunk: core/src/pivot/beans/
core/src/pivot/serialization/ web/src/pivot/web/ wtk/src/pivot/wtkx/
Author: gbrown
Date: Fri May 22 19:45:40 2009
New Revision: 777674
URL: http://svn.apache.org/viewvc?rev=777674&view=rev
Log:
Minor fixes to exception constructors; add HTTP status code constants to pivot.web.Query class.
Modified:
incubator/pivot/trunk/core/src/pivot/beans/PropertyNotFoundException.java
incubator/pivot/trunk/core/src/pivot/serialization/SerializationException.java
incubator/pivot/trunk/web/src/pivot/web/Query.java
incubator/pivot/trunk/web/src/pivot/web/QueryException.java
incubator/pivot/trunk/wtk/src/pivot/wtkx/BindException.java
Modified: incubator/pivot/trunk/core/src/pivot/beans/PropertyNotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/pivot/beans/PropertyNotFoundException.java?rev=777674&r1=777673&r2=777674&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/pivot/beans/PropertyNotFoundException.java (original)
+++ incubator/pivot/trunk/core/src/pivot/beans/PropertyNotFoundException.java Fri May 22 19:45:40 2009
@@ -26,15 +26,15 @@
private static final long serialVersionUID = 0;
public PropertyNotFoundException() {
- this(null, null);
+ super();
}
public PropertyNotFoundException(String message) {
- this(message, null);
+ super(message);
}
public PropertyNotFoundException(Throwable cause) {
- this(null, cause);
+ super(cause);
}
public PropertyNotFoundException(String message, Throwable cause) {
Modified: incubator/pivot/trunk/core/src/pivot/serialization/SerializationException.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/pivot/serialization/SerializationException.java?rev=777674&r1=777673&r2=777674&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/pivot/serialization/SerializationException.java (original)
+++ incubator/pivot/trunk/core/src/pivot/serialization/SerializationException.java Fri May 22 19:45:40 2009
@@ -25,15 +25,15 @@
private static final long serialVersionUID = 0;
public SerializationException() {
- this(null, null);
+ super();
}
public SerializationException(String message) {
- this(message, null);
+ super(message);
}
public SerializationException(Throwable cause) {
- this(null, cause);
+ super(cause);
}
public SerializationException(String message, Throwable cause) {
Modified: incubator/pivot/trunk/web/src/pivot/web/Query.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/web/src/pivot/web/Query.java?rev=777674&r1=777673&r2=777674&view=diff
==============================================================================
--- incubator/pivot/trunk/web/src/pivot/web/Query.java (original)
+++ incubator/pivot/trunk/web/src/pivot/web/Query.java Fri May 22 19:45:40 2009
@@ -58,11 +58,11 @@
*/
public abstract class Query<V> extends IOTask<V> {
/**
- * The supported HTTP methods.
+ * Supported HTTP methods.
*
* @author gbrown
*/
- protected enum Method {
+ public enum Method {
GET,
POST,
PUT,
@@ -70,6 +70,35 @@
}
/**
+ * Query status codes.
+ *
+ * @author gbrown
+ */
+ public static class Status {
+ public static final int OK = 200;
+ public static final int CREATED = 201;
+ public static final int NO_CONTENT = 204;
+
+ public static final int BAD_REQUEST = 400;
+ public static final int UNAUTHORIZED = 401;
+ public static final int FORBIDDEN = 403;
+ public static final int NOT_FOUND = 404;
+ public static final int METHOD_NOT_ALLOWED = 405;
+ public static final int REQUEST_TIMEOUT = 408;
+ public static final int CONFLICT = 409;
+ public static final int LENGTH_REQUIRED = 411;
+ public static final int PRECONDITION_FAILED = 412;
+ public static final int REQUEST_ENTITY_TOO_LARGE = 413;
+ public static final int REQUEST_URI_TOO_LONG = 414;
+ public static final int UNSUPPORTED_MEDIA_TYPE = 415;
+
+ public static final int INTERNAL_SERVER_ERROR = 500;
+ public static final int NOT_IMPLEMENTED = 501;
+ public static final int SERVICE_UNAVAILABLE = 503;
+ public static final int HTTP_VERSION_NOT_SUPPORTED = 505;
+ }
+
+ /**
* Arguments dictionary implementation.
*/
public final class ArgumentsDictionary
Modified: incubator/pivot/trunk/web/src/pivot/web/QueryException.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/web/src/pivot/web/QueryException.java?rev=777674&r1=777673&r2=777674&view=diff
==============================================================================
--- incubator/pivot/trunk/web/src/pivot/web/QueryException.java (original)
+++ incubator/pivot/trunk/web/src/pivot/web/QueryException.java Fri May 22 19:45:40 2009
@@ -24,9 +24,7 @@
public class QueryException extends TaskExecutionException {
private static final long serialVersionUID = 0;
- private int status = -1;
-
- // TODO Define static constants for status codes
+ private int status;
public QueryException(int status) {
this(status, null);
@@ -40,13 +38,15 @@
public QueryException(Throwable cause) {
super(cause);
+ status = 0;
}
/**
* Returns the HTTP status code corresponding to the exception.
*
* @return
- * An HTTP status code reflecting the nature of the exception.
+ * An HTTP status code reflecting the nature of the exception, or
+ * <tt>0</tt> if the HTTP status is not known.
*/
public int getStatus() {
return status;
Modified: incubator/pivot/trunk/wtk/src/pivot/wtkx/BindException.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtkx/BindException.java?rev=777674&r1=777673&r2=777674&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtkx/BindException.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtkx/BindException.java Fri May 22 19:45:40 2009
@@ -25,15 +25,15 @@
private static final long serialVersionUID = 7977199368589467986L;
public BindException() {
- this(null, null);
+ super();
}
public BindException(String message) {
- this(message, null);
+ super(message);
}
public BindException(Throwable cause) {
- this(null, cause);
+ super(cause);
}
public BindException(String message, Throwable cause) {