Class MessageSample
Represents a sample message generated according to a message schema.
Inherited Members
Namespace: Nevatech.Vsb.Repository.Entities
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class MessageSample : DomainObjectBase, IValidator, IExtensibleDataObject, IEquatable<MessageSample>
Constructors
MessageSample()
Initializes a new instance of the MessageSample object.
Declaration
public MessageSample()
MessageSample(MessageSample)
Initializes a new instance from the provided message sample.
Declaration
public MessageSample(MessageSample sample)
Parameters
Type | Name | Description |
---|---|---|
MessageSample | sample | Message sample to be initialized from. |
Properties
ContentType
Gets or sets the content type of the sample message. This property is applied to REST messages only.
Declaration
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Delay
Gets or sets the number of milliseconds to wait before returning the response. If set to zero, the response will be returned immediately. This property applies to request-reply operations only.
Declaration
public int Delay { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
FileId
Gets or sets the identifier of the file storing message content.
Declaration
public int FileId { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
HttpHeaders
Gets collection of HTTP headers to be returned with the sample message.
Declaration
public Collection<TransportHeader> HttpHeaders { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<TransportHeader> |
MessageId
Gets or sets identifier of the service message this sample is based on.
Declaration
public int MessageId { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MessageVersion
Gets or sets the message envelope version of the sample message.
Declaration
public MessageEnvelopeVersion MessageVersion { get; set; }
Property Value
Type | Description |
---|---|
MessageEnvelopeVersion |
Name
Gets or sets the friendly name of the sample.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ObjectType
Gets object type identifier.
Declaration
public override EntityType ObjectType { get; }
Property Value
Type | Description |
---|---|
EntityType |
Overrides
OperationId
Gets the identifier of the service operation this sample is for.
Declaration
public int OperationId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Priority
Gets or sets the priority of this sample among the other samples generated for the same message. The operation static responses will be generated in order starting from the highest priority sample.
Declaration
public byte Priority { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
RepeatCount
Gets or sets the number of times this message will be sent before moving to the next sample message for the same operation. If set to zero, message sample will be skipped.
Declaration
public int RepeatCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
StatusCode
Gets or sets the HTTP status code to be returned with the sample message. This property is applied to REST messages only.
Declaration
public int? StatusCode { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Methods
CopyFrom(MessageSample)
Populates current instance from the provided message sample.
Declaration
public void CopyFrom(MessageSample sample)
Parameters
Type | Name | Description |
---|---|---|
MessageSample | sample | Message sample to be populated from. |
Equals(MessageSample)
Determines whether the specified sample is equal to the current sample.
Declaration
public bool Equals(MessageSample other)
Parameters
Type | Name | Description |
---|---|---|
MessageSample | other | The sample to compare with the current sample. |
Returns
Type | Description |
---|---|
System.Boolean | True, if samples are equal. False, if samples are not equal. |
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.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 |
---|---|
System.Int32 | Hash code of the current instance. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the current object. |
Overrides
Validate()
Evaluates the state of this object.
Declaration
public override bool Validate()
Returns
Type | Description |
---|---|
System.Boolean | True if state is valid; otherwise, false. |
Overrides
Validate(Boolean)
Evaluates the state of this object.
Declaration
public bool Validate(bool isRest)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isRest | Flag indicating that message sample been validated is a REST message. |
Returns
Type | Description |
---|---|
System.Boolean | True if state is valid; otherwise, false. |