public void Register(IServiceLocationRuntimeManager manager, IServiceLocator locator)
        {
            if (manager.IsNull())
            {
                throw new ArgumentNullException("manager");
            }

            if (locator.IsNull())
            {
                throw new ArgumentNullException("locator");
            }

            var overrideManager = new HDInsightClusterOverrideManager();

            overrideManager.AddOverride <HDInsightCertificateCredential>(new VersionFinderClientFactory(),
                                                                         new HDInsightManagementRdfeUriBuilderFactory(),
                                                                         new PayloadConverter());

            overrideManager.AddOverride <HDInsightAccessTokenCredential>(new VersionFinderClientFactory(),
                                                                         new HDInsightManagementRdfeUriBuilderFactory(),
                                                                         new PayloadConverter());

            manager.RegisterInstance <IHDInsightClusterOverrideManager>(overrideManager);
            manager.RegisterType <ICloudServiceNameResolver, CloudServiceNameResolver>();
            manager.RegisterType <IHDInsightManagementRestClientFactory, HDInsightManagementRestClientFactory>();
            manager.RegisterType <IHDInsightManagementPocoClientFactory, HDInsightManagementPocoClientFactory>();
            manager.RegisterType <IHDInsightJobSubmissionRestClientFactory, HDInsightJobSubmissionRestClientFactory>();
            manager.RegisterType <IHDInsightClientFactory, HDInsightClientFactory>();
            manager.RegisterType <IAsvValidatorClientFactory, AsvValidatorValidatorClientFactory>();
            manager.RegisterType <IHDInsightSubscriptionCredentialsFactory, ProductionIHDInsightSubscriptionCertificateCredentialsFactory>();
            manager.RegisterType <ISubscriptionRegistrationClientFactory, SubscriptionRegistrationClientFactory>();
            manager.RegisterType <ILocationFinderClientFactory, LocationFinderClientFactory>();
            manager.RegisterType <IRdfeServiceRestClientFactory, RdfeServiceRestClientFactory>();
            manager.RegisterType <IHDInsightJobSubmissionPocoClientFactory, HDInsightJobSubmissionPocoClientFactory>();
            manager.RegisterType <IHDInsightHttpClientAbstractionFactory, HDInsightHttpClientAbstractionFactory>();
            manager.RegisterType <IJobSubmissionCache, JobSubmissionCache>();
            manager.RegisterType <IRdfeClustersResourceRestClientFactory, RdfeClustersResourceRestClientFactory>();
            manager.RegisterType <IRdfeResourceTypeFinderFactory, RdfeResourceTypeFinderClientFactory>();
            manager.RegisterType <IRdfeIaasClustersRestClientFactory, RdfeIaasClustersRestClientFactory>();

            var changeManager = new UserChangeRequestManager();

            changeManager.RegisterUserChangeRequestHandler(typeof(HDInsightCertificateCredential),
                                                           UserChangeRequestUserType.Http, HttpChangeRequestUriBuilder,
                                                           PayloadConverter.SerializeHttpConnectivityRequest);
            changeManager.RegisterUserChangeRequestHandler(typeof(HDInsightCertificateCredential),
                                                           UserChangeRequestUserType.Rdp, RdpChangeRequestUriBuilder,
                                                           PayloadConverter.SerializeRdpConnectivityRequest);
            manager.RegisterInstance <IUserChangeRequestManager>(changeManager);
            var hadoopManager = locator.Locate <IHadoopClientFactoryManager>();

            hadoopManager.RegisterFactory <JobSubmissionCertificateCredential, IHDInsightHadoopClientFactory, HDInsightHadoopClientFactory>();
            hadoopManager.RegisterFactory <JobSubmissionAccessTokenCredential, IHDInsightHadoopClientFactory, HDInsightHadoopClientFactory>();
        }
        public void Register(IServiceLocationRuntimeManager manager, IServiceLocator locator)
        {
            if (manager.IsNull())
            {
                throw new ArgumentNullException("manager");
            }

            if (locator.IsNull())
            {
                throw new ArgumentNullException("locator");
            }

            var overrideManager = new HDInsightClusterOverrideManager();
            overrideManager.AddOverride<HDInsightCertificateCredential>(new VersionFinderClientFactory(),
                                                                        new HDInsightManagementRdfeUriBuilderFactory(),
                                                                        new PayloadConverter());

            overrideManager.AddOverride<HDInsightAccessTokenCredential>(new VersionFinderClientFactory(),
                                                                        new HDInsightManagementRdfeUriBuilderFactory(),
                                                                        new PayloadConverter());

            manager.RegisterInstance<IHDInsightClusterOverrideManager>(overrideManager);
            manager.RegisterType<ICloudServiceNameResolver, CloudServiceNameResolver>();
            manager.RegisterType<IHDInsightManagementRestClientFactory, HDInsightManagementRestClientFactory>();
            manager.RegisterType<IHDInsightManagementPocoClientFactory, HDInsightManagementPocoClientFactory>();
            manager.RegisterType<IHDInsightJobSubmissionRestClientFactory, HDInsightJobSubmissionRestClientFactory>();
            manager.RegisterType<IHDInsightClientFactory, HDInsightClientFactory>();
            manager.RegisterType<IAsvValidatorClientFactory, AsvValidatorValidatorClientFactory>();
            manager.RegisterType<IHDInsightSubscriptionCredentialsFactory, ProductionIHDInsightSubscriptionCertificateCredentialsFactory>();
            manager.RegisterType<ISubscriptionRegistrationClientFactory, SubscriptionRegistrationClientFactory>();
            manager.RegisterType<ILocationFinderClientFactory, LocationFinderClientFactory>();
            manager.RegisterType<IRdfeServiceRestClientFactory, RdfeServiceRestClientFactory>();
            manager.RegisterType<IHDInsightJobSubmissionPocoClientFactory, HDInsightJobSubmissionPocoClientFactory>();
            manager.RegisterType<IHDInsightHttpClientAbstractionFactory, HDInsightHttpClientAbstractionFactory>();
            manager.RegisterType<IJobSubmissionCache, JobSubmissionCache>();
            manager.RegisterType<IRdfeClustersResourceRestClientFactory, RdfeClustersResourceRestClientFactory>();
            manager.RegisterType<IRdfeResourceTypeFinderFactory, RdfeResourceTypeFinderClientFactory>();
            manager.RegisterType<IRdfeIaasClustersRestClientFactory, RdfeIaasClustersRestClientFactory>();
            
            var changeManager = new UserChangeRequestManager();
            changeManager.RegisterUserChangeRequestHandler(typeof (HDInsightCertificateCredential),
                UserChangeRequestUserType.Http, HttpChangeRequestUriBuilder,
                PayloadConverter.SerializeHttpConnectivityRequest);
            changeManager.RegisterUserChangeRequestHandler(typeof (HDInsightCertificateCredential),
                UserChangeRequestUserType.Rdp, RdpChangeRequestUriBuilder,
                PayloadConverter.SerializeRdpConnectivityRequest);
            manager.RegisterInstance<IUserChangeRequestManager>(changeManager);
            var hadoopManager = locator.Locate<IHadoopClientFactoryManager>();
            hadoopManager.RegisterFactory<JobSubmissionCertificateCredential, IHDInsightHadoopClientFactory, HDInsightHadoopClientFactory>();
            hadoopManager.RegisterFactory<JobSubmissionAccessTokenCredential, IHDInsightHadoopClientFactory, HDInsightHadoopClientFactory>();
        }