コード例 #1
0
        /// <summary>
        /// Returns an instance of a text file reader input adapter.
        /// </summary>
        /// <param name="configInfo">Configuration passed from the query binding.</param>
        /// <param name="eventShape">Event shape requested from the query binding.</param>
        /// <param name="cepEventType">Event type expected by the bound query template.</param>
        /// <returns>An instance of a text file reader input adapter.</returns>
        public InputAdapterBase Create(TextFileReaderConfig configInfo, EventShape eventShape, CepEventType cepEventType)
        {
            InputAdapterBase adapter = default(InputAdapterBase);

            if (eventShape == EventShape.Point)
            {
                adapter = new TextFilePointInput(configInfo, cepEventType);
            }
            else if (eventShape == EventShape.Interval)
            {
                adapter = new TextFileIntervalInput(configInfo, cepEventType);
            }
            else if (eventShape == EventShape.Edge)
            {
                adapter = new TextFileEdgeInput(configInfo, cepEventType);
            }
            else
            {
                throw new ArgumentException(
                          string.Format(
                              CultureInfo.InvariantCulture,
                              "TextFileReaderFactory cannot instantiate adapter with event shape {0}",
                              eventShape.ToString()));
            }

            return(adapter);
        }
コード例 #2
0
        /// <summary>
        /// Returns an instance of a text file writer output adapter.
        /// </summary>
        /// <param name="configInfo">Configuration passed from the query binding.</param>
        /// <param name="eventShape">Event shape requested from the query binding.</param>
        /// <param name="cepEventType">Event type produced by the bound query template.</param>
        /// <returns>An instance of a text file writer output adapter.</returns>
        public OutputAdapterBase Create(TextFileWriterConfig configInfo, EventShape eventShape, CepEventType cepEventType)
        {
            OutputAdapterBase adapter = default(OutputAdapterBase);

            switch (eventShape)
            {
            case EventShape.Point:
                adapter = new TextFilePointOutput(configInfo, cepEventType);
                break;

            case EventShape.Interval:
                adapter = new TextFileIntervalOutput(configInfo, cepEventType);
                break;

            case EventShape.Edge:
                adapter = new TextFileEdgeOutput(configInfo, cepEventType);
                break;

            default:
                throw new ArgumentException(string.Format(
                                                CultureInfo.InvariantCulture,
                                                "TextFileWriterFactory cannot instantiate adapter with event shape {0}",
                                                eventShape.ToString()));
            }

            return(adapter);
        }
コード例 #3
0
        private TestDataProducer CreateProducer(TestDataInputConfig config, EventShape eventShape)
        {
            switch (eventShape)
            {
            case EventShape.Point:
                //Create the publisher.
                return(new TestDataProducer(config));

            default:
                throw new ArgumentException(string.Format(
                                                System.Globalization.CultureInfo.InvariantCulture,
                                                "TestDataInputFactory cannot instantiate adapter with event shape {0}",
                                                eventShape.ToString()));
            }
        }
コード例 #4
0
        public OutputAdapterBase Create(SqlOutputConfig configInfo, EventShape eventShape, CepEventType cepEventType)
        {
            OutputAdapterBase adapter = default(OutputAdapterBase);

            switch (eventShape)
            {
            case EventShape.Point:
                adapter = new SqlOutputPoint(configInfo, cepEventType);
                break;

            case EventShape.Interval:
                adapter = new SqlOutputInterval(configInfo, cepEventType);
                break;

            default:
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unknown event shape {0}", eventShape.ToString()));
            }

            return(adapter);
        }