cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r926253 - /cxf/sandbox/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java
Date Mon, 22 Mar 2010 18:50:00 GMT
Author: bluk
Date: Mon Mar 22 18:50:00 2010
New Revision: 926253

URL: http://svn.apache.org/viewvc?rev=926253&view=rev
Log:
Update with Response.StatusType

Modified:
    cxf/sandbox/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java

Modified: cxf/sandbox/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java?rev=926253&r1=926252&r2=926253&view=diff
==============================================================================
--- cxf/sandbox/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java (original)
+++ cxf/sandbox/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java Mon Mar
22 18:50:00 2010
@@ -82,9 +82,14 @@ public abstract class Response {
         public abstract Response.ResponseBuilder variant(Variant value);
 
         public abstract Response.ResponseBuilder variants(List<Variant> values);
+
+        public Response.ResponseBuilder status(Response.StatusType status) {
+                return delegate.createResponseBuilder().status(
+                                status.getStatusCode());
+        }
     }
 
-    public static enum Status {
+    public static enum Status implements StatusType {
         ACCEPTED(Family.SUCCESSFUL, 202, "Accepted"), BAD_REQUEST(Family.CLIENT_ERROR, 400,
             "Bad Request"), CONFLICT(Family.CLIENT_ERROR, 409, "Conflict"), CREATED(
             Family.SUCCESSFUL, 201, "Created"), FORBIDDEN(Family.CLIENT_ERROR, 403, "Forbidden"),
GONE(
@@ -134,6 +139,18 @@ public abstract class Response {
         public String toString() {
             return reasonPhrase;
         }
+
+        public String getReasonPhrase() {
+            return reasonPhrase;
+        }
+    }
+
+    public interface StatusType {
+        public Response.Status.Family getFamily();
+
+        public String getReasonPhrase();
+
+        public int getStatusCode();
     }
 
     protected Response() {



Mime
View raw message