|
|
@ -276,8 +276,9 @@ public class OperationTemplateServiceImpl implements OperationTemplateService {
|
|
|
|
throws OperationTemplateMgtPluginException {
|
|
|
|
throws OperationTemplateMgtPluginException {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
AssertUtils.hasText(subTypeId, "Invalid meter device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.hasText(subTypeId, "Invalid device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.isTrue(Integer.valueOf(subTypeId)>0, "Invalid meter device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.isTrue(Integer.parseInt(subTypeId) > 0,
|
|
|
|
|
|
|
|
"Invalid device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.hasText(deviceType, "Invalid device type.");
|
|
|
|
AssertUtils.hasText(deviceType, "Invalid device type.");
|
|
|
|
|
|
|
|
|
|
|
|
String key = OperationTemplateManagementUtil.setOperationTemplateCacheKey(deviceType, subTypeId);
|
|
|
|
String key = OperationTemplateManagementUtil.setOperationTemplateCacheKey(deviceType, subTypeId);
|
|
|
@ -294,7 +295,6 @@ public class OperationTemplateServiceImpl implements OperationTemplateService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param subTypeId
|
|
|
|
* @param subTypeId
|
|
|
|
* @param deviceType
|
|
|
|
* @param deviceType
|
|
|
|
* @param operationCode
|
|
|
|
* @param operationCode
|
|
|
@ -303,18 +303,18 @@ public class OperationTemplateServiceImpl implements OperationTemplateService {
|
|
|
|
private void validateGetOperationTemplate(String subTypeId, String deviceType, String operationCode)
|
|
|
|
private void validateGetOperationTemplate(String subTypeId, String deviceType, String operationCode)
|
|
|
|
throws OperationTemplateMgtPluginException {
|
|
|
|
throws OperationTemplateMgtPluginException {
|
|
|
|
|
|
|
|
|
|
|
|
AssertUtils.hasText(subTypeId, "Invalid meter device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.hasText(subTypeId, "Invalid device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.isTrue(Integer.valueOf(subTypeId)>0, "Invalid meter device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.isTrue(Integer.parseInt(subTypeId) > 0, "Invalid device subtype id: " + subTypeId);
|
|
|
|
AssertUtils.hasText(operationCode, "Validation failed due to invalid operation code: " + operationCode);
|
|
|
|
AssertUtils.hasText(operationCode, "Validation failed due to invalid operation code: " + operationCode);
|
|
|
|
AssertUtils.hasText(deviceType, "Invalid device type.");
|
|
|
|
AssertUtils.hasText(deviceType, "Invalid device type.");
|
|
|
|
AssertUtils.isTrue(deviceType.equals("METER"), "Invalid device type. ");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param operationTemplate
|
|
|
|
* @param operationTemplate
|
|
|
|
* @throws OperationTemplateMgtPluginException
|
|
|
|
* @throws OperationTemplateMgtPluginException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void validateAddOperationTemplate(OperationTemplate operationTemplate) throws OperationTemplateMgtPluginException {
|
|
|
|
private void validateAddOperationTemplate(OperationTemplate operationTemplate)
|
|
|
|
|
|
|
|
throws OperationTemplateMgtPluginException {
|
|
|
|
|
|
|
|
|
|
|
|
AssertUtils.isNull(operationTemplate, "Operation Template can not be null");
|
|
|
|
AssertUtils.isNull(operationTemplate, "Operation Template can not be null");
|
|
|
|
AssertUtils.hasText(operationTemplate.getOperationDefinition(), "Operation definition can not be null");
|
|
|
|
AssertUtils.hasText(operationTemplate.getOperationDefinition(), "Operation definition can not be null");
|
|
|
|