summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java
Publish
Diffstat (limited to 'container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java')
-rw-r--r--container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java78
1 files changed, 78 insertions, 0 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java b/container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java
new file mode 100644
index 00000000000..adfb461c122
--- /dev/null
+++ b/container-core/src/main/java/com/yahoo/container/jdisc/ExtendedResponse.java
@@ -0,0 +1,78 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.container.jdisc;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import com.yahoo.container.handler.Coverage;
+import com.yahoo.container.handler.Timing;
+import com.yahoo.container.logging.HitCounts;
+import com.yahoo.jdisc.handler.CompletionHandler;
+import com.yahoo.jdisc.handler.ContentChannel;
+
+/**
+ * An HTTP response supporting async rendering and extended information for
+ * logging.
+ *
+ * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
+ */
+public abstract class ExtendedResponse extends AsyncHttpResponse {
+
+ public ExtendedResponse(int status) {
+ super(status);
+ }
+
+ @Override
+ public abstract void render(OutputStream output,
+ ContentChannel networkChannel, CompletionHandler handler)
+ throws IOException;
+
+ /**
+ * @return user name performing the request
+ */
+ public String getUser() {
+ return null;
+ }
+
+ /**
+ * The parsed query or some other normal form for the query/request
+ * resulting in this Response. Never null. This default implementation
+ * returns null though.
+ */
+ public String getParsedQuery() {
+ return null;
+ }
+
+ /**
+ * Returns timing information about the processing leading to this response.
+ * This default implementation returns null.
+ *
+ * @see com.yahoo.container.handler.Timing
+ * @return a Timing instance or null
+ */
+ public Timing getTiming() {
+ return null;
+ }
+
+ /**
+ * Returns the completeness of the scan of the total known data for this
+ * response. This default implementation returns null.
+ *
+ * @see Coverage
+ * @return coverage information or null
+ */
+ public Coverage getCoverage() {
+ return null;
+ }
+
+ /**
+ * Returns the number of "hits" in this. This default implementation returns
+ * null.
+ *
+ * @return a Counts instance or null
+ */
+ public HitCounts getHitCounts() {
+ return null;
+ }
+
+}