7f5dd3a1f7336d0e9f764044d6988c94888cd66e
[dmaap/messagerouter/msgrtr.git] / src / main / java / com / att / dmf / mr / transaction / DMaaPTransactionObj.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  org.onap.dmaap
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  *        http://www.apache.org/licenses/LICENSE-2.0
11 *  
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  *  
19  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  *  
21  *******************************************************************************/
22 package com.att.dmf.mr.transaction;
23
24 import org.json.JSONObject;
25 /**
26  * This is an interface for DMaaP transactional logging object class.
27  * @author nilanjana.maity
28  *
29  */
30 public interface DMaaPTransactionObj {
31         /**
32          * This will get the transaction id
33          * @return id transactionId
34          */
35         String getId();
36         /**
37          * This will set the transaction id
38          * @param id transactionId
39          */
40         void setId(String id);
41         /**
42          * This will sync the transaction object mapping
43          * @return String or null
44          */
45         String serialize();
46         /**
47          * get the total message count once the publisher published
48          * @return long totalMessageCount
49          */
50         long getTotalMessageCount();
51         /**
52          * set the total message count once the publisher published
53          * @param totalMessageCount
54          */
55         void setTotalMessageCount(long totalMessageCount);
56         /**
57          * get the total Success Message Count once the publisher published
58          * @return getSuccessMessageCount
59          */
60         long getSuccessMessageCount();
61         /**
62          * set the total Success Message Count once the publisher published
63          * @param successMessageCount
64          */
65         void setSuccessMessageCount(long successMessageCount);
66         /**
67          * get the failure Message Count once the publisher published
68          * @return failureMessageCount
69          */
70         long getFailureMessageCount();
71         /**
72          * set the failure Message Count once the publisher published
73          * @param failureMessageCount
74          */
75         void setFailureMessageCount(long failureMessageCount);
76
77         /**
78          * wrapping the data into json object
79          * @return JSONObject
80          */
81         JSONObject asJsonObject();
82
83 }