C# Class CodeSharp.EventSourcing.MsmqUtilities

MSMQ-related utility functions
ファイルを表示 Open project: tangxuehua/eventsourcing

Public Methods

Method Description
AccountToBeAssignedQueuePermissions ( string account ) : void

Sets the account to be assigned queue permissions.

Convert ( System m ) : Message

Converts an MSMQ message to a Message.

Convert ( Message message ) : System.Messaging.Message

Converts a Message to an Msmq message. Doesn't set the ResponseQueue of the result.

CreateQueue ( string queueName, string account ) : void

Create named message queue

CreateQueueIfNecessary ( Address address, string account ) : void

Utility method for creating a queue if it does not exist.

GetFullPath ( Address value ) : string

Turns a '@' separated value into a full path. Format is 'queue@machine', or 'queue@ipaddress'

GetFullPathWithoutPrefix ( Address address ) : string

Returns the full path without Format or direct os from an address.

GetFullPathWithoutPrefix ( string value ) : string

Returns the full path without Format or direct os from a '@' separated path.

GetIndependentAddressForQueue ( System.Messaging.MessageQueue q ) : Address

Gets an independent address for the queue in the form: queue@machine.

GetNumberOfPendingMessages ( string queueName ) : int

Returns the number of messages in the queue.

GetReturnAddress ( Address value, Address target ) : string

Gets the name of the return address from the provided value. If the target includes a machine name, uses the local machine name in the returned value otherwise uses the local IP address in the returned value.

GetReturnAddress ( string value, string target ) : string

Gets the name of the return address from the provided value. If the target includes a machine name, uses the local machine name in the returned value otherwise uses the local IP address in the returned value.

QueueIsLocal ( string value ) : bool

Checks whether or not a queue is local by its path.

SetPermissionsForQueue ( string queue, string account ) : void

Sets default permissions for queue.

Private Methods

Method Description
ExtractMsmqMessageLabelInformationForBackwardCompatibility ( System msmqMsg, Message result ) : void

For backward compatibility, extract the V2.6 MSMQ label content (IdForCorrelation and WindowsIdentityName) into the V3.X transport message.

FillLabelForBackwardsCompatabilityWhileSending ( Message transportMessage, System msmqMessage ) : void

Fill MSMQ message's label.

LocalIpAddress ( IPAddress targetIpAddress ) : string
getFullPath ( string value ) : string
getMachineNameFromLogicalName ( string logicalName ) : string
getQueueNameFromLogicalName ( string logicalName ) : string

Method Details

AccountToBeAssignedQueuePermissions() public static method

Sets the account to be assigned queue permissions.
public static AccountToBeAssignedQueuePermissions ( string account ) : void
account string Account to be used.
return void

Convert() public static method

Converts an MSMQ message to a Message.
public static Convert ( System m ) : Message
m System
return Message

Convert() public static method

Converts a Message to an Msmq message. Doesn't set the ResponseQueue of the result.
public static Convert ( Message message ) : System.Messaging.Message
message Message
return System.Messaging.Message

CreateQueue() public static method

Create named message queue
public static CreateQueue ( string queueName, string account ) : void
queueName string
account string The account to be given permissions to the queue
return void

CreateQueueIfNecessary() public static method

Utility method for creating a queue if it does not exist.
public static CreateQueueIfNecessary ( Address address, string account ) : void
address Address
account string The account to be given permissions to the queue
return void

GetFullPath() public static method

Turns a '@' separated value into a full path. Format is 'queue@machine', or 'queue@ipaddress'
public static GetFullPath ( Address value ) : string
value Address
return string

GetFullPathWithoutPrefix() public static method

Returns the full path without Format or direct os from an address.
public static GetFullPathWithoutPrefix ( Address address ) : string
address Address
return string

GetFullPathWithoutPrefix() public static method

Returns the full path without Format or direct os from a '@' separated path.
public static GetFullPathWithoutPrefix ( string value ) : string
value string
return string

GetIndependentAddressForQueue() public static method

Gets an independent address for the queue in the form: queue@machine.
public static GetIndependentAddressForQueue ( System.Messaging.MessageQueue q ) : Address
q System.Messaging.MessageQueue
return Address

GetNumberOfPendingMessages() public static method

Returns the number of messages in the queue.
public static GetNumberOfPendingMessages ( string queueName ) : int
queueName string
return int

GetReturnAddress() public static method

Gets the name of the return address from the provided value. If the target includes a machine name, uses the local machine name in the returned value otherwise uses the local IP address in the returned value.
public static GetReturnAddress ( Address value, Address target ) : string
value Address
target Address
return string

GetReturnAddress() public static method

Gets the name of the return address from the provided value. If the target includes a machine name, uses the local machine name in the returned value otherwise uses the local IP address in the returned value.
public static GetReturnAddress ( string value, string target ) : string
value string
target string
return string

QueueIsLocal() public static method

Checks whether or not a queue is local by its path.
public static QueueIsLocal ( string value ) : bool
value string The path to the queue to check.
return bool

SetPermissionsForQueue() public static method

Sets default permissions for queue.
public static SetPermissionsForQueue ( string queue, string account ) : void
queue string
account string
return void