aboutsummaryrefslogtreecommitdiffstats
path: root/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao
diff options
context:
space:
mode:
authorMarcus G K Williams <marcus.williams@intel.com>2017-08-02 15:09:24 -0700
committerMarcus G K Williams <marcus.williams@intel.com>2017-08-02 16:08:09 -0700
commit806052bf4df8bd023cfb391794bc5937f2624716 (patch)
tree166e4a28582d96eaf3a8dd69b484cf02076d634c /resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao
parent16508ffde287f481791ae0b9c071f60a331c680d (diff)
Convert tabs to spaces
Per Java Code Style Guide: https://wiki.onap.org/display/DW/Java+code+style Converting tabs to 4 spaces. Issue-Id: SDNC-25 Change-Id: I99ce6c244df72f805b52d0d66403d8b76d9929ae Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao')
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDao.java6
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDaoImpl.java78
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDao.java6
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDaoImpl.java80
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDao.java4
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDaoImpl.java36
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDao.java4
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDaoImpl.java58
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDao.java14
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDaoImpl.java160
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDao.java4
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDaoImpl.java26
12 files changed, 238 insertions, 238 deletions
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDao.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDao.java
index a56b7880..af6eca7e 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDao.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDao.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,6 @@ package org.openecomp.sdnc.ra.rule.dao;
public interface MaxPortSpeedDao {
- // Returns max speed in kbps
- long getMaxPortSpeed(String imageFile, String endPointPosition, String interfaceName);
+ // Returns max speed in kbps
+ long getMaxPortSpeed(String imageFile, String endPointPosition, String interfaceName);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDaoImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDaoImpl.java
index ea0bd771..b0cc7d2c 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDaoImpl.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,53 +33,53 @@ import org.springframework.jdbc.core.RowMapper;
public class MaxPortSpeedDaoImpl implements MaxPortSpeedDao {
- @SuppressWarnings("unused")
- private static final Logger log = LoggerFactory.getLogger(MaxPortSpeedDaoImpl.class);
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory.getLogger(MaxPortSpeedDaoImpl.class);
- private final static String GET_SQL =
- "SELECT * FROM MAX_PORT_SPEED WHERE image_file_name = ? AND end_point_position = ? AND interface_name = ?";
+ private final static String GET_SQL =
+ "SELECT * FROM MAX_PORT_SPEED WHERE image_file_name = ? AND end_point_position = ? AND interface_name = ?";
- private JdbcTemplate jdbcTemplate;
- private long defaultMaxPortSpeed = 5000000;
- private SpeedUtil speedUtil;
+ private JdbcTemplate jdbcTemplate;
+ private long defaultMaxPortSpeed = 5000000;
+ private SpeedUtil speedUtil;
- @Override
- public long getMaxPortSpeed(String imageFile, String endPointPosition, String interfaceName) {
- List<MaxPortSpeed> maxPortSpeedList =
- jdbcTemplate.query(GET_SQL, new Object[] { imageFile, endPointPosition, interfaceName },
- new RowMapper<MaxPortSpeed>() {
+ @Override
+ public long getMaxPortSpeed(String imageFile, String endPointPosition, String interfaceName) {
+ List<MaxPortSpeed> maxPortSpeedList =
+ jdbcTemplate.query(GET_SQL, new Object[] { imageFile, endPointPosition, interfaceName },
+ new RowMapper<MaxPortSpeed>() {
- @Override
- public MaxPortSpeed mapRow(ResultSet rs, int rowNum) throws SQLException {
- MaxPortSpeed mps = new MaxPortSpeed();
- mps.maxSpeed = rs.getLong("max_speed");
- mps.unit = rs.getString("unit");
- return mps;
- }
- });
+ @Override
+ public MaxPortSpeed mapRow(ResultSet rs, int rowNum) throws SQLException {
+ MaxPortSpeed mps = new MaxPortSpeed();
+ mps.maxSpeed = rs.getLong("max_speed");
+ mps.unit = rs.getString("unit");
+ return mps;
+ }
+ });
- if (maxPortSpeedList.isEmpty())
- return defaultMaxPortSpeed;
+ if (maxPortSpeedList.isEmpty())
+ return defaultMaxPortSpeed;
- MaxPortSpeed mps = maxPortSpeedList.get(0);
- return speedUtil.convertToKbps(mps.maxSpeed, mps.unit);
- }
+ MaxPortSpeed mps = maxPortSpeedList.get(0);
+ return speedUtil.convertToKbps(mps.maxSpeed, mps.unit);
+ }
- private static class MaxPortSpeed {
+ private static class MaxPortSpeed {
- public long maxSpeed;
- public String unit;
- }
+ public long maxSpeed;
+ public String unit;
+ }
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
- public void setDefaultMaxPortSpeed(long defaultMaxPortSpeed) {
- this.defaultMaxPortSpeed = defaultMaxPortSpeed;
- }
+ public void setDefaultMaxPortSpeed(long defaultMaxPortSpeed) {
+ this.defaultMaxPortSpeed = defaultMaxPortSpeed;
+ }
- public void setSpeedUtil(SpeedUtil speedUtil) {
- this.speedUtil = speedUtil;
- }
+ public void setSpeedUtil(SpeedUtil speedUtil) {
+ this.speedUtil = speedUtil;
+ }
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDao.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDao.java
index 4bd17f1d..dd6ae9c8 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDao.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDao.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,6 @@ package org.openecomp.sdnc.ra.rule.dao;
public interface MaxServerSpeedDao {
- // Returns max speed in kbps
- long getMaxServerSpeed(String serverModel, int evcCount);
+ // Returns max speed in kbps
+ long getMaxServerSpeed(String serverModel, int evcCount);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDaoImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDaoImpl.java
index c3428179..c0be2e6b 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDaoImpl.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,54 +33,54 @@ import org.springframework.jdbc.core.RowMapper;
public class MaxServerSpeedDaoImpl implements MaxServerSpeedDao {
- @SuppressWarnings("unused")
- private static final Logger log = LoggerFactory.getLogger(MaxServerSpeedDaoImpl.class);
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory.getLogger(MaxServerSpeedDaoImpl.class);
- private final static String GET_SQL =
- "SELECT * FROM MAX_SERVER_SPEED\n" +
- "WHERE (server_model = ? OR server_model = 'ALL') AND evc_count >= ?\n" +
- "ORDER BY evc_count";
+ private final static String GET_SQL =
+ "SELECT * FROM MAX_SERVER_SPEED\n" +
+ "WHERE (server_model = ? OR server_model = 'ALL') AND evc_count >= ?\n" +
+ "ORDER BY evc_count";
- private JdbcTemplate jdbcTemplate;
- private long defaultMaxServerSpeed = 1600000;
- private SpeedUtil speedUtil;
+ private JdbcTemplate jdbcTemplate;
+ private long defaultMaxServerSpeed = 1600000;
+ private SpeedUtil speedUtil;
- @Override
- public long getMaxServerSpeed(String serverModel, int evcCount) {
- List<MaxServerSpeed> maxServerSpeedList =
- jdbcTemplate.query(GET_SQL, new Object[] { serverModel, evcCount }, new RowMapper<MaxServerSpeed>() {
+ @Override
+ public long getMaxServerSpeed(String serverModel, int evcCount) {
+ List<MaxServerSpeed> maxServerSpeedList =
+ jdbcTemplate.query(GET_SQL, new Object[] { serverModel, evcCount }, new RowMapper<MaxServerSpeed>() {
- @Override
- public MaxServerSpeed mapRow(ResultSet rs, int rowNum) throws SQLException {
- MaxServerSpeed mps = new MaxServerSpeed();
- mps.maxSpeed = rs.getLong("max_speed");
- mps.unit = rs.getString("unit");
- return mps;
- }
- });
+ @Override
+ public MaxServerSpeed mapRow(ResultSet rs, int rowNum) throws SQLException {
+ MaxServerSpeed mps = new MaxServerSpeed();
+ mps.maxSpeed = rs.getLong("max_speed");
+ mps.unit = rs.getString("unit");
+ return mps;
+ }
+ });
- if (maxServerSpeedList.isEmpty())
- return defaultMaxServerSpeed;
+ if (maxServerSpeedList.isEmpty())
+ return defaultMaxServerSpeed;
- MaxServerSpeed mps = maxServerSpeedList.get(0);
- return speedUtil.convertToKbps(mps.maxSpeed, mps.unit);
- }
+ MaxServerSpeed mps = maxServerSpeedList.get(0);
+ return speedUtil.convertToKbps(mps.maxSpeed, mps.unit);
+ }
- private static class MaxServerSpeed {
+ private static class MaxServerSpeed {
- public long maxSpeed;
- public String unit;
- }
+ public long maxSpeed;
+ public String unit;
+ }
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
- public void setDefaultMaxServerSpeed(long defaultMaxServerSpeed) {
- this.defaultMaxServerSpeed = defaultMaxServerSpeed;
- }
+ public void setDefaultMaxServerSpeed(long defaultMaxServerSpeed) {
+ this.defaultMaxServerSpeed = defaultMaxServerSpeed;
+ }
- public void setSpeedUtil(SpeedUtil speedUtil) {
- this.speedUtil = speedUtil;
- }
+ public void setSpeedUtil(SpeedUtil speedUtil) {
+ this.speedUtil = speedUtil;
+ }
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDao.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDao.java
index 509a034a..2042ba9c 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDao.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDao.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,5 +23,5 @@ package org.openecomp.sdnc.ra.rule.dao;
public interface ParameterDao {
- String getParameter(String name);
+ String getParameter(String name);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDaoImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDaoImpl.java
index 2cafb280..c2ca99ce 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDaoImpl.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,28 +30,28 @@ import org.springframework.jdbc.core.JdbcTemplate;
public class ParameterDaoImpl implements ParameterDao {
- private static final Logger log = LoggerFactory.getLogger(ParameterDaoImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(ParameterDaoImpl.class);
- private final static String GET_SQL = "SELECT * FROM PARAMETERS WHERE name = ?";
+ private final static String GET_SQL = "SELECT * FROM PARAMETERS WHERE name = ?";
- private JdbcTemplate jdbcTemplate;
+ private JdbcTemplate jdbcTemplate;
- @Override
- public String getParameter(String name) {
- List<Map<String, Object>> ll = jdbcTemplate.queryForList(GET_SQL, name);
+ @Override
+ public String getParameter(String name) {
+ List<Map<String, Object>> ll = jdbcTemplate.queryForList(GET_SQL, name);
- if (ll == null || ll.isEmpty()) {
- log.info("Parameter: " + name + " not found in DB");
- return null;
- }
+ if (ll == null || ll.isEmpty()) {
+ log.info("Parameter: " + name + " not found in DB");
+ return null;
+ }
- String v = (String) ll.get(0).get("value");
- log.info("Parameter from DB: " + name + "='" + v + "'");
+ String v = (String) ll.get(0).get("value");
+ log.info("Parameter from DB: " + name + "='" + v + "'");
- return v;
- }
+ return v;
+ }
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDao.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDao.java
index 798a2303..670039f4 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDao.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDao.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,5 +28,5 @@ import org.openecomp.sdnc.ra.rule.data.RangeRule;
public interface RangeRuleDao {
- List<RangeRule> getRangeRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel);
+ List<RangeRule> getRangeRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDaoImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDaoImpl.java
index dec05ece..0880929b 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDaoImpl.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,37 +34,37 @@ import org.springframework.jdbc.core.RowMapper;
public class RangeRuleDaoImpl implements RangeRuleDao {
- @SuppressWarnings("unused")
- private static final Logger log = LoggerFactory.getLogger(RangeRuleDaoImpl.class);
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory.getLogger(RangeRuleDaoImpl.class);
- private static final String GET_SQL =
- "SELECT * FROM RANGE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ?";
+ private static final String GET_SQL =
+ "SELECT * FROM RANGE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ?";
- private JdbcTemplate jdbcTemplate;
+ private JdbcTemplate jdbcTemplate;
- @Override
- public List<RangeRule> getRangeRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel) {
- List<RangeRule> rangeRuleList =
- jdbcTemplate.query(GET_SQL, new Object[] { serviceModel, endPointPosition, equipLevel.toString() },
- new RowMapper<RangeRule>() {
+ @Override
+ public List<RangeRule> getRangeRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel) {
+ List<RangeRule> rangeRuleList =
+ jdbcTemplate.query(GET_SQL, new Object[] { serviceModel, endPointPosition, equipLevel.toString() },
+ new RowMapper<RangeRule>() {
- @Override
- public RangeRule mapRow(ResultSet rs, int rowNum) throws SQLException {
- RangeRule rl = new RangeRule();
- rl.id = rs.getLong("range_rule_id");
- rl.rangeName = rs.getString("range_name");
- rl.serviceModel = rs.getString("service_model");
- rl.endPointPosition = rs.getString("end_point_position");
- rl.equipmentLevel = rs.getString("equipment_level");
- rl.minValue = rs.getInt("min_value");
- rl.maxValue = rs.getInt("max_value");
- return rl;
- }
- });
- return rangeRuleList;
- }
+ @Override
+ public RangeRule mapRow(ResultSet rs, int rowNum) throws SQLException {
+ RangeRule rl = new RangeRule();
+ rl.id = rs.getLong("range_rule_id");
+ rl.rangeName = rs.getString("range_name");
+ rl.serviceModel = rs.getString("service_model");
+ rl.endPointPosition = rs.getString("end_point_position");
+ rl.equipmentLevel = rs.getString("equipment_level");
+ rl.minValue = rs.getInt("min_value");
+ rl.maxValue = rs.getInt("max_value");
+ return rl;
+ }
+ });
+ return rangeRuleList;
+ }
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDao.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDao.java
index 31ce9e6a..55b24b61 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDao.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDao.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,11 +28,11 @@ import org.openecomp.sdnc.ra.rule.data.ResourceRule;
public interface ResourceRuleDao {
- List<ResourceRule> getResourceRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel);
+ List<ResourceRule> getResourceRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel);
- ResourceRule getResourceRule(
- String serviceModel,
- String endPointPosition,
- EquipmentLevel equipLevel,
- String resourceName);
+ ResourceRule getResourceRule(
+ String serviceModel,
+ String endPointPosition,
+ EquipmentLevel equipLevel,
+ String resourceName);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDaoImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDaoImpl.java
index 819a01cd..72793a40 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDaoImpl.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,83 +35,83 @@ import org.springframework.jdbc.core.RowMapper;
public class ResourceRuleDaoImpl implements ResourceRuleDao {
- @SuppressWarnings("unused")
- private static final Logger log = LoggerFactory.getLogger(ResourceRuleDaoImpl.class);
-
- private static final String GET1_SQL =
- "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ?";
- private static final String GET2_SQL =
- "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ? AND resource_name = ?";
- private static final String THRESHOLD_SQL = "SELECT * FROM RESOURCE_THRESHOLD WHERE resource_rule_id = ?";
-
- private JdbcTemplate jdbcTemplate;
- ResourceRuleRowMapper resourceRuleRowMapper = new ResourceRuleRowMapper();
- ResourceThresholdRowMapper resourceThresholdRowMapper = new ResourceThresholdRowMapper();
-
- @Override
- public List<ResourceRule> getResourceRules(
- String serviceModel,
- String endPointPosition,
- EquipmentLevel equipLevel) {
- List<ResourceRule> resourceRuleList = jdbcTemplate.query(GET1_SQL,
- new Object[] { serviceModel, endPointPosition, equipLevel.toString() }, resourceRuleRowMapper);
-
- for (ResourceRule rr : resourceRuleList)
- rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] { rr.id }, resourceThresholdRowMapper);
-
- return resourceRuleList;
- }
-
- @Override
- public ResourceRule getResourceRule(
- String serviceModel,
- String endPointPosition,
- EquipmentLevel equipLevel,
- String resourceName) {
- List<ResourceRule> resourceRuleList = jdbcTemplate.query(GET2_SQL,
- new Object[] { serviceModel, endPointPosition, equipLevel.toString(), resourceName },
- resourceRuleRowMapper);
-
- if (resourceRuleList == null || resourceRuleList.isEmpty())
- return null;
-
- ResourceRule rr = resourceRuleList.get(0);
- rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] { rr.id }, resourceThresholdRowMapper);
-
- return rr;
- }
-
- private static class ResourceRuleRowMapper implements RowMapper<ResourceRule> {
-
- @Override
- public ResourceRule mapRow(ResultSet rs, int rowNum) throws SQLException {
- ResourceRule rl = new ResourceRule();
- rl.id = rs.getLong("resource_rule_id");
- rl.resourceName = rs.getString("resource_name");
- rl.serviceModel = rs.getString("service_model");
- rl.endPointPosition = rs.getString("end_point_position");
- rl.serviceExpression = rs.getString("service_expression");
- rl.equipmentLevel = rs.getString("equipment_level");
- rl.equipmentExpression = rs.getString("equipment_expression");
- rl.allocationExpression = rs.getString("allocation_expression");
- rl.softLimitExpression = rs.getString("soft_limit_expression");
- rl.hardLimitExpression = rs.getString("hard_limit_expression");
- return rl;
- }
- }
-
- private static class ResourceThresholdRowMapper implements RowMapper<ResourceThreshold> {
-
- @Override
- public ResourceThreshold mapRow(ResultSet rs, int rowNum) throws SQLException {
- ResourceThreshold th = new ResourceThreshold();
- th.expression = rs.getString("threshold_expression");
- th.message = rs.getString("threshold_message");
- return th;
- }
- }
-
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory.getLogger(ResourceRuleDaoImpl.class);
+
+ private static final String GET1_SQL =
+ "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ?";
+ private static final String GET2_SQL =
+ "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ? AND resource_name = ?";
+ private static final String THRESHOLD_SQL = "SELECT * FROM RESOURCE_THRESHOLD WHERE resource_rule_id = ?";
+
+ private JdbcTemplate jdbcTemplate;
+ ResourceRuleRowMapper resourceRuleRowMapper = new ResourceRuleRowMapper();
+ ResourceThresholdRowMapper resourceThresholdRowMapper = new ResourceThresholdRowMapper();
+
+ @Override
+ public List<ResourceRule> getResourceRules(
+ String serviceModel,
+ String endPointPosition,
+ EquipmentLevel equipLevel) {
+ List<ResourceRule> resourceRuleList = jdbcTemplate.query(GET1_SQL,
+ new Object[] { serviceModel, endPointPosition, equipLevel.toString() }, resourceRuleRowMapper);
+
+ for (ResourceRule rr : resourceRuleList)
+ rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] { rr.id }, resourceThresholdRowMapper);
+
+ return resourceRuleList;
+ }
+
+ @Override
+ public ResourceRule getResourceRule(
+ String serviceModel,
+ String endPointPosition,
+ EquipmentLevel equipLevel,
+ String resourceName) {
+ List<ResourceRule> resourceRuleList = jdbcTemplate.query(GET2_SQL,
+ new Object[] { serviceModel, endPointPosition, equipLevel.toString(), resourceName },
+ resourceRuleRowMapper);
+
+ if (resourceRuleList == null || resourceRuleList.isEmpty())
+ return null;
+
+ ResourceRule rr = resourceRuleList.get(0);
+ rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] { rr.id }, resourceThresholdRowMapper);
+
+ return rr;
+ }
+
+ private static class ResourceRuleRowMapper implements RowMapper<ResourceRule> {
+
+ @Override
+ public ResourceRule mapRow(ResultSet rs, int rowNum) throws SQLException {
+ ResourceRule rl = new ResourceRule();
+ rl.id = rs.getLong("resource_rule_id");
+ rl.resourceName = rs.getString("resource_name");
+ rl.serviceModel = rs.getString("service_model");
+ rl.endPointPosition = rs.getString("end_point_position");
+ rl.serviceExpression = rs.getString("service_expression");
+ rl.equipmentLevel = rs.getString("equipment_level");
+ rl.equipmentExpression = rs.getString("equipment_expression");
+ rl.allocationExpression = rs.getString("allocation_expression");
+ rl.softLimitExpression = rs.getString("soft_limit_expression");
+ rl.hardLimitExpression = rs.getString("hard_limit_expression");
+ return rl;
+ }
+ }
+
+ private static class ResourceThresholdRowMapper implements RowMapper<ResourceThreshold> {
+
+ @Override
+ public ResourceThreshold mapRow(ResultSet rs, int rowNum) throws SQLException {
+ ResourceThreshold th = new ResourceThreshold();
+ th.expression = rs.getString("threshold_expression");
+ th.message = rs.getString("threshold_message");
+ return th;
+ }
+ }
+
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDao.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDao.java
index eb41792d..6734fb54 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDao.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDao.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,5 +23,5 @@ package org.openecomp.sdnc.ra.rule.dao;
public interface VpeLockDao {
- String getVpeLock(String vpeName);
+ String getVpeLock(String vpeName);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDaoImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDaoImpl.java
index eb6cef3b..d712b8d0 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDaoImpl.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,20 +29,20 @@ import org.springframework.jdbc.core.JdbcTemplate;
public class VpeLockDaoImpl implements VpeLockDao {
- @SuppressWarnings("unused")
- private static final Logger log = LoggerFactory.getLogger(VpeLockDaoImpl.class);
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory.getLogger(VpeLockDaoImpl.class);
- private final static String GET_SQL = "SELECT vpn_lock FROM VPE_LOCK WHERE vpe_name = ?";
+ private final static String GET_SQL = "SELECT vpn_lock FROM VPE_LOCK WHERE vpe_name = ?";
- private JdbcTemplate jdbcTemplate;
+ private JdbcTemplate jdbcTemplate;
- @Override
- public String getVpeLock(String vpeName) {
- List<String> ll = jdbcTemplate.queryForList(GET_SQL, String.class, vpeName);
- return ll != null && !ll.isEmpty() ? ll.get(0) : null;
- }
+ @Override
+ public String getVpeLock(String vpeName) {
+ List<String> ll = jdbcTemplate.queryForList(GET_SQL, String.class, vpeName);
+ return ll != null && !ll.isEmpty() ? ll.get(0) : null;
+ }
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
}