Class CacheRequestComponent
Implements a message pipeline component that resides in the inbound request pipeline and returns cached response messages for the similar client request messages.
Inherited Members
Namespace: Nevatech.Vsb.Repository.Processing
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class CacheRequestComponent : MessagePipelineComponentBase, IValidator, IEquatable<MessagePipelineComponentBase>, IExtensibleDataObject, IDisposable
Remarks
The response message cache key is constructed from multiple properties of the corresponding request message. The key always includes the message body (only BODY element content for SOAP operations). RESTful message is always keyed by request URI and HTTP method. SOAP message is always keyed by Action header value. In addition, key may contain SOAP headers, HTTP headers, and identity claims values (all or a subset).
Constructors
CacheRequestComponent()
Declaration
public CacheRequestComponent()
Fields
ElementName
Name of the root element when object is serialized to XML.
Declaration
public const string ElementName = "CACHE-REQUEST"
Field Value
| Type | Description |
|---|---|
| String |
Properties
AllowedPositions
Gets the message processing pipeline position(s) supported by the component: inbound request.
Declaration
public override MessagePipelinePositions AllowedPositions { get; }
Property Value
| Type | Description |
|---|---|
| MessagePipelinePositions |
Overrides
CacheDuration
Gets or sets the maximum time of storing a response message in the cache. The value must be greater than zero.
Declaration
public TimeSpan CacheDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
ExecuteResponsePipeline
Gets or sets the flag indicating that cached response message must be sent to inbound response pipeline where it can be processed and fine-tuned. If property is set to False then cached response message is returned directly to the client.
Declaration
public bool ExecuteResponsePipeline { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
VaryByClaims
Gets or sets the comma-, semicolon-, or space-separated list of caller principal claim types which values must be included in the cache key computation. If property is set to a wildcard (*) then all claims are included.
Declaration
public string VaryByClaims { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
VaryByHttpHeaders
Gets or sets the comma-, semicolon-, or space-separated list of HTTP headers which values must be included in the cache key computation. If property is set to a wildcard (*) then all headers are included.
Declaration
public string VaryByHttpHeaders { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
VaryBySoapHeaders
Gets or sets the comma-, semicolon-, or space-separated list of SOAP headers which values must be included in the cache key computation. Each header is defined by its Qualified Name in the form of "namespace:localName". If property is set to a wildcard (*) then all headers are included.
Declaration
public string VaryBySoapHeaders { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
Dispose()
Disposes the internal cache storage.
Declaration
public void Dispose()
Equals(MessagePipelineComponentBase)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(MessagePipelineComponentBase other)
Parameters
| Type | Name | Description |
|---|---|---|
| MessagePipelineComponentBase | other | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| Boolean | True, if objects are equal. False, if objects are not equal. |
Overrides
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| Boolean | True, if objects are equal. False, if objects are not equal. |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | Hash code of the current instance. |
Overrides
ProcessMessage(MessagePipelineContext)
Examines the intercepted message, computes the cache key, and returns the cached response, if it exists.
Declaration
public override MessagePipelineResult ProcessMessage(MessagePipelineContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| MessagePipelineContext | context | Provides the message processing context. |
Returns
| Type | Description |
|---|---|
| MessagePipelineResult | Value indicating if message should continue on its way to the recipient or must be stopped and returned to the sender. |
Overrides
ToString()
Returns string representation of the object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | String representing the object's content. |
Overrides
Validate()
Evaluates the state of this object.
Declaration
public override bool Validate()
Returns
| Type | Description |
|---|---|
| Boolean | True if state is valid; otherwise, false. |