diff --git a/src/DataStreamSuite/DataStreamCore/Messaging/v2/Receive/PubSubServer/PubsubServerStreamTagHandler.cs b/src/DataStreamSuite/DataStreamCore/Messaging/v2/Receive/PubSubServer/PubsubServerStreamTagHandler.cs index db59f851a..0b826b5bd 100644 --- a/src/DataStreamSuite/DataStreamCore/Messaging/v2/Receive/PubSubServer/PubsubServerStreamTagHandler.cs +++ b/src/DataStreamSuite/DataStreamCore/Messaging/v2/Receive/PubSubServer/PubsubServerStreamTagHandler.cs @@ -13,6 +13,9 @@ namespace bts { public PubsubServerGenericDataHandler() { _bw = new BinaryWriter(_str); } + + public string TagType => "*"; + public void update(string tag, byte[] msg) { _str.Position = 0; _bw.Write(msg); @@ -25,7 +28,6 @@ namespace bts { Log.Gen.info($"PubsubServerGenericDataHandler.get_content tag: {tag} rv: {rv.Length}"); return rv; } - public string[] supportedTagTypes { get; } } // This class is created by the SingleTagData for stream tag_type. Every pub @@ -38,6 +40,7 @@ namespace bts { // this is where the state of the table is kept. BlueTable _state = null; + public string TagType => DSTagManager.DataStreamTagType; public void update(string tag, byte[] msg) { StreamIOMessage str_msg = _deser.deserialize(msg); @@ -72,11 +75,6 @@ namespace bts { Log.Gen.info($"PubsubServerSingleStreamTagHandler.get_content rv: {rv_txt}"); return rv; } - public string[] supportedTagTypes { - get { - return new string[] { "DS" }; - } - } } public class PubsubServerStreamTagHandler : IPubSubServerTagHandler { @@ -86,6 +84,9 @@ namespace bts { public PubsubServerStreamTagHandler() { } + + public string TagType => DSTagManager.DataStreamTagType; + public void update(string tag, byte[] msg) { BCG.IPubSubServerTagHandler rv = _get_handler(tag); rv.update(tag, msg); @@ -94,14 +95,6 @@ namespace bts { BCG.IPubSubServerTagHandler rv = _get_handler(tag); return rv.get_content(tag); } - public string[] supportedTagTypes { - get { - List rv = new List(); - foreach (var h in _handler_map.Values) - rv.AddRange(h.supportedTagTypes); - return rv.ToArray(); - } - } private BCG.IPubSubServerTagHandler _get_handler(string tag) { PubsubServerSingleStreamTagHandler rv = null; diff --git a/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandler.cs b/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandler.cs index 981093bca..d6a7f0b2e 100644 --- a/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandler.cs +++ b/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandler.cs @@ -1,14 +1,11 @@ -using System.Collections.Generic; -using mbts; - namespace BCG { - public delegate void InternalPublishDelegate(ICollection> pubData); /// /// The Pubsub holds an instance of this for every tag /// type. this interface holds the state of each tag /// in the pubsub. /// public interface IPubSubServerTagHandler { + string TagType { get; } /// /// This is called when a new data gets published, so IPubSubServerTagHandler can ///interpret the data and update its state (which it will be asked to return in get_content) diff --git a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs index 8e7b0fbac..0ab1037fa 100644 --- a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs +++ b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs @@ -28,6 +28,8 @@ namespace BCG { _master_worker.addWorker(this, TimeSpan.FromMilliseconds(250)); } + public string TagType => tag_type; + public static void init(PubSubState state) { bts.Log.Gen.info("SystemStatsPublisher.init"); _self = new SystemStatsPublisher(state); diff --git a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs index e293f4aec..f6fd76c52 100644 --- a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs +++ b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs @@ -36,6 +36,8 @@ namespace BCG { _master_worker.addWorker(this, TimeSpan.FromMilliseconds(500)); } + public string TagType => tag_type; + public static void init(PubSubState state) { bts.Log.Gen.info("SystemSubscriptionMapPublisher.init"); _self = new SystemSubscriptionMapPublisher(state);