e2c1322715cb5de9f75068a9eca0e8469973cbf7
[dcaegen2/analytics/tca.git] / dcae-analytics-common / src / main / java / org / openecomp / dcae / apod / analytics / common / service / processor / ProcessorContext.java
1 /*\r
2  * ===============================LICENSE_START======================================\r
3  *  dcae-analytics\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
10  *\r
11  *          http://www.apache.org/licenses/LICENSE-2.0\r
12  *\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
19  */\r
20 \r
21 package org.openecomp.dcae.apod.analytics.common.service.processor;\r
22 \r
23 import java.io.Serializable;\r
24 import java.util.List;\r
25 \r
26 /**\r
27  * <p>\r
28  *     A Processor Context is used a an input and output to a {@link MessageProcessor}\r
29  *     <br>\r
30  *     DCAE Analytics sub projects should extend this interface and add specific fields\r
31  *     required for input and output\r
32  * </p>\r
33  *\r
34  * @author Rajiv Singla . Creation Date: 11/7/2016.\r
35  */\r
36 public interface ProcessorContext extends Serializable {\r
37 \r
38     /**\r
39      * Returns Processor Context message that will be processed by Chain of Processors\r
40      *\r
41      * @return message that need to be processed by processors\r
42      */\r
43     String getMessage();\r
44 \r
45     /**\r
46      * Processing Context flag which determines if Processing can continue in a processing\r
47      * chain\r
48      *\r
49      * @return true if ok to continue processing normally\r
50      */\r
51     boolean canProcessingContinue();\r
52 \r
53 \r
54     /**\r
55      * Sets new value for ProcessingContinue flag which will cause early termination of processing in chain if\r
56      * set to false\r
57      *\r
58      * @param canProcessingContinue set new value for canProcessing Continue flag\r
59      */\r
60     void setProcessingContinueFlag(boolean canProcessingContinue);\r
61 \r
62 \r
63     /**\r
64      * Provides a List of previous processors which have completed processing\r
65      *\r
66      * @return list of previous processors\r
67      */\r
68     List<? super MessageProcessor<? extends ProcessorContext>> getMessageProcessors();\r
69 \r
70 }\r