Author: heiko.braun(a)jboss.com
Date: 2007-10-30 17:12:37 -0400 (Tue, 30 Oct 2007)
New Revision: 4943
Modified:
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/RuntimeContext.java
Log:
Docs and comments
Modified:
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java
===================================================================
---
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java 2007-10-30
20:57:23 UTC (rev 4942)
+++
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java 2007-10-30
21:12:37 UTC (rev 4943)
@@ -27,6 +27,8 @@
import java.util.List;
/**
+ * Resolves resource methods from runtime context.
+ *
* @author Heiko.Braun(a)jboss.com
* @version $Revision$
*/
@@ -36,6 +38,7 @@
public static ResourceResolver newInstance(RuntimeContext context)
{
+ assert context!=null;
return new ResourceResolver(context);
}
@@ -171,16 +174,23 @@
return match;
}
+ // TODO: error handling and media-type matching
private ResourceMethod
contentNegotiation(List<ResourceMatch<ResourceMethod>> matches)
{
ResourceMethod match = null;
for(ResourceMatch<ResourceMethod> candiate : matches)
{
+ // Match by request method -> HTTP 405
if(context.getRequestMethod() == candiate.model.getMethodHTTP())
{
match = candiate.model;
break;
}
+
+ // Match by supported input data format -> HTTP 415
+
+ // Match by supported output data format -> HTTP 406
+
}
return match;
}
Modified: stack/native/branches/rest/src/main/java/org/jboss/rs/model/RuntimeContext.java
===================================================================
---
stack/native/branches/rest/src/main/java/org/jboss/rs/model/RuntimeContext.java 2007-10-30
20:57:23 UTC (rev 4942)
+++
stack/native/branches/rest/src/main/java/org/jboss/rs/model/RuntimeContext.java 2007-10-30
21:12:37 UTC (rev 4943)
@@ -35,6 +35,9 @@
private List<ResourceModel> rootResources;
private String uri;
+ private Object requestMediaType;
+ private Object responseMediaType;
+
public RuntimeContext(MethodHTTP requestMethod, String uri, List<ResourceModel>
rootResources)
{
this.requestMethod = requestMethod;
Show replies by date