List <ServiceBusNode> Discover(string root, ServiceBusNode router) { root = VerifyNoEndSlash(root); Uri feedUri = new Uri(root); List <ServiceBusNode> nodes = new List <ServiceBusNode>(); if (root.Contains("!") == false) { string relativeAddress = root.Replace(ServiceBusRootAddress, ""); if (relativeAddress != "" && relativeAddress != "/") { ServiceBusNode node = new ServiceBusNode(root); nodes.Add(node); } } SyndicationFeed feed = GetFeed(feedUri, Token); if (feed != null) { foreach (SyndicationItem endpoint in feed.Items) { foreach (SyndicationLink link in endpoint.Links) { Trace.WriteLine("Link: " + link.RelationshipType + " " + link.Uri.AbsoluteUri); nodes.AddRange(Discover(link.Uri.AbsoluteUri, router)); } } } return(nodes); }
void AddNodesToTree(TreeView tree,ServiceBusNode[] nodes) { string serviceNamespace = m_NamespaceTextBox.Text; if(tree.Nodes[0].Text == "Unspecified Namespace") { tree.Nodes.Clear(); } else { foreach(TreeNode domianNode in tree.Nodes) { if(domianNode.Text == serviceNamespace) { tree.Nodes.Remove(domianNode); break; } } } TreeNode newNamespaceNode = new NamespaceTreeNode(this,serviceNamespace); tree.Nodes.Add(newNamespaceNode); tree.SelectedNode = newNamespaceNode; tree.Focus(); foreach(ServiceBusNode node in nodes) { AddNode(newNamespaceNode,node); } }
public override void Refresh(ServiceBusNode node,TransportClientEndpointBehavior credential) { MessageBufferPolicy policy = node.Policy as MessageBufferPolicy; int overflowIndex = 0; switch(policy.OverflowPolicy) { case OverflowPolicy.RejectIncomingMessage: { overflowIndex = 0; break; } default: { throw new InvalidOperationException("Unrecognized overflow value"); } } m_OverflowComboBox.Text = m_OverflowComboBox.Items[overflowIndex] as string; m_ExpirationTime.Text = policy.ExpiresAfter.TotalMinutes.ToString(); m_CountTextBox.Text = policy.MaxMessageCount.ToString(); base.Refresh(node,credential); }
ServiceBusTreeNode MatchTreeNode(ServiceBusNode node) { if (node == null) { return(new NamespaceTreeNode(this, m_NamespaceTextBox.Text)); } if (node.Policy != null) { if (node.Policy is RouterPolicy) { return(new RouterTreeNode(this, node, node.Name)); } else { return(new BufferTreeNode(this, node, node.Name)); } } else { if (node.SubscribedTo != null) { return(new RouterSubscriberTreeNode(this, node, node.Name)); } else { return(new EndpointTreeNode(this, node, node.Name)); } } }
public override void Refresh(ServiceBusNode node, TransportClientEndpointBehavior credential) { MessageBufferPolicy policy = node.Policy as MessageBufferPolicy; int overflowIndex = 0; switch (policy.OverflowPolicy) { case OverflowPolicy.RejectIncomingMessage: { overflowIndex = 0; break; } default: { throw new InvalidOperationException("Unrecognized overflow value"); } } m_OverflowComboBox.Text = m_OverflowComboBox.Items[overflowIndex] as string; m_ExpirationTime.Text = policy.ExpiresAfter.TotalMinutes.ToString(); m_CountTextBox.Text = policy.MaxMessageCount.ToString(); base.Refresh(node, credential); }
public void AddSubscribedTo(ServiceBusNode subscribedTo) { if (subscribedTo == null) { return; } AddSubscribedTo(new ServiceBusNode[] { subscribedTo }); }
public void AddSubscribedTo(ServiceBusNode subscribedTo) { if(subscribedTo == null) { return; } AddSubscribedTo(new ServiceBusNode[] { subscribedTo }); }
public ServiceBusTreeNode(ExplorerForm form, ServiceBusNode serviceBusNode, string text, int imageIndex) : base(text, imageIndex, imageIndex) { Form = form; ServiceBusNode = serviceBusNode; if (serviceBusNode != null) { string serviceNamespace = ExtractNamespace(new Uri(serviceBusNode.Address)); Credential = form.Graphs[serviceNamespace.ToLower()].Credential; } }
public ServiceBusTreeNode(ExplorerForm form,ServiceBusNode serviceBusNode,string text,int imageIndex) : base(text,imageIndex,imageIndex) { Form = form; ServiceBusNode = serviceBusNode; if(serviceBusNode != null) { string serviceNamespace = ExtractNamespace(new Uri(serviceBusNode.Address)); Credential = form.Graphs[serviceNamespace.ToLower()].Credential; } }
public override void Refresh(ServiceBusNode node, TransportClientEndpointBehavior credential) { base.Refresh(node, credential); m_Address = Address; //The feed does not show correct transport - always http/https, so remove all transports m_Address = m_Address.Replace(@"sb://", @"[transport]://"); m_AddressLabel.Text = m_Address; TrimLable(m_AddressLabel, 69); }
public override void Refresh(ServiceBusNode node,TransportClientEndpointBehavior credential) { base.Refresh(node,credential); m_Address = Address; //The feed does not show correct transport - always http/https, so remove all transports m_Address = m_Address.Replace(@"sb://",@"[transport]://"); m_AddressLabel.Text = m_Address; TrimLable(m_AddressLabel,69); }
public virtual void Refresh(ServiceBusNode node,TransportClientEndpointBehavior credential) { Node = node; Credential = credential; Address = GetRealAddress(node.Address).AbsoluteUri; m_ItemNameLabel.Text = node.Name; m_AddressLabel.Text = GetRealAddress(node.Address).AbsoluteUri; TrimLable(m_ItemNameLabel,34); TrimLable(m_AddressLabel,69); }
public virtual void Refresh(ServiceBusNode node, TransportClientEndpointBehavior credential) { Node = node; Credential = credential; Address = GetRealAddress(node.Address).AbsoluteUri; m_ItemNameLabel.Text = node.Name; m_AddressLabel.Text = GetRealAddress(node.Address).AbsoluteUri; TrimLable(m_ItemNameLabel, 34); TrimLable(m_AddressLabel, 69); }
ServiceBusNode FindMax(List <ServiceBusNode> nodes) { ServiceBusNode maxNode = new ServiceBusNode(""); foreach (ServiceBusNode node in nodes) { if (StringComparer.Ordinal.Compare(node.Name, maxNode.Name) >= 0) { maxNode = node; } } return(maxNode); }
public void AddSubscribedTo(ServiceBusNode[] subscribedTo) { if(SubscribedTo == null) { SubscribedTo = subscribedTo; return; } if(subscribedTo != null) { List<ServiceBusNode> list = new List<ServiceBusNode>(SubscribedTo); list.AddRange(subscribedTo); SubscribedTo = list.ToArray(); } }
void AssertIntegrery(ServiceBusNode[] array) { foreach(ServiceBusNode node in array) { if(node.SubscribersCount > 0) { Debug.Assert(node.Subscribers != null); foreach(ServiceBusNode subscriber in node.Subscribers) { subscriber.SubscribedTo.Contains(node); } } } }
void AddNode(TreeNode root, ServiceBusNode nodeToAdd) { TreeNode newTreeNode = MatchTreeNode(nodeToAdd); root.Nodes.Add(newTreeNode); if (nodeToAdd.Subscribers == null) { return; } foreach (ServiceBusNode subscriber in nodeToAdd.Subscribers) { AddNode(newTreeNode, subscriber); } }
List <ServiceBusNode> Discover(string root, ServiceBusNode router) { root = VerifyNoEndSlash(root); Uri feedUri = new Uri(root); List <ServiceBusNode> nodes = new List <ServiceBusNode>(); if (root.Contains("!") == false) { string relativeAddress = root.Replace(ServiceBusRootAddress, ""); if (relativeAddress != "" && relativeAddress != "/") { ServiceBusNode node = new ServiceBusNode(root); node.AddSubscribedTo(router); nodes.Add(node); } } SyndicationFeed feed = GetFeed(feedUri, Token); if (feed != null) { foreach (SyndicationItem endpoint in feed.Items) { ServiceBusNode node = null; foreach (SyndicationLink link in endpoint.Links) { Trace.WriteLine("Link: " + link.RelationshipType + " " + link.Uri.AbsoluteUri); //Try to threat as buffer try { MessageBufferPolicy policy = GetBufferPolicy(link.Uri.AbsoluteUri); node = new ServiceBusNode(link.Uri.AbsoluteUri); node.Policy = policy; nodes.Add(node); break; } catch (FaultException exception) { Debug.Assert(exception.Message.StartsWith("Policy could not be retrieved")); } nodes.AddRange(Discover(link.Uri.AbsoluteUri, router)); } } } return(nodes); }
public void ReplaceSubscriber(ServiceBusNode service,ServiceBusNode junction) { if(Subscribers == null) { return; } Debug.Assert(service != null); Debug.Assert(junction != null); List<ServiceBusNode> list = new List<ServiceBusNode>(Subscribers); if(list.Contains(service)) { list.Remove(service); list.Add(junction); } Subscribers = list.ToArray(); }
//TODO Restore on next release public override void Refresh(ServiceBusNode node, TransportClientEndpointBehavior credential) { RouterPolicy policy = node.Policy as RouterPolicy; m_AllRadioButton.Checked = policy.MessageDistribution == MessageDistributionPolicy.AllSubscribers; m_OneRadioButton.Checked = policy.MessageDistribution == MessageDistributionPolicy.OneSubscriber; m_MaxSubscribersTextBox.Text = policy.MaxSubscribers.ToString(); m_PushRetriesTextBox.Text = policy.PushDeliveryRetries.ToString(); m_Expiration = policy.ExpirationInstant; m_ExpirationTimePicker.Value = m_Expiration; m_BufferLengthTextBox.Text = policy.MaxBufferLength.ToString(); int overflowIndex = 0; switch (policy.OverflowPolicy) { case OverflowPolicy.RejectIncomingMessage: { overflowIndex = 0; break; } /* TODO Restore on next release * case OverflowPolicy.DiscardIncomingMessage: * { * overflowIndex = 1; * break; * } * case OverflowPolicy.DiscardExistingMessage: * { * overflowIndex = 2; * break; * } */ } m_OverflowComboBox.Text = m_OverflowComboBox.Items[overflowIndex] as string; m_PurgeButton.Enabled = node.SubscribersCount > 0; base.Refresh(node, credential); }
public void AddSubscriber(ServiceBusNode junction) { Debug.Assert(junction != null); if (Subscribers == null) { Subscribers = new ServiceBusNode[] { junction }; return; } List <ServiceBusNode> list = new List <ServiceBusNode>(Subscribers); Debug.Assert(list.Contains(junction) == false); list.Add(junction); Subscribers = list.ToArray(); }
public void AddSubscriber(ServiceBusNode junction) { Debug.Assert(junction != null); if(Subscribers == null) { Subscribers = new ServiceBusNode[] { junction }; return; } List<ServiceBusNode> list = new List<ServiceBusNode>(Subscribers); Debug.Assert(list.Contains(junction) == false); list.Add(junction); Subscribers = list.ToArray(); }
public void ReplaceSubscriber(ServiceBusNode service, ServiceBusNode junction) { if (Subscribers == null) { return; } Debug.Assert(service != null); Debug.Assert(junction != null); List <ServiceBusNode> list = new List <ServiceBusNode>(Subscribers); if (list.Contains(service)) { list.Remove(service); list.Add(junction); } Subscribers = list.ToArray(); }
//TODO Restore on next release public override void Refresh(ServiceBusNode node,TransportClientEndpointBehavior credential) { RouterPolicy policy = node.Policy as RouterPolicy; m_AllRadioButton.Checked = policy.MessageDistribution == MessageDistributionPolicy.AllSubscribers; m_OneRadioButton.Checked = policy.MessageDistribution == MessageDistributionPolicy.OneSubscriber; m_MaxSubscribersTextBox.Text = policy.MaxSubscribers.ToString(); m_PushRetriesTextBox.Text = policy.PushDeliveryRetries.ToString(); m_Expiration = policy.ExpirationInstant; m_ExpirationTimePicker.Value = m_Expiration; m_BufferLengthTextBox.Text = policy.MaxBufferLength.ToString(); int overflowIndex = 0; switch(policy.OverflowPolicy) { case OverflowPolicy.RejectIncomingMessage: { overflowIndex = 0; break; } /* TODO Restore on next release case OverflowPolicy.DiscardIncomingMessage: { overflowIndex = 1; break; } case OverflowPolicy.DiscardExistingMessage: { overflowIndex = 2; break; } */ } m_OverflowComboBox.Text = m_OverflowComboBox.Items[overflowIndex] as string; m_PurgeButton.Enabled = node.SubscribersCount > 0; base.Refresh(node,credential); }
ServiceBusNode[] SortList(List <ServiceBusNode> nodes) { ServiceBusNode[] array = new ServiceBusNode[nodes.Count]; for (int i = 0; i < array.Length; i++) { ServiceBusNode maxNode = FindMax(nodes); array[i] = maxNode; nodes.Remove(maxNode); } //Transpose array ServiceBusNode[] returned = new ServiceBusNode[array.Length]; int index = 0; for (int j = array.Length - 1; j >= 0; j--) { returned[index++] = array[j]; } return(returned); }
public EndpointTreeNode(ExplorerForm form,ServiceBusNode serviceBusNode,string name) : base(form,serviceBusNode,name,ExplorerForm.EndpointIndex) {}
public RouterSubscriberTreeNode(ExplorerForm form, ServiceBusNode serviceBusNode, string name) : base(form, serviceBusNode, name, ExplorerForm.EventEndpointIndex) { }
public RouterSubscriberTreeNode(ExplorerForm form,ServiceBusNode serviceBusNode,string name) : base(form,serviceBusNode,name,ExplorerForm.EventEndpointIndex) {}
public EndpointTreeNode(ExplorerForm form, ServiceBusNode serviceBusNode, string name) : base(form, serviceBusNode, name, ExplorerForm.EndpointIndex) { }
internal void DisplayRouterControl(ServiceBusNode node, TransportClientEndpointBehavior credential) { m_RouterViewControl.Refresh(node, credential); DisplayControl(m_RouterViewControl); }
List<ServiceBusNode> Discover(string root,ServiceBusNode router) { root = VerifyNoEndSlash(root); Uri feedUri = new Uri(root); List<ServiceBusNode> nodes = new List<ServiceBusNode>(); if(root.Contains("!") == false) { string relativeAddress = root.Replace(ServiceBusRootAddress,""); if(relativeAddress != "" && relativeAddress != "/") { ServiceBusNode node = new ServiceBusNode(root); nodes.Add(node); } } SyndicationFeed feed = GetFeed(feedUri,Token); if(feed != null) { foreach(SyndicationItem endpoint in feed.Items) { ServiceBusNode node = null; foreach(SyndicationLink link in endpoint.Links) { Trace.WriteLine("Link: " + link.RelationshipType + " " + link.Uri.AbsoluteUri); //Try to threat as buffer try { MessageBufferPolicy policy = GetBufferPolicy(link.Uri.AbsoluteUri); node = new ServiceBusNode(link.Uri.AbsoluteUri); node.Policy = policy; nodes.Add(node); break; } catch(FaultException exception) { Debug.Assert(exception.Message.StartsWith("Policy could not be retrieved")); } nodes.AddRange(Discover(link.Uri.AbsoluteUri,router)); } } } return nodes; }
List<ServiceBusNode> Discover(string root,ServiceBusNode router) { root = VerifyNoEndSlash(root); Uri feedUri = new Uri(root); List<ServiceBusNode> nodes = new List<ServiceBusNode>(); if(root.Contains("!") == false) { string relativeAddress = root.Replace(ServiceBusRootAddress,""); if(relativeAddress != "" && relativeAddress != "/") { ServiceBusNode node = new ServiceBusNode(root); nodes.Add(node); } } SyndicationFeed feed = GetFeed(feedUri,Token); if(feed != null) { foreach(SyndicationItem endpoint in feed.Items) { foreach(SyndicationLink link in endpoint.Links) { Trace.WriteLine("Link: " + link.RelationshipType + " " + link.Uri.AbsoluteUri); nodes.AddRange(Discover(link.Uri.AbsoluteUri,router)); } } } return nodes; }
internal void DisplayRouterControl(ServiceBusNode node,TransportClientEndpointBehavior credential) { m_RouterViewControl.Refresh(node,credential); DisplayControl(m_RouterViewControl); }
void AddNode(TreeNode root,ServiceBusNode nodeToAdd) { TreeNode newTreeNode = MatchTreeNode(nodeToAdd); root.Nodes.Add(newTreeNode); if(nodeToAdd.Subscribers == null) { return; } foreach(ServiceBusNode subscriber in nodeToAdd.Subscribers) { AddNode(newTreeNode,subscriber); } }
public BufferTreeNode(ExplorerForm form, ServiceBusNode serviceBusNode, string name) : base(form, serviceBusNode, name, ExplorerForm.BufferIndex) { }
public RouterTreeNode(ExplorerForm form,ServiceBusNode serviceBusNode,string name) : base(form,serviceBusNode,name,ExplorerForm.RouterIndex) {}
ServiceBusNode FindMax(List<ServiceBusNode> nodes) { ServiceBusNode maxNode = new ServiceBusNode(""); foreach(ServiceBusNode node in nodes) { if(StringComparer.Ordinal.Compare(node.Name,maxNode.Name) >= 0) { maxNode = node; } } return maxNode; }
ServiceBusNode[] SortList(List<ServiceBusNode> nodes) { ServiceBusNode[] array = new ServiceBusNode[nodes.Count]; for(int i = 0;i<array.Length;i++) { ServiceBusNode maxNode = FindMax(nodes); array[i] = maxNode; nodes.Remove(maxNode); } //Transpose array ServiceBusNode[] returned = new ServiceBusNode[array.Length]; int index = 0; for(int j = array.Length-1;j>=0;j--) { returned[index++] = array[j]; } return returned; }
ServiceBusTreeNode MatchTreeNode(ServiceBusNode node) { if(node == null) { return new NamespaceTreeNode(this,m_NamespaceTextBox.Text); } if(node.Policy != null) { if(node.Policy is RouterPolicy) { return new RouterTreeNode(this,node,node.Name); } else { return new BufferTreeNode(this,node,node.Name); } } else { if(node.SubscribedTo != null) { return new RouterSubscriberTreeNode(this,node,node.Name); } else { return new EndpointTreeNode(this,node,node.Name); } } }