DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Static Private Attributes | List of all members
Deveel.Data.Protocol.EmbeddedMessageEnvelope Class Reference
Inheritance diagram for Deveel.Data.Protocol.EmbeddedMessageEnvelope:
Deveel.Data.Protocol.IServerMessageEnvelope Deveel.Data.Protocol.IMessageEnvelope

Public Member Functions

void SetError (Exception error)
 

Static Public Member Functions

static EmbeddedMessageEnvelope Create (int dispatchId, IMessage message)
 
static EmbeddedMessageEnvelope Create (IDictionary< string, object > metadata, IMessage message)
 

Properties

IDictionary< string, object > Metadata [get, private set]
 
int DispatchId [get, private set]
 
IMessage Message [get, private set]
 
ServerError Error [get, private set]
 
- Properties inherited from Deveel.Data.Protocol.IMessageEnvelope
IDictionary< string, object > Metadata [get]
 
IMessage Message [get]
 
ServerError Error [get]
 

Private Member Functions

 EmbeddedMessageEnvelope (IDictionary< string, object > metadata, IMessage message)
 

Static Private Attributes

static int dispatchCounter = -1
 

Detailed Description

Definition at line 21 of file EmbeddedMessageEnvelope.cs.

Constructor & Destructor Documentation

Deveel.Data.Protocol.EmbeddedMessageEnvelope.EmbeddedMessageEnvelope ( IDictionary< string, object >  metadata,
IMessage  message 
)
inlineprivate

Definition at line 24 of file EmbeddedMessageEnvelope.cs.

24  {
25  Message = message;
26  Metadata = metadata;
27 
28  object dispatchId;
29  if (!metadata.TryGetValue("DispatchID", out dispatchId))
30  throw new ArgumentException("Metadata must specify a Dispatch ID");
31 
32  DispatchId = (int) dispatchId;
33  }

Member Function Documentation

static EmbeddedMessageEnvelope Deveel.Data.Protocol.EmbeddedMessageEnvelope.Create ( int  dispatchId,
IMessage  message 
)
inlinestatic

Definition at line 48 of file EmbeddedMessageEnvelope.cs.

48  {
49  var metadata = new Dictionary<string, object>();
50  metadata["DispatchID"] = dispatchId;
51  return new EmbeddedMessageEnvelope(metadata, message);
52  }
EmbeddedMessageEnvelope(IDictionary< string, object > metadata, IMessage message)
static EmbeddedMessageEnvelope Deveel.Data.Protocol.EmbeddedMessageEnvelope.Create ( IDictionary< string, object >  metadata,
IMessage  message 
)
inlinestatic

Definition at line 54 of file EmbeddedMessageEnvelope.cs.

54  {
55  if (metadata == null)
56  metadata = new Dictionary<string, object>();
57 
58  object dispatchId;
59  if (!metadata.TryGetValue("DispatchID", out dispatchId))
60  dispatchId = dispatchCounter++;
61 
62  metadata["DispatchID"] = dispatchId;
63  return new EmbeddedMessageEnvelope(metadata, message);
64  }
EmbeddedMessageEnvelope(IDictionary< string, object > metadata, IMessage message)
void Deveel.Data.Protocol.EmbeddedMessageEnvelope.SetError ( Exception  error)
inline

Implements Deveel.Data.Protocol.IServerMessageEnvelope.

Definition at line 43 of file EmbeddedMessageEnvelope.cs.

43  {
44  // TODO: in another version there will be support for Class and Code of error
45  Error = new ServerError(-1, -1, error.Message);
46  }

Member Data Documentation

int Deveel.Data.Protocol.EmbeddedMessageEnvelope.dispatchCounter = -1
staticprivate

Definition at line 22 of file EmbeddedMessageEnvelope.cs.

Property Documentation

int Deveel.Data.Protocol.EmbeddedMessageEnvelope.DispatchId
getprivate set

Definition at line 37 of file EmbeddedMessageEnvelope.cs.

ServerError Deveel.Data.Protocol.EmbeddedMessageEnvelope.Error
getprivate set

Definition at line 41 of file EmbeddedMessageEnvelope.cs.

IMessage Deveel.Data.Protocol.EmbeddedMessageEnvelope.Message
getprivate set

Definition at line 39 of file EmbeddedMessageEnvelope.cs.

IDictionary<string, object> Deveel.Data.Protocol.EmbeddedMessageEnvelope.Metadata
getprivate set

Definition at line 35 of file EmbeddedMessageEnvelope.cs.


The documentation for this class was generated from the following file: