Refactor Citrix virtual session data collection
This commit is contained in:
@@ -54,6 +54,9 @@ namespace C4IT_DataHistoryProvider_Test
|
||||
if (Program.Collector.M42WpmCollector != null)
|
||||
await Program.Collector.M42WpmCollector.ValidateConnectionAsync(true, CancellationToken.None);
|
||||
|
||||
if (Program.Collector.CitrixCollector != null)
|
||||
await Program.Collector.CitrixCollector.ValidateConnectionsAsync(CancellationToken.None);
|
||||
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
@@ -117,20 +120,37 @@ namespace C4IT_DataHistoryProvider_Test
|
||||
ctrlProtocolBox1.ProcessMessage("no further information found.");
|
||||
else
|
||||
{
|
||||
comboBoxTickets.Items.Clear();
|
||||
ctrlProtocolBox1.ProcessMessage($"{RetVal.Count} related objects found:");
|
||||
|
||||
// fill the drop down boxes for the realtions found
|
||||
comboBoxTickets.Items.Clear();
|
||||
comboBoxSessions.Items.Clear();
|
||||
foreach (var Entry2 in RetVal)
|
||||
{
|
||||
if (Entry2.Type == enumF4sdSearchResultClass.Ticket)
|
||||
comboBoxTickets.Items.Add(Entry2);
|
||||
switch(Entry2.Type)
|
||||
{
|
||||
case enumF4sdSearchResultClass.Ticket:
|
||||
comboBoxTickets.Items.Add(Entry2);
|
||||
break;
|
||||
case enumF4sdSearchResultClass.VirtualSession:
|
||||
if (!string.IsNullOrEmpty(Entry2.DisplayName))
|
||||
comboBoxSessions.Items.Add(Entry2);
|
||||
break;
|
||||
}
|
||||
|
||||
ctrlProtocolBox1.ProcessMessage($" {Entry2.Type} {Entry2.Name} {{{Entry2.id}}}:");
|
||||
ctrlProtocolBox1.ProcessMessage($" LastUsed: {Entry2.LastUsed}");
|
||||
ctrlProtocolBox1.ProcessMessage($" Usage weight: {Entry2.UsingLevel}");
|
||||
foreach (var Entry3 in Entry2.Infos)
|
||||
ctrlProtocolBox1.ProcessMessage($" {Entry3.Key}: {Entry3.Value}");
|
||||
}
|
||||
|
||||
if (comboBoxTickets.Items.Count > 0)
|
||||
comboBoxTickets.SelectedIndex = 0;
|
||||
if (comboBoxSessions.Items.Count > 0)
|
||||
comboBoxSessions.SelectedIndex = 0;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception E)
|
||||
@@ -196,6 +216,11 @@ namespace C4IT_DataHistoryProvider_Test
|
||||
GetTables();
|
||||
}
|
||||
|
||||
private void comboBoxSessions_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
GetTables();
|
||||
}
|
||||
|
||||
private void GetTables()
|
||||
{
|
||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||
@@ -204,13 +229,15 @@ namespace C4IT_DataHistoryProvider_Test
|
||||
bool HasUser = comboBoxUserSelect.SelectedItem != null;
|
||||
bool HasComputer = comboBoxComputerSelect.SelectedItem != null;
|
||||
bool HasTicket = comboBoxTickets.SelectedItem != null;
|
||||
bool HasSession = comboBoxSessions.SelectedItem != null;
|
||||
|
||||
var Tables = new List<cDataHistoryConfigTable>();
|
||||
foreach (var table in Program.Collector.ClusterConfig.Tables.Values)
|
||||
{
|
||||
if ((HasUser && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.User) ||
|
||||
(HasComputer && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Computer) ||
|
||||
(HasTicket && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Ticket))
|
||||
(HasTicket && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Ticket) ||
|
||||
(HasSession && table.ParentCluster.InformationClass == enumFasdInformationClass.VirtualSession))
|
||||
{
|
||||
Tables.Add(table);
|
||||
}
|
||||
@@ -278,6 +305,8 @@ namespace C4IT_DataHistoryProvider_Test
|
||||
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = UserEntry.id, AccountType = enumAccountType.AD });
|
||||
if (comboBoxTickets.SelectedItem is cF4sdApiSearchResultRelation TicketEntry)
|
||||
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Ticket, Id = TicketEntry.id });
|
||||
if (comboBoxSessions.SelectedItem is cF4sdApiSearchResultRelation SessionEntry)
|
||||
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.VirtualSession, Id = SessionEntry.id, Instance = SessionEntry.Instance });
|
||||
if (!(comboBoxTable.SelectedItem is cDataHistoryConfigTable Table))
|
||||
return;
|
||||
|
||||
@@ -467,5 +496,6 @@ namespace C4IT_DataHistoryProvider_Test
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user