Exemple #1
0
        /// <summary>
        /// Sends a message to the configured OMF endpoints
        /// </summary>
        /// <param name="omfMessage">The OMF message to send</param>
        internal void SendOmfMessage(OmfMessage omfMessage)
        {
            SerializedOmfMessage serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage);

            if (AdhHttpClient != null)
            {
                _ = SendOmfMessageAsync(serializedOmfMessage, AdhHttpClient).Result;
            }

            if (EdsHttpClient != null)
            {
                _ = SendOmfMessageAsync(serializedOmfMessage, EdsHttpClient).Result;
            }

            if (PiHttpClient != null)
            {
                _ = SendOmfMessageAsync(serializedOmfMessage, PiHttpClient).Result;
            }
        }
Exemple #2
0
        /// <summary>
        /// Deletes type and containers that were created by these services
        /// </summary>
        internal void CleanupOmf()
        {
            SerializedOmfMessage serializedTypeDelete      = OmfMessageSerializer.Serialize(_typeDeleteMessage);
            SerializedOmfMessage serializedContainerDelete = OmfMessageSerializer.Serialize(_containerDeleteMessage);

            if (AdhHttpClient != null)
            {
                _ = SendOmfMessageAsync(serializedContainerDelete, AdhHttpClient).Result;
                _ = SendOmfMessageAsync(serializedTypeDelete, AdhHttpClient).Result;
            }

            if (EdsHttpClient != null)
            {
                _ = SendOmfMessageAsync(serializedContainerDelete, EdsHttpClient).Result;
                _ = SendOmfMessageAsync(serializedTypeDelete, EdsHttpClient).Result;
            }

            if (PiHttpClient != null)
            {
                _ = SendOmfMessageAsync(serializedContainerDelete, PiHttpClient).Result;
                _ = SendOmfMessageAsync(serializedTypeDelete, PiHttpClient).Result;
            }
        }
 private async Task SendOmfMessageAsync(OmfMessage omfMessage)
 {
     SerializedOmfMessage serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage);
     await _deviceOmfIngressService.SendOMFMessageAsync(serializedOmfMessage);
 }
Exemple #4
0
 private async Task SendOmfMessageAsync(OmfMessage omfMessage)
 {
     SerializedOmfMessage serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage);
     await _deviceOmfIngressService.SendOmfMessageAsync(serializedOmfMessage).ConfigureAwait(false);
 }
        /// <summary>
        /// Sends a message to the OCS OMF endpoint
        /// </summary>
        private static object SendOmfMessage(IOmfIngressService service, OmfMessage omfMessage)
        {
            var serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage);

            return(service.SendOmfMessageAsync(serializedOmfMessage).Result);
        }