public String getCompiledCondition() { String compiledCondition = this.conditionOperands.pop(); for (Map.Entry<String, Object> entry : this.placeholders.entrySet()) { if (entry.getValue() instanceof Constant) { Constant constant = (Constant) entry.getValue(); if (constant.getType().equals(Attribute.Type.STRING)) { compiledCondition = compiledCondition.replaceAll(entry.getKey(), "'" + constant.getValue().toString() + "'"); } else { compiledCondition = compiledCondition.replaceAll(entry.getKey(), constant.getValue().toString()); } this.placeholders.remove(entry.getKey()); } } return compiledCondition; }
public String getCompiledCondition() { String compiledCondition = this.conditionOperands.pop(); for (Map.Entry<String, Object> entry : this.placeholders.entrySet()) { if (entry.getValue() instanceof Constant) { Constant constant = (Constant) entry.getValue(); if (constant.getType().equals(Attribute.Type.STRING)) { compiledCondition = compiledCondition.replaceAll(entry.getKey(), "'" + constant.getValue().toString() + "'"); } else { compiledCondition = compiledCondition.replaceAll(entry.getKey(), constant.getValue().toString()); } this.placeholders.remove(entry.getKey()); } } return compiledCondition; }
/** * Convert the given {@link Event} to Text string. * * @param event Event object * @return the constructed TEXT string */ private Object constructDefaultMapping(Event event, boolean isEventGroup) { StringBuilder eventText = new StringBuilder(); Object[] data = event.getData(); for (int i = 0; i < data.length; i++) { Object attributeValue = data[i]; Attribute attribute = attributeList.get(i); if ((attributeValue != null) && attribute.getType().equals(Attribute.Type.STRING)) { eventText.append(attribute.getName()).append(EVENT_ATTRIBUTE_VALUE_SEPARATOR) .append(STRING_ENCLOSING_ELEMENT).append(attributeValue.toString()) .append(STRING_ENCLOSING_ELEMENT).append(EVENT_ATTRIBUTE_SEPARATOR).append(endOfLine); } else { eventText.append(attribute.getName()).append(EVENT_ATTRIBUTE_VALUE_SEPARATOR) .append(attributeValue).append(EVENT_ATTRIBUTE_SEPARATOR).append(endOfLine); } } int idx = eventText.lastIndexOf(EVENT_ATTRIBUTE_SEPARATOR); if (!isEventGroup) { eventText.delete(idx, idx + (EVENT_ATTRIBUTE_SEPARATOR + endOfLine).length()); } else { eventText.delete(idx, idx + EVENT_ATTRIBUTE_SEPARATOR.length()); } return eventText.toString(); } }
OMElement element = (OMElement) elementObj; if (element.getFirstElement() != null) { if (attributeType.equals(Attribute.Type.STRING)) { data[attributeMapping.getPosition()] = element.toString(); } else {
if (attribute.getType().equals(Attribute.Type.INT)) { columnTypes.append(elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_INTEGER)); } else if (attribute.getType().equals(Attribute.Type.LONG)) { columnTypes.append(elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_LONG)); } else if (attribute.getType().equals(Attribute.Type.FLOAT)) { columnTypes.append(elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_FLOAT)); } else if (attribute.getType().equals(Attribute.Type.DOUBLE)) { columnTypes.append(elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_DOUBLE)); } else if (attribute.getType().equals(Attribute.Type.STRING)) { columnTypes.append(elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_STRING)); } else if (attribute.getType().equals(Attribute.Type.BOOL)) { columnTypes.append(elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_BOOL));
correlationDataPositions.add(i); } else if (attributeName.startsWith(ARBITRARY_DATA_PREFIX)) { if (attributeType.equals(Attribute.Type.STRING)) { arbitraryDataPositions.add( new AttributePosition(attributeName.replace(ARBITRARY_DATA_PREFIX, ""), i));
correlationDataList.add(i); } else if (attributeName.startsWith(ARBITRARY_DATA_PREFIX)) { if (attributeType.equals(Attribute.Type.STRING)) { arbitraryDataList.add( new AttributePosition(attributeName.replace(ARBITRARY_DATA_PREFIX, ""), i));
try { Object dataValue = null; if (attribute.getType().equals(Attribute.Type.STRING)) { dataValue = eventRecords.get(j); } else {
if (Type.DOUBLE.equals(attrType)) { firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.INT.equals(attrType)) { firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.LONG.equals(attrType)) { firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.FLOAT.equals(attrType)) { firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
if (Type.DOUBLE.equals(subjectedAttrType)) { firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.INT.equals(subjectedAttrType)) { firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.LONG.equals(subjectedAttrType)) { firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.FLOAT.equals(subjectedAttrType)) { firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
if (Type.DOUBLE.equals(attrType)) { firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.INT.equals(attrType)) { firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.LONG.equals(attrType)) { firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.FLOAT.equals(attrType)) { firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
if (Type.DOUBLE.equals(subjectedAttrType)) { firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.INT.equals(subjectedAttrType)) { firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.LONG.equals(subjectedAttrType)) { firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex]; } else if (Type.FLOAT.equals(subjectedAttrType)) { firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex]; lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
try { Object dataValue = null; if (type.equals(Attribute.Type.STRING)) { dataValue = eventRecords.get(position); } else {
Object parameter = entry.getValue(); Attribute variable = (Attribute) parameter; if (variable.getType().equals(Attribute.Type.STRING)) { compiledQuery = compiledQuery.replaceAll(entry.getKey(), "\"" + conditionParameterMap.get(variable.getName()).toString() + "\"");