Table of Contents

Class EndpointMiddleware<TRequest, TResponse>

Namespace
Steeltoe.Management.Endpoint.Middleware
Assembly
Steeltoe.Management.Endpoint.dll
public abstract class EndpointMiddleware<TRequest, TResponse> : IEndpointMiddleware, IMiddleware

Type Parameters

TRequest
TResponse
Inheritance
EndpointMiddleware<TRequest, TResponse>
Implements
Inherited Members

Constructors

EndpointMiddleware(IEndpointHandler<TRequest, TResponse>, IOptionsMonitor<ManagementOptions>, ILoggerFactory)

protected EndpointMiddleware(IEndpointHandler<TRequest, TResponse> endpointHandler, IOptionsMonitor<ManagementOptions> managementOptionsMonitor, ILoggerFactory loggerFactory)

Parameters

endpointHandler IEndpointHandler<TRequest, TResponse>
managementOptionsMonitor IOptionsMonitor<ManagementOptions>
loggerFactory ILoggerFactory

Properties

EndpointHandler

protected IEndpointHandler<TRequest, TResponse> EndpointHandler { get; }

Property Value

IEndpointHandler<TRequest, TResponse>

EndpointOptions

public EndpointOptions EndpointOptions { get; }

Property Value

EndpointOptions

ManagementOptionsMonitor

protected IOptionsMonitor<ManagementOptions> ManagementOptionsMonitor { get; }

Property Value

IOptionsMonitor<ManagementOptions>

Methods

CanInvoke(PathString)

public virtual bool CanInvoke(PathString requestPath)

Parameters

requestPath PathString

Returns

bool

GetMetadataProvider()

public virtual ActuatorMetadataProvider GetMetadataProvider()

Returns

ActuatorMetadataProvider

InvokeAsync(HttpContext, RequestDelegate?)

Request handling method.

public Task InvokeAsync(HttpContext context, RequestDelegate? next)

Parameters

context HttpContext

The HttpContext for the current request.

next RequestDelegate

The delegate representing the remaining middleware in the request pipeline.

Returns

Task

A Task that represents the execution of this middleware.

InvokeEndpointHandlerAsync(TRequest?, CancellationToken)

protected abstract Task<TResponse> InvokeEndpointHandlerAsync(TRequest? request, CancellationToken cancellationToken)

Parameters

request TRequest
cancellationToken CancellationToken

Returns

Task<TResponse>

ParseRequestAsync(HttpContext, CancellationToken)

protected virtual Task<TRequest?> ParseRequestAsync(HttpContext httpContext, CancellationToken cancellationToken)

Parameters

httpContext HttpContext
cancellationToken CancellationToken

Returns

Task<TRequest>

WriteResponseAsync(TResponse, HttpContext, CancellationToken)

protected virtual Task WriteResponseAsync(TResponse response, HttpContext httpContext, CancellationToken cancellationToken)

Parameters

response TResponse
httpContext HttpContext
cancellationToken CancellationToken

Returns

Task