Click or drag to resize

Message Class

Unit of communication between endpoints in a NetSwitch network.
Inheritance Hierarchy
SystemObject
  OBCOM.NetSwitchLib.MessagesMessage

Namespace:  OBCOM.NetSwitchLib.Messages
Assembly:  OBCOM.NetSwitchLib (in OBCOM.NetSwitchLib.dll) Version: 1.48.7760.35650 (1.48.7760.35650)
Syntax
[SerializableAttribute]
public class Message

The Message type exposes the following members.

Constructors
  NameDescription
Public methodMessage
Constructs a new Message instance.
Public methodMessage(Byte)
Constructs a new Message with supplied bytes.
Public methodMessage(Object)
Constructs a new Message with supplied odata.
Public methodMessage(String)
Constructs a new Message with supplied text.
Public methodMessage(Type)
Constructs a new Message with supplied type.
Top
Properties
  NameDescription
Public propertyBytes
Gets or sets the bytes data of this Message.
Public propertyStatus
Gets or sets the status of this Message.
Public propertyText
Gets or sets the string data of this Message.
Public propertyType
Gets or sets the type of this Message.
Top
Methods
  NameDescription
Public methodClear
Resets all the fields of this Message to their default value.
Public methodClearLabels
Removes all defined labels from this Message.
Public methodClearProperties
Removes all defined properties from this Message.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFromStream
Decodes all the fields of this Message from supplied stream.
Public methodGetBoolean
Returns the boolean value of the property indexed by name.
Public methodGetByte
Returns the byte value of the property indexed by name.
Public methodGetBytes
Returns the bytes value of the property indexed by name.
Public methodGetDate
Returns the date value of the property indexed by name.
Public methodGetDecimal
Returns the decimal value of the property indexed by name.
Public methodGetDouble
Returns the double value of the property indexed by name.
Public methodGetFloat
Returns the float value of the property indexed by name.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetInteger
Returns the integer value of the property indexed by name.
Public methodGetLabel
Returns the value of the label indexed by key.
Public methodGetLabelKeys
Returns a read-only collection with all defined label keys.
Public methodGetLong
Returns the long value of the property indexed by name.
Public methodGetObjectT
Returns the object containing the data of this Message.
Public methodGetObjectT(String)
Returns the object value of the property indexed by name.
Public methodGetProperties
Returns a read-only dictionary with all defined properties.
Public methodGetPropertyNames
Returns a read-only collection with all defined property names.
Public methodGetShort
Returns the short value of the property indexed by name.
Public methodGetText
Returns the string value of the property indexed by name.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasLabel
Returns true if the label indexed by key is defined.
Public methodHasProperty
Returns true if the property with name is defined.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPutBoolean
Changes the boolean value of the property indexed by name. If value is null the property is removed.
Public methodPutByte
Changes the byte value of the property indexed by name. If value is null the property is removed.
Public methodPutBytes
Changes the bytes value of the property indexed by name. If value is null the property is removed.
Public methodPutDate
Changes the date value of the property indexed by name. If value is null the property is removed.
Public methodPutDecimal
Changes the big decimal value of the property indexed by name. If value is null the property is removed.
Public methodPutDouble
Changes the double value of the property indexed by name. If value is null the property is removed.
Public methodPutFloat
Changes the float value of the property indexed by name. If value is null the property is removed.
Public methodPutInteger
Changes the integer value of the property indexed by name. If value is null the property is removed.
Public methodPutLabel
Changes the value of the label indexed by key.
Public methodPutLong
Changes the long value of the property indexed by name. If value is null the property is removed.
Public methodPutObject(Object)
Changes the object containing the data of this Message.
Public methodPutObject(String, Object)
Changes the object value of the property indexed by name. If value is null the property is removed.
Public methodPutProperties
Copies all the properties of the message to this Message.
Public methodPutShort
Changes the short value of the property indexed by name. If value is null the property is removed.
Public methodPutText
Changes the string value of the property indexed by name. If value is null the property is removed.
Public methodRemoveLabel
Removes the label indexed by supplied key.
Public methodRemoveProperty
Removes the property indexed by name.
Public methodToStream
Encodes all the fields of this Message into a Stream.
Public methodToString
Returns a string representation of this Message.
(Overrides ObjectToString.)
Public methodStatic memberValueOf
Returns a Message built using the supplied object data.
Top
Fields
  NameDescription
Public fieldStatic memberERROR
Completion status indicating error.
Public fieldStatic memberHEADER_LEN
Number of bytes used by a Message header.
Public fieldStatic memberSUCCESS
Completion status indicating success.
Top
Remarks

A Message is composed of the following required and optional fields:

  1. A required message Type: used by the communication protocol.
  2. A required status code: indicates successful or error completion.
  3. An optional set of labels: used by the communication protocol.
  4. An optional text value: used to send a unicode string such as XML content.
  5. An optional bytes value: used to send an array of bytes such as a PDF file.
  6. An optional object value: used to send a {@link Serializable} object.
  7. An optional set of properties: used to send a set of name-value pairs.

Warning: a Message is not synchronized. If multiple threads access a Message instance concurrently, and at least one of the threads modifies the Message, it should be synchronized externally. This is typically accomplished by synchronizing on some object that naturally encapsulates the Message

.
See Also