- else {
- protocolQuery = "select count(protocol) from " + FlowControllerConstants.DB_PROTOCOL_REFERENCE
- + " where action = '" + transaction.getAction() + "'" + " and action_level = '"
- + transaction.getActionLevel() + "'" + " and vnf_type = '" + vnf_type + "'";
-
- log.debug(fn + "Query String : " + protocolQuery);
- status = serviceLogic.query("SQL", false, null, protocolQuery, null, null, context);
- if (status.toString().equals("FAILURE"))
- throw new SvcLogicException("Error - while getting FlowReferenceData ");
-
- log.debug(" Protocol Count " + context.getAttribute("count(protocol)"));
- protocolCount = Integer.parseInt(context.getAttribute("count(protocol)"));
- if(protocolCount > 1){
- throw new Exception("Got more than 2 values..");
- }else if(protocolCount == 1){
- protocolQuery = "select protocol from " + FlowControllerConstants.DB_PROTOCOL_REFERENCE
- + " where action = '" + transaction.getAction() + "'" + " and action_level = '"
- + transaction.getActionLevel() + "'"+ " and vnf_type = '" + vnf_type + "'";
- log.debug(fn + "Query String : " + protocolQuery);
- status = serviceLogic.query("SQL", false, null, protocolQuery, null, null, context);
- if (status.toString().equals("FAILURE"))
- throw new SvcLogicException("Error - while getting FlowReferenceData ");
- protocolType = context.getAttribute("protocol");
- }
+ return null;
+ }
+
+ private boolean hasSingleProtocol(Transaction transaction, String vnfType, String fn, SvcLogicContext context)
+ throws SvcLogicException {
+ String protocolQuery;
+ QueryStatus status;
+ int protocolCount;
+ protocolQuery = "select count(protocol) from " + FlowControllerConstants.DB_PROTOCOL_REFERENCE
+ + WHERE_ACTION_QUERY_STR + transaction.getAction() + "'" + AND_ACTION_LEVEL_QUERY_STR
+ + transaction.getActionLevel() + "'" + " and vnf_type = '" + vnfType + "'";
+
+ log.debug(fn + QUERY_STR + protocolQuery);
+ status = serviceLogic.query("SQL", false, null, protocolQuery, null, null, context);
+ if (status.toString().equals(FAILURE_PARAM)) {
+ throw new SvcLogicException(GET_FLOW_REF_DATA_ERROR);
+ }
+
+ log.debug(" Protocol Count " + context.getAttribute(COUNT_PROTOCOL_PARAM));
+ protocolCount = Integer.parseInt(context.getAttribute(COUNT_PROTOCOL_PARAM));
+ if (protocolCount > 1) {
+ throw new SvcLogicException("Got more than 2 values..");
+ } else if (protocolCount == 1) {
+ protocolQuery = "select protocol from " + FlowControllerConstants.DB_PROTOCOL_REFERENCE
+ + WHERE_ACTION_QUERY_STR + transaction.getAction() + "'" + AND_ACTION_LEVEL_QUERY_STR
+ + transaction.getActionLevel() + "'" + " and vnf_type = '" + vnfType + "'";
+ log.debug(fn + QUERY_STR + protocolQuery);
+ status = serviceLogic.query("SQL", false, null, protocolQuery, null, null, context);
+ if (status.toString().equals(FAILURE_PARAM)) {
+ throw new SvcLogicException(GET_FLOW_REF_DATA_ERROR);