10.27.03

SDTUtils Class

Used to manipulate SDT components in a message.

Definition

Namespace: SolaceSystems.Solclient.Messaging.SDT
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.27.0
C#
public class SDTUtils
Inheritance
Object    SDTUtils

Constructors

SDTUtilsInitializes a new instance of the SDTUtils class

Methods

CreateMap(Int32) Allocates a memory buffer of size maxSize on the heap and creates a message-independent (free standing) IMapContainer within.

If the subsequent calls to add structured data types exceeds the buffer size an error (InsufficientSpace) is returned to the application.

Note: When using message-indpendent maps, it's an error to have more than one open subcontainer at once. In other words, client applications must close the open subcontainer before creating a new one. If such attempt is made, client applications will get an error with SDKErrorSubcode equal to OutOfMemory. Note that this limitation is not present with maps created with CreateMap(IMessage, Int32).

Note: Applications should call Dispose as soon as they're done with the map. Message-independent containers, when created, allocate memory resources.

CreateMap(IMessage, Int32) This method creates a map container (IMapContainer) in the binary attachment part of the given message, and any existing data is overwritten. The returned IMapContainer instance can be later used to add SDT fields. It is recommended to Close the IMapContainer when done. If it is not explicitly closed, the IMapContainer is automatically closed when the associated message is disposed IDisposable.

Whether it is explicitly closed by the client application, or implicitly by the API, any attempt to use this map will result in an OperationErrorException with ParamNullReference error subcode.

CreateStream(Int32) Allocates a memory buffer of size bufferSize on the heap and creates a message-independent (free standing) IStreamContainer within.

If the subsequent calls to add structured data types exceeds the buffer size an error (InsufficientSpace) is returned to the application.

Note: When using message-indpendent streams, it's an error to have more than one open subcontainer at once. In other words, client applications must close the open subcontainer before creating a new one. If such attempt is made, client applications will get an error with SDKErrorSubcode equal to OutOfMemory. Note that this limitation is not present with streams created with CreateStream(IMessage, Int32).

Note: Applications should call Dispose as soon as they're done with the stream. Message-independent containers, when created, allocate memory resources.

CreateStream(IMessage, Int32) Creates a stream container (IStreamContainer) in the binary attachment part of the given message. Any existing data is overwritten. The returned IStreamContainer instance can be later used to add SDT fields. It is recommended to Close the IStreamContainer when done. If it is not explicitly closed, the stream is automatically closed when the associated message is disposed IDisposable.

Whether it is explicitly closed by the client application, or implicitly by the API, any attempt to use this stream will result in an OperationErrorException with ParamNullReference error subcode.

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetContainer Returns an ISDTContainer (if available) within a message. The ISDTContainer could be either a IMapContainer or IStreamContainer. It is recommended to Close the ISDTContainer when done. If it is not explicitly closed, the container is automatically closed when the associated message is sent or disposed IDisposable.

Whether it is explicitly closed by the client application, or implicitly by the API, any attempt to use this container will result in an OperationErrorException with ParamNullReference error subcode.

GetHashCodeServes as the default hash function.
(Inherited from Object)
GetText If the message's binary payload contains a string, this method will return it. Otherwise it will return null.
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
SetSDTContainer Sets an SDT container as the binary attachment of a message.

Any existing data in the message is overwritten. This method copies in from the given container, therefore changes to the container after this method returns will not be propagated to the message.

WARNING: This method is intended to be used to add an existing message independent container to a message.That is, a container created by either CreateMap(Int32) or CreateStream(Int32). Do not call this method with a container that is already in the message, returned from a call to CreateMap(IMessage, Int32) or CreateStream(IMessage, Int32). That is unnecessary as the container is already in the message. Further, the first operation of SetSDTContainer(IMessage, ISDTContainer) is to wipe out the existing binary attachment.

SetText Sets the binary attachment part of the message to the specified utf8 encoded string.
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also