abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r439107 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractRequestHandler.java
Date Fri, 01 Sep 2006 00:00:16 GMT
Author: jmsnell
Date: Thu Aug 31 17:00:15 2006
New Revision: 439107

URL: http://svn.apache.org/viewvc?rev=439107&view=rev
Log:
don't use an enum for this.  implementations may want to extend the types of resources
targeted for the implementation.  For instance, Queso provides a history feed resource.

(missed this on the previous commit.. update AbstractRequestHandler to the new
ResourceType impl)

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractRequestHandler.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractRequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractRequestHandler.java?rev=439107&r1=439106&r2=439107&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractRequestHandler.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractRequestHandler.java
Thu Aug 31 17:00:15 2006
@@ -109,12 +109,12 @@
    */
   protected String[] getAllowedMethods(ResourceType type) {
     if (type == null) return EMPTY;
-    switch (type) {
-      case COLLECTION:    return new String[] { "GET", "POST", "HEAD", "OPTIONS" };
-      case ENTRY:         return new String[] { "GET", "HEAD", "OPTIONS" };
-      case ENTRY_EDIT:    return new String[] { "GET", "DELETE", "PUT", "HEAD", "OPTIONS"
};
-      case MEDIA_EDIT:    return new String[] { "GET", "DELETE", "PUT", "HEAD", "OPTIONS"
};
-      case SERVICE: return new String[] { "GET", "HEAD", "OPTIONS" };
+    switch (type.ordinal()) {
+      case ResourceType.COLLECTION_ORDINAL:    return new String[] { "GET", "POST", "HEAD",
"OPTIONS" };
+      case ResourceType.ENTRY_ORDINAL:         return new String[] { "GET", "HEAD", "OPTIONS"
};
+      case ResourceType.ENTRY_EDIT_ORDINAL:    return new String[] { "GET", "DELETE", "PUT",
"HEAD", "OPTIONS" };
+      case ResourceType.MEDIA_EDIT_ORDINAL:    return new String[] { "GET", "DELETE", "PUT",
"HEAD", "OPTIONS" };
+      case ResourceType.SERVICE_ORDINAL:       return new String[] { "GET", "HEAD", "OPTIONS"
};
       default:            return new String[] { "GET", "HEAD", "OPTIONS" };
     }
   }



Mime
View raw message