Changed duration type to long
This commit is contained in:
@@ -28,7 +28,7 @@ public class XPathController implements RestController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private XMLResponseBody prepareErrorResponse(String message, String processor) {
|
private XMLResponseBody prepareErrorResponse(String message, String processor) {
|
||||||
return new XMLResponseBody(message, "ERR", processor, "N/A");
|
return new XMLResponseBody(message, "ERR", processor, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ScopedControllerManifest(method = HandlerType.POST, path = "/xpath")
|
@ScopedControllerManifest(method = HandlerType.POST, path = "/xpath")
|
||||||
@@ -71,7 +71,7 @@ public class XPathController implements RestController {
|
|||||||
response.status(200);
|
response.status(200);
|
||||||
long duration = System.currentTimeMillis() - timeStart;
|
long duration = System.currentTimeMillis() - timeStart;
|
||||||
responseBody = new XMLResponseBody(xPathQueryResult.getData().trim(),
|
responseBody = new XMLResponseBody(xPathQueryResult.getData().trim(),
|
||||||
"OK", xalan.getVersion(), String.valueOf(duration));
|
"OK", xalan.getVersion(),duration);
|
||||||
|
|
||||||
responseBody.setType(xPathQueryResult.getType());
|
responseBody.setType(xPathQueryResult.getType());
|
||||||
this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms.");
|
this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms.");
|
||||||
@@ -98,7 +98,7 @@ public class XPathController implements RestController {
|
|||||||
|
|
||||||
long duration = System.currentTimeMillis() - timeStart;
|
long duration = System.currentTimeMillis() - timeStart;
|
||||||
String processor = "Saxon " + saxon.getVersion() + " " + requestBody.getVersion() + " over s9api";
|
String processor = "Saxon " + saxon.getVersion() + " " + requestBody.getVersion() + " over s9api";
|
||||||
responseBody = new XMLResponseBody(result, "OK", processor, String.valueOf(duration));
|
responseBody = new XMLResponseBody(result, "OK", processor, duration);
|
||||||
|
|
||||||
this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms.");
|
this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms.");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ public class XMLResponseBody {
|
|||||||
private String result;
|
private String result;
|
||||||
private String status;
|
private String status;
|
||||||
private String processor;
|
private String processor;
|
||||||
private String duration;
|
private long duration;
|
||||||
|
|
||||||
// Optional
|
// Optional
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
public XMLResponseBody(String result, String status, String processor, String duration) {
|
public XMLResponseBody(String result, String status, String processor, long duration) {
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.processor = processor;
|
this.processor = processor;
|
||||||
@@ -41,11 +41,11 @@ public class XMLResponseBody {
|
|||||||
this.processor = processor;
|
this.processor = processor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDuration() {
|
public long getDuration() {
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDuration(String duration) {
|
public void setDuration(long duration) {
|
||||||
this.duration = duration;
|
this.duration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user