Class HttpInterceptorRdfLogging
java.lang.Object
org.aksw.jena_sparql_api.sparql.ext.http.HttpInterceptorRdfLogging
- All Implemented Interfaces:
org.apache.http.HttpRequestInterceptor,org.apache.http.HttpResponseInterceptor
public class HttpInterceptorRdfLogging
extends Object
implements org.apache.http.HttpRequestInterceptor, org.apache.http.HttpResponseInterceptor
Interceptor for HTTP requests and responses that generates RDF and puts it into
a sink
- Author:
- raven
-
Constructor Summary
ConstructorsConstructorDescriptionHttpInterceptorRdfLogging(org.apache.jena.atlas.lib.Sink<org.apache.jena.rdf.model.Model> modelSink) -
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) voidprocess(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) static org.apache.http.HttpRequestunwrap(org.apache.http.HttpRequest result) static voidwriteHttpLogMsg(org.apache.jena.rdf.model.Model target, org.apache.jena.rdf.model.Resource root) :logMsg123 a :LogMessage ; http:uri <http://localhost/foobar> ; dc:created "timestamp" ; sparql:query "query string" timeTaken: // we could use start and end time instead
-
Constructor Details
-
HttpInterceptorRdfLogging
public HttpInterceptorRdfLogging(org.apache.jena.atlas.lib.Sink<org.apache.jena.rdf.model.Model> modelSink)
-
-
Method Details
-
unwrap
public static org.apache.http.HttpRequest unwrap(org.apache.http.HttpRequest result) -
writeHttpLogMsg
public static void writeHttpLogMsg(org.apache.jena.rdf.model.Model target, org.apache.jena.rdf.model.Resource root) :logMsg123 a :LogMessage ; http:uri <http://localhost/foobar> ; dc:created "timestamp" ; sparql:query "query string" timeTaken: // we could use start and end time instead -
process
public void process(org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, IOException - Specified by:
processin interfaceorg.apache.http.HttpRequestInterceptor- Throws:
org.apache.http.HttpExceptionIOException
-
process
public void process(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, IOException - Specified by:
processin interfaceorg.apache.http.HttpResponseInterceptor- Throws:
org.apache.http.HttpExceptionIOException
-