2  * ============LICENSE_START=======================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 
   6  * ================================================================================
 
   7  * Copyright (C) 2017 Amdocs
 
   8  * =============================================================================
 
   9  * Licensed under the Apache License, Version 2.0 (the "License");
 
  10  * you may not use this file except in compliance with the License.
 
  11  * You may obtain a copy of the License at
 
  13  *      http://www.apache.org/licenses/LICENSE-2.0
 
  15  * Unless required by applicable law or agreed to in writing, software
 
  16  * distributed under the License is distributed on an "AS IS" BASIS,
 
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  18  * See the License for the specific language governing permissions and
 
  19  * limitations under the License.
 
  21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
 
  22  * ============LICENSE_END=========================================================
 
  25 package org.onap.appc.design.dbervices;
 
  27 import org.onap.appc.design.services.util.DesignServiceConstants;
 
  29 import com.att.eelf.configuration.EELFLogger;
 
  30 import com.att.eelf.configuration.EELFManager;
 
  32 public class DbResponseProcessor {
 
  34     private static final EELFLogger log = EELFManager.getInstance().getLogger(DbResponseProcessor.class);
 
  35     public String parseResponse(String dbresposne, String action) throws Exception {
 
  37         log.info("Starting Parsing the response for action : " + action +  "\n data "  + dbresposne );
 
  40         case DesignServiceConstants.GETDESIGNS:
 
  41             response =  getDesignsResponse(dbresposne);
 
  43         case DesignServiceConstants.ADDINCART:
 
  44             response =  getAddInCartResponse(dbresposne);
 
  46         case DesignServiceConstants.GETARTIFACTREFERENCE:
 
  47             response=  getArtifactReferenceResponse(dbresposne);
 
  49         case DesignServiceConstants.GETARTIFACT:
 
  50             response=  getArtifactResponse(dbresposne);
 
  52         case DesignServiceConstants.GETGUIREFERENCE:
 
  53             response=  getGuiReferenceResponse(dbresposne);
 
  55         case DesignServiceConstants.GETSTATUS:
 
  56             response=  getStatusResponse(dbresposne);
 
  58         case DesignServiceConstants.UPLOADARTIFACT:
 
  59             response=  getsetStatusResponse(dbresposne);
 
  61         case DesignServiceConstants.SETPROTOCOLREFERENCE:
 
  62             response=  getsetStatusResponse(dbresposne);
 
  64         case DesignServiceConstants.SETINCART:
 
  65             response=  getsetStatusResponse(dbresposne);
 
  68             log.error("Action " + action + " Not Supported by response Parser");
 
  69             throw new Exception(" Action " + action + " not found while processing request ");            
 
  76     private String getArtifactResponse(String dbresposne) {
 
  77         // TODO Auto-generated method stub
 
  81     private String getsetStatusResponse(String dbresposne) {
 
  82         // TODO Auto-generated method stub
 
  86     private String getStatusResponse(String dbresposne) {
 
  87         log.info("Returning reposne from Response Parser " + dbresposne);
 
  91     private String getGuiReferenceResponse(String dbresposne) {
 
  92         // TODO Auto-generated method stub
 
  96     private String getArtifactReferenceResponse(String dbresposne) {
 
  97         // TODO Auto-generated method stub
 
 101     private String getAddInCartResponse(String dbresposne) {
 
 102         // TODO Auto-generated method stub
 
 106     private String getDesignsResponse(String dbresposne) {