2dde5e1eeb1943fb536094154b99f0a0785cd0dc
[dcaegen2/analytics/tca.git] / dcae-analytics-common / src / main / java / org / openecomp / dcae / apod / analytics / common / service / processor / ProcessorContext.java
1 /*
2  * ===============================LICENSE_START======================================
3  *  dcae-analytics
4  * ================================================================================
5  *    Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  *  Licensed under the Apache License, Version 2.0 (the "License");
8  *  you may not use this file except in compliance with the License.
9  *   You may obtain a copy of the License at
10  *
11  *          http://www.apache.org/licenses/LICENSE-2.0
12  *
13  *  Unless required by applicable law or agreed to in writing, software
14  *  distributed under the License is distributed on an "AS IS" BASIS,
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *  See the License for the specific language governing permissions and
17  *  limitations under the License.
18  *  ============================LICENSE_END===========================================
19  */
20
21 package org.openecomp.dcae.apod.analytics.common.service.processor;
22
23 import java.io.Serializable;
24 import java.util.List;
25
26 /**
27  * <p>
28  *     A Processor Context is used a an input and output to a {@link MessageProcessor}
29  *     <br>
30  *     DCAE Analytics sub projects should extend this interface and add specific fields
31  *     required for input and output
32  * </p>
33  *
34  * @author Rajiv Singla . Creation Date: 11/7/2016.
35  */
36 public interface ProcessorContext extends Serializable {
37
38     /**
39      * Returns Processor Context message that will be processed by Chain of Processors
40      *
41      * @return message that need to be processed by processors
42      */
43     String getMessage();
44
45     /**
46      * Processing Context flag which determines if Processing can continue in a processing
47      * chain
48      *
49      * @return true if ok to continue processing normally
50      */
51     boolean canProcessingContinue();
52
53
54     /**
55      * Sets new value for ProcessingContinue flag which will cause early termination of processing in chain if
56      * set to false
57      *
58      * @param canProcessingContinue set new value for canProcessing Continue flag
59      */
60     void setProcessingContinueFlag(boolean canProcessingContinue);
61
62
63     /**
64      * Provides a List of previous processors which have completed processing
65      *
66      * @return list of previous processors
67      */
68     List<? super MessageProcessor<? extends ProcessorContext>> getMessageProcessors();
69
70 }