public DataFlowOperator operator(DataFlowOpInitializeContext context) { EPDataFlowEventBeanCollector collectorInstance = DataFlowParameterResolution.resolveOptionalInstance("collector", collector, EPDataFlowEventBeanCollector.class, context); return new EventBusSourceOp(this, context.getAgentInstanceContext(), collectorInstance); }
public DataFlowOperator operator(DataFlowOpInitializeContext context) { EPDataFlowEventCollector collectorInstance = DataFlowParameterResolution.resolveOptionalInstance("collector", collector, EPDataFlowEventCollector.class, context); return new EventBusSinkOp(this, context.getAgentInstanceContext(), collectorInstance); }
public DataFlowOperator operator(DataFlowOpInitializeContext context) { String statementDeploymentIdParam = DataFlowParameterResolution.resolveStringOptional("statementDeploymentId", statementDeploymentId, context); String statementNameParam = DataFlowParameterResolution.resolveStringOptional("statementName", statementName, context); EPDataFlowEPStatementFilter statementFilterInstance = DataFlowParameterResolution.resolveOptionalInstance("statementFilter", statementFilter, EPDataFlowEPStatementFilter.class, context); EPDataFlowIRStreamCollector collectorInstance = DataFlowParameterResolution.resolveOptionalInstance("collector", collector, EPDataFlowIRStreamCollector.class, context); if (statementNameParam == null && statementFilterInstance == null) { throw new EPException("Failed to find required 'statementName' or 'statementFilter' parameter"); } return new EPStatementSourceOp(this, context.getAgentInstanceContext(), statementDeploymentIdParam, statementNameParam, statementFilterInstance, collectorInstance); }
public AMQPSettingsSinkValues evaluate(DataFlowOpInitializeContext context) { AMQPSettingsSinkValues values = new AMQPSettingsSinkValues(); super.evaluateAndSet(values, context); values.setCollector(DataFlowParameterResolution.resolveOptionalInstance("collector", collector, ObjectToAMQPCollector.class, context)); return values; }
public DataFlowOperator operator(DataFlowOpInitializeContext context) { boolean classpathFileFlag = DataFlowParameterResolution.resolveWithDefault("classpathFile", classpathFile, false, boolean.class, context); AdapterInputSource adapterInputSourceValue = DataFlowParameterResolution.resolveOptionalInstance("adapterInputSource", adapterInputSource, AdapterInputSource.class, context); String fileName = DataFlowParameterResolution.resolveWithDefault("file", file, null, String.class, context); if (adapterInputSourceValue == null) { if (fileName != null) { if (classpathFileFlag) { adapterInputSourceValue = new AdapterInputSource(fileName); } else { adapterInputSourceValue = new AdapterInputSource(new File(fileName)); } } else { throw new EPException("Failed to find required parameter, either the file or the adapterInputSource parameter is required"); } } String formatValue = DataFlowParameterResolution.resolveStringOptional("format", format, context); if (formatValue == null || formatValue.equals("csv")) { boolean hasHeaderLineFlag = DataFlowParameterResolution.resolveWithDefault("hasHeaderLine", hasHeaderLine, false, boolean.class, context); boolean hasTitleLineFlag = DataFlowParameterResolution.resolveWithDefault("hasTitleLine", hasTitleLine, false, boolean.class, context); Integer numLoopsValue = DataFlowParameterResolution.resolveWithDefault("numLoops", numLoops, null, Integer.class, context); String dateFormatValue = DataFlowParameterResolution.resolveStringOptional("dateFormat", dateFormat, context); return new FileSourceCSV(this, context, adapterInputSourceValue, hasHeaderLineFlag, hasTitleLineFlag, numLoopsValue, propertyNames, dateFormatValue); } else if (formatValue.equals("line")) { String propertyNameLineValue = DataFlowParameterResolution.resolveStringOptional("propertyNameLine", propertyNameLine, context); String propertyNameFileValue = DataFlowParameterResolution.resolveStringOptional("propertyNameFile", propertyNameFile, context); return new FileSourceLineUnformatted(this, context, adapterInputSourceValue, fileName, propertyNameLineValue, propertyNameFileValue); } else { throw new IllegalArgumentException("Unrecognized file format '" + formatValue + "'"); } }
public AMQPSettingsSourceValues evaluate(DataFlowOpInitializeContext context) { AMQPSettingsSourceValues values = new AMQPSettingsSourceValues(); super.evaluateAndSet(values, context); values.setCollector(DataFlowParameterResolution.resolveOptionalInstance("collector", collector, AMQPToObjectCollector.class, context)); values.setPrefetchCount(DataFlowParameterResolution.resolveWithDefault("prefetchCount", prefetchCount, 100, int.class, context)); values.setConsumeAutoAck(DataFlowParameterResolution.resolveWithDefault("consumeAutoAck", consumeAutoAck, true, boolean.class, context)); return values; }
public DataFlowOperator operator(DataFlowOpInitializeContext context) { boolean classpathFileFlag = DataFlowParameterResolution.resolveWithDefault("classpathFile", classpathFile, false, boolean.class, context); AdapterInputSource adapterInputSourceValue = DataFlowParameterResolution.resolveOptionalInstance("adapterInputSource", adapterInputSource, AdapterInputSource.class, context); String fileName = DataFlowParameterResolution.resolveWithDefault("file", file, null, String.class, context); if (adapterInputSourceValue == null) { if (fileName != null) { if (classpathFileFlag) { adapterInputSourceValue = new AdapterInputSource(fileName); } else { adapterInputSourceValue = new AdapterInputSource(new File(fileName)); } } else { throw new EPException("Failed to find required parameter, either the file or the adapterInputSource parameter is required"); } } String formatValue = DataFlowParameterResolution.resolveStringOptional("format", format, context); if (formatValue == null || formatValue.equals("csv")) { boolean hasHeaderLineFlag = DataFlowParameterResolution.resolveWithDefault("hasHeaderLine", hasHeaderLine, false, boolean.class, context); boolean hasTitleLineFlag = DataFlowParameterResolution.resolveWithDefault("hasTitleLine", hasTitleLine, false, boolean.class, context); Integer numLoopsValue = DataFlowParameterResolution.resolveWithDefault("numLoops", numLoops, null, Integer.class, context); String dateFormatValue = DataFlowParameterResolution.resolveStringOptional("dateFormat", dateFormat, context); return new FileSourceCSV(this, context, adapterInputSourceValue, hasHeaderLineFlag, hasTitleLineFlag, numLoopsValue, propertyNames, dateFormatValue); } else if (formatValue.equals("line")) { String propertyNameLineValue = DataFlowParameterResolution.resolveStringOptional("propertyNameLine", propertyNameLine, context); String propertyNameFileValue = DataFlowParameterResolution.resolveStringOptional("propertyNameFile", propertyNameFile, context); return new FileSourceLineUnformatted(this, context, adapterInputSourceValue, fileName, propertyNameLineValue, propertyNameFileValue); } else { throw new IllegalArgumentException("Unrecognized file format '" + formatValue + "'"); } }