Permalink
Browse files

Tweaked Plugtest resource and logging.

  • Loading branch information...
mkovatsc committed Mar 17, 2012
1 parent 85c9508 commit c0d14d668201610c2c61a19b352d111faa9e57cb
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -253,7 +253,7 @@ public void removeObserver(String clientID) {
}
observersByClient.remove(clientID);
- LOG.info(String.format("Terminated all observing relationship: %s", clientID));
+ LOG.info(String.format("Terminated all observing relationships for client: %s", clientID));
}
}
@@ -69,7 +69,7 @@ public LargeCreate() {
* Constructs a new storage resource with the given resourceIdentifier.
*/
public LargeCreate(String resourceIdentifier) {
- super(resourceIdentifier, true); // hidden
+ super(resourceIdentifier, false);
setTitle("Large resource that can be created using POST method");
setResourceType("block");
}
@@ -83,15 +83,16 @@ public void performGET(GETRequest request) {
if (data==null) {
- response = new Response(CodeRegistry.RESP_NOT_FOUND);
+ response = new Response(CodeRegistry.RESP_CONTENT);
+ response.setPayload("Nothing POSTed yet", MediaTypeRegistry.TEXT_PLAIN);
} else {
// content negotiation
ArrayList<Integer> supported = new ArrayList<Integer>();
supported.add(dataCt);
- int ct = MediaTypeRegistry.IMAGE_PNG;
+ int ct = dataCt;
if ((ct = MediaTypeRegistry.contentNegotiation(dataCt, supported, request.getOptions(OptionNumberRegistry.ACCEPT)))==MediaTypeRegistry.UNDEFINED) {
request.respond(CodeRegistry.RESP_NOT_ACCEPTABLE, "Accept " + MediaTypeRegistry.toString(dataCt));
return;
@@ -129,7 +130,7 @@ public void performPOST(POSTRequest request) {
Response response = new Response(CodeRegistry.RESP_CREATED);
// inform client about the location of the new resource
- response.setLocationPath(this.getPath());
+ response.setLocationPath("/nirvana");
// complete the request
request.respond(response);

0 comments on commit c0d14d6

Please sign in to comment.