bump the version
[dmaap/messagerouter/msgrtr.git] / src / main / java / com / att / dmf / mr / service / impl / TransactionServiceImpl.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.service.impl;
23
24 import java.io.IOException;
25
26 import org.springframework.stereotype.Service;
27
28 import com.att.aft.dme2.internal.jettison.json.JSONException;
29 import com.att.dmf.mr.beans.DMaaPContext;
30 import com.att.dmf.mr.service.TransactionService;
31 import com.att.dmf.mr.transaction.TransactionObj;
32 import com.att.nsa.configs.ConfigDbException;
33
34 /**
35  * Once the transaction rest gateway will be using that time it will provide all
36  * the transaction details like fetching all the transactional objects or get
37  * any particular transaction object details
38  * 
39  * @author nilanjana.maity
40  *
41  */
42 @Service
43 public class TransactionServiceImpl implements TransactionService {
44
45         @Override
46         public void checkTransaction(TransactionObj trnObj) {
47                 /* Need to implement the method */
48         }
49
50         @Override
51         public void getAllTransactionObjs(DMaaPContext dmaapContext)
52                         throws ConfigDbException, IOException {
53
54                 /*
55                 
56                  * 
57                  * LOG.info("configReader : "+configReader.toString());
58                  * 
59                  * final JSONObject result = new JSONObject (); final JSONArray
60                  * transactionIds = new JSONArray (); result.put ( "transactionIds",
61                  * transactionIds );
62                  * 
63                  * DMaaPTransactionObjDB<DMaaPTransactionObj> transDb =
64                  * configReader.getfTranDb();
65                  * 
66                  * for (String transactionId : transDb.loadAllTransactionObjs()) {
67                  * transactionIds.put (transactionId); } LOG.info(
68                  * "========== TransactionServiceImpl: getAllTransactionObjs: Transaction objects are : "
69                  * + transactionIds.toString()+"===========");
70                  * DMaaPResponseBuilder.respondOk(dmaapContext, result);
71                  */
72         }
73
74         @Override
75         public void getTransactionObj(DMaaPContext dmaapContext,
76                         String transactionId) throws ConfigDbException, JSONException,
77                         IOException {
78
79                 /*
80                  
81                  * 
82                  * ConfigurationReader configReader = dmaapContext.getConfigReader();
83                  * 
84                  * DMaaPTransactionObj trnObj;
85                  * 
86                  * trnObj = configReader.getfTranDb().loadTransactionObj(transactionId);
87                  * 
88                  * 
89                  * if (null != trnObj) { trnObj.serialize(); JSONObject result =
90                  * trnObj.asJsonObject(); DMaaPResponseBuilder.respondOk(dmaapContext,
91                  * result);
92                  * LOG.info("========== TransactionServiceImpl: getTransactionObj : "+
93                  * result.toString()+"==========="); return; }
94                  * 
95                  * } LOG.info(
96                  * "========== TransactionServiceImpl: getTransactionObj: Error : Transaction object does not exist. "
97                  * +"===========");
98                  */
99         }
100 }