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.SdcArtifactHandlerConstants;
31 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
33 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
34 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
35 import org.onap.ccsdk.sli.adaptors.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;
46 public static DBService initialise() {
47 if (dgGeneralDBService == null) {
48 dgGeneralDBService = new DBService();
50 return dgGeneralDBService;
54 if (serviceLogic == null) {
55 serviceLogic = new SqlResource();
59 protected DBService(SqlResource svcLogic) {
60 if (serviceLogic == null) {
61 serviceLogic = svcLogic;
65 public String getInternalVersionNumber(SvcLogicContext ctx, String artifactName, String prefix)
66 throws SvcLogicException {
67 String fn = "DBService.getInternalVersionNumber";
68 QueryStatus status = null;
69 String artifactInternalVersion = null;
70 if (serviceLogic != null && ctx != null) {
71 String key = "select max(internal_version) as maximum from ASDC_ARTIFACTS WHERE ARTIFACT_NAME = '"
73 log.info("Getting internal Versoin :" + key);
74 status = serviceLogic.query("SQL", false, null, key, prefix, null, ctx);
75 if (status.toString().equals("FAILURE"))
76 throw new SvcLogicException("Error - getting internal Artifact Number");
77 artifactInternalVersion = ctx.getAttribute("maximum");
78 log.info("Internal Version received as : " + artifactInternalVersion);
79 log.info("Internal Version received as1 : " + ctx.getAttribute("max(internal_version)"));
80 log.info("Internal Version received as1 : " + ctx.getAttribute("max"));
81 log.info("Internal Version received as1 : " + ctx.getAttribute("internal_version"));
82 log.info("Internal Version received as1 : " + ctx.getAttributeKeySet().toString());
84 return artifactInternalVersion;
87 public String getArtifactID(SvcLogicContext ctx, String artifactName) throws SvcLogicException {
88 String fn = "DBService.getArtifactID";
89 QueryStatus status = null;
90 String artifactID = null;
91 if (serviceLogic != null && ctx != null) {
92 String key = "select max(ASDC_ARTIFACTS_ID) as id from ASDC_ARTIFACTS WHERE ARTIFACT_NAME = '"
94 log.info("Getting Artifact ID String :" + key);
95 status = serviceLogic.query("SQL", false, null, key, null, null, ctx);
96 if (status.toString().equals("FAILURE"))
97 throw new SvcLogicException("Error - getting Artifact ID from database");
98 artifactID = ctx.getAttribute("id");
99 log.info("SDC_ARTIFACTS_ID received as : " + ctx.getAttribute("id"));
104 public QueryStatus saveArtifacts(SvcLogicContext ctx, int intversion) throws SvcLogicException {
105 String fn = "DBService.saveArtifacts";
106 QueryStatus status = null;
107 if (serviceLogic != null && ctx != null) {
108 String key = "INSERT INTO ASDC_ARTIFACTS " + "SET SERVICE_UUID = $service-uuid , "
109 + " DISTRIBUTION_ID = $distribution-id ," + " SERVICE_NAME = $service-name ,"
110 + " SERVICE_DESCRIPTION = $service-description ," + " RESOURCE_UUID = $resource-uuid ,"
111 + " RESOURCE_INSTANCE_NAME = $resource-instance-name ," + " RESOURCE_NAME = $resource-name ,"
112 + " RESOURCE_VERSION = $resource-version ," + " RESOURCE_TYPE = $resource-type ,"
113 + " ARTIFACT_UUID = $artifact-uuid ," + " ARTIFACT_TYPE = $artifact-type ,"
114 + " ARTIFACT_VERSION = $artifact-version ," + " ARTIFACT_DESCRIPTION = $artifact-description ,"
115 + " INTERNAL_VERSION = " + intversion + "," + " ARTIFACT_NAME = $artifact-name ,"
116 + " ARTIFACT_CONTENT = $artifact-contents ";
118 status = serviceLogic.save("SQL", false, false, key, null, null, ctx);
119 if (status.toString().equals("FAILURE"))
120 throw new SvcLogicException("Error While processing storing Artifact: "
121 + ctx.getAttribute(SdcArtifactHandlerConstants.ARTIFACT_NAME));
127 public QueryStatus logData(SvcLogicContext ctx, String prefix) throws SvcLogicException {
128 String fn = "DBService.saveReferenceData";
129 QueryStatus status = null;
130 if (serviceLogic != null && ctx != null) {
131 String key = "INSERT INTO CONFIG_TRANSACTION_LOG " + " SET request_id = $request-id , "
132 + " message_type = $log-message-type , " + " message = $log-message ;";
133 status = serviceLogic.save("SQL", false, false, key, null, prefix, ctx);
134 if (status.toString().equals("FAILURE"))
135 throw new SvcLogicException("Error while loging data");
141 public void processConfigureActionDg(SvcLogicContext context, boolean isUpdate) {
142 String fn = "DBService.processConfigureActionDg";
143 log.info("Update Parameter for SDC Reference " + isUpdate);
145 QueryStatus status = null;
150 public void processSdcReferences(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
151 String fn = "DBService.processSdcReferences";
153 QueryStatus status = null;
155 if (isUpdate && SdcArtifactHandlerConstants.FILE_CATEGORY.equals(SdcArtifactHandlerConstants.CAPABILITY)) {
156 key = "update " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set ARTIFACT_NAME = $"
157 + SdcArtifactHandlerConstants.ARTIFACT_NAME + " where VNFC_TYPE = $"
158 + SdcArtifactHandlerConstants.VNFC_TYPE + " and FILE_CATEGORY = $"
159 + SdcArtifactHandlerConstants.FILE_CATEGORY + " and ACTION = null";
161 key = "update " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set ARTIFACT_NAME = $"
162 + SdcArtifactHandlerConstants.ARTIFACT_NAME + " where VNFC_TYPE = $"
163 + SdcArtifactHandlerConstants.VNFC_TYPE + " and FILE_CATEGORY = $"
164 + SdcArtifactHandlerConstants.FILE_CATEGORY + " and ACTION = $"
165 + SdcArtifactHandlerConstants.ACTION;
168 if (SdcArtifactHandlerConstants.FILE_CATEGORY.equals(SdcArtifactHandlerConstants.CAPABILITY)) {
169 key = "insert into " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set VNFC_TYPE = null "
170 + " , FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + " , VNF_TYPE = $"
171 + SdcArtifactHandlerConstants.VNF_TYPE + " , ACTION = null " + " , ARTIFACT_TYPE = null "
172 + " , ARTIFACT_NAME = $" + SdcArtifactHandlerConstants.ARTIFACT_NAME;
174 key = "insert into " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set VNFC_TYPE = $"
175 + SdcArtifactHandlerConstants.VNFC_TYPE + " , FILE_CATEGORY = $"
176 + SdcArtifactHandlerConstants.FILE_CATEGORY + " , VNF_TYPE = $"
177 + SdcArtifactHandlerConstants.VNF_TYPE + " , ACTION = $" + SdcArtifactHandlerConstants.ACTION
178 + " , ARTIFACT_TYPE = $" + SdcArtifactHandlerConstants.ARTIFACT_TYPE + " , ARTIFACT_NAME = $"
179 + SdcArtifactHandlerConstants.ARTIFACT_NAME;
182 if (serviceLogic != null && context != null) {
183 log.info("Insert Key: " + key);
184 status = serviceLogic.save("SQL", false, false, key, null, null, context);
185 if (status.toString().equals("FAILURE"))
186 throw new SvcLogicException("Error While processing sdc_reference table ");
190 public boolean isArtifactUpdateRequired(SvcLogicContext context, String db) throws SvcLogicException, SQLException {
191 String fn = "DBService.isArtifactUpdateRequired";
192 log.info("Checking if Update required for this data");
195 log.info("ACTION=" + context.getAttribute(SdcArtifactHandlerConstants.ACTION));
196 log.info("VNFC_TYPE=" + context.getAttribute(SdcArtifactHandlerConstants.VNFC_TYPE));
197 log.info("VNFC_INSTANCE=" + context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE));
198 log.info("VM_INSTANCE=" + context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE));
199 log.info("VNF_TYPE=" + context.getAttribute(SdcArtifactHandlerConstants.VNF_TYPE));
200 String whereClause = "";
202 QueryStatus status = null;
203 whereClause = " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE;
205 if (db != null && db.equals(SdcArtifactHandlerConstants.DB_SDC_REFERENCE)
206 && context.getAttribute(SdcArtifactHandlerConstants.FILE_CATEGORY)
207 .equals(SdcArtifactHandlerConstants.CAPABILITY)
208 && context.getAttribute(SdcArtifactHandlerConstants.ACTION) == null) {
209 whereClause = whereClause + " and FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY;
212 else if (db != null && db.equals(SdcArtifactHandlerConstants.DB_SDC_REFERENCE)) {
213 whereClause = whereClause + " and VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE
214 + " and FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + " and ACTION = $"
215 + SdcArtifactHandlerConstants.ACTION;
218 else if (db.equals(SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE)) {
219 whereClause = " where PROTOCOL = $" + SdcArtifactHandlerConstants.DEVICE_PROTOCOL;
220 } else if (db.equals(SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG)) {
221 whereClause = whereClause + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION;
222 } else if (db.equals(SdcArtifactHandlerConstants.DB_VNFC_REFERENCE)) {
223 int vm_instance = -1;
224 if (context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE) != null)
225 vm_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE));
226 int vnfc_instance = -1;
227 if (context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE) != null)
228 vnfc_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE));
229 whereClause = whereClause + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION + " and VNFC_TYPE = $"
230 + SdcArtifactHandlerConstants.VNFC_TYPE + " and VNFC_INSTANCE = $"
231 + SdcArtifactHandlerConstants.VNFC_INSTANCE + " and VM_INSTANCE = $"
232 + SdcArtifactHandlerConstants.VM_INSTANCE;
235 if (serviceLogic != null && context != null) {
236 String key = "select COUNT(*) from " + db + whereClause;
237 log.info("SELECT String : " + key);
238 status = serviceLogic.query("SQL", false, null, key, null, null, context);
239 if (status.toString().equals("FAILURE")) {
240 throw new SvcLogicException("Error while reading data from " + db);
242 String count = context.getAttribute("COUNT(*)");
243 log.info("Number of row Returned : " + count + ": " + status + ":");
244 if (count != null && Integer.parseInt(count) > 0) {
245 context.setAttribute(count, null);
253 public void processDeviceInterfaceProtocol(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
254 String fn = "DBService.processDeviceInterfaceProtocol";
255 log.info("Starting DB operation for Device Interface Protocol " + isUpdate);
257 QueryStatus status = null;
259 key = "update " + SdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL + " set PROTOCOL = $"
260 + SdcArtifactHandlerConstants.DEVICE_PROTOCOL + " , DG_RPC = 'getDeviceRunningConfig' "
261 + " , MODULE = 'APPC' " + " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE;
263 key = "insert into " + SdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL + " set VNF_TYPE = $"
264 + SdcArtifactHandlerConstants.VNF_TYPE + " , PROTOCOL = $"
265 + SdcArtifactHandlerConstants.DEVICE_PROTOCOL + " , DG_RPC = 'getDeviceRunningConfig' "
266 + " , MODULE = 'APPC' ";
268 if (serviceLogic != null && context != null) {
270 status = serviceLogic.save("SQL", false, false, key, null, null, context);
271 if (status.toString().equals("FAILURE"))
272 throw new SvcLogicException("Error While processing DEVICE_INTERFACE_PROTOCOL table ");
277 public void processDeviceAuthentication(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
278 String fn = "DBService.processDeviceAuthentication";
279 log.info(fn + "Starting DB operation for Device Authentication " + isUpdate);
281 QueryStatus status = null;
283 key = "update " + SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION + " set USER_NAME = $"
284 + SdcArtifactHandlerConstants.USER_NAME + " , PASSWORD = 'dummy' " + " , PORT_NUMBER = $"
285 + SdcArtifactHandlerConstants.PORT_NUMBER + " where VNF_TYPE = $"
286 + SdcArtifactHandlerConstants.VNF_TYPE;
288 key = "insert into " + SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION + " set VNF_TYPE = $"
289 + SdcArtifactHandlerConstants.VNF_TYPE + " , USER_NAME = $" + SdcArtifactHandlerConstants.USER_NAME
290 + " , PASSWORD = 'dummy' " + " , PORT_NUMBER = $" + SdcArtifactHandlerConstants.PORT_NUMBER;
292 if (serviceLogic != null && context != null) {
293 status = serviceLogic.save("SQL", false, false, key, null, null, context);
294 if (status.toString().equals("FAILURE"))
295 throw new SvcLogicException("Error While processing DEVICE_AUTHENTICATION table ");
299 public void processVnfcReference(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
300 String fn = "DBService.processVnfcReference";
301 log.info(fn + "Starting DB operation for Vnfc Reference " + isUpdate);
303 int vm_instance = -1;
304 if (context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE) != null)
305 vm_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE));
306 int vnfc_instance = -1;
307 if (context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE) != null)
308 vnfc_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE));
309 QueryStatus status = null;
311 key = "update " + SdcArtifactHandlerConstants.DB_VNFC_REFERENCE + " set VM_INSTANCE = " + vm_instance
312 + " , VNFC_INSTANCE = " + vnfc_instance + " , VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE
313 + " , VNFC_FUNCTION_CODE = $" + SdcArtifactHandlerConstants.VNFC_FUNCTION_CODE
314 + " , GROUP_NOTATION_TYPE = $" + SdcArtifactHandlerConstants.GROUP_NOTATION_TYPE
315 + " , GROUP_NOTATION_VALUE = $" + SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE
316 + " , IPADDRESS_V4_OAM_VIP = $" + SdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP
317 + " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + " and ACTION = $"
318 + SdcArtifactHandlerConstants.ACTION + " and VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE
319 + " and VNFC_INSTANCE = $" + SdcArtifactHandlerConstants.VNFC_INSTANCE + " and VM_INSTANCE = $"
320 + SdcArtifactHandlerConstants.VM_INSTANCE;
322 key = "insert into " + SdcArtifactHandlerConstants.DB_VNFC_REFERENCE + " set VNF_TYPE = $"
323 + SdcArtifactHandlerConstants.VNF_TYPE + " , ACTION = $" + SdcArtifactHandlerConstants.ACTION
324 + " , VM_INSTANCE = $" + SdcArtifactHandlerConstants.VM_INSTANCE + " , VNFC_INSTANCE = $"
325 + SdcArtifactHandlerConstants.VNFC_INSTANCE + " , VNFC_TYPE = $"
326 + SdcArtifactHandlerConstants.VNFC_TYPE + " , VNFC_FUNCTION_CODE = $"
327 + SdcArtifactHandlerConstants.VNFC_FUNCTION_CODE + " , GROUP_NOTATION_TYPE = $"
328 + SdcArtifactHandlerConstants.GROUP_NOTATION_TYPE + " , IPADDRESS_V4_OAM_VIP = $"
329 + SdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP + " , GROUP_NOTATION_VALUE = $"
330 + SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE;
332 if (serviceLogic != null && context != null) {
333 status = serviceLogic.save("SQL", false, false, key, null, null, context);
334 if (status.toString().equals("FAILURE"))
335 throw new SvcLogicException("Error While processing VNFC_REFERENCE table ");
339 public void processDownloadDgReference(SvcLogicContext context, boolean isUpdate)
340 throws SvcLogicException, SQLException {
341 String fn = "DBService.processDownloadDgReference";
342 log.info(fn + "Starting DB operation for Download DG Reference " + isUpdate);
344 QueryStatus status = null;
347 key = "update " + SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE + " set DOWNLOAD_CONFIG_DG = $"
348 + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + " where PROTOCOL = $"
349 + SdcArtifactHandlerConstants.DEVICE_PROTOCOL;
351 key = "insert into " + SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE + " set DOWNLOAD_CONFIG_DG = $"
352 + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + " , PROTOCOL = $"
353 + SdcArtifactHandlerConstants.DEVICE_PROTOCOL;
355 if (serviceLogic != null && context != null)
356 status = serviceLogic.save("SQL", false, false, key, null, null, context);
357 if (status.toString().equals("FAILURE"))
358 throw new SvcLogicException("Error While processing DOWNLOAD_DG_REFERENCE table ");
361 public void processConfigActionDg(SvcLogicContext context, boolean isUpdate) throws SvcLogicException {
362 String fn = "DBService.processConfigActionDg";
363 log.info(fn + "Starting DB operation for Config DG Action " + isUpdate);
365 QueryStatus status = null;
367 if (context.getAttribute(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE) != null
368 && context.getAttribute(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE).length() > 0) {
370 key = "update " + SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG + " set DOWNLOAD_CONFIG_DG = $"
371 + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + " where ACTION = $"
372 + SdcArtifactHandlerConstants.ACTION + " and VNF_TYPE = $"
373 + SdcArtifactHandlerConstants.VNF_TYPE;
375 key = "insert into " + SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG + " set DOWNLOAD_CONFIG_DG = $"
376 + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + " , ACTION = $"
377 + SdcArtifactHandlerConstants.ACTION + " , VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE;
379 if (serviceLogic != null && context != null)
380 status = serviceLogic.save("SQL", false, false, key, null, null, context);
381 if (status.toString().equals("FAILURE"))
382 throw new SvcLogicException("Error While processing Configure DG Action table ");
384 log.info("No Update required for Config DG Action");
388 public String getModelDataInformationbyArtifactName(String artifact_name) throws SvcLogicException {
389 String fn = "DBService.getVnfData";
391 SvcLogicContext con = new SvcLogicContext();
392 HashMap<String, String> modelData = new HashMap<String, String>();
393 QueryStatus status = null;
394 key = "select VNF_TYPE, VNFC_TYPE, ACTION, FILE_CATEGORY, ARTIFACT_TYPE from ASDC_REFERENCE where ARTIFACT_NAME = "
397 if (serviceLogic != null && con != null) {
398 log.info(fn + "select Key: " + key);
399 status = serviceLogic.query("SQL", false, null, key, null, null, con);
400 if (status.toString().equals("FAILURE"))
401 throw new SvcLogicException("Error While processing is ArtifactUpdateRequiredforPD table ");
405 log.info(fn + "Vnf_received :" + con.getAttribute("VNF_TYPE"));
407 return con.getAttribute("VNF_TYPE");
411 public void updateYangContents(SvcLogicContext context, String artifactId, String yangContents)
412 throws SvcLogicException {
413 String fn = "DBService.updateYangContents";
414 log.info(fn + "Starting DB operation for updateYangContents");
416 QueryStatus status = null;
418 key = "update ASDC_ARTIFACTS " + " set ARTIFACT_CONTENT = '" + yangContents + "'"
419 + " where ASDC_ARTIFACTS_ID = " + artifactId;
421 if (serviceLogic != null && context != null)
422 status = serviceLogic.save("SQL", false, false, key, null, null, context);
423 if (status.toString().equals("FAILURE"))
424 throw new SvcLogicException("Error While processing Configure DG Action table ");
429 public void insertProtocolReference(SvcLogicContext context, String vnfType, String protocol, String action,
430 String action_level, String template) throws SvcLogicException {
431 String fn = "DBService.insertProtocolReference";
432 log.info(fn + "Starting DB operation for insertProtocolReference");
434 QueryStatus status = null;
436 key = "insert into PROTOCOL_REFERENCE (ACTION, VNF_TYPE, PROTOCOL, UPDATED_DATE, TEMPLATE, ACTION_LEVEL)"
437 + " values (" + "'" + action + "', '" + vnfType + "', '" + protocol + "', now(),'" + template + "', '"
438 + action_level + "')";
440 if (serviceLogic != null && context != null)
441 status = serviceLogic.save("SQL", false, false, key, null, null, context);
442 if (status.toString().equals("FAILURE"))
443 throw new SvcLogicException("Error While processing insertProtocolReference ");