use of io.siddhi.query.api.exception.SiddhiAppValidationException in project siddhi by wso2.
the class SiddhiApp method defineStream.
public SiddhiApp defineStream(StreamDefinition streamDefinition) {
if (streamDefinition == null) {
throw new SiddhiAppValidationException("Stream Definition should not be null");
} else if (streamDefinition.getId() == null) {
throw new SiddhiAppValidationException("Stream Id should not be null for Stream Definition", streamDefinition.getQueryContextStartIndex(), streamDefinition.getQueryContextEndIndex());
}
checkDuplicateDefinition(streamDefinition);
this.streamDefinitionMap.put(streamDefinition.getId(), streamDefinition);
return this;
}
use of io.siddhi.query.api.exception.SiddhiAppValidationException in project siddhi by wso2.
the class Partition method addQuery.
public Partition addQuery(Query query) {
if (query == null) {
throw new SiddhiAppValidationException("Query should not be null");
}
String name = null;
Element element = AnnotationHelper.getAnnotationElement(SiddhiConstants.ANNOTATION_INFO, SiddhiConstants.ANNOTATION_ELEMENT_NAME, query.getAnnotations());
if (element != null) {
name = element.getValue();
}
if (name != null && queryNameList.contains(name)) {
throw new SiddhiAppValidationException("Cannot add Query as another Execution Element already uses " + "its name=" + name + " within the same Partition", element.getQueryContextStartIndex(), element.getQueryContextEndIndex());
}
queryNameList.add(name);
this.queryList.add(query);
return this;
}
Aggregations