Skip to content

Commit

Permalink
Merge pull request #324 from solarwinds/feature/obsolete-protocols
Browse files Browse the repository at this point in the history
Removed support for obsolete connection types
  • Loading branch information
danjagnow authored Sep 15, 2022
2 parents 20007a7 + 2ab0efe commit 37d4428
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 191 deletions.
11 changes: 0 additions & 11 deletions Src/SwqlStudio/ConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,12 @@ public static List<ServerType> AvailableServerTypes
new ServerType { Type = "Orion (v3) AD", IsAuthenticationRequired = false },
new ServerType { Type = "Orion (v3) Certificate", IsAuthenticationRequired = false },
new ServerType { Type = "Orion (v3) over HTTPS", IsAuthenticationRequired = true },
new ServerType { Type = "Orion (v2)", IsAuthenticationRequired = true },
new ServerType { Type = "Orion (v2) AD", IsAuthenticationRequired = false },
new ServerType { Type = "Orion (v2) Certificate", IsAuthenticationRequired = false },
new ServerType { Type = "Orion (v2) over HTTPS", IsAuthenticationRequired = true },
new ServerType { Type = "EOC", IsAuthenticationRequired = true },
new ServerType { Type = "NCM", IsAuthenticationRequired = true },
new ServerType { Type = "NCM (Windows Authentication)", IsAuthenticationRequired = false },
new ServerType { Type = "NCM Integration", IsAuthenticationRequired = true },
new ServerType { Type = "Java over HTTP", IsAuthenticationRequired = true }
};

if (Settings.Default.ShowCompressedModes)
{
serverTypes.AddRange(new[]
{
new ServerType { Type = "Orion (v2) Compressed", IsAuthenticationRequired = true },
new ServerType { Type = "Orion (v2) AD Compressed", IsAuthenticationRequired = false },
new ServerType { Type = "Orion (v3) Compressed", IsAuthenticationRequired = true },
new ServerType { Type = "Orion (v3) AD Compressed", IsAuthenticationRequired = false },
});
Expand Down
35 changes: 4 additions & 31 deletions Src/SwqlStudio/InfoServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,17 @@ public static InfoServiceBase Create(string serverType, string username, string
{
switch (serverType.ToUpperInvariant())
{
case "EOC":
return new EOCInfoService(username, password);

case "ORION (V2)":
return new OrionInfoService(username, password);

case "ORION (V2) AD":
return new OrionInfoServiceWindows(string.Empty, string.Empty);

case "ORION (V2) CERTIFICATE":
return new OrionInfoServiceCertificate();

case "ORION (V2) OVER HTTPS":
return new OrionHttpsInfoService(username, password);

case "ORION (V3)":
return new OrionInfoService(username, password, isSwisV3: true);
return new OrionInfoService(username, password);

case "ORION (V3) AD":
return new OrionInfoServiceWindows(string.Empty, string.Empty, v3: true);
return new OrionInfoServiceWindows(string.Empty, string.Empty);

case "ORION (V3) CERTIFICATE":
return new OrionInfoServiceCertificate(v3: true);
return new OrionInfoServiceCertificate();

case "ORION (V3) OVER HTTPS":
return new OrionHttpsInfoService(username, password, v3: true);

case "NCM":
return new NCMInfoService(username, password);

case "NCM (WINDOWS AUTHENTICATION)":
return new NCMWindowsAuthInfoService(username, password);

case "NCM INTEGRATION":
return new NCMForwarderInfoService(username, password);

case "JAVA OVER HTTP":
return new JavaHttpInfoService(username, password);
return new OrionHttpsInfoService(username, password);
}

return null;
Expand Down
23 changes: 0 additions & 23 deletions Src/SwqlStudio/ProductSpecific/EOCInfoService.cs

This file was deleted.

43 changes: 0 additions & 43 deletions Src/SwqlStudio/ProductSpecific/JavaHttpInfoService.cs

This file was deleted.

22 changes: 0 additions & 22 deletions Src/SwqlStudio/ProductSpecific/NCMForwarderInfoService.cs

This file was deleted.

22 changes: 0 additions & 22 deletions Src/SwqlStudio/ProductSpecific/NCMInfoService.cs

This file was deleted.

22 changes: 0 additions & 22 deletions Src/SwqlStudio/ProductSpecific/NCMWindowsAuthInfoService.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Src/SwqlStudio/ProductSpecific/OrionHttpsInfoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ private static bool ValidateRemoteCertificate(object sender, X509Certificate cer
"SSL Certificate Issue", MessageBoxButtons.YesNo));
}

public OrionHttpsInfoService(string username, string password, bool v3 = false)
public OrionHttpsInfoService(string username, string password)
{
_protocolName = "https";
_endpoint = v3 ? Settings.Default.OrionV3HttpsEndpointPath : Settings.Default.OrionHttpsEndpointPath;
_endpoint = Settings.Default.OrionV3HttpsEndpointPath;
_endpointConfigName = "OrionHttpBinding_InformationServicev2";
_binding = new BasicHttpBinding("SWIS.Over.HTTP");
_credentials = new UsernameCredentials(username, password);
Expand Down
11 changes: 4 additions & 7 deletions Src/SwqlStudio/ProductSpecific/OrionInfoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ namespace SwqlStudio
{
internal class OrionInfoService : InfoServiceBase
{
private readonly bool _isSwisV3;

public OrionInfoService(string username, string password, bool isSwisV3 = false)
public OrionInfoService(string username, string password)
{
_isSwisV3 = isSwisV3;
_endpoint = isSwisV3 ? Settings.Default.OrionV3EndpointPath : Settings.Default.OrionEndpointPath;
_endpoint = Settings.Default.OrionV3EndpointPath;
_endpointConfigName = "OrionTcpBinding_InformationServicev2";
_binding = new NetTcpBinding("TransportMessage");
_credentials = new UsernameCredentials(username, password);
}

public override string ServiceType => string.Format("Orion (v{0})", _isSwisV3 ? 3 : 2);
public override string ServiceType => "Orion (v3)";

public override bool SupportsActiveSubscriber
{
get { return Settings.Default.UseActiveSubscriber && _isSwisV3; }
get { return Settings.Default.UseActiveSubscriber; }
}

public override NotificationDeliveryServiceProxy CreateNotificationDeliveryServiceProxy(string server, INotificationSubscriber notificationSubscriber)
Expand Down
9 changes: 3 additions & 6 deletions Src/SwqlStudio/ProductSpecific/OrionInfoServiceCertificate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel;
using System.ServiceModel.Security;
using SolarWinds.InformationService.Contract2;
Expand All @@ -12,11 +11,9 @@ namespace SwqlStudio
{
internal class OrionInfoServiceCertificate : InfoServiceBase
{
public OrionInfoServiceCertificate(bool v3 = false)
public OrionInfoServiceCertificate()
{
_endpoint = v3
? Settings.Default.OrionV3EndpointPathCertificate
: Settings.Default.OrionEndpointPathCertificate;
_endpoint = Settings.Default.OrionV3EndpointPathCertificate;
_endpointConfigName = "OrionCertificateTcpBinding";
_binding = new NetTcpBinding("Certificate");
_credentials = new MyCertificateCredential(Settings.Default.CertificateSubjectName,
Expand Down
4 changes: 2 additions & 2 deletions Src/SwqlStudio/ProductSpecific/OrionInfoServiceWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace SwqlStudio
{
internal class OrionInfoServiceWindows : InfoServiceBase
{
public OrionInfoServiceWindows(string username, string password, bool v3 = false)
public OrionInfoServiceWindows(string username, string password)
{
_endpoint = v3 ? Settings.Default.OrionV3EndpointPathAD : Settings.Default.OrionEndpointPathAD;
_endpoint = Settings.Default.OrionV3EndpointPathAD;
_endpointConfigName = "OrionWindowsTcpBinding";
_binding = new NetTcpBinding("Windows");
_credentials = new WindowsCredential(username, password);
Expand Down

0 comments on commit 37d4428

Please sign in to comment.