2 * ===============================LICENSE_START======================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============================LICENSE_END===========================================
\r
21 package org.openecomp.dcae.apod.analytics.common.service.processor;
\r
23 import com.google.common.base.Objects;
\r
25 import java.util.LinkedList;
\r
26 import java.util.List;
\r
30 * An abstract implementation for {@link ProcessorContext} which other DCAE Analytics Modules
\r
31 * can extend to add module specific functionality
\r
34 * @author Rajiv Singla . Creation Date: 11/7/2016.
\r
36 public abstract class AbstractProcessorContext implements ProcessorContext {
\r
38 private final String message;
\r
39 private List<? super MessageProcessor<? extends ProcessorContext>> messageProcessors;
\r
40 private boolean canProcessingContinue;
\r
42 public AbstractProcessorContext(final String message,
\r
43 boolean canProcessingContinue) {
\r
44 this.message = message;
\r
45 this.canProcessingContinue = canProcessingContinue;
\r
46 this.messageProcessors = new LinkedList<>();
\r
50 * Returns JSON String of incoming CEF Message that needs to be processed
\r
52 * @return incoming CEF message that needs to be processed
\r
55 public String getMessage() {
\r
60 * Sets if it is ok to continue processing normally
\r
62 * @return boolean which determines if it is ok to continue processing normally
\r
65 public boolean canProcessingContinue() {
\r
66 return canProcessingContinue;
\r
71 * Set if it is ok to continue processing normally
\r
73 * @param canProcessingContinue sets boolean which determines if it is ok to continue processing normally
\r
76 public void setProcessingContinueFlag(boolean canProcessingContinue) {
\r
77 this.canProcessingContinue = canProcessingContinue;
\r
81 * Provides List of message processors which were used in processing CEF message
\r
83 * @return List of message processors which were used in processing CEF message
\r
86 public List<? super MessageProcessor<? extends ProcessorContext>> getMessageProcessors() {
\r
87 return messageProcessors;
\r
91 public String toString() {
\r
92 return Objects.toStringHelper(this)
\r
93 .add("canProcessingContinue", canProcessingContinue)
\r