From 0bc4c733e0959a050c7e6db014a514bccd8c0c23 Mon Sep 17 00:00:00 2001 From: Jon Anglin Date: Fri, 8 Feb 2013 10:32:33 -0500 Subject: [PATCH] Removing the NServiceBusHostQueues class and its usages. ReSharper cleanup of the dropkick.remote program --- dropkick.sln.DotSettings | 2 + product/dropkick.remote/Program.cs | 20 +++--- .../NServiceBusHostConfigurator.cs | 12 ---- .../NServiceBusHost/NServiceBusHostOptions.cs | 3 - .../NServiceBusHost/NServiceBusHostQueues.cs | 71 ------------------- product/dropkick/dropkick.csproj | 1 - 6 files changed, 11 insertions(+), 98 deletions(-) delete mode 100644 product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostQueues.cs diff --git a/dropkick.sln.DotSettings b/dropkick.sln.DotSettings index 85d3acd9..a5182b60 100644 --- a/dropkick.sln.DotSettings +++ b/dropkick.sln.DotSettings @@ -2,5 +2,7 @@ C:\dev\dropkick\dropkick.DotSettings ..\dropkick.DotSettings True + True + 2 True 1 \ No newline at end of file diff --git a/product/dropkick.remote/Program.cs b/product/dropkick.remote/Program.cs index 4e1598d7..9755a2e2 100644 --- a/product/dropkick.remote/Program.cs +++ b/product/dropkick.remote/Program.cs @@ -49,7 +49,7 @@ static void Main(string[] args) //TODO:remote needs to become as awesome as the regular console - DeploymentResult result = new DeploymentResult(); + var result = new DeploymentResult(); switch (args[0]) { @@ -93,7 +93,7 @@ private static void DisplayResults(DeploymentResult results) private static DeploymentResult VerifyMsmqExists(string[] args) { - DeploymentResult result = new DeploymentResult(); + var result = new DeploymentResult(); var queuename = args[1]; var queueAddress = new QueueAddress(queuename); var formattedName = queueAddress.LocalName; @@ -106,22 +106,20 @@ private static DeploymentResult VerifyMsmqExists(string[] args) private static DeploymentResult CreateMsmq(string[] args) { - DeploymentResult result = new DeploymentResult(); - var queuename = args[1]; var queueAddress = new QueueAddress(queuename); var transactional = false; if (args.Length > 2) bool.TryParse(args[2], out transactional); - result = new CreateLocalMsmqQueueTask(_server, queueAddress, transactional).Execute(); + var result = new CreateLocalMsmqQueueTask(_server, queueAddress, transactional).Execute(); return result; } private static DeploymentResult GrantMsmqPermissions(string[] args) { - DeploymentResult result = new DeploymentResult(); + var result = new DeploymentResult(); var perm = args[1]; var user = args[2]; @@ -159,18 +157,18 @@ private static DeploymentResult GrantMsmqPermissions(string[] args) private static DeploymentResult GrantCertificatePermissions(string[] args) { - DeploymentResult result = new DeploymentResult(); + var result = new DeploymentResult(); var perm = args[1]; var groupArray = args[2]; var thumbprint = args[3]; - string s_storeName = args[4]; - var s_storeLocation = args[5]; + var storeNameArg = args[4]; + var storeLocationArg = args[5]; var groups = groupArray.Split(new[]{"|"},StringSplitOptions.RemoveEmptyEntries); - StoreName storeName = (StoreName)Enum.Parse(typeof(StoreName), s_storeName,true); - StoreLocation storeLocation = (StoreLocation)Enum.Parse(typeof(StoreLocation), s_storeLocation,true); + var storeName = (StoreName)Enum.Parse(typeof(StoreName), storeNameArg,true); + var storeLocation = (StoreLocation)Enum.Parse(typeof(StoreLocation), storeLocationArg,true); switch (perm) { diff --git a/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostConfigurator.cs b/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostConfigurator.cs index d46ac678..06f086cb 100644 --- a/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostConfigurator.cs +++ b/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostConfigurator.cs @@ -12,7 +12,6 @@ // specific language governing permissions and limitations under the License. namespace dropkick.Configuration.Dsl.NServiceBusHost { - using System; using DeploymentModel; using FileSystem; using Tasks; @@ -23,7 +22,6 @@ public class NServiceBusHostConfigurator : NServiceBusHostOptions { readonly NServiceBusHostExeArgs _args; - NServiceBusHostQueues _queues; readonly Path _path; string _location; string _exeName; @@ -85,13 +83,6 @@ public void Profiles(string profiles) _args.Profiles = profiles; } - public void CreateServiceQueue(Action queueOptions = null) - { - _queues = new NServiceBusHostQueues(); - if (queueOptions != null) - queueOptions(_queues); - } - public override void RegisterRealTasks(PhysicalServer site) { _args.PromptForUsernameAndPasswordIfNecessary(_exeName); @@ -105,9 +96,6 @@ public override void RegisterRealTasks(PhysicalServer site) { site.AddTask(new RemoteNServiceBusHostTask(_exeName, location, site, _args)); } - - if (_queues != null) - _queues.RegisterRealTasks(site, _args.ServiceName, _args.Username); } } } \ No newline at end of file diff --git a/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostOptions.cs b/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostOptions.cs index 12632272..21b204e7 100644 --- a/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostOptions.cs +++ b/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostOptions.cs @@ -12,8 +12,6 @@ // specific language governing permissions and limitations under the License. namespace dropkick.Configuration.Dsl.NServiceBusHost { - using System; - public interface NServiceBusHostOptions { void ExeName(string name); @@ -26,6 +24,5 @@ public interface NServiceBusHostOptions void EndpointName(string name); void EndpointConfigurationType(string iConfigureThisEndpointTypeFullName, string assembly); void Profiles(string profiles); - void CreateServiceQueue(Action queueOptions); } } \ No newline at end of file diff --git a/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostQueues.cs b/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostQueues.cs deleted file mode 100644 index 94485212..00000000 --- a/product/dropkick/Configuration/Dsl/NServiceBusHost/NServiceBusHostQueues.cs +++ /dev/null @@ -1,71 +0,0 @@ -namespace dropkick.Configuration.Dsl.NServiceBusHost -{ - using DeploymentModel; - using Msmq; - using Security.Msmq; - - public class NServiceBusHostQueues - { - bool _createRetriesQueue; - bool _createErrorsQueue; - bool _createSubscriptionsQueue; - bool _createAuditQueue; - bool _createTimeoutQueues; - - public NServiceBusHostQueues CreateRetriesQueue() - { - _createRetriesQueue = true; - return this; - } - - public NServiceBusHostQueues CreateErrorsQueue() - { - _createErrorsQueue = true; - return this; - } - public NServiceBusHostQueues CreateSubscriptionsQueue() - { - _createSubscriptionsQueue = true; - return this; - } - public NServiceBusHostQueues CreateAuditQueue() - { - _createAuditQueue = true; - return this; - } - public NServiceBusHostQueues CreateTimeoutQueues() - { - _createTimeoutQueues = true; - return this; - } - - public void RegisterRealTasks(PhysicalServer site, string serviceName, string username) - { - RegisterMsmqQueueCreation(site, username, serviceName); - - if (_createRetriesQueue) - RegisterMsmqQueueCreation(site, username, serviceName + ".retries"); - if (_createErrorsQueue) - RegisterMsmqQueueCreation(site, username, serviceName + ".errors"); - if (_createSubscriptionsQueue) - RegisterMsmqQueueCreation(site, username, serviceName + ".subscriptions"); - if (_createAuditQueue) - RegisterMsmqQueueCreation(site, username, serviceName + ".audit"); - if (_createTimeoutQueues) - { - RegisterMsmqQueueCreation(site, username, serviceName + ".timeouts"); - RegisterMsmqQueueCreation(site, username, serviceName + ".timeoutsdispatcher"); - } - } - - void RegisterMsmqQueueCreation(PhysicalServer site, string username, string queueName) - { - var protoMsmqTask = new ProtoMsmqTask(); - protoMsmqTask.PrivateQueue(queueName).Transactional(); - protoMsmqTask.RegisterRealTasks(site); - - var msmqSecurity = new ProtoMsmqNServiceBusPermissionsTask(queueName, username); - msmqSecurity.RegisterRealTasks(site); - } - } -} \ No newline at end of file diff --git a/product/dropkick/dropkick.csproj b/product/dropkick/dropkick.csproj index 5b841ca4..f117c3d8 100644 --- a/product/dropkick/dropkick.csproj +++ b/product/dropkick/dropkick.csproj @@ -113,7 +113,6 @@ -