import org.openecomp.dcae.apod.analytics.common.service.processor.MessageProcessor;
import org.openecomp.dcae.apod.analytics.common.service.processor.ProcessorContext;
import org.openecomp.dcae.apod.analytics.common.utils.PersistenceUtils;
-import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.MetricsPerFunctionalRole;
+import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.MetricsPerEventName;
import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.Threshold;
import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFJsonProcessor;
import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFPolicyDomainFilter;
-import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFPolicyFunctionalRoleFilter;
+import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFPolicyEventNameFilter;
import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFPolicyThresholdsProcessor;
import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFProcessorContext;
import org.openecomp.dcae.apod.analytics.tca.utils.TCAUtils;
final String vesMessage = StringEscapeUtils.unescapeJson(processorContext.getMessage());
// Find Functional Role and domain
- final Pair<String, String> domainAndFunctionalRole = TCAUtils.getDomainAndFunctionalRole(processorContext);
- final String domain = domainAndFunctionalRole.getLeft();
- final String functionalRole = domainAndFunctionalRole.getRight();
+ final Pair<String, String> domainAndEventName = TCAUtils.getDomainAndEventName(processorContext);
+ final String domain = domainAndEventName.getLeft();
+ final String eventName = domainAndEventName.getRight();
final TCAMessageStatusEntity tcaMessageStatusEntity = new TCAMessageStatusEntity(currentTS,
- instanceId, calculatorMessageType.name(), vesMessage, domain, functionalRole);
+ instanceId, calculatorMessageType.name(), vesMessage, domain, eventName);
// add threshold violation fields
addViolatedThreshold(tcaMessageStatusEntity, processorContext);
public static TCAMessageStatusEntity addViolatedThreshold(final TCAMessageStatusEntity tcaMessageStatusEntity,
final TCACEFProcessorContext processorContext) {
- final MetricsPerFunctionalRole metricsPerFunctionalRole = processorContext.getMetricsPerFunctionalRole();
+ final MetricsPerEventName metricsPerEventName = processorContext.getMetricsPerEventName();
- if (metricsPerFunctionalRole != null
- && metricsPerFunctionalRole.getThresholds() != null
- && metricsPerFunctionalRole.getThresholds().get(0) != null) {
+ if (metricsPerEventName != null
+ && metricsPerEventName.getThresholds() != null
+ && metricsPerEventName.getThresholds().get(0) != null) {
- final Threshold threshold = metricsPerFunctionalRole.getThresholds().get(0);
+ final Threshold threshold = metricsPerEventName.getThresholds().get(0);
tcaMessageStatusEntity.setThresholdPath(threshold.getFieldPath());
tcaMessageStatusEntity.setThresholdSeverity(threshold.getSeverity().name());
tcaMessageStatusEntity.setThresholdDirection(threshold.getDirection().name());
tcaMessageStatusEntity.setDomainFilterMessage(processingMessage);
}
- if (messageProcessor.getClass().equals(TCACEFPolicyFunctionalRoleFilter.class)) {
- tcaMessageStatusEntity.setFunctionalRoleFilterStatus(processingState);
- tcaMessageStatusEntity.setFunctionalRoleFilterMessage(processingMessage);
+ if (messageProcessor.getClass().equals(TCACEFPolicyEventNameFilter.class)) {
+ tcaMessageStatusEntity.setEventNameFilterStatus(processingState);
+ tcaMessageStatusEntity.setEventNameFilterMessage(processingMessage);
}
if (messageProcessor.getClass().equals(TCACEFPolicyThresholdsProcessor.class)) {