Пример #1
0
        /// <summary>
        /// Configure OCS/OMF Services
        /// </summary>
        private static IOmfIngressService ConfigureOcsOmf(Uri address, string tenantId, string namespaceId, string clientId, string clientSecret)
        {
            var deviceAuthenticationHandler = new AuthenticationHandler(address, clientId, clientSecret);
            var deviceBaseOmfIngressService = new OmfIngressService(address, null, HttpCompressionMethod.None, deviceAuthenticationHandler);

            return(deviceBaseOmfIngressService.GetOmfIngressService(tenantId, namespaceId));
        }
Пример #2
0
        public Device(string address, string tenantId, string namespaceId, string clientId, string clientSecret)
        {
            // Create the AuthenticationHandler and IngressSerice to use to send data
            AuthenticationHandler deviceAuthenticationHandler = new AuthenticationHandler(new Uri(address), clientId, clientSecret);

            OmfIngressService deviceBaseOmfIngressService = new OmfIngressService(new Uri(address), null, HttpCompressionMethod.None, deviceAuthenticationHandler);

            _deviceOmfIngressService = deviceBaseOmfIngressService.GetOmfIngressService(tenantId, namespaceId);
        }
Пример #3
0
        public OmfIngressClient(string address, string tenantId, string namespaceId, string clientId, string clientSecret)
        {
            // Get Ingress Services to communicate with server and handle ingress management
            AuthenticationHandler authenticationHandler = new AuthenticationHandler(new Uri(address), clientId, clientSecret);

            _tenantId    = tenantId;
            _namespaceId = namespaceId;
            OmfIngressService baseOmfIngressService = new OmfIngressService(new Uri(address), null, HttpCompressionMethod.None, authenticationHandler);

            _omfIngressService = baseOmfIngressService.GetOmfIngressService(tenantId, namespaceId);
        }