diff options
24 files changed, 95 insertions, 96 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml index 07b000875e..aa9317c920 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml +++ b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml @@ -28,7 +28,6 @@ spring: password: ${DB_ADMIN_PASSWORD} outOfOrder: true validateOnMigrate: false - repeatableSqlMigrationPrefix: RATT jpa: show-sql: true hibernate: diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java index d042c9eb19..429948cef1 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -72,6 +72,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { private static final String CREATE_NETWORK_ERROR_LOGMSG = "{} {} Error sending createNetwork notification {} "; private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info "; private static final String SHARED = "shared"; + private static final String EXTERNAL = "external"; @Autowired private Environment environment; @@ -133,8 +134,8 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { String external = null; if (params.containsKey(SHARED)) shared = params.get(SHARED); - if (params.containsKey("external")) - external = params.get("external"); + if (params.containsKey(EXTERNAL)) + external = params.get(EXTERNAL); try { networkAdapter.createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, @@ -217,8 +218,8 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { String external = null; if (params.containsKey(SHARED)) shared = params.get(SHARED); - if (params.containsKey("external")) - external = params.get("external"); + if (params.containsKey(EXTERNAL)) + external = params.get(EXTERNAL); try { networkAdapter.updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, @@ -269,7 +270,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { MsoRequest msoRequest, String notificationUrl) { logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId); - String errorCreateNetworkMessage = "{} {} Error sending createNetwork notification {} "; + String errorCreateNetworkMessage = CREATE_NETWORK_ERROR_LOGMSG; // Use the synchronous method to perform the actual Create diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java index c15fc0d204..b12d2397f9 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java @@ -87,6 +87,7 @@ public class NetworkAdapterRest { private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterRest.class); private static final String TESTING_KEYWORD = "___TESTING___"; private String exceptionMsg = "Exception:"; + private static final String SHARED = "shared"; @Autowired private MsoNetworkAdapterImpl adapter; @@ -170,7 +171,7 @@ public class NetworkAdapterRest { HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams(); if (params == null) { - params = new HashMap<String, String>(); + params = new HashMap<>(); } String shared = null; String external = null; @@ -192,8 +193,8 @@ public class NetworkAdapterRest { ctn = new ContrailNetwork(); req.setContrailNetwork(ctn); } - if (params.containsKey("shared")) { - shared = params.get("shared"); + if (params.containsKey(SHARED)) { + shared = params.get(SHARED); } else { if (ctn.getShared() != null) { shared = ctn.getShared(); @@ -218,8 +219,8 @@ public class NetworkAdapterRest { pvn = new ProviderVlanNetwork(); req.setProviderVlanNetwork(pvn); } - if (params.containsKey("shared")) - shared = params.get("shared"); + if (params.containsKey(SHARED)) + shared = params.get(SHARED); if (params.containsKey("external")) external = params.get("external"); adapter.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), @@ -573,8 +574,8 @@ public class NetworkAdapterRest { ctn = new ContrailNetwork(); req.setContrailNetwork(ctn); } - if (params.containsKey("shared")) { - shared = params.get("shared"); + if (params.containsKey(SHARED)) { + shared = params.get(SHARED); } else { if (ctn.getShared() != null) { shared = ctn.getShared(); @@ -598,8 +599,8 @@ public class NetworkAdapterRest { pvn = new ProviderVlanNetwork(); req.setProviderVlanNetwork(pvn); } - if (params.containsKey("shared")) { - shared = params.get("shared"); + if (params.containsKey(SHARED)) { + shared = params.get(SHARED); } if (params.containsKey("external")) { external = params.get("external"); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java index d2dfae4b4b..9236945d37 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java @@ -65,6 +65,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth"; private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey"; private static final String UPDATE_VNFA = "{} UpdateVnfA"; + private static final String EXCEPTION_UPDATEVNF_NOTIFICATION = "{} {} Exception sending updateVnf notification "; @Autowired private Environment environment; @@ -188,7 +189,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { vnfAdapter.updateVnf(cloudSiteId, cloudOwner, tenantId, vnfType, vnfVersion, vnfName, requestType, volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback); } catch (VnfException e) { - logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_UPDATE_VNF_ERR, + logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_UPDATE_VNF_ERR, ErrorCode.BusinessProcesssError.getValue(), e); org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null; String eMsg = null; @@ -205,7 +206,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); notifyPort.updateVnfNotification(messageId, false, exCat, eMsg, null, null); } catch (Exception e1) { - logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR, + logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_SEND_VNF_NOTIF_ERR, ErrorCode.BusinessProcesssError.getValue(), e1); } logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE); @@ -218,7 +219,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { notifyPort.updateVnfNotification(messageId, true, null, null, copyUpdateOutputs(outputs), copyVrb(vnfRollback)); } catch (Exception e) { - logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR, + logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_SEND_VNF_NOTIF_ERR, ErrorCode.BusinessProcesssError.getValue(), e); } logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index 5c7e70673b..b59a1fa79a 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -107,7 +107,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { private static final Logger logger = LoggerFactory.getLogger(MsoVnfAdapterImpl.class); - private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError"; private static final String VNF_ADAPTER_SERVICE_NAME = "MSO-BPMN:MSO-VnfAdapter."; private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; private static final String ADD_GET_FILES_ON_VOLUME_REQ = "org.onap.so.adapters.vnf.addGetFilesOnVolumeReq"; @@ -115,7 +114,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { private static final String VALET_ENABLED = "org.onap.so.adapters.vnf.valet_enabled"; private static final String FAIL_REQUESTS_ON_VALET_FAILURE = "org.onap.so.adapters.vnf.fail_requests_on_valet_failure"; - private static final String SUCCESS_MSG = "Successfully received response from Open Stack"; + private static final String OPENSTACK = "OpenStack"; @Autowired private VFModuleCustomizationRepository vfModuleCustomRepo; @@ -133,7 +132,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { /** * DO NOT use that constructor to instantiate this class, the msoPropertiesfactory will be NULL. - * + * * @see MsoVnfAdapterImpl#MsoVnfAdapterImpl(MsoPropertiesFactory, CloudConfigFactory) */ public MsoVnfAdapterImpl() { @@ -268,7 +267,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Query VNF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId, - tenantId, "OpenStack", "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryStack", me); + tenantId, OPENSTACK, "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryStack", me); logger.debug(error); throw new VnfException(me); } @@ -328,7 +327,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Delete VNF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudOwner, - cloudSiteId, tenantId, "OpenStack", "DeleteVNF", ErrorCode.DataError.getValue(), + cloudSiteId, tenantId, OPENSTACK, "DeleteVNF", ErrorCode.DataError.getValue(), "Exception - DeleteVNF", me); logger.debug(error); throw new VnfException(me); @@ -348,7 +347,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { long startTime = System.currentTimeMillis(); // rollback may be null (e.g. if stack already existed when Create was called) if (rollback == null) { - logger.info(MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf"); + logger.info(MessageEnum.RA_ROLLBACK_NULL.toString(), OPENSTACK, "rollbackVnf"); return; } @@ -373,7 +372,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Rollback VNF: " + vnfId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfId, cloudOwner, - cloudSiteId, tenantId, "OpenStack", "DeleteStack", ErrorCode.DataError.getValue(), + cloudSiteId, tenantId, OPENSTACK, "DeleteStack", ErrorCode.DataError.getValue(), "Exception - DeleteStack", me); logger.debug(error); throw new VnfException(me); @@ -655,7 +654,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "queryStack", ErrorCode.DataError.getValue(), "Exception - queryStack", me); logger.debug(error); // Failed to query the Stack due to an openstack exception. @@ -674,7 +673,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually."; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "queryStack", ErrorCode.DataError.getValue(), "Stack " + vfModuleName + " already exists"); logger.debug(error); throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId, @@ -685,7 +684,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VF: Stack " + vfModuleName + " already exists and is in FAILED state in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention."; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "queryStack", ErrorCode.DataError.getValue(), "Stack " + vfModuleName + " already exists and is " + "in FAILED state"); logger.debug(error); throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId, @@ -697,7 +696,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention."; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "queryStack", ErrorCode.DataError.getValue(), "Stack " + vfModuleName + " already exists and is " + "in UPDATED or UNKNOWN state"); logger.debug(error); throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId, @@ -709,7 +708,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VF: Stack " + vfModuleName + " already exists in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), - vfModuleName, cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", + vfModuleName, cloudOwner, cloudSiteId, tenantId, OPENSTACK, "queryStack", ErrorCode.DataError.getValue(), "Stack " + vfModuleName + " already exists"); logger.debug(error); throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId, @@ -741,7 +740,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VFModule: Attached heatStack ID Query " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "queryStack", ErrorCode.BusinessProcesssError.getValue(), "MsoException trying to query nested stack", me); logger.debug("ERROR trying to query nested stack= {}", error); throw new VnfException(me); @@ -750,7 +749,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VFModule: Attached heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"; logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, error, "OpenStack", "queryStack", + cloudOwner, cloudSiteId, tenantId, error, OPENSTACK, "queryStack", ErrorCode.BusinessProcesssError.getValue(), "Create VFModule: Attached heatStack ID " + "DOES NOT EXIST"); logger.debug(error); @@ -776,7 +775,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "QueryStack", + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "QueryStack", ErrorCode.BusinessProcesssError.getValue(), "MsoException trying to query nested base stack", me); logger.debug("ERROR trying to query nested base stack= {}", error); @@ -786,7 +785,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"; logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, error, "OpenStack", "QueryStack", + cloudOwner, cloudSiteId, tenantId, error, OPENSTACK, "QueryStack", ErrorCode.BusinessProcesssError.getValue(), "Create VFModule: Attached base heatStack ID DOES NOT EXIST"); logger.debug("Exception occurred", error); @@ -821,7 +820,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + mcu; logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), - "VF Module ModelCustomizationUuid", modelCustomizationUuid, "OpenStack", + "VF Module ModelCustomizationUuid", modelCustomizationUuid, OPENSTACK, ErrorCode.DataError.getValue(), "Create VF Module: Unable to find vfModule with " + "modelCustomizationUuid=" + mcu); logger.debug(error); @@ -850,7 +849,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (vnfResource == null) { String error = "Create VNF: Unknown VNF Type: " + vnfType; logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "VNF Type", vnfType, - "OpenStack", ErrorCode.DataError.getValue(), "Create VNF: Unknown VNF Type"); + OPENSTACK, ErrorCode.DataError.getValue(), "Create VNF: Unknown VNF Type"); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.USERDATA); } @@ -923,7 +922,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { + vnfResource.getModelUUID() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion(); - logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack", + logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, OPENSTACK, ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion"); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.USERDATA); @@ -966,7 +965,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestTypeString; logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", - vfModuleType, "OpenStack", ErrorCode.DataError.getValue(), error); + vfModuleType, OPENSTACK, ErrorCode.DataError.getValue(), error); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { @@ -980,7 +979,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (heatEnvironment == null) { String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType; logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID", - "OpenStack", ErrorCode.DataError.getValue(), error); + OPENSTACK, ErrorCode.DataError.getValue(), error); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { @@ -1161,7 +1160,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (checkRequiredParameters) { // Problem - missing one or more required parameters String error = "Create VFModule: Missing Required inputs: " + missingParams; - logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, "OpenStack", + logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, OPENSTACK, ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs"); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.USERDATA); @@ -1227,7 +1226,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, - cloudOwner, cloudSiteId, tenantId, "OpenStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, ErrorCode.DataError.getValue(), "MsoException - createStack", me); logger.debug(error); if (isValetEnabled && sendResponseToValet) { @@ -1246,7 +1245,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + npe; logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, - cloudOwner, cloudSiteId, tenantId, "OpenStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, ErrorCode.DataError.getValue(), "NullPointerException - createStack", npe); logger.debug(error); logger.debug("NULL POINTER EXCEPTION at heat.createStack"); @@ -1305,7 +1304,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, - cloudSiteId, tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), + cloudSiteId, tenantId, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), "Exception - QueryStack", me); logger.debug(error); throw new VnfException(me); @@ -1338,7 +1337,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Delete VF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudOwner, - cloudSiteId, tenantId, "OpenStack", "DeleteStack", ErrorCode.DataError.getValue(), + cloudSiteId, tenantId, OPENSTACK, "DeleteStack", ErrorCode.DataError.getValue(), "Exception - deleteStack", me); logger.debug(error); if (isValetEnabled && valetDeleteRequestSucceeded) { @@ -1474,7 +1473,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VFModule: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), "Exception - QueryStack", me); logger.debug(error); throw new VnfException(me); @@ -1486,8 +1485,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VF: Stack " + vfModuleName + " does not exist in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_NOT_EXIST.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), - error); + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), error); throw new VnfNotFound(cloudSiteId, cloudOwner, tenantId, vfModuleName); } else { logger.debug("Found Existing stack, status={}", heatStack.getStatus()); @@ -1511,7 +1509,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VF: Attached heatStack ID Query " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, - cloudSiteId, tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), + cloudSiteId, tenantId, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), "Exception - " + error, me); logger.debug("ERROR trying to query nested stack= {}", error); throw new VnfException(me); @@ -1520,7 +1518,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VFModule: Attached volume heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"; logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, - cloudOwner, cloudSiteId, tenantId, error, "OpenStack", "QueryStack", + cloudOwner, cloudSiteId, tenantId, error, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), error); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.USERDATA); @@ -1545,7 +1543,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), + cloudOwner, cloudSiteId, tenantId, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), "Exception - " + error, me); logger.debug("ERROR trying to query nested base stack= {}", error); throw new VnfException(me); @@ -1554,7 +1552,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"; logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, error, "OpenStack", "QueryStack", + cloudOwner, cloudSiteId, tenantId, error, OPENSTACK, "QueryStack", ErrorCode.DataError.getValue(), error); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.USERDATA); @@ -1585,7 +1583,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (vf == null) { String error = "Update VfModule: unable to find vfModule with modelCustomizationUuid=" + mcu; logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "VF Module Type", - vfModuleType, "OpenStack", ErrorCode.DataError.getValue(), error); + vfModuleType, OPENSTACK, ErrorCode.DataError.getValue(), error); throw new VnfException(error, MsoExceptionCategory.USERDATA); } logger.debug("Got VF module definition from Catalog: {}", vf.toString()); @@ -1665,7 +1663,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "VNF Resource type: " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + aicV; - logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack", + logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, OPENSTACK, ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion"); logger.debug(error); throw new VnfException(error, MsoExceptionCategory.USERDATA); @@ -1697,7 +1695,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestTypeString; logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", - vfModuleType, "OpenStack", ErrorCode.DataError.getValue(), error); + vfModuleType, OPENSTACK, ErrorCode.DataError.getValue(), error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { logger.debug("Got HEAT Template from DB: {}", heatTemplate.getHeatTemplate()); @@ -1706,7 +1704,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (heatEnvironment == null) { String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType; logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID", - "OpenStack", ErrorCode.DataError.getValue(), error); + OPENSTACK, ErrorCode.DataError.getValue(), error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { logger.debug("Got Heat Environment from DB: {}", heatEnvironment.getEnvironment()); @@ -1913,7 +1911,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { // Problem - missing one or more required parameters if (checkRequiredParameters) { String error = "Update VNF: Missing Required inputs: " + missingParams; - logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, "OpenStack", + logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, OPENSTACK, ErrorCode.DataError.getValue(), error); throw new VnfException(error, MsoExceptionCategory.USERDATA); } else { @@ -1936,7 +1934,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { extraParams.removeAll(paramList); if (!extraParams.isEmpty()) { logger.warn("{} {} {} {} {} {}", MessageEnum.RA_VNF_EXTRA_PARAM.toString(), vnfType, - extraParams.toString(), "OpenStack", ErrorCode.DataError.getValue(), "Extra params"); + extraParams.toString(), OPENSTACK, ErrorCode.DataError.getValue(), "Extra params"); inputs.keySet().removeAll(extraParams); } } @@ -2000,7 +1998,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_UPDATE_VNF_ERR.toString(), vfModuleType, cloudOwner, - cloudSiteId, tenantId, "OpenStack", ErrorCode.DataError.getValue(), "Exception - " + error, me); + cloudSiteId, tenantId, OPENSTACK, ErrorCode.DataError.getValue(), "Exception - " + error, me); if (isValetEnabled && sendResponseToValet) { logger.debug("valet is enabled, the orchestration failed - now sending rollback to valet"); try { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java index e1a42706a9..073ea35f9e 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java @@ -37,9 +37,9 @@ import javax.xml.ws.WebServiceFeature; wsdlLocation = "/VnfAdapterNotify.wsdl") public class VnfAdapterNotify_Service extends Service { - private final static URL VNFADAPTERNOTIFY_WSDL_LOCATION; - private final static WebServiceException VNFADAPTERNOTIFY_EXCEPTION; - private final static QName VNFADAPTERNOTIFY_QNAME = new QName("http://org.onap.so/vnfNotify", "vnfAdapterNotify"); + private static final URL VNFADAPTERNOTIFY_WSDL_LOCATION; + private static final WebServiceException VNFADAPTERNOTIFY_EXCEPTION; + private static final QName VNFADAPTERNOTIFY_QNAME = new QName("http://org.onap.so/vnfNotify", "vnfAdapterNotify"); static { VNFADAPTERNOTIFY_WSDL_LOCATION = org.onap.so.adapters.vnf.async.client.VnfAdapterNotify_Service.class @@ -53,11 +53,11 @@ public class VnfAdapterNotify_Service extends Service { } public VnfAdapterNotify_Service() { - super(__getWsdlLocation(), VNFADAPTERNOTIFY_QNAME); + super(getWsdlLocation(), VNFADAPTERNOTIFY_QNAME); } public VnfAdapterNotify_Service(WebServiceFeature... features) { - super(__getWsdlLocation(), VNFADAPTERNOTIFY_QNAME, features); + super(getWsdlLocation(), VNFADAPTERNOTIFY_QNAME, features); } public VnfAdapterNotify_Service(URL wsdlLocation) { @@ -98,7 +98,7 @@ public class VnfAdapterNotify_Service extends Service { VnfAdapterNotify.class, features); } - private static URL __getWsdlLocation() { + private static URL getWsdlLocation() { if (VNFADAPTERNOTIFY_EXCEPTION != null) { throw VNFADAPTERNOTIFY_EXCEPTION; } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java index dd64d53732..933b42e0b2 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java @@ -14,10 +14,6 @@ package org.onap.so.heatbridge.constants; public class HeatBridgeConstants { - private HeatBridgeConstants() { - throw new IllegalStateException("Trying to instantiate a constants class."); - } - /** * Openstack related constants */ @@ -70,4 +66,9 @@ public class HeatBridgeConstants { public static final String KEY_MSO_REQUEST_ID = "msoRequestId"; public static final String KEY_SO_WORKFLOW_EXCEPTION = "WorkflowException"; public static final String KEY_PROCESS_STATUS_MSG = "processStatusMsg"; + + private HeatBridgeConstants() { + throw new IllegalStateException("Trying to instantiate a constants class."); + } + } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java index 9726197172..788e038855 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java @@ -20,10 +20,6 @@ import javax.annotation.Nonnull; public class HeatBridgeUtils { - private HeatBridgeUtils() { - throw new IllegalStateException("Trying to instantiate a utility class."); - } - /** * IaaS naming convention for compute/p-interface to openstack/physical-network name mapping */ @@ -32,6 +28,10 @@ public class HeatBridgeUtils { private static final String COMPUTE_SIDE_SHARED_SRIOV_PREFIX = "sriov-s-"; private static final String COMPUTE_SIDE_DEDICATED_SRIOV_PREFIX = "sriov-d-"; + private HeatBridgeUtils() { + throw new IllegalStateException("Trying to instantiate a utility class."); + } + public static Optional<String> getMatchingPserverPifName(@Nonnull final String physicalNetworkName) { Preconditions.checkState(!Strings.isNullOrEmpty(physicalNetworkName), "Physical network name is null or " + "empty!"); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java index 83fe31a116..514f48ffc8 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java @@ -40,7 +40,6 @@ import org.springframework.stereotype.Component; @Component public class AAIVfModuleResources { - private static final Logger logger = LoggerFactory.getLogger(AAIVfModuleResources.class); @Autowired private InjectionHelper injectionHelper; @@ -97,8 +96,8 @@ public class AAIVfModuleResources { public void changeAssignVfModule(VfModule vfModule, GenericVnf vnf) { AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnf.getVnfId(), vfModule.getVfModuleId()); - org.onap.aai.domain.yang.VfModule AAIVfModule = aaiObjectMapper.mapVfModule(vfModule); - injectionHelper.getAaiClient().update(vfModuleURI, AAIVfModule); + org.onap.aai.domain.yang.VfModule aaiVfModule = aaiObjectMapper.mapVfModule(vfModule); + injectionHelper.getAaiClient().update(vfModuleURI, aaiVfModule); } public void connectVfModuleToVolumeGroup(GenericVnf vnf, VfModule vfModule, VolumeGroup volumeGroup, diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java index bf33e8f8d3..f7f5d78604 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java @@ -56,9 +56,9 @@ public class DSLNodeKey implements QueryStep { result.append("('").append(keyName).append("', "); List<String> temp = new ArrayList<>(); for (String item : values) { - if (item.equals("null")) { + if ("null".equals(item)) { temp.add(String.format("' %s '", item)); - } else if (item.equals("")) { + } else if ("".equals(item)) { temp.add("' '"); } else { temp.add(String.format("'%s'", item)); diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/parsers/UriParserSpringImpl.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/parsers/UriParserSpringImpl.java index 14a46c243b..71afdb83d9 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/parsers/UriParserSpringImpl.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/parsers/UriParserSpringImpl.java @@ -20,7 +20,6 @@ package org.onap.so.client.graphinventory.entities.uri.parsers; -import java.io.UnsupportedEncodingException; import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedHashSet; diff --git a/common/src/main/java/org/onap/so/client/sdno/beans/Body.java b/common/src/main/java/org/onap/so/client/sdno/beans/Body.java index 84dd83ea6f..8c40b749a6 100644 --- a/common/src/main/java/org/onap/so/client/sdno/beans/Body.java +++ b/common/src/main/java/org/onap/so/client/sdno/beans/Body.java @@ -37,8 +37,8 @@ public class Body implements Serializable { @JsonProperty("input") private Input input; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); - private final static long serialVersionUID = 9101706044452851559L; + private Map<String, Object> additionalProperties = new HashMap<>(); + private static final long serialVersionUID = 9101706044452851559L; @JsonProperty("input") public Input getInput() { diff --git a/common/src/main/java/org/onap/so/client/sdno/beans/Input.java b/common/src/main/java/org/onap/so/client/sdno/beans/Input.java index ea537bba09..c8122c06f6 100644 --- a/common/src/main/java/org/onap/so/client/sdno/beans/Input.java +++ b/common/src/main/java/org/onap/so/client/sdno/beans/Input.java @@ -40,7 +40,7 @@ public class Input implements Serializable { private RequestHdCustom requestHdCustom; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); private final static long serialVersionUID = 7155546785389227528L; @JsonProperty("request-healthdiagnostic") diff --git a/common/src/main/java/org/onap/so/client/sdno/beans/RequestHdCustom.java b/common/src/main/java/org/onap/so/client/sdno/beans/RequestHdCustom.java index c08d1ef386..485f64673f 100644 --- a/common/src/main/java/org/onap/so/client/sdno/beans/RequestHdCustom.java +++ b/common/src/main/java/org/onap/so/client/sdno/beans/RequestHdCustom.java @@ -49,7 +49,7 @@ public class RequestHdCustom implements Serializable { @JsonProperty("send-detailed-cmd-response") private String sendDetailedCmdResponse = "false"; @JsonProperty("aai-param-list") - private List<AAIParamList> aaiParamList = new ArrayList<AAIParamList>(); + private List<AAIParamList> aaiParamList = new ArrayList<>(); /** * No args constructor for use in serialization diff --git a/common/src/main/java/org/onap/so/client/sdno/beans/RequestHealthDiagnostic.java b/common/src/main/java/org/onap/so/client/sdno/beans/RequestHealthDiagnostic.java index c05b470b0e..b1b75ab412 100644 --- a/common/src/main/java/org/onap/so/client/sdno/beans/RequestHealthDiagnostic.java +++ b/common/src/main/java/org/onap/so/client/sdno/beans/RequestHealthDiagnostic.java @@ -52,8 +52,8 @@ public class RequestHealthDiagnostic implements Serializable { @JsonProperty("health-diagnostic-code") private String healthDiagnosticCode; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); - private final static long serialVersionUID = 1166788526178388021L; + private Map<String, Object> additionalProperties = new HashMap<>(); + private static final long serialVersionUID = 1166788526178388021L; @JsonProperty("request-client-name") public String getRequestClientName() { diff --git a/common/src/main/java/org/onap/so/client/sdno/beans/ResultInfo.java b/common/src/main/java/org/onap/so/client/sdno/beans/ResultInfo.java index 93826c752f..8b84cf6659 100644 --- a/common/src/main/java/org/onap/so/client/sdno/beans/ResultInfo.java +++ b/common/src/main/java/org/onap/so/client/sdno/beans/ResultInfo.java @@ -44,7 +44,7 @@ public class ResultInfo { @JsonProperty("status") private String status; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); @JsonProperty("client-name") public String getClientName() { diff --git a/common/src/main/java/org/onap/so/client/sdno/beans/SDNO.java b/common/src/main/java/org/onap/so/client/sdno/beans/SDNO.java index 09f408c967..46e2c1d1fc 100644 --- a/common/src/main/java/org/onap/so/client/sdno/beans/SDNO.java +++ b/common/src/main/java/org/onap/so/client/sdno/beans/SDNO.java @@ -43,8 +43,8 @@ public class SDNO implements Serializable { @JsonProperty("body") private Body body; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); - private final static long serialVersionUID = -5303297382564282650L; + private Map<String, Object> additionalProperties = new HashMap<>(); + private static final long serialVersionUID = -5303297382564282650L; @JsonProperty("operation") public String getOperation() { diff --git a/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java b/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java index e63e226457..6e2bc97ee9 100644 --- a/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java +++ b/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java @@ -73,9 +73,9 @@ public class EqualsAndHashCodeTester implements Tester { boolean hasEquals = false; boolean hasHashcode = false; for (Method method : methods) { - if (method.getName().equals("equals")) { + if ("equals".equals(method.getName())) { hasEquals = true; - } else if (method.getName().equals("hashCode")) { + } else if ("hashCode".equals(method.getName())) { hasHashcode = true; } } @@ -114,7 +114,7 @@ public class EqualsAndHashCodeTester implements Tester { Affirm.affirmTrue("HashCode test failed for [" + classInstanceOne.getClass().getName() + "]", classInstanceOne.hashCode() == classInstanceTwo.hashCode()); - Affirm.affirmFalse("Expected false for comparison of two unlike objects", classInstanceOne.equals("test")); + Affirm.affirmFalse("Expected false for comparison of two unlike objects", "test".equals(classInstanceOne)); } } diff --git a/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationMatcher.java b/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationMatcher.java index 9062f60280..42dda850f5 100644 --- a/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationMatcher.java +++ b/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationMatcher.java @@ -64,6 +64,6 @@ public class HasAnnotationMatcher<T extends PojoField> extends TypeSafeDiagnosin public static <T extends PojoField> Matcher<T> hasAnnotation(final Class<? extends Annotation> annotationType, final Matcher<? super T> annotationMatcher) { - return new HasAnnotationMatcher<T>(annotationType, annotationMatcher); + return new HasAnnotationMatcher<>(annotationType, annotationMatcher); } } diff --git a/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java b/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java index 8a47299c73..a55113b0d0 100644 --- a/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java +++ b/common/src/main/java/org/onap/so/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java @@ -78,6 +78,6 @@ public class HasAnnotationPropertyWithValueMatcher<T extends PojoField> extends public static <T extends PojoField> Matcher<T> hasAnnotationPropertyWithValue(Class<? extends Annotation> clazz, String attribute, final Matcher<?> annotationMatcher) { - return new HasAnnotationPropertyWithValueMatcher<T>(clazz, attribute, annotationMatcher); + return new HasAnnotationPropertyWithValueMatcher<>(clazz, attribute, annotationMatcher); } } diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 88a5001f17..611e2d293d 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -64,7 +64,7 @@ <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> - <version>0.19.1</version> + <version>0.28.0</version> <configuration> <verbose>true</verbose> diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image b/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image index cf50868ca5..c0b298e778 100644 --- a/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image +++ b/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image @@ -1,4 +1,4 @@ -FROM openjdk:8-jdk-alpine +FROM docker.io/openjdk:8-jdk-alpine ARG http_proxy ARG https_proxy @@ -503,7 +503,7 @@ <plugin> <groupId>io.fabric8</groupId> <artifactId>fabric8-maven-plugin</artifactId> - <version>3.5.33</version> + <version>4.0.0-M2</version> <configuration> <skip>${docker.skip}</skip> <skipBuild>${docker.skip.build}</skipBuild> diff --git a/version.properties b/version.properties index 668657e962..99af34261b 100644 --- a/version.properties +++ b/version.properties @@ -3,7 +3,7 @@ # because they are used in Jenkins, whose plug-in doesn't support major=1 -minor=4 +minor=5 patch=0 base_version=${major}.${minor}.${patch} |