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.openecomp.appc.artifact.handler.dbservices;
27 import java.sql.SQLException;
28 import java.util.HashMap;
30 import org.openecomp.appc.artifact.handler.utils.AsdcArtifactHandlerConstants;
31 import org.openecomp.sdnc.sli.SvcLogicContext;
32 import org.openecomp.sdnc.sli.SvcLogicException;
33 import org.openecomp.sdnc.sli.SvcLogicResource;
34 import org.openecomp.sdnc.sli.SvcLogicResource.QueryStatus;
35 import org.openecomp.sdnc.sli.resource.sql.SqlResource;
37 import com.att.eelf.configuration.EELFLogger;
38 import com.att.eelf.configuration.EELFManager;
40 public class DBService {
42 private static final EELFLogger log = EELFManager.getInstance().getLogger(DBService.class);
43 private SvcLogicResource serviceLogic;
44 private static DBService dgGeneralDBService = null;
45 public static DBService initialise() {
46 if (dgGeneralDBService == null) {
47 dgGeneralDBService = new DBService();
49 return dgGeneralDBService;
52 if (serviceLogic == null) {
53 serviceLogic = new SqlResource();
57 public String getInternalVersionNumber(SvcLogicContext ctx, String artifactName, String prefix) throws SvcLogicException {
58 String fn = "DBService.getInternalVersionNumber";
59 QueryStatus status = null;
60 String artifactInternalVersion = null;
61 if (serviceLogic != null && ctx != null) {
62 String key = "select max(internal_version) as maximum from ASDC_ARTIFACTS WHERE ARTIFACT_NAME = '" + artifactName + "'";
63 log.info("Getting internal Versoin :" + key);
64 status = serviceLogic.query("SQL", false, null, key, prefix, null, ctx);
65 if(status.toString().equals("FAILURE"))
66 throw new SvcLogicException("Error - getting internal Artifact Number");
67 artifactInternalVersion = ctx.getAttribute("maximum");
68 log.info("Internal Version received as : " + artifactInternalVersion);
69 log.info("Internal Version received as1 : " + ctx.getAttribute("max(internal_version)"));
70 log.info("Internal Version received as1 : " + ctx.getAttribute("max"));
71 log.info("Internal Version received as1 : " + ctx.getAttribute("internal_version"));
72 log.info("Internal Version received as1 : " + ctx.getAttributeKeySet().toString());
74 return artifactInternalVersion;
76 public String getArtifactID(SvcLogicContext ctx, String artifactName) throws SvcLogicException {
77 String fn = "DBService.getArtifactID";
78 QueryStatus status = null;
79 String artifactID = null;
80 if (serviceLogic != null && ctx != null) {
81 String key = "select max(ASDC_ARTIFACTS_ID) as id from ASDC_ARTIFACTS WHERE ARTIFACT_NAME = '" + artifactName + "'";
82 log.info("Getting Artifact ID String :" + key);
83 status = serviceLogic.query("SQL", false, null, key, null, null, ctx);
84 if(status.toString().equals("FAILURE"))
85 throw new SvcLogicException("Error - getting Artifact ID from database");
86 artifactID = ctx.getAttribute("id");
87 log.info("ASDC_ARTIFACTS_ID received as : " + ctx.getAttribute("id"));
91 public QueryStatus saveArtifacts(SvcLogicContext ctx, int intversion) throws SvcLogicException {
92 String fn = "DBService.saveArtifacts";
93 QueryStatus status = null;
94 if (serviceLogic != null && ctx != null) {
95 String key = "INSERT INTO ASDC_ARTIFACTS " +
96 "SET SERVICE_UUID = $service-uuid , " +
97 " DISTRIBUTION_ID = $distribution-id ," +
98 " SERVICE_NAME = $service-name ," +
99 " SERVICE_DESCRIPTION = $service-description ," +
100 " RESOURCE_UUID = $resource-uuid ," +
101 " RESOURCE_INSTANCE_NAME = $resource-instance-name ," +
102 " RESOURCE_NAME = $resource-name ," +
103 " RESOURCE_VERSION = $resource-version ," +
104 " RESOURCE_TYPE = $resource-type ," +
105 " ARTIFACT_UUID = $artifact-uuid ," +
106 " ARTIFACT_TYPE = $artifact-type ," +
107 " ARTIFACT_VERSION = $artifact-version ," +
108 " ARTIFACT_DESCRIPTION = $artifact-description ," +
109 " INTERNAL_VERSION = " + intversion + "," +
110 " ARTIFACT_NAME = $artifact-name ," +
111 " ARTIFACT_CONTENT = $artifact-contents " ;
113 status = serviceLogic.save("SQL", false, false, key, null, null, ctx);
114 if(status.toString().equals("FAILURE"))
115 throw new SvcLogicException("Error While processing storing Artifact: " +ctx.getAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME));
120 public QueryStatus logData(SvcLogicContext ctx, String prefix) throws SvcLogicException {
121 String fn = "DBService.saveReferenceData";
122 QueryStatus status = null;
123 if (serviceLogic != null && ctx != null) {
124 String key = "INSERT INTO CONFIG_TRANSACTION_LOG " + " SET request_id = $request-id , "
125 + " message_type = $log-message-type , "
126 + " message = $log-message ;";
127 status = serviceLogic.save("SQL", false, false, key, null, prefix, ctx);
128 if(status.toString().equals("FAILURE"))
129 throw new SvcLogicException("Error while loging data");
135 public void processConfigureActionDg(SvcLogicContext context, boolean isUpdate) {
136 String fn = "DBService.processConfigureActionDg";
137 log.info("Update Parameter for ASDC Reference " + isUpdate );
139 QueryStatus status = null;
144 public void processAsdcReferences(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
145 String fn = "DBService.processAsdcReferences";
147 QueryStatus status = null;
149 if (isUpdate && AsdcArtifactHandlerConstants.FILE_CATEGORY.equals(AsdcArtifactHandlerConstants.CAPABILITY)) {
150 key = "update " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE + " set ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME +
151 " where VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE +
152 " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY +
153 " and ACTION = null";
156 key = "update " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE + " set ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME +
157 " where VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE +
158 " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY +
159 " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION ;
162 if (AsdcArtifactHandlerConstants.FILE_CATEGORY.equals(AsdcArtifactHandlerConstants.CAPABILITY)) {
163 key = "insert into " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE +
164 " set VNFC_TYPE = null " +
165 " , FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY +
166 " , VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE +
167 " , ACTION = null " +
168 " , ARTIFACT_TYPE = null " +
169 " , ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME ;
172 key = "insert into " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE +
173 " set VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE +
174 " , FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY +
175 " , VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE +
176 " , ACTION = $" + AsdcArtifactHandlerConstants.ACTION +
177 " , ARTIFACT_TYPE = $" + AsdcArtifactHandlerConstants.ARTIFACT_TYPE +
178 " , ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME ;
181 if (serviceLogic != null && context != null) {
182 log.info("Insert Key: " + key);
183 status = serviceLogic.save("SQL", false, false, key, null, null, context);
184 if(status.toString().equals("FAILURE"))
185 throw new SvcLogicException("Error While processing asdc_reference table ");
189 public boolean isArtifactUpdateRequired(SvcLogicContext context, String db) throws SvcLogicException, SQLException {
190 String fn = "DBService.isArtifactUpdateRequired";
191 log.info("Checking if Update required for this data" );
194 log.info("ACTION=" + context.getAttribute(AsdcArtifactHandlerConstants.ACTION));
195 log.info("VNFC_TYPE=" + context.getAttribute(AsdcArtifactHandlerConstants.VNFC_TYPE));
196 log.info("VNFC_INSTANCE=" + context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE));
197 log.info("VM_INSTANCE=" + context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE));
198 log.info("VNF_TYPE=" + context.getAttribute(AsdcArtifactHandlerConstants.VNF_TYPE));
199 String whereClause = "";
201 QueryStatus status = null;
202 /* if(context.getAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME) !=null &&
203 context.getAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME).toLowerCase().startsWith(AsdcArtifactHandlerConstants.PD))
204 whereClause = " where artifact_name = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME
205 + " and vnf_type = 'DummyVnf' ";
207 whereClause = " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE;
209 if (db !=null && db.equals(AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE) &&
210 context.getAttribute(AsdcArtifactHandlerConstants.FILE_CATEGORY).equals(AsdcArtifactHandlerConstants.CAPABILITY) &&
211 context.getAttribute(AsdcArtifactHandlerConstants.ACTION) ==null) {
212 whereClause = whereClause + " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY ;
215 else if(db !=null && db.equals(AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE)) {
216 whereClause = whereClause + " and VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE
217 + " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY
218 + " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION;
221 else if(db.equals(AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE)) {
222 whereClause = " where PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL;
224 else if(db.equals(AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG)) {
225 whereClause = whereClause + " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION;
227 else if(db.equals(AsdcArtifactHandlerConstants.DB_VNFC_REFERENCE)){
228 int vm_instance = -1 ;
229 if(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE) !=null)
230 vm_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE));
231 int vnfc_instance = -1 ;
232 if(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE) !=null)
233 vnfc_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE));
234 whereClause = whereClause + " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION
235 + " and VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE
236 + " and VNFC_INSTANCE = $" + AsdcArtifactHandlerConstants.VNFC_INSTANCE
237 + " and VM_INSTANCE = $" + AsdcArtifactHandlerConstants.VM_INSTANCE ;
240 if (serviceLogic != null && context != null) {
241 String key = "select COUNT(*) from " + db + whereClause ;
242 log.info("SELECT String : " + key);
243 status = serviceLogic.query("SQL", false, null, key, null, null, context);
244 if(status.toString().equals("FAILURE")){
245 throw new SvcLogicException("Error while reading data from " + db );
247 String count = context.getAttribute("COUNT(*)");
248 log.info("Number of row Returned : " + count + ": " + status + ":");
249 if(count !=null && Integer.parseInt(count) > 0){
250 context.setAttribute(count, null);
259 public void processDeviceInterfaceProtocol(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
260 String fn = "DBService.processDeviceInterfaceProtocol";
261 log.info("Starting DB operation for Device Interface Protocol " + isUpdate );
263 QueryStatus status = null;
265 key = "update " + AsdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL +
266 " set PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL +
267 " , DG_RPC = 'getDeviceRunningConfig' " +
268 " , MODULE = 'APPC' " +
269 " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ;
271 key = "insert into " + AsdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL+
272 " set VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE +
273 " , PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL +
274 " , DG_RPC = 'getDeviceRunningConfig' " +
275 " , MODULE = 'APPC' " ;
277 if (serviceLogic != null && context != null) {
279 status = serviceLogic.save("SQL", false, false, key, null, null, context);
280 if(status.toString().equals("FAILURE"))
281 throw new SvcLogicException("Error While processing DEVICE_INTERFACE_PROTOCOL table ");
286 public void processDeviceAuthentication(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
287 String fn = "DBService.processDeviceAuthentication";
288 log.info(fn + "Starting DB operation for Device Authentication " + isUpdate );
290 QueryStatus status = null;
292 key = "update " + AsdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION +
293 " set USER_NAME = $" + AsdcArtifactHandlerConstants.USER_NAME +
294 " , PASSWORD = 'dummy' " +
295 " , PORT_NUMBER = $" + AsdcArtifactHandlerConstants.PORT_NUMBER +
296 " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ;
298 key = "insert into " + AsdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION+
299 " set VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE +
300 " , USER_NAME = $" + AsdcArtifactHandlerConstants.USER_NAME +
301 " , PASSWORD = 'dummy' " +
302 " , PORT_NUMBER = $" + AsdcArtifactHandlerConstants.PORT_NUMBER;
304 if (serviceLogic != null && context != null) {
305 status = serviceLogic.save("SQL", false, false, key, null, null, context);
306 if(status.toString().equals("FAILURE"))
307 throw new SvcLogicException("Error While processing DEVICE_AUTHENTICATION table ");
311 public void processVnfcReference(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
312 String fn = "DBService.processVnfcReference";
313 log.info(fn + "Starting DB operation for Vnfc Reference " + isUpdate );
315 int vm_instance = -1 ;
316 if(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE) !=null)
317 vm_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE));
318 int vnfc_instance = -1 ;
319 if(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE) !=null)
320 vnfc_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE));
321 QueryStatus status = null;
323 key = "update " + AsdcArtifactHandlerConstants.DB_VNFC_REFERENCE +
324 " set VM_INSTANCE = " + vm_instance +
325 " , VNFC_INSTANCE = " + vnfc_instance +
326 " , VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE +
327 " , VNFC_FUNCTION_CODE = $" + AsdcArtifactHandlerConstants.VNFC_FUNCTION_CODE +
328 " , GROUP_NOTATION_TYPE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_TYPE +
329 " , GROUP_NOTATION_VALUE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_VALUE +
330 " , IPADDRESS_V4_OAM_VIP = $" + AsdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP +
331 " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE +
332 " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION +
333 " and VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE +
334 " and VNFC_INSTANCE = $" + AsdcArtifactHandlerConstants.VNFC_INSTANCE
335 + " and VM_INSTANCE = $" + AsdcArtifactHandlerConstants.VM_INSTANCE ;
337 key = "insert into " + AsdcArtifactHandlerConstants.DB_VNFC_REFERENCE+
338 " set VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE +
339 " , ACTION = $" + AsdcArtifactHandlerConstants.ACTION +
340 " , VM_INSTANCE = $" + AsdcArtifactHandlerConstants.VM_INSTANCE +
341 " , VNFC_INSTANCE = $" + AsdcArtifactHandlerConstants.VNFC_INSTANCE +
342 " , VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE +
343 " , VNFC_FUNCTION_CODE = $" + AsdcArtifactHandlerConstants.VNFC_FUNCTION_CODE +
344 " , GROUP_NOTATION_TYPE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_TYPE +
345 " , IPADDRESS_V4_OAM_VIP = $" + AsdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP +
346 " , GROUP_NOTATION_VALUE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_VALUE ;
348 if (serviceLogic != null && context != null) {
349 status = serviceLogic.save("SQL", false, false, key, null, null, context);
350 if(status.toString().equals("FAILURE"))
351 throw new SvcLogicException("Error While processing VNFC_REFERENCE table ");
355 public void processDownloadDgReference(SvcLogicContext context, boolean isUpdate) throws SvcLogicException, SQLException {
356 String fn = "DBService.processDownloadDgReference";
357 log.info(fn + "Starting DB operation for Download DG Reference " + isUpdate );
359 QueryStatus status = null;
362 key = "update " + AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE +
363 " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE +
364 " where PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL ;
366 key = "insert into " + AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE+
367 " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE +
368 " , PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL ;
370 if (serviceLogic != null && context != null)
371 status = serviceLogic.save("SQL", false, false, key, null, null, context);
372 if(status.toString().equals("FAILURE"))
373 throw new SvcLogicException("Error While processing DOWNLOAD_DG_REFERENCE table ");
375 public void processConfigActionDg(SvcLogicContext context, boolean isUpdate) throws SvcLogicException
377 String fn = "DBService.processConfigActionDg";
378 log.info(fn + "Starting DB operation for Config DG Action " + isUpdate );
380 QueryStatus status = null;
382 if(context.getAttribute(AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE) != null &&
383 context.getAttribute(AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE).length() > 0){
385 key = "update " + AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG +
386 " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE +
387 " where ACTION = $" + AsdcArtifactHandlerConstants.ACTION +
388 " and VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ;
390 key = "insert into " + AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG+
391 " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE +
392 " , ACTION = $" + AsdcArtifactHandlerConstants.ACTION +
393 " , VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ;
395 if (serviceLogic != null && context != null)
396 status = serviceLogic.save("SQL", false, false, key, null, null, context);
397 if(status.toString().equals("FAILURE"))
398 throw new SvcLogicException("Error While processing Configure DG Action table ");
401 log.info("No Update required for Config DG Action");
405 public String getModelDataInformationbyArtifactName(String artifact_name) throws SvcLogicException
407 String fn = "DBService.getVnfData";
409 SvcLogicContext con = new SvcLogicContext();
410 HashMap<String, String> modelData = new HashMap<String, String>();
411 QueryStatus status = null;
412 key = "select VNF_TYPE, VNFC_TYPE, ACTION, FILE_CATEGORY, ARTIFACT_TYPE from ASDC_REFERENCE where ARTIFACT_NAME = " + artifact_name ;
414 if (serviceLogic != null && con != null) {
415 log.info(fn + "select Key: " + key);
416 status = serviceLogic.query("SQL", false, null, key, null, null, con);
417 if(status.toString().equals("FAILURE"))
418 throw new SvcLogicException("Error While processing is ArtifactUpdateRequiredforPD table ");
422 log.info(fn + "Vnf_received :" + con.getAttribute("VNF_TYPE"));
424 return con.getAttribute("VNF_TYPE");
427 public void updateYangContents(SvcLogicContext context, String artifactId, String yangContents) throws SvcLogicException {
428 String fn = "DBService.updateYangContents";
429 log.info(fn + "Starting DB operation for updateYangContents");
431 QueryStatus status = null;
433 key = "update ASDC_ARTIFACTS " +
434 " set ARTIFACT_CONTENT = '" + yangContents + "'" +
435 " where ASDC_ARTIFACTS_ID = " + artifactId ;
437 if (serviceLogic != null && context != null)
438 status = serviceLogic.save("SQL", false, false, key, null, null, context);
439 if(status.toString().equals("FAILURE"))
440 throw new SvcLogicException("Error While processing Configure DG Action table ");
445 public void insertProtocolReference(SvcLogicContext context, String vnfType, String protocol, String action, String action_level,
446 String template) throws SvcLogicException {
447 String fn = "DBService.insertProtocolReference";
448 log.info(fn + "Starting DB operation for insertProtocolReference");
450 QueryStatus status = null;
452 key = "insert into PROTOCOL_REFERENCE (ACTION, VNF_TYPE, PROTOCOL, UPDATED_DATE, TEMPLATE, ACTION_LEVEL)" +
454 "'"+action +"', '"+ vnfType+"', '"+protocol+"', now(),'"+template+"', '"+action_level+"')";
456 if (serviceLogic != null && context != null)
457 status = serviceLogic.save("SQL", false, false, key, null, null, context);
458 if(status.toString().equals("FAILURE"))
459 throw new SvcLogicException("Error While processing insertProtocolReference ");