Permalink
Browse files

fixed MultiValuedMap parameters

  • Loading branch information...
1 parent 14fb1a4 commit 5efba9220974c86c62dc482098140af0830e3e2f @pauloricardomg pauloricardomg committed Aug 10, 2010
@@ -4,7 +4,9 @@
import javax.ws.rs.GET;
import javax.ws.rs.POST;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.UriInfo;
import org.nimbustools.messaging.gt4_0_elastic.generated.v2010_06_15.CancelSpotInstanceRequestsResponseType;
import org.nimbustools.messaging.gt4_0_elastic.generated.v2010_06_15.CancelSpotInstanceRequestsType;
@@ -30,8 +32,14 @@ public String getName() {
@GET
public CancelSpotInstanceRequestsResponseType handleGet(
- MultivaluedMap<String, String> form) {
+ @Context UriInfo uriInfo) {
+ if (uriInfo == null) {
+ throw new IllegalArgumentException("uriInfo may not be null");
+ }
+
+ MultivaluedMap<String, String> form = uriInfo.getQueryParameters();
+
final CancelSpotInstanceRequestsType request = new CancelSpotInstanceRequestsType();
if(form != null && !form.isEmpty()){
SpotInstanceRequestIdSetType spotInstanceRequestIdSet =
@@ -49,8 +57,8 @@ public CancelSpotInstanceRequestsResponseType handleGet(
}
@POST
public CancelSpotInstanceRequestsResponseType handlePost(
- MultivaluedMap<String, String> form) {
- return handleGet(form);
+ @Context UriInfo uriInfo) {
+ return handleGet(uriInfo);
}
}
@@ -7,7 +7,9 @@
import javax.ws.rs.GET;
import javax.ws.rs.POST;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.UriInfo;
import org.nimbustools.messaging.gt4_0_elastic.generated.v2010_06_15.DescribeSpotInstanceRequestsResponseType;
import org.nimbustools.messaging.gt4_0_elastic.generated.v2010_06_15.DescribeSpotInstanceRequestsType;
@@ -34,8 +36,14 @@ public String getName() {
@GET
public DescribeSpotInstanceRequestsResponseType handleGet(
- MultivaluedMap<String, String> form) {
+ @Context UriInfo uriInfo) {
+ if (uriInfo == null) {
+ throw new IllegalArgumentException("uriInfo may not be null");
+ }
+
+ MultivaluedMap<String, String> form = uriInfo.getQueryParameters();
+
final DescribeSpotInstanceRequestsType request = new DescribeSpotInstanceRequestsType();
if(form != null && !form.isEmpty()){
SpotInstanceRequestIdSetType spotInstanceRequestIdSet = extractRequestIdSet(form);
@@ -71,8 +79,8 @@ public static SpotInstanceRequestIdSetType extractRequestIdSet(
@POST
public DescribeSpotInstanceRequestsResponseType handlePost(
- MultivaluedMap<String, String> form) {
- return handleGet(form);
+ @Context UriInfo uriInfo) {
+ return handleGet(uriInfo);
}
}

0 comments on commit 5efba92

Please sign in to comment.