Example #1
0
            public void OnValue(string topicPath, ITopicSpecification specification, IJSON oldValue, IJSON newValue)
            {
                //put JSON processing here
                Console.WriteLine($"New value of {topicPath} is {newValue.ToJSONString()}.");

                //var d = Diffusion.DataTypes.JSON.FromJSONString(newValue);
            }
Example #2
0
 /// <summary>
 /// Notification of a successful subscription.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 public void OnSubscription(string topicPath, ITopicSpecification specification)
 => WriteLine($"Client subscribed to {topicPath}.");
Example #3
0
 /// <summary>
 /// Topic update received.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 /// <param name="oldValue">Value prior to update.</param>
 /// <param name="newValue">Value after update.</param>
 public void OnValue(string topicPath, ITopicSpecification specification, IRecordV2 oldValue, IRecordV2 newValue)
 => WriteLine($"New value of {topicPath} is [{string.Join( ", ", newValue.AsFields() )}].");
Example #4
0
 /// <summary>
 /// Notification of a successful unsubscription.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 /// <param name="reason">Error reason.</param>
 public void OnUnsubscription(string topicPath, ITopicSpecification specification, TopicUnsubscribeReason reason)
 => WriteLine($"Client unsubscribed from {topicPath} : {reason}.");
 /// <summary>
 /// Topic update received.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 /// <param name="oldValue">Value prior to update.</param>
 /// <param name="newValue">Value after update.</param>
 public void OnValue(string topicPath, ITopicSpecification specification, IJSON oldValue, IJSON newValue)
 => WriteLine($"New value of {topicPath} is {newValue.ToJSONString()}.");
 /// <summary>
 /// Topic update received.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 /// <param name="oldValue">Value prior to update.</param>
 /// <param name="newValue">Value after update.</param>
 public void OnValue(string topicPath, ITopicSpecification specification, IBinary oldValue, IBinary newValue)
 => WriteLine($"New value of {topicPath} is {Encoding.UTF8.GetString( newValue.ToByteArray() )}.");
Example #7
0
 /// <summary>
 /// Notification of a succesfull unsubscription.
 /// </summary>
 /// <param name="topicPath">topic</param>
 /// <param name="specification">the specification of the topic</param>
 /// <param name="reason">error reason</param>
 public void OnUnsubscription(string topicPath, ITopicSpecification specification, TopicUnsubscribeReason reason)
 {
     Console.WriteLine("Client unsubscribed from {0} : {1}", topicPath, reason);
 }
Example #8
0
 /// <summary>
 /// Topic update received.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 /// <param name="oldValue">Value prior to update.</param>
 /// <param name="newValue">Value after update.</param>
 public void OnValue(string topicPath, ITopicSpecification specification, string oldValue, string newValue)
 => WriteLine($"New value of {topicPath} is {newValue}.");
Example #9
0
 /// <summary>
 /// Notification of a succesfull subscription.
 /// </summary>
 /// <param name="topicPath"></param>
 /// <param name="specification"></param>
 public void OnSubscription(string topicPath, ITopicSpecification specification)
 {
     Console.WriteLine("Client subscribed to {0} ", topicPath);
 }
Example #10
0
 /// <summary>
 /// Topic update received.
 /// </summary>
 /// <param name="topicPath">topic</param>
 /// <param name="specification">the specification of the topic</param>
 /// <param name="oldValue">value prior to update</param>
 /// <param name="newValue">value after update</param>
 public void OnValue(string topicPath, ITopicSpecification specification, IContent oldValue, IContent newValue)
 {
     Console.WriteLine("New value of {0} is {1}", topicPath, newValue.AsString());
 }
Example #11
0
 /// <summary>
 /// Topic update received.
 ///
 /// This indicates an update to the state of a topic that is subscribed to.
 /// </summary>
 /// <param name="topicPath">the full topic path.</param>
 /// <param name="content">the topic content. The context may contain more information about the nature
 /// of the content</param>
 /// <param name="context">the update context which may indicate whether the content represents the total
 /// state or a change to the state</param>
 public new void OnValue(string topicPath, ITopicSpecification specification, IContent oldValue,
                         IContent newValue)
 {
     LOG.Info(newValue.AsString());
 }
Example #12
0
 /// <summary>
 /// Topic update received.
 ///
 /// This indicates an update to the state of a topic that is subscribed
 /// to.
 /// </summary>
 /// <param name="topicPath">the full topic path.</param>
 /// <param name="content">the topic content. The context may contain more information about the nature
 /// of the content</param>
 /// <param name="context">the update context which may indicate whether the content represents the total
 /// state or a change to the state</param>
 public new void OnValue(string topicPath, ITopicSpecification specification, IJSON oldValue,
                         IJSON newValue)
 {
     LOG.Info(newValue.ToJSONString());
 }
Example #13
0
 /// <summary>
 /// Topic update received.
 /// </summary>
 /// <param name="topicPath">Topic path.</param>
 /// <param name="specification">Topic specification.</param>
 /// <param name="oldValue">Value prior to update.</param>
 /// <param name="newValue">Value after update.</param>
 public void OnValue(string topicPath, ITopicSpecification specification, IJSON oldValue, IJSON newValue)
 {
     Console.WriteLine("New value of {0} is {1}", topicPath, newValue.ToJSONString());
 }