コード例 #1
0
        private void Connect(string hostname, string username, string password)
        {
            ServiceClients.Add(ClientType.PublishJson, new SdkServiceClient(PublishV2.ResolveEndpoint(hostname)));
            ServiceClients.Add(ClientType.AcquisitionJson, new SdkServiceClient(AcquisitionV2.ResolveEndpoint(hostname)));
            ServiceClients.Add(ClientType.ProvisioningJson, new SdkServiceClient(ProvisioningV1.ResolveEndpoint(hostname)));

            ServerVersion = AquariusSystemDetector.Instance.GetAquariusServerVersion(hostname);

            Connection = ConnectionPool.Instance.GetConnection(hostname, username, password, CreateSession, DeleteSession);

            SetSessionToken(Connection.SessionToken);
        }
コード例 #2
0
        private void InternalConnect(string hostname, Func <Connection> connectionFactory)
        {
            AddServiceClient(ClientType.PublishJson, PublishV2.ResolveEndpoint(hostname));
            AddServiceClient(ClientType.AcquisitionJson, AcquisitionV2.ResolveEndpoint(hostname));
            AddServiceClient(ClientType.ProvisioningJson, ProvisioningV1.ResolveEndpoint(hostname));

            ServerVersion = AquariusSystemDetector.Instance.GetAquariusServerVersion(hostname);

            Connection = connectionFactory();

            SetAutomaticReAuthentication();
        }
コード例 #3
0
        private void SetupClientWithMockEndpoints()
        {
            _client = new AquariusClient
            {
                ServerVersion = CreateDeveloperBuild()
            };

            _mockPublish       = CreateMockServiceClient();
            _mockAcquisition   = CreateMockServiceClient();
            _mockProvisioning  = CreateMockServiceClient();
            _mockAuthenticator = CreateMockAuthenticator();

            var mockHost = "http://example.com";

            _client.AddServiceClient(AquariusClient.ClientType.PublishJson, _mockPublish, PublishV2.ResolveEndpoint(mockHost));
            _client.AddServiceClient(AquariusClient.ClientType.AcquisitionJson, _mockAcquisition, AcquisitionV2.ResolveEndpoint(mockHost));
            _client.AddServiceClient(AquariusClient.ClientType.ProvisioningJson, _mockProvisioning, Provisioning.ResolveEndpoint(mockHost));

            _client.Connection = new Connection(
                _fixture.Create <string>(),
                _fixture.Create <string>(),
                _fixture.Create <string>(),
                _mockAuthenticator,
                connection => { });
        }