Ejemplo n.º 1
0
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                ftpURL = defn.Attributes["ftpURL"].Value;
            } catch (Exception) {
                Console.WriteLine($"No FTP URL defined for { defn.Attributes["name"].Value}");
                return(false);
            }

            try {
                ftpUser = defn.Attributes["ftpUser"].Value;
            } catch (Exception) {
                ftpUser = null;
            }

            try {
                ftpPass = defn.Attributes["ftpPass"].Value;
            } catch (Exception) {
                ftpPass = null;
            }

            return(true);
        }
Ejemplo n.º 2
0
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            MqttFactory factory = new MqttFactory();

            mqttClient = factory.CreateMqttClient();
            try {
                mqttServer = defn.Attributes["mqttServer"].Value;
            } catch (Exception) {
                mqttServer = null;
            }
            try {
                mqttServerURL = defn.Attributes["mqttServerURL"].Value;
            } catch (Exception) {
                mqttServerURL = null;
            }
            try {
                mqttServerPort = int.Parse(defn.Attributes["mqttPort"].Value);
            } catch (Exception) {
                mqttServerPort = -1;
            }
            try {
                topic = defn.Attributes["mqttTopic"].Value;
            } catch (Exception) {
                topic = null;
            }
            try {
                serverType = defn.Attributes["mqttServerType"].Value;
            } catch (Exception) {
                topic = null;
            }

            return(true);
        }
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                bootStrapServers = defn.Attributes["connection"].Value;
            } catch (Exception) {
                return(false);
            }
            try {
                Key = defn.Attributes["key"].Value;
            } catch (Exception) {
                Key = null;
            }

            try {
                Topic = defn.Attributes["topic"].Value;
            } catch (Exception) {
                Topic = "my_topic";
            }

            if (Key == null)
            {
                Key = Topic;
            }

            return(true);
        }
Ejemplo n.º 4
0
        public virtual bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            this.defn       = node;
            this.controller = cont;

            return(true);
        }
Ejemplo n.º 5
0
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                tcpServerPort = int.Parse(defn.Attributes["tcpServerPort"].Value);
            } catch (Exception) {
                Console.WriteLine($"No TCP Server Port correctly defined for {defn.Attributes["name"].Value}");
                return(false);
            }

            try {
                tcpServerIP = defn.Attributes["tcpServerIP"].Value;
                if (tcpServerIP == "localhost")
                {
                    tcpServerIP = "127.0.0.1";
                }
            } catch (Exception) {
                Console.WriteLine("Using '127.0.0.1' for TCP Server IP");
                tcpServerIP = "127.0.0.1";
            }

            try {
                closeConnection = bool.Parse(defn.Attributes["closeConnection"].Value);
            } catch (Exception) {
                closeConnection = false;
            }

            return(true);
        }
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                showResults = bool.Parse(defn.Attributes["showResults"].Value);
            } catch (Exception) {
                showResults = false;
            }

            return(true);
        }
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                queueName = defn.Attributes["queue"].Value;
            } catch (Exception) {
                Console.WriteLine($"No Queue defined for {defn.Attributes["name"].Value}");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 8
0
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            name = defn.Attributes["name"]?.Value;
            try {
                serverURL = defn.Attributes["serverURL"]?.Value;
            } catch (Exception ex) {
                serverURL = null;
                Console.WriteLine($"HTTP Server URL Invalid. {ex.Message}");
            }
            if (serverURL == null)
            {
                return(false);
            }
            return(true);
        }
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                showResults = bool.Parse(defn.Attributes["showResults"].Value);
            } catch (Exception) {
                showResults = false;
            }
            try {
                connStr = defn.Attributes["connStr"].Value;
            } catch (Exception) {
                Console.WriteLine($"No Connection String defined for { defn.Attributes["name"].Value}");
                return(false);
            }

            return(true);
        }
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                destinationFile = defn.Attributes["destinationFile"].Value;
            } catch (Exception) {
                Console.WriteLine($"No Destination Filename defined for {defn.Attributes["name"].Value}");
                return(false);
            }

            try {
                appendFile = bool.Parse(defn.Attributes["appendFile"].Value);
            } catch (Exception) {
                appendFile = false;
            }

            return(true);
        }
Ejemplo n.º 11
0
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);
            USE_ASYNC_SEND = true;
            name           = defn.Attributes["name"].Value;

            try {
                postURL = defn.Attributes["postURL"].Value;
            } catch (Exception) {
                Console.WriteLine($"No HTTP URL defined for {name}");
                return(false);
            }

            try {
                httpLogPath = defn.Attributes["httpLogPath"].Value;
            } catch (Exception) {
                httpLogPath = null;
            }
            try {
                maxRetry = Convert.ToInt32(defn.Attributes["maxRetry"].Value);
            } catch (Exception) {
                maxRetry = 2;
            }

            try {
                timeout = Convert.ToInt32(defn.Attributes["timeout"].Value);
            } catch (Exception) {
                timeout = 5;
            }

            XElement xElem = XElement.Load(defn.CreateNavigator().ReadSubtree());
            IEnumerable <XElement> headerDefn = from value in xElem.Descendants("header") select value;

            foreach (XElement v in headerDefn)
            {
                string key   = v.Attribute("name").Value;
                string value = v.Attribute("value").Value;
                headers.Add(key, value);
            }

            return(true);
        }
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);

            try {
                connection = defn.Attributes["connection"].Value;
            } catch (Exception) {
                return(false);
            }
            try {
                queueName = defn.Attributes["queue"].Value;
            } catch (Exception) {
                queueName = null;
            }

            try {
                user = defn.Attributes["rabbitUser"].Value;
            } catch (Exception) {
                user = "******";
            }
            try {
                pass = defn.Attributes["rabbitPass"].Value;
            } catch (Exception) {
                pass = "******";
            }
            try {
                vhost = defn.Attributes["rabbitVHost"].Value;
            } catch (Exception) {
                vhost = "/";
            }
            try {
                port = int.Parse(defn.Attributes["rabbitPort"].Value);
            } catch (Exception) {
                port = 5672;
            }

            return(true);
        }
Ejemplo n.º 13
0
        public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
        {
            base.Configure(node, cont, log);
            try {
                try {
                    queueName = defn.Attributes["queue"].Value;
                } catch (Exception) {
                    Console.WriteLine($"No Queue defined for {defn.Attributes["name"].Value}");
                    return(false);
                }

                try {
                    qMgr = defn.Attributes["queueMgr"].Value;
                } catch (Exception) {
                    Console.WriteLine($"Queue Manager not defined for {defn.Attributes["name"].Value}");
                    return(false);
                }
                try {
                    qSvrChan = defn.Attributes["channel"].Value;
                } catch (Exception) {
                    Console.WriteLine($"Channel not defined for {defn.Attributes["name"].Value}");
                    return(false);
                }

                try {
                    qHost = defn.Attributes["host"].Value;
                } catch (Exception) {
                    Console.WriteLine($"Queue  not defined for {defn.Attributes["name"].Value}");
                    return(false);
                }

                try {
                    qPort = defn.Attributes["port"].Value;
                } catch (Exception) {
                    Console.WriteLine($"Port not defined for {defn.Attributes["name"].Value}");
                    return(false);
                }

                try {
                    qUser = defn.Attributes["username"].Value;
                } catch (Exception) {
                    qUser = null;
                    logger.Info($"No username defined for {defn.Attributes["name"].Value}");
                }

                try {
                    putTimeout = int.Parse(defn.Attributes["putTimeout"].Value);
                } catch (Exception) {
                    putTimeout = 10;
                    logger.Info("MQ Message Put Timeout set to default");
                }

                try {
                    qPass = defn.Attributes["password"].Value;
                } catch (Exception) {
                    qPass = null;
                    logger.Info($"No password defined for {defn.Attributes["name"].Value}");
                }
                try {
                    useSendLocking = bool.Parse(defn.Attributes["useSendLocking"].Value);
                } catch (Exception) {
                    useSendLocking = false;
                }

                try {
                    // Set the connection parameter
                    connectionParams.Add(MQC.CHANNEL_PROPERTY, qSvrChan);
                    connectionParams.Add(MQC.HOST_NAME_PROPERTY, qHost);
                    connectionParams.Add(MQC.PORT_PROPERTY, qPort);

                    if (qUser != null)
                    {
                        connectionParams.Add(MQC.USER_ID_PROPERTY, qUser);
                    }
                    if (qPass != null)
                    {
                        connectionParams.Add(MQC.PASSWORD_PROPERTY, qPass);
                    }
                } catch (Exception) {
                    return(false);
                }
            } catch (AccessViolationException ex) {
                logger.Info(ex.Message);
                logger.Info(ex.StackTrace);
                return(false);
            } catch (Exception ex) {
                logger.Info("Error configuring MQ queue");
                logger.Info(ex.Message);
                logger.Info(ex.StackTrace);
                Console.WriteLine($"Error configuring MQ access for {defn.Attributes["name"].Value}");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 14
0
 public override bool Configure(XmlNode node, IDestinationEndPointController cont, Logger log)
 {
     base.Configure(node, cont, log);
     return(true);
 }