* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
- *
+*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- *
+ *
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*
*******************************************************************************/
import org.springframework.stereotype.Component;
import com.att.aft.dme2.internal.jettison.json.JSONException;
-import com.att.nsa.cambria.CambriaApiException;
-import com.att.nsa.cambria.beans.DMaaPContext;
-import com.att.nsa.cambria.exception.DMaaPResponseCode;
-import com.att.nsa.cambria.exception.ErrorResponse;
-import com.att.nsa.cambria.service.TransactionService;
-import com.att.nsa.cambria.utils.ConfigurationReader;
+import com.att.dmf.mr.CambriaApiException;
+import com.att.dmf.mr.beans.DMaaPContext;
+import com.att.dmf.mr.exception.DMaaPResponseCode;
+import com.att.dmf.mr.exception.ErrorResponse;
+import com.att.dmf.mr.service.TransactionService;
+import com.att.dmf.mr.utils.ConfigurationReader;
import com.att.nsa.configs.ConfigDbException;
/**
- * This class is a CXF REST service which acts as gateway for DMaaP Transaction
- * Ids.
- *
- * @author author
+ * This class is a CXF REST service
+ * which acts as gateway for DMaaP
+ * Transaction Ids.
+ * @author rajashree.khare
*
*/
@Component
@Autowired
private TransactionService transactionService;
- private DMaaPContext dmaapContext = new DMaaPContext();
-
/**
*
* Returns a list of all the existing Transaction Ids
- *
- * @throws CambriaApiException
+ * @throws CambriaApiException
*
* @throws IOException
* @exception ConfigDbException
LOGGER.info("Returning list of all transactions.");
} catch (ConfigDbException | IOException e) {
- LOGGER.error("Error while retrieving list of all transactions: " + e.getMessage(), e);
- ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_EXPECTATION_FAILED,
- DMaaPResponseCode.RETRIEVE_TRANSACTIONS.getResponseCode(),
- "Error while retrieving list of all transactions:" + e.getMessage());
+ LOGGER.error("Error while retrieving list of all transactions: "
+ + e.getMessage(), e);
+ ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_EXPECTATION_FAILED,
+ DMaaPResponseCode.RETRIEVE_TRANSACTIONS.getResponseCode(),
+ "Error while retrieving list of all transactions:"+e.getMessage());
LOGGER.info(errRes.toString());
throw new CambriaApiException(errRes);
}
*
* @param transactionId
* - id of transaction
- * @throws CambriaApiException
+ * @throws CambriaApiException
* @throws IOException
* @exception ConfigDbException
* @exception IOException
*/
@GET
@Path("/{transactionId}")
- public void getTransactionObj(@PathParam("transactionId") String transactionId) throws CambriaApiException {
+ public void getTransactionObj(
+ @PathParam("transactionId") String transactionId) throws CambriaApiException {
LOGGER.info("Fetching details of Transaction ID : " + transactionId);
try {
- transactionService.getTransactionObj(getDmaapContext(), transactionId);
+ transactionService.getTransactionObj(getDmaapContext(),
+ transactionId);
} catch (ConfigDbException | JSONException | IOException e) {
- LOGGER.error("Error while retrieving transaction details for id: " + transactionId, e);
-
- ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_EXPECTATION_FAILED,
- DMaaPResponseCode.RETRIEVE_TRANSACTIONS_DETAILS.getResponseCode(),
- "Error while retrieving transaction details for id: [" + transactionId + "]: " + e.getMessage());
+ LOGGER.error("Error while retrieving transaction details for id: "
+ + transactionId, e);
+
+ ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_EXPECTATION_FAILED,
+ DMaaPResponseCode.RETRIEVE_TRANSACTIONS_DETAILS.getResponseCode(),
+ "Error while retrieving transaction details for id: ["
+ + transactionId + "]: " + e.getMessage());
LOGGER.info(errRes.toString());
throw new CambriaApiException(errRes);
* Object,HttpServlet Object
*
*/
- public DMaaPContext getDmaapContext() {
+ private DMaaPContext getDmaapContext() {
+ DMaaPContext dmaapContext = new DMaaPContext();
dmaapContext.setConfigReader(configReader);
dmaapContext.setRequest(request);
dmaapContext.setResponse(response);