Пример #1
0
        public async Task ApplyReferenceEntityHeader(String propName, StringBuilder bldr, String indent, EntityHeader eh, Object model = null)
        {
            switch (propName)
            {
            case nameof(Verifier.Component):
                var msg = await _deviceMsgMgr.GetDeviceMessageDefinitionAsync(eh.Id, _org, _user);

                var verifier = model as Verifier;
                bldr.AppendLine($"{indent}  type: {propName}");
                bldr.AppendLine($"{indent}  name: {msg.Name}");
                bldr.AppendLine($"{indent}  subType: {verifier.VerifierType}");
                bldr.AppendLine($"{indent}  key: {msg.Key}");
                break;

            case "Listeners":
                var listener = await _pipelineMgr.GetListenerConfigurationAsync(eh.Id, _org, _user);

                bldr.AppendLine($"{indent}  type: Listener");
                bldr.AppendLine($"{indent}  name: {listener.Name}");
                bldr.AppendLine($"{indent}  key: {listener.Key}");
                break;

            case nameof(DeviceType.DefaultDeviceConfiguration):
            case "DeviceConfigurations":
                var config = await _deviceCfgMgr.GetDeviceConfigurationAsync(eh.Id, _org, _user);

                bldr.AppendLine($"{indent}  type: DeviceConfiguration");
                bldr.AppendLine($"{indent}  name: {config.Name}");
                bldr.AppendLine($"{indent}  key: {config.Key}");
                break;

            case "Planner":
                var planner = await _pipelineMgr.GetPlannerConfigurationAsync(eh.Id, _org, _user);

                bldr.AppendLine($"{indent}  type: Planner");
                bldr.AppendLine($"{indent}  name: {planner.Name}");
                bldr.AppendLine($"{indent}  key: {planner.Key}");

                break;

            default:
                bldr.AppendLine($"{indent}  Don't know how to process {propName}");
                break;
            }
        }
        public async Task <DetailResponse <ListenerConfiguration> > GetListenerConfigurationAsync(String id)
        {
            var listenerConfig = await _pipelineModuleManager.GetListenerConfigurationAsync(id, OrgEntityHeader, UserEntityHeader);

            return(DetailResponse <ListenerConfiguration> .Create(listenerConfig));
        }