aboutsummaryrefslogtreecommitdiffstats
path: root/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule
diff options
context:
space:
mode:
Diffstat (limited to 'resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule')
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilder.java20
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilderImpl.java250
-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
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/RangeRule.java16
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceRule.java24
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceThreshold.java6
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ThresholdStatus.java14
18 files changed, 403 insertions, 403 deletions
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilder.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilder.java
index 44e4c53a..c2d61416 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilder.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilder.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,14 +29,14 @@ import org.openecomp.sdnc.rm.data.LimitAllocationOutcome;
public interface AllocationRequestBuilder {
- AllocationRequest buildAllocationRequest(
- ServiceData serviceData,
- EquipmentData equipmentData,
- boolean checkOnly,
- boolean change);
+ AllocationRequest buildAllocationRequest(
+ ServiceData serviceData,
+ EquipmentData equipmentData,
+ boolean checkOnly,
+ boolean change);
- ThresholdStatus getThresholdStatus(
- ServiceData serviceData,
- EquipmentData equipmentData,
- LimitAllocationOutcome limitAllocationOutcome);
+ ThresholdStatus getThresholdStatus(
+ ServiceData serviceData,
+ EquipmentData equipmentData,
+ LimitAllocationOutcome limitAllocationOutcome);
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilderImpl.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilderImpl.java
index dbc0d8be..37f9cb81 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilderImpl.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilderImpl.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.
@@ -45,128 +45,128 @@ import org.slf4j.LoggerFactory;
public class AllocationRequestBuilderImpl implements AllocationRequestBuilder {
- private static final Logger log = LoggerFactory.getLogger(AllocationRequestBuilderImpl.class);
-
- private ResourceRuleDao resourceRuleDao;
- private RangeRuleDao rangeRuleDao;
-
- @Override
- public AllocationRequest buildAllocationRequest(
- ServiceData serviceData,
- EquipmentData equipmentData,
- boolean checkOnly,
- boolean change) {
- List<ResourceRule> resourceRuleList = resourceRuleDao.getResourceRules(serviceData.serviceModel,
- serviceData.endPointPosition, equipmentData.equipmentLevel);
- List<RangeRule> rangeRuleList = rangeRuleDao.getRangeRules(serviceData.serviceModel,
- serviceData.endPointPosition, equipmentData.equipmentLevel);
- if (resourceRuleList.isEmpty() && rangeRuleList.isEmpty())
- return null;
- if (resourceRuleList.size() == 1 && rangeRuleList.isEmpty())
- return buildAllocationRequest(resourceRuleList.get(0), serviceData, equipmentData, checkOnly, change);
-
- if (resourceRuleList.isEmpty() && rangeRuleList.size() == 1)
- return buildAllocationRequest(rangeRuleList.get(0), serviceData, equipmentData, checkOnly, change);
-
- MultiResourceAllocationRequest ar = new MultiResourceAllocationRequest();
- ar.stopOnFirstFailure = false;
- ar.allocationRequestList = new ArrayList<AllocationRequest>();
- for (ResourceRule rr : resourceRuleList) {
- AllocationRequest ar1 = buildAllocationRequest(rr, serviceData, equipmentData, checkOnly, change);
- ar.allocationRequestList.add(ar1);
- }
- for (RangeRule rr : rangeRuleList) {
- AllocationRequest ar1 = buildAllocationRequest(rr, serviceData, equipmentData, checkOnly, change);
- ar.allocationRequestList.add(ar1);
- }
- return ar;
- }
-
- private AllocationRequest buildAllocationRequest(
- ResourceRule resourceRule,
- ServiceData serviceData,
- EquipmentData equipmentData,
- boolean checkOnly,
- boolean change) {
- StrUtil.info(log, resourceRule);
-
- LimitAllocationRequest ar = new LimitAllocationRequest();
- ar.resourceSetId = serviceData.resourceSetId;
- ar.resourceUnionId = serviceData.resourceUnionId;
- ar.resourceName = resourceRule.resourceName;
- ar.assetId = equipmentData.equipmentId;
- ar.missingResourceAction = AllocationAction.Succeed_Allocate;
- ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
- ar.replace = true;
- ar.strict = false;
- ar.checkLimit = ExpressionEvaluator.evalLong(
- change ? resourceRule.hardLimitExpression : resourceRule.softLimitExpression, equipmentData.data);
- ar.checkCount = ExpressionEvaluator.evalLong(resourceRule.allocationExpression, serviceData.data);
- ar.allocateCount = checkOnly ? 0 : ar.checkCount;
- return ar;
- }
-
- private AllocationRequest buildAllocationRequest(
- RangeRule rangeRule,
- ServiceData serviceData,
- EquipmentData equipmentData,
- boolean checkOnly,
- boolean change) {
- StrUtil.info(log, rangeRule);
-
- RangeAllocationRequest ar = new RangeAllocationRequest();
- ar.resourceSetId = serviceData.resourceSetId;
- ar.resourceUnionId = serviceData.resourceUnionId;
- ar.resourceName = rangeRule.rangeName;
- ar.assetId = equipmentData.equipmentId;
- ar.missingResourceAction = AllocationAction.Succeed_Allocate;
- ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
- ar.replace = true;
- ar.check = true;
- ar.allocate = !checkOnly;
- ar.checkMin = rangeRule.minValue;
- ar.checkMax = rangeRule.maxValue;
- return ar;
- }
-
- @Override
- public ThresholdStatus getThresholdStatus(
- ServiceData serviceData,
- EquipmentData equipmentData,
- LimitAllocationOutcome limitAllocationOutcome) {
- ResourceRule rr = resourceRuleDao.getResourceRule(serviceData.serviceModel, serviceData.endPointPosition,
- equipmentData.equipmentLevel, limitAllocationOutcome.request.resourceName);
- if (rr == null || rr.thresholdList == null || rr.thresholdList.isEmpty())
- return null;
-
- ThresholdStatus thresholdStatus = null;
- long maxThresholdValue = 0;
- for (ResourceThreshold th : rr.thresholdList) {
- long thresholdValue = ExpressionEvaluator.evalLong(th.expression, equipmentData.data);
-
- if (thresholdValue > maxThresholdValue) {
- maxThresholdValue = thresholdValue;
-
- if (limitAllocationOutcome.used >= thresholdValue) {
- thresholdStatus = new ThresholdStatus();
- thresholdStatus.resourceRule = rr;
- thresholdStatus.resourceThreshold = th;
- thresholdStatus.limitValue = limitAllocationOutcome.limit;
- thresholdStatus.thresholdValue = thresholdValue;
- thresholdStatus.used = limitAllocationOutcome.used;
- thresholdStatus.lastAdded = limitAllocationOutcome.allocatedCount;
- }
- }
- }
-
- return thresholdStatus;
- }
-
- public void setResourceRuleDao(ResourceRuleDao resourceRuleDao) {
- this.resourceRuleDao = resourceRuleDao;
- }
-
- public void setRangeRuleDao(RangeRuleDao rangeRuleDao) {
- this.rangeRuleDao = rangeRuleDao;
- }
+ private static final Logger log = LoggerFactory.getLogger(AllocationRequestBuilderImpl.class);
+
+ private ResourceRuleDao resourceRuleDao;
+ private RangeRuleDao rangeRuleDao;
+
+ @Override
+ public AllocationRequest buildAllocationRequest(
+ ServiceData serviceData,
+ EquipmentData equipmentData,
+ boolean checkOnly,
+ boolean change) {
+ List<ResourceRule> resourceRuleList = resourceRuleDao.getResourceRules(serviceData.serviceModel,
+ serviceData.endPointPosition, equipmentData.equipmentLevel);
+ List<RangeRule> rangeRuleList = rangeRuleDao.getRangeRules(serviceData.serviceModel,
+ serviceData.endPointPosition, equipmentData.equipmentLevel);
+ if (resourceRuleList.isEmpty() && rangeRuleList.isEmpty())
+ return null;
+ if (resourceRuleList.size() == 1 && rangeRuleList.isEmpty())
+ return buildAllocationRequest(resourceRuleList.get(0), serviceData, equipmentData, checkOnly, change);
+
+ if (resourceRuleList.isEmpty() && rangeRuleList.size() == 1)
+ return buildAllocationRequest(rangeRuleList.get(0), serviceData, equipmentData, checkOnly, change);
+
+ MultiResourceAllocationRequest ar = new MultiResourceAllocationRequest();
+ ar.stopOnFirstFailure = false;
+ ar.allocationRequestList = new ArrayList<AllocationRequest>();
+ for (ResourceRule rr : resourceRuleList) {
+ AllocationRequest ar1 = buildAllocationRequest(rr, serviceData, equipmentData, checkOnly, change);
+ ar.allocationRequestList.add(ar1);
+ }
+ for (RangeRule rr : rangeRuleList) {
+ AllocationRequest ar1 = buildAllocationRequest(rr, serviceData, equipmentData, checkOnly, change);
+ ar.allocationRequestList.add(ar1);
+ }
+ return ar;
+ }
+
+ private AllocationRequest buildAllocationRequest(
+ ResourceRule resourceRule,
+ ServiceData serviceData,
+ EquipmentData equipmentData,
+ boolean checkOnly,
+ boolean change) {
+ StrUtil.info(log, resourceRule);
+
+ LimitAllocationRequest ar = new LimitAllocationRequest();
+ ar.resourceSetId = serviceData.resourceSetId;
+ ar.resourceUnionId = serviceData.resourceUnionId;
+ ar.resourceName = resourceRule.resourceName;
+ ar.assetId = equipmentData.equipmentId;
+ ar.missingResourceAction = AllocationAction.Succeed_Allocate;
+ ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
+ ar.replace = true;
+ ar.strict = false;
+ ar.checkLimit = ExpressionEvaluator.evalLong(
+ change ? resourceRule.hardLimitExpression : resourceRule.softLimitExpression, equipmentData.data);
+ ar.checkCount = ExpressionEvaluator.evalLong(resourceRule.allocationExpression, serviceData.data);
+ ar.allocateCount = checkOnly ? 0 : ar.checkCount;
+ return ar;
+ }
+
+ private AllocationRequest buildAllocationRequest(
+ RangeRule rangeRule,
+ ServiceData serviceData,
+ EquipmentData equipmentData,
+ boolean checkOnly,
+ boolean change) {
+ StrUtil.info(log, rangeRule);
+
+ RangeAllocationRequest ar = new RangeAllocationRequest();
+ ar.resourceSetId = serviceData.resourceSetId;
+ ar.resourceUnionId = serviceData.resourceUnionId;
+ ar.resourceName = rangeRule.rangeName;
+ ar.assetId = equipmentData.equipmentId;
+ ar.missingResourceAction = AllocationAction.Succeed_Allocate;
+ ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
+ ar.replace = true;
+ ar.check = true;
+ ar.allocate = !checkOnly;
+ ar.checkMin = rangeRule.minValue;
+ ar.checkMax = rangeRule.maxValue;
+ return ar;
+ }
+
+ @Override
+ public ThresholdStatus getThresholdStatus(
+ ServiceData serviceData,
+ EquipmentData equipmentData,
+ LimitAllocationOutcome limitAllocationOutcome) {
+ ResourceRule rr = resourceRuleDao.getResourceRule(serviceData.serviceModel, serviceData.endPointPosition,
+ equipmentData.equipmentLevel, limitAllocationOutcome.request.resourceName);
+ if (rr == null || rr.thresholdList == null || rr.thresholdList.isEmpty())
+ return null;
+
+ ThresholdStatus thresholdStatus = null;
+ long maxThresholdValue = 0;
+ for (ResourceThreshold th : rr.thresholdList) {
+ long thresholdValue = ExpressionEvaluator.evalLong(th.expression, equipmentData.data);
+
+ if (thresholdValue > maxThresholdValue) {
+ maxThresholdValue = thresholdValue;
+
+ if (limitAllocationOutcome.used >= thresholdValue) {
+ thresholdStatus = new ThresholdStatus();
+ thresholdStatus.resourceRule = rr;
+ thresholdStatus.resourceThreshold = th;
+ thresholdStatus.limitValue = limitAllocationOutcome.limit;
+ thresholdStatus.thresholdValue = thresholdValue;
+ thresholdStatus.used = limitAllocationOutcome.used;
+ thresholdStatus.lastAdded = limitAllocationOutcome.allocatedCount;
+ }
+ }
+ }
+
+ return thresholdStatus;
+ }
+
+ public void setResourceRuleDao(ResourceRuleDao resourceRuleDao) {
+ this.resourceRuleDao = resourceRuleDao;
+ }
+
+ public void setRangeRuleDao(RangeRuleDao rangeRuleDao) {
+ this.rangeRuleDao = rangeRuleDao;
+ }
}
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;
+ }
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/RangeRule.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/RangeRule.java
index ed76f6b1..e657e8b4 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/RangeRule.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/RangeRule.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,11 +23,11 @@ package org.openecomp.sdnc.ra.rule.data;
public class RangeRule {
- public long id;
- public String rangeName;
- public String serviceModel;
- public String endPointPosition;
- public String equipmentLevel;
- public int minValue;
- public int maxValue;
+ public long id;
+ public String rangeName;
+ public String serviceModel;
+ public String endPointPosition;
+ public String equipmentLevel;
+ public int minValue;
+ public int maxValue;
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceRule.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceRule.java
index c4d55f92..ca8ab540 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceRule.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceRule.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.
@@ -25,15 +25,15 @@ import java.util.List;
public class ResourceRule {
- public long id;
- public String resourceName;
- public String serviceModel;
- public String endPointPosition;
- public String serviceExpression;
- public String equipmentLevel;
- public String equipmentExpression;
- public String allocationExpression;
- public String softLimitExpression;
- public String hardLimitExpression;
- public List<ResourceThreshold> thresholdList;
+ public long id;
+ public String resourceName;
+ public String serviceModel;
+ public String endPointPosition;
+ public String serviceExpression;
+ public String equipmentLevel;
+ public String equipmentExpression;
+ public String allocationExpression;
+ public String softLimitExpression;
+ public String hardLimitExpression;
+ public List<ResourceThreshold> thresholdList;
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceThreshold.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceThreshold.java
index 7be4067e..b733a356 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceThreshold.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceThreshold.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.data;
public class ResourceThreshold {
- public String expression;
- public String message;
+ public String expression;
+ public String message;
}
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ThresholdStatus.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ThresholdStatus.java
index 5f772ef1..d9ea2176 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ThresholdStatus.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/rule/data/ThresholdStatus.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,10 +23,10 @@ package org.openecomp.sdnc.ra.rule.data;
public class ThresholdStatus {
- public ResourceRule resourceRule;
- public ResourceThreshold resourceThreshold;
- public long limitValue;
- public long thresholdValue;
- public long used;
- public long lastAdded;
+ public ResourceRule resourceRule;
+ public ResourceThreshold resourceThreshold;
+ public long limitValue;
+ public long thresholdValue;
+ public long used;
+ public long lastAdded;
}