/// <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); }
public InputAdapterBase Create(CsvInputConfig configInfo, EventShape eventShape, CepEventType cepEventType) { InputAdapterBase adapter = default(InputAdapterBase); switch (eventShape) { case EventShape.Interval: adapter = new CsvInputInterval(configInfo, cepEventType); break; case EventShape.Point: adapter = new CsvInputPoint(configInfo, cepEventType); break; default: throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unknown event shape {0}", eventShape.ToString())); } return(adapter); }
/// <summary> /// Based on a configuration and an event type generate an adapter reference /// </summary> public InputAdapterBase Create <TPayload>(SimulatedInputAdapterConfig configInfo, EventShape eventShape) { InputAdapterBase ret = default(InputAdapterBase); switch (eventShape) { case EventShape.Point: ret = new SimulatedInputPointAdapter <TPayload>(configInfo); break; case EventShape.Interval: ret = new SimulatedInputIntervalAdapter <TPayload>(configInfo); break; case EventShape.Edge: ret = new SimulatedInputEdgeAdapter <TPayload>(configInfo); break; } return(ret); }