/** * Generates a PayloadOrAttributeElement object from the given Siddhi Element object * @param element Siddhi Element object * @return PayloadOrAttributeElement object */ private PayloadOrAttributeElement generatePayloadOrAttributesElement(Element element) { PayloadOrAttributeElement payloadOrAttributeElement = new PayloadOrAttributeElement(); payloadOrAttributeElement.key = element.getKey(); payloadOrAttributeElement.value = element.getValue(); return payloadOrAttributeElement; }
public StoreConfig generateStoreConfig(Annotation storeAnnotation) throws DesignGenerationException { String type = null; Map<String, String> options = new HashMap<>(); for (Element element : storeAnnotation.getElements()) { if (element.getKey().equalsIgnoreCase("TYPE")) { type = element.getValue(); } else { options.put(element.getKey(), element.getValue()); } } if (type == null) { throw new DesignGenerationException("Can not find type for the Store"); } StoreConfig storeConfig = new StoreConfig(type, options); preserveAndBindCodeSegment(storeAnnotation, storeConfig); return storeConfig; } }
if (annotation.getName().equalsIgnoreCase(Constants.KAFKA_SOURCE)) { for (Element sourceElement : annotation.getElements()) { if (sourceElement.getKey().equalsIgnoreCase(Constants.KAFKA_SOURCE_TOPIC_LIST)) { sourceList.add(sourceElement.getValue()); if (sinkElement.getKey().equalsIgnoreCase(Constants.KAFKA_SINK_TOPIC)) { sinkList.add(sinkElement.getValue());
List<String> options = new ArrayList<>(); for (Element element : sourceOrSinkAndConnectedElement.getKey().getElements()) { if (element.getKey().equalsIgnoreCase(TYPE)) { type = element.getValue(); } else { options.add(element.toString()); if (element.getKey().equalsIgnoreCase(SINK_ID) || element.getKey().equalsIgnoreCase(SOURCE_ID)) { correlationId = element.getValue();
/** * Generates config for a Mapper * @param mapAnnotation Siddhi annotation that contains details of a Siddhi Mapper * @return MapperConfig object * @throws DesignGenerationException Error while generating MapperConfig */ private MapperConfig generateMapperConfig(Annotation mapAnnotation) throws DesignGenerationException { String type = null; List<String> options = new ArrayList<>(); for (Element element : mapAnnotation.getElements()) { if (element.getKey().equalsIgnoreCase(TYPE)) { type = element.getValue(); } else { options.add(element.toString()); } } if (type == null) { throw new DesignGenerationException("Unable to find 'type' of the mapper"); } MapperPayloadOrAttribute payloadOrAttribute = null; if (!mapAnnotation.getAnnotations().isEmpty()) { payloadOrAttribute = generateMapperPayloadOrAttributes(mapAnnotation.getAnnotations().get(0)); } MapperConfig mapperConfig = new MapperConfig(type, options, payloadOrAttribute); preserveAndBindCodeSegment(mapAnnotation, mapperConfig); return mapperConfig; }
String elementKey = element.getKey(); try { if ("maxIdle".equalsIgnoreCase(elementKey)) {