Show / Hide Table of Contents

Class HandlerHelper

Static Helper class for HTTP Handlers
Inheritance
System.Object
HandlerHelper
Namespace: VDS.RDF.Web
Assembly: dotNetRDF.Web.dll
Syntax
public static class HandlerHelper : object

Methods

| Improve this Doc View Source

AddCachingHeaders(IHttpContext, String, Nullable<DateTime>)

Adds ETag and/or Last-Modified headers as appropriate to a response
Declaration
public static void AddCachingHeaders(IHttpContext context, String etag, DateTime? lastModified)
Parameters
Type Name Description
IHttpContext context HTTP Context
String etag ETag
System.Nullable<DateTime> lastModified Last Modified
| Improve this Doc View Source

AddCorsHeaders(IHttpContext)

Adds CORS headers which are needed to allow JS clients to access RDF/SPARQL endpoints powered by dotNetRDF
Declaration
public static void AddCorsHeaders(IHttpContext context)
Parameters
Type Name Description
IHttpContext context HTTP Context
| Improve this Doc View Source

AddStandardHeaders(IHttpContext, BaseHandlerConfiguration)

Adds the Standard Custom Headers that dotNetRDF attaches to all responses from it's Handlers
Declaration
public static void AddStandardHeaders(IHttpContext context, BaseHandlerConfiguration config)
Parameters
Type Name Description
IHttpContext context HTTP Context
BaseHandlerConfiguration config Handler Configuration
| Improve this Doc View Source

ApplyWriterOptions(Object, BaseHandlerConfiguration)

Applies the Writer Options from a Handler Configuration to a Writer
Declaration
public static void ApplyWriterOptions(Object writer, BaseHandlerConfiguration config)
Parameters
Type Name Description
Object writer Writer
BaseHandlerConfiguration config Handler Configuration
| Improve this Doc View Source

CheckCachingHeaders(IHttpContext, String, Nullable<DateTime>)

Checks whether the HTTP Request contains caching headers that means a 304 Modified response can be sent
Declaration
public static bool CheckCachingHeaders(IHttpContext context, String etag, DateTime? lastModified)
Parameters
Type Name Description
IHttpContext context HTTP Context
String etag ETag
System.Nullable<DateTime> lastModified Last Modified
Returns
Type Description
System.Boolean True if a 304 Not Modified can be sent
| Improve this Doc View Source

GetETag(IGraph)

Computes the ETag for a Graph
Declaration
public static String GetETag(this IGraph g)
Parameters
Type Name Description
IGraph g Graph
Returns
Type Description
String
| Improve this Doc View Source

HandleQueryErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception)

Handles errors in processing SPARQL Query Requests
Declaration
public static void HandleQueryErrors(IHttpContext context, BaseHandlerConfiguration config, String title, String query, Exception ex)
Parameters
Type Name Description
IHttpContext context Context of the HTTP Request
BaseHandlerConfiguration config Handler Configuration
String title Error title
String query Sparql Query
Exception ex Error
| Improve this Doc View Source

HandleQueryErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception, Int32)

Handles errors in processing SPARQL Query Requests
Declaration
public static void HandleQueryErrors(IHttpContext context, BaseHandlerConfiguration config, String title, String query, Exception ex, int statusCode)
Parameters
Type Name Description
IHttpContext context Context of the HTTP Request
BaseHandlerConfiguration config Handler Configuration
String title Error title
String query Sparql Query
Exception ex Error
System.Int32 statusCode HTTP Status Code to return
| Improve this Doc View Source

HandleUpdateErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception)

Handles errors in processing SPARQL Update Requests
Declaration
public static void HandleUpdateErrors(IHttpContext context, BaseHandlerConfiguration config, String title, String update, Exception ex)
Parameters
Type Name Description
IHttpContext context Context of the HTTP Request
BaseHandlerConfiguration config Handler Configuration
String title Error title
String update SPARQL Update
Exception ex Error
| Improve this Doc View Source

HandleUpdateErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception, Int32)

Handles errors in processing SPARQL Update Requests
Declaration
public static void HandleUpdateErrors(IHttpContext context, BaseHandlerConfiguration config, String title, String update, Exception ex, int statusCode)
Parameters
Type Name Description
IHttpContext context Context of the HTTP Request
BaseHandlerConfiguration config Handler Configuration
String title Error title
String update SPARQL Update
Exception ex Error
System.Int32 statusCode HTTP Status Code to return
| Improve this Doc View Source

IsAuthenticated(IHttpContext, IEnumerable<UserGroup>)

Checks whether a User is authenticated (or guests are permitted)
Declaration
public static bool IsAuthenticated(IHttpContext context, IEnumerable<UserGroup> groups)
Parameters
Type Name Description
IHttpContext context HTTP Context
IEnumerable<UserGroup> groups User Groups to test against
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsAuthenticated(IHttpContext, IEnumerable<UserGroup>, String)

Checks whether a User is authenticated (or guests are permitted) and the given action is allowed
Declaration
public static bool IsAuthenticated(IHttpContext context, IEnumerable<UserGroup> groups, String action)
Parameters
Type Name Description
IHttpContext context HTTP Context
IEnumerable<UserGroup> groups User Groups to test against
String action Action to check for permission for
Returns
Type Description
System.Boolean
| Improve this Doc View Source

SendToClient(IHttpContext, Object)

Helper function which returns the Results (Graph/Triple Store/SPARQL Results) back to the Client in one of their accepted formats
Declaration
public static void SendToClient(IHttpContext context, Object result)
Parameters
Type Name Description
IHttpContext context Context of the HTTP Request
Object result Results of the Sparql Query
| Improve this Doc View Source

SendToClient(IHttpContext, Object, BaseHandlerConfiguration)

Helper function which returns the Results (Graph/Triple Store/SPARQL Results) back to the Client in one of their accepted formats
Declaration
public static void SendToClient(IHttpContext context, Object result, BaseHandlerConfiguration config)
Parameters
Type Name Description
IHttpContext context Context of the HTTP Request
Object result Results of the Sparql Query
BaseHandlerConfiguration config Handler Configuration
  • Improve this Doc
  • View Source
In This Article
  • Methods
    • AddCachingHeaders(IHttpContext, String, Nullable<DateTime>)
    • AddCorsHeaders(IHttpContext)
    • AddStandardHeaders(IHttpContext, BaseHandlerConfiguration)
    • ApplyWriterOptions(Object, BaseHandlerConfiguration)
    • CheckCachingHeaders(IHttpContext, String, Nullable<DateTime>)
    • GetETag(IGraph)
    • HandleQueryErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception)
    • HandleQueryErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception, Int32)
    • HandleUpdateErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception)
    • HandleUpdateErrors(IHttpContext, BaseHandlerConfiguration, String, String, Exception, Int32)
    • IsAuthenticated(IHttpContext, IEnumerable<UserGroup>)
    • IsAuthenticated(IHttpContext, IEnumerable<UserGroup>, String)
    • SendToClient(IHttpContext, Object)
    • SendToClient(IHttpContext, Object, BaseHandlerConfiguration)
Back to top Generated by DocFX