diff options
author | vasraz <vasyl.razinkov@est.tech> | 2021-03-27 22:37:42 +0000 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-03-29 07:15:40 +0000 |
commit | da41c43ddbb7f688e128bf369d5a9548f807f5bb (patch) | |
tree | 7681d392e0ae4635539b38636bd45f805373707c /common-be/src/main/java/org | |
parent | 4014cbcbe3a61391fa5f7de9f42ec247ca493979 (diff) |
Reformat common-be
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3449
Change-Id: I910e423a6ff68e84035f4d3391d00f244730405c
Diffstat (limited to 'common-be/src/main/java/org')
119 files changed, 248 insertions, 712 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java index 02dcb3591b..1c7ef863b2 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java @@ -16,14 +16,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.config; -import lombok.AllArgsConstructor; -import lombok.Getter; - import java.util.Arrays; import java.util.Optional; +import lombok.AllArgsConstructor; +import lombok.Getter; /** * Stores non mano artifact types. @@ -31,6 +29,7 @@ import java.util.Optional; @Getter @AllArgsConstructor public enum NonManoArtifactType { + // @formatter:off ONAP_VES_EVENTS("onap_ves_events"), ONAP_PM_DICTIONARY("onap_pm_dictionary"), ONAP_YANG_MODULES("onap_yang_modules"), @@ -39,6 +38,7 @@ public enum NonManoArtifactType { ONAP_OTHERS("onap_others"), ONAP_SW_INFORMATION("onap_pnf_sw_information"), ONAP_CNF_HELM("onap_cnf_helm"); + // @formatter:on private final String type; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java index 2b2602240a..843d6fb07e 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java @@ -16,15 +16,13 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.config; import java.util.Collections; +import java.util.Map; import java.util.Map.Entry; import java.util.stream.Collectors; import lombok.Data; - -import java.util.Map; import org.apache.commons.collections.MapUtils; /** @@ -32,13 +30,14 @@ import org.apache.commons.collections.MapUtils; */ @Data public class NonManoConfiguration { + private Map<String, NonManoFolderType> nonManoKeyFolderMapping; /** * Gets the non mano folder type based on the non mano artifact type. + * * @param nonManoArtifactType the artifact type - * @return - * The NonManoType for the artifact type + * @return The NonManoType for the artifact type */ public NonManoFolderType getNonManoType(final NonManoArtifactType nonManoArtifactType) { return nonManoKeyFolderMapping.get(nonManoArtifactType.getType()); @@ -48,9 +47,7 @@ public class NonManoConfiguration { if (MapUtils.isEmpty(nonManoKeyFolderMapping)) { return Collections.emptyMap(); } - - return nonManoKeyFolderMapping.entrySet().stream() - .filter(entry -> entry.getValue().isValid()) + return nonManoKeyFolderMapping.entrySet().stream().filter(entry -> entry.getValue().isValid()) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java index 640c95bf65..14a48d5a03 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.config; import java.io.IOException; @@ -30,6 +29,7 @@ import org.yaml.snakeyaml.Yaml; * Singleton that loads and stores the Non Mano configuration */ public class NonManoConfigurationManager { + private static NonManoConfigurationManager nonManoConfigurationManager = null; private NonManoConfiguration nonManoConfiguration; @@ -37,6 +37,13 @@ public class NonManoConfigurationManager { loadConfiguration(); } + public static NonManoConfigurationManager getInstance() { + if (nonManoConfigurationManager == null) { + nonManoConfigurationManager = new NonManoConfigurationManager(); + } + return nonManoConfigurationManager; + } + /** * Loads the configuration yaml from the resources. */ @@ -54,14 +61,6 @@ public class NonManoConfigurationManager { nonManoConfiguration = convertFromString(data, NonManoConfiguration.class); } - public static NonManoConfigurationManager getInstance() { - if (nonManoConfigurationManager == null) { - nonManoConfigurationManager = new NonManoConfigurationManager(); - } - - return nonManoConfigurationManager; - } - public NonManoConfiguration getNonManoConfiguration() { return nonManoConfiguration; } @@ -70,9 +69,7 @@ public class NonManoConfigurationManager { try { return (new Yaml()).loadAs(yamlContents, className); } catch (final Exception e) { - throw new - LoadConfigurationException(String.format("Failed to convert YAML %s to object.", yamlContents), e); + throw new LoadConfigurationException(String.format("Failed to convert YAML %s to object.", yamlContents), e); } } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java index 4ad6c31fd5..b8df041c7c 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java @@ -23,18 +23,19 @@ import org.apache.commons.lang.StringUtils; @Data public class NonManoFolderType { + private String location; private String type; /** * Gets the expected folder path + * * @return */ public String getPath() { return String.format("Artifacts/%s/%s", type, location); } - public boolean isValid() { return StringUtils.isNotBlank(location) && StringUtils.isNotBlank(type); } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/exception/LoadConfigurationException.java b/common-be/src/main/java/org/openecomp/sdc/be/config/exception/LoadConfigurationException.java index 53432a3490..1020eb0aea 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/config/exception/LoadConfigurationException.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/config/exception/LoadConfigurationException.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.config.exception; public class LoadConfigurationException extends RuntimeException { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareInformation.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareInformation.java index cb3ef1486e..351ee967d1 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareInformation.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareInformation.java @@ -16,18 +16,16 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.pnf; +import java.util.LinkedHashSet; +import java.util.Set; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; import org.apache.commons.collections.CollectionUtils; -import java.util.LinkedHashSet; -import java.util.Set; - /** * Represents the Pnf software information non-mano yaml */ @@ -43,6 +41,7 @@ public class PnfSoftwareInformation { /** * Adds a {@link PnfSoftwareVersion} instance to the software version set + * * @param softwareVersion the pnf software version to add */ public void addToSoftwareVersionSet(final PnfSoftwareVersion softwareVersion) { @@ -53,27 +52,20 @@ public class PnfSoftwareInformation { return new LinkedHashSet<>(softwareVersionSet); } + public boolean isValid() { + if (CollectionUtils.isEmpty(softwareVersionSet)) { + return false; + } + return softwareVersionSet.stream().allMatch(PnfSoftwareVersion::isValid); + } + /** * Stores the software information yaml field names. */ @AllArgsConstructor @Getter public enum PnfSoftwareInformationField { - DESCRIPTION("description"), - PROVIDER("provider"), - VERSION("version"), - PNF_SOFTWARE_INFORMATION("pnf_software_information"); - + DESCRIPTION("description"), PROVIDER("provider"), VERSION("version"), PNF_SOFTWARE_INFORMATION("pnf_software_information"); private final String fieldName; - } - - public boolean isValid() { - if(CollectionUtils.isEmpty(softwareVersionSet)) { - return false; - } - - return softwareVersionSet.stream().allMatch(PnfSoftwareVersion::isValid); - } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareVersion.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareVersion.java index 8dbb43ae00..440acac7b2 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareVersion.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/PnfSoftwareVersion.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.pnf; import lombok.AllArgsConstructor; @@ -32,19 +31,17 @@ public class PnfSoftwareVersion { private final String version; private final String description; + public boolean isValid() { + return StringUtils.isNotEmpty(version); + } + /** * Stores the pnf software version yaml fields. */ @Getter @AllArgsConstructor public enum PnfSoftwareVersionField { - DESCRIPTION("description"), - PNF_SOFTWARE_VERSION("pnf_software_version"); - + DESCRIPTION("description"), PNF_SOFTWARE_VERSION("pnf_software_version"); private final String fieldName; } - - public boolean isValid() { - return StringUtils.isNotEmpty(version); - } -}
\ No newline at end of file +} diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/SoftwareInformationArtifactYamlParser.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/SoftwareInformationArtifactYamlParser.java index ad67962de4..671a003ed5 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/SoftwareInformationArtifactYamlParser.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/pnf/SoftwareInformationArtifactYamlParser.java @@ -16,9 +16,13 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.pnf; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Optional; import org.apache.commons.collections.CollectionUtils; import org.onap.sdc.tosca.services.YamlUtil; import org.openecomp.sdc.be.csar.pnf.PnfSoftwareInformation.PnfSoftwareInformationField; @@ -27,28 +31,21 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.error.YAMLException; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Optional; - /** * Handles the parsing of the non-mano software information file. */ public class SoftwareInformationArtifactYamlParser { + private static final Logger LOGGER = LoggerFactory.getLogger(SoftwareInformationArtifactYamlParser.class); private SoftwareInformationArtifactYamlParser() { - } /** * Parses the non-mano software information yaml file. * * @param softwareInformationYamlFileBytes the file byte array - * @return an {@code Optional<PnfSoftwareInformation>} if the file was successful parsed, otherwise {@code - * Optional.empty()} + * @return an {@code Optional<PnfSoftwareInformation>} if the file was successful parsed, otherwise {@code Optional.empty()} */ @SuppressWarnings("unchecked") public static Optional<PnfSoftwareInformation> parse(final byte[] softwareInformationYamlFileBytes) { @@ -58,23 +55,17 @@ public class SoftwareInformationArtifactYamlParser { if (!(yaml instanceof Map)) { return Optional.empty(); } - softwareVersionYamlObject = (Map<String, Object>) yaml; // unchecked warning suppressed } catch (final IOException | YAMLException e) { LOGGER.warn("Could not parse the software information yaml file", e); return Optional.empty(); } - final PnfSoftwareInformation pnfSoftwareInformation = new PnfSoftwareInformation(); - pnfSoftwareInformation.setDescription( - (String) softwareVersionYamlObject.get(PnfSoftwareInformationField.DESCRIPTION.getFieldName())); - pnfSoftwareInformation.setProvider( - (String) softwareVersionYamlObject.get(PnfSoftwareInformationField.PROVIDER.getFieldName())); - pnfSoftwareInformation.setVersion( - (String) softwareVersionYamlObject.get(PnfSoftwareInformationField.VERSION.getFieldName())); + pnfSoftwareInformation.setDescription((String) softwareVersionYamlObject.get(PnfSoftwareInformationField.DESCRIPTION.getFieldName())); + pnfSoftwareInformation.setProvider((String) softwareVersionYamlObject.get(PnfSoftwareInformationField.PROVIDER.getFieldName())); + pnfSoftwareInformation.setVersion((String) softwareVersionYamlObject.get(PnfSoftwareInformationField.VERSION.getFieldName())); final List<Map<String, String>> pnfSoftwareInformationYaml = (List<Map<String, String>>) softwareVersionYamlObject .get(PnfSoftwareInformationField.PNF_SOFTWARE_INFORMATION.getFieldName()); // unchecked warning suppressed - if (CollectionUtils.isNotEmpty(pnfSoftwareInformationYaml)) { pnfSoftwareInformationYaml.forEach(stringStringMap -> { final String description = stringStringMap.get(PnfSoftwareVersionField.DESCRIPTION.getFieldName()); @@ -82,9 +73,6 @@ public class SoftwareInformationArtifactYamlParser { pnfSoftwareInformation.addToSoftwareVersionSet(new PnfSoftwareVersion(version, description)); }); } - return Optional.of(pnfSoftwareInformation); } - - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/CertificateManagerImpl.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/CertificateManagerImpl.java index 9ec8ea864e..7323eae690 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/CertificateManagerImpl.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/CertificateManagerImpl.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security; import java.io.File; @@ -47,21 +46,16 @@ import org.springframework.stereotype.Component; @Component public class CertificateManagerImpl implements CertificateManager { + public static final String CERT_DIR_ENV_VARIABLE = "SDC_CERT_DIR"; private static final Logger LOGGER = LoggerFactory.getLogger(CertificateManagerImpl.class); - private final PrivateKeyReader privateKeyReader; private final CertificateReader certificateReader; private final Environment environment; - + private final Map<String, CertificateInfo> certificateMap = new HashMap<>(); private Path certificateDirectoryPath; private File certificateDirectory; - private final Map<String, CertificateInfo> certificateMap = new HashMap<>(); - public static final String CERT_DIR_ENV_VARIABLE = "SDC_CERT_DIR"; - - public CertificateManagerImpl(final PrivateKeyReader privateKeyReader, - final CertificateReader certificateReader, - final Environment environment) { + public CertificateManagerImpl(final PrivateKeyReader privateKeyReader, final CertificateReader certificateReader, final Environment environment) { this.certificateReader = certificateReader; this.privateKeyReader = privateKeyReader; this.environment = environment; @@ -72,7 +66,6 @@ public class CertificateManagerImpl implements CertificateManager { if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { Security.addProvider(new BouncyCastleProvider()); } - final String certificateDir = environment.getProperty(CERT_DIR_ENV_VARIABLE); if (certificateDir == null) { LOGGER.warn("Environment variable '{}' was not provided. Could not load certificates.", CERT_DIR_ENV_VARIABLE); @@ -81,8 +74,8 @@ public class CertificateManagerImpl implements CertificateManager { try { this.certificateDirectoryPath = Paths.get(certificateDir); } catch (final Exception e) { - LOGGER.error("Invalid path '{}' provided in the environment variable '{}'. Could not load certificates.", - certificateDir, CERT_DIR_ENV_VARIABLE, e); + LOGGER.error("Invalid path '{}' provided in the environment variable '{}'. Could not load certificates.", certificateDir, + CERT_DIR_ENV_VARIABLE, e); return; } try { @@ -104,49 +97,37 @@ public class CertificateManagerImpl implements CertificateManager { LOGGER.warn("Certificate directory is empty. No trusted certificate found."); return; } - - final List<File> certFileList = Arrays.stream(files) - .filter(file -> "cert".equals(FilenameUtils.getExtension(file.getName()))) + final List<File> certFileList = Arrays.stream(files).filter(file -> "cert".equals(FilenameUtils.getExtension(file.getName()))) .collect(Collectors.toList()); - final List<File> keyFileList = Arrays.stream(files) - .filter(file -> "key".equals(FilenameUtils.getExtension(file.getName()))) + final List<File> keyFileList = Arrays.stream(files).filter(file -> "key".equals(FilenameUtils.getExtension(file.getName()))) .collect(Collectors.toList()); - if (certFileList.isEmpty()) { LOGGER.error("Certificate directory is empty. No trusted certificate found."); return; } - certFileList.forEach(certFile -> { final String baseFileName = FilenameUtils.getBaseName(certFile.getName()); final Certificate certificate = loadCertificate(certFile); - final Optional<File> keyFileOptional = keyFileList.stream().filter( - keyFile1 -> FilenameUtils.getBaseName(keyFile1.getName()) - .equals(baseFileName)).findFirst(); - keyFileOptional.ifPresentOrElse( - keyFile -> { - final CertificateInfoImpl certificateInfo = - new CertificateInfoImpl(certFile, certificate, keyFile, loadPrivateKey(keyFile)); - if (certificateInfo.isValid()) { - certificateMap.put(baseFileName, certificateInfo); - } - }, - () -> { - final CertificateInfoImpl certificateInfo = new CertificateInfoImpl(certFile, certificate); - if (certificateInfo.isValid()) { - certificateMap.put(baseFileName, new CertificateInfoImpl(certFile, certificate)); - } + final Optional<File> keyFileOptional = keyFileList.stream() + .filter(keyFile1 -> FilenameUtils.getBaseName(keyFile1.getName()).equals(baseFileName)).findFirst(); + keyFileOptional.ifPresentOrElse(keyFile -> { + final CertificateInfoImpl certificateInfo = new CertificateInfoImpl(certFile, certificate, keyFile, loadPrivateKey(keyFile)); + if (certificateInfo.isValid()) { + certificateMap.put(baseFileName, certificateInfo); + } + }, () -> { + final CertificateInfoImpl certificateInfo = new CertificateInfoImpl(certFile, certificate); + if (certificateInfo.isValid()) { + certificateMap.put(baseFileName, new CertificateInfoImpl(certFile, certificate)); } - ); + }); }); } private void loadCertificateDirectory() { final File file = certificateDirectoryPath.toFile(); if (!file.exists() || !file.isDirectory()) { - final String errorMsg = - String.format("Provided certificate path '%s' is not a directory or does not exist", - certificateDirectoryPath); + final String errorMsg = String.format("Provided certificate path '%s' is not a directory or does not exist", certificateDirectoryPath); throw new CertificateNotFoundException(errorMsg); } this.certificateDirectory = file; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/PrivateKeyReaderImpl.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/PrivateKeyReaderImpl.java index a6ee61d680..d042ef0dd0 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/PrivateKeyReaderImpl.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/PrivateKeyReaderImpl.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security; import java.io.File; @@ -49,5 +48,4 @@ public class PrivateKeyReaderImpl implements PrivateKeyReader { final String errorMsg = "Could not load the private key from given file '%s'. Unsupported format."; throw new UnsupportedKeyFormatException(String.format(errorMsg, privateKeyFile)); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/Sha256WithRsaCmsContentSigner.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/Sha256WithRsaCmsContentSigner.java index 7b7273e810..ef0315dd84 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/Sha256WithRsaCmsContentSigner.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/Sha256WithRsaCmsContentSigner.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security; import java.io.IOException; @@ -48,24 +47,17 @@ import org.springframework.stereotype.Component; public class Sha256WithRsaCmsContentSigner implements CmsContentSigner { @Override - public byte[] signData(final byte[] data, final Certificate signingCertificate, final Key signingKey) - throws CmsSignatureException { - + public byte[] signData(final byte[] data, final Certificate signingCertificate, final Key signingKey) throws CmsSignatureException { final CMSTypedData cmsData = new CMSProcessableByteArray(data); final JcaCertStore certStore = createCertificateStore(signingCertificate); try { - final ContentSigner contentSigner - = new JcaContentSignerBuilder("SHA256withRSA") - .setProvider(BouncyCastleProvider.PROVIDER_NAME).build((PrivateKey) signingKey); - + final ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA").setProvider(BouncyCastleProvider.PROVIDER_NAME) + .build((PrivateKey) signingKey); final CMSSignedDataGenerator cmsGenerator = new CMSSignedDataGenerator(); cmsGenerator.addSignerInfoGenerator( - new JcaSignerInfoGeneratorBuilder( - new JcaDigestCalculatorProviderBuilder().setProvider(BouncyCastleProvider.PROVIDER_NAME).build() - ).build(contentSigner, (X509Certificate) signingCertificate) - ); + new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider(BouncyCastleProvider.PROVIDER_NAME).build()) + .build(contentSigner, (X509Certificate) signingCertificate)); cmsGenerator.addCertificates(certStore); - final CMSSignedData cms = cmsGenerator.generate(cmsData, false); return cms.getEncoded(); } catch (final Exception e) { @@ -89,10 +81,8 @@ public class Sha256WithRsaCmsContentSigner implements CmsContentSigner { try { return new JcaCertStore(Collections.singletonList(signingCertificate)); } catch (final CertificateEncodingException e) { - final String errorMsg = String - .format("Could not create certificate store from certificate '%s'", signingCertificate); + final String errorMsg = String.format("Could not create certificate store from certificate '%s'", signingCertificate); throw new CmsSignatureException(errorMsg, e); } } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/X509CertificateReader.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/X509CertificateReader.java index b8e95e7b18..a0f4226cd1 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/X509CertificateReader.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/X509CertificateReader.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security; import java.io.File; @@ -53,5 +52,4 @@ public class X509CertificateReader implements CertificateReader { final CertificateFactory factory = CertificateFactory.getInstance("X.509"); return factory.generateCertificate(certificateInputStream); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateManager.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateManager.java index 53437f399f..2a1a702118 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateManager.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateManager.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.api; import java.util.Optional; @@ -25,5 +24,4 @@ import org.openecomp.sdc.be.csar.security.api.model.CertificateInfo; public interface CertificateManager { Optional<CertificateInfo> getCertificate(String certName); - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateReader.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateReader.java index 4c32fa1cee..62b36904c1 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateReader.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CertificateReader.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.api; import java.io.File; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CmsContentSigner.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CmsContentSigner.java index 37bd988e50..0bd056fede 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CmsContentSigner.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/CmsContentSigner.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.api; import java.security.Key; @@ -25,8 +24,7 @@ import org.openecomp.sdc.be.csar.security.exception.CmsSignatureException; public interface CmsContentSigner { - byte[] signData(byte[] data, Certificate signingCertificate, Key signingKey) - throws CmsSignatureException; + byte[] signData(byte[] data, Certificate signingCertificate, Key signingKey) throws CmsSignatureException; String formatToPemSignature(byte[] signedData) throws CmsSignatureException; } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/PrivateKeyReader.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/PrivateKeyReader.java index 3e8c406b74..2650eb5455 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/PrivateKeyReader.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/PrivateKeyReader.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.api; import java.io.File; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/model/CertificateInfo.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/model/CertificateInfo.java index 5b234cc661..7fe425c23a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/model/CertificateInfo.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/api/model/CertificateInfo.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.api.model; import java.io.File; @@ -42,5 +41,4 @@ public interface CertificateInfo { * @throws UnsupportedOperationException when the certificate is not supported */ boolean isValid(); - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CertificateNotFoundException.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CertificateNotFoundException.java index a2175f379c..a37aa6d53c 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CertificateNotFoundException.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CertificateNotFoundException.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.exception; public class CertificateNotFoundException extends RuntimeException { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CmsSignatureException.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CmsSignatureException.java index 6bc49d6e4d..8ed0283ebf 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CmsSignatureException.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/CmsSignatureException.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.exception; public class CmsSignatureException extends Exception { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadCertificateException.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadCertificateException.java index 3cd10628f5..aaa3f667ea 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadCertificateException.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadCertificateException.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.exception; public class LoadCertificateException extends RuntimeException { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadPrivateKeyException.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadPrivateKeyException.java index 00681bc842..54b6a60dc0 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadPrivateKeyException.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/LoadPrivateKeyException.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.exception; public class LoadPrivateKeyException extends RuntimeException { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/UnsupportedKeyFormatException.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/UnsupportedKeyFormatException.java index d30f6f274a..e7b37a7c57 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/UnsupportedKeyFormatException.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/exception/UnsupportedKeyFormatException.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.exception; public class UnsupportedKeyFormatException extends RuntimeException { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/model/CertificateInfoImpl.java b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/model/CertificateInfoImpl.java index f7b2fafb3c..49c2c61b69 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/csar/security/model/CertificateInfoImpl.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/csar/security/model/CertificateInfoImpl.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.csar.security.model; import java.io.File; @@ -33,7 +32,6 @@ import org.slf4j.LoggerFactory; public class CertificateInfoImpl implements CertificateInfo { private static final Logger LOGGER = LoggerFactory.getLogger(CertificateInfoImpl.class); - private final String name; private final File certificateFile; private final Certificate certificate; @@ -46,8 +44,7 @@ public class CertificateInfoImpl implements CertificateInfo { this.name = FilenameUtils.getBaseName(certificateFile.getName()); } - public CertificateInfoImpl(final File certificateFile, final Certificate certificate, - final File privateKeyFile, final Key privateKey) { + public CertificateInfoImpl(final File certificateFile, final Certificate certificate, final File privateKeyFile, final Key privateKey) { this(certificateFile, certificate); this.privateKeyFile = privateKeyFile; this.privateKey = privateKey; @@ -55,7 +52,7 @@ public class CertificateInfoImpl implements CertificateInfo { @Override public boolean isValid() { - if("X.509".equals(certificate.getType())) { + if ("X.509".equals(certificate.getType())) { try { ((X509Certificate) certificate).checkValidity(); return true; @@ -66,5 +63,4 @@ public class CertificateInfoImpl implements CertificateInfo { } throw new UnsupportedOperationException(String.format("Certificate type '%s' not supported", certificate.getType())); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java index 5758dbeaf5..171eb70457 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java @@ -17,16 +17,15 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.category; -import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; -import lombok.NoArgsConstructor; -import java.util.List; +import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; @Getter @Setter @@ -50,5 +49,4 @@ public class CategoryDataDefinition extends ToscaDataDefinition { this.useServiceSubstitutionForNestedServices = c.useServiceSubstitutionForNestedServices; this.metadataKeys = c.metadataKeys; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/GroupingDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/GroupingDataDefinition.java index 69edbf2833..48f7ac3639 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/GroupingDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/GroupingDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.category; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; @@ -29,7 +28,6 @@ public class GroupingDataDefinition extends ToscaDataDefinition { private String uniqueId; public GroupingDataDefinition() { - } public GroupingDataDefinition(GroupingDataDefinition c) { @@ -107,8 +105,6 @@ public class GroupingDataDefinition extends ToscaDataDefinition { @Override public String toString() { - return "GroupingDataDefinition [name=" + name + ", normalizedName=" + normalizedName + ", uniqueId=" + uniqueId - + "]"; + return "GroupingDataDefinition [name=" + name + ", normalizedName=" + normalizedName + ", uniqueId=" + uniqueId + "]"; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/MetadataKeyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/MetadataKeyDataDefinition.java index 3278ec65ea..4ee4c59d19 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/MetadataKeyDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/MetadataKeyDataDefinition.java @@ -19,12 +19,12 @@ package org.openecomp.sdc.be.datatypes.category; import java.util.List; -import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; +import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; @Getter @Setter @@ -32,11 +32,12 @@ import lombok.ToString; @ToString @NoArgsConstructor public class MetadataKeyDataDefinition extends ToscaDataDefinition { + private String name; private List<String> validValues; private boolean mandatory; private String defaultValue; - + public MetadataKeyDataDefinition(MetadataKeyDataDefinition metadataKeyDataDefinition) { this.name = metadataKeyDataDefinition.name; this.validValues = metadataKeyDataDefinition.validValues; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinition.java index 38d7027e49..38419456b1 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinition.java @@ -17,16 +17,15 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.category; -import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; -import java.util.List; +import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; @Getter @Setter @@ -48,5 +47,4 @@ public class SubCategoryDataDefinition extends ToscaDataDefinition { this.icons = c.icons; this.metadataKeys = c.metadataKeys; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java index 96cccf62bb..ebccc6c2b8 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.components; import java.util.ArrayList; @@ -41,7 +40,6 @@ import org.openecomp.sdc.common.log.wrappers.Logger; public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinition { private static final Logger LOGGER = Logger.getLogger(ComponentMetadataDataDefinition.class.getName()); - @Getter private String uniqueId; @Getter @@ -205,8 +203,7 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio public void setInvariantUUID(String invariantUUID) { if (this.invariantUUID != null && !this.invariantUUID.equals(invariantUUID)) { - LOGGER.warn("InvariantUUID changed more then once -> OLD : {} , NEW: {} ", this.invariantUUID, - invariantUUID); + LOGGER.warn("InvariantUUID changed more then once -> OLD : {} , NEW: {} ", this.invariantUUID, invariantUUID); } this.invariantUUID = invariantUUID; } @@ -249,5 +246,4 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio * @return */ public abstract String getActualComponentType(); - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java index ddb25c6e29..ced5a679d7 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.components; import lombok.EqualsAndHashCode; @@ -31,7 +30,9 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit private String vendorRelease; private String resourceVendorModelNumber; private ResourceTypeEnum resourceType = ResourceTypeEnum.VFC; // ResourceType.VFC + // is + // default private Boolean isAbstract; private String cost; @@ -129,14 +130,12 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit @Override public String toString() { - return "ResourceMetadataDataDefinition [vendorName=" + vendorName + ", vendorRelease=" + vendorRelease - + ", resourceVendorModelNumber=" + resourceVendorModelNumber + ", resourceType=" + resourceType - + ", isAbstract=" + isAbstract + super.toString() + "]"; + return "ResourceMetadataDataDefinition [vendorName=" + vendorName + ", vendorRelease=" + vendorRelease + ", resourceVendorModelNumber=" + + resourceVendorModelNumber + ", resourceType=" + resourceType + ", isAbstract=" + isAbstract + super.toString() + "]"; } @Override public String getActualComponentType() { return getResourceType().getValue(); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java index b8cc269bdf..84cf853d7a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.components; import lombok.Data; @@ -25,36 +24,19 @@ import lombok.NoArgsConstructor; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFieldsExtractor; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; - @Data @NoArgsConstructor public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefinition { private static final String EMPTY_STR = ""; - private String distributionStatus; - - private String serviceType = EMPTY_STR; - - private String serviceRole = EMPTY_STR; - - private String instantiationType = EMPTY_STR; - - private String serviceFunction = EMPTY_STR; - - private Boolean ecompGeneratedNaming = true; - - private String namingPolicy = EMPTY_STR; - - private String environmentContext; - private String serviceVendorModelNumber; public Boolean isAbstract; private ResourceTypeEnum importServiceType = ResourceTypeEnum.SERVICE; @@ -79,13 +61,11 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti } public Boolean isEcompGeneratedNaming() { - return getEcompGeneratedNaming(); + return getEcompGeneratedNaming(); } @Override public String getActualComponentType() { - return componentType != null ? componentType.getValue() : ""; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java index 10881e325a..a5e8ade5c4 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -37,7 +36,6 @@ public class AdditionalInfoParameterDataDefinition extends ToscaDataDefinition { private Long creationTime; private Long modificationTime; private Integer lastCreatedCounter = 0; - @ToString.Exclude private List<AdditionalInfoParameterInfo> parameters; @@ -48,5 +46,4 @@ public class AdditionalInfoParameterDataDefinition extends ToscaDataDefinition { this.lastCreatedCounter = p.lastCreatedCounter; this.parameters = p.parameters; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java index 53bf3da5fc..dc6a07206a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.AllArgsConstructor; @@ -42,5 +41,4 @@ public class AdditionalInfoParameterInfo extends ToscaDataDefinition { this.key = key; this.value = value; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java index 6e561184ff..d24c6d77dd 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -35,7 +34,6 @@ public class Annotation { @EqualsAndHashCode.Include private String name; - private String type; private String description; private List<PropertyDataDefinition> properties; @@ -43,5 +41,4 @@ public class Annotation { public static void setAnnotationsName(Map<String, Annotation> annotations) { annotations.forEach((name, annotation) -> annotation.setName(name)); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java index 8088d8a8a9..7803690dac 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.Getter; @@ -33,15 +32,11 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class AnnotationTypeDataDefinition extends ToscaDataDefinition { protected String uniqueId; - @ToString.Exclude protected String type; - protected String description; - protected Long creationTime; protected Long modificationTime; - protected String version; protected boolean highestVersion; @@ -54,5 +49,4 @@ public class AnnotationTypeDataDefinition extends ToscaDataDefinition { modificationTime = other.modificationTime; highestVersion = other.highestVersion; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java index 3b1b26659f..b71a95a1fa 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.ArrayList; @@ -76,18 +75,14 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { } this.setGeneratedFromId(a.getGeneratedFromId()); this.setIsFromCsar(a.getIsFromCsar()); - - } public String getArtifactName() { return (String) getToscaPresentationValue(JsonPresentationFields.NAME); - } public void setArtifactName(String artifactName) { setToscaPresentationValue(JsonPresentationFields.NAME, artifactName); - } public String getArtifactType() { @@ -96,7 +91,6 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { public void setArtifactType(String artifactType) { setToscaPresentationValue(JsonPresentationFields.ARTIFACT_TYPE, artifactType); - } public boolean isHeatEnvType() { @@ -105,7 +99,6 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { public String getArtifactRef() { return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_REF); - } public void setArtifactRef(String artifactRef) { @@ -114,7 +107,6 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { public String getArtifactRepository() { return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_REPOSITORY); - } public void setArtifactRepository(String artifactRepository) { @@ -130,7 +122,6 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { } public String getUserIdCreator() { - return (String) getToscaPresentationValue(JsonPresentationFields.USER_ID_CREATOR); } @@ -367,21 +358,18 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { return "ArtifactDataDefinition [uniqueId=" + getUniqueId() + ", artifactType=" + getArtifactType() + ", artifactRef=" + getArtifactRef() + ", artifactName=" + getArtifactName() + ", artifactRepository=" + getArtifactRepository() + ", artifactChecksum=" + getArtifactChecksum() + ", userIdCreator=" + getUserIdCreator() + ", userIdLastUpdater=" + getUserIdLastUpdater() + ", creatorFullName=" - + getCreatorFullName() + ", updaterFullName=" + getUpdaterFullName() + ", creationDate=" + getCreationDate() - + ", lastUpdateDate=" + getLastUpdateDate() + ", esId=" + getEsId() + ", artifactLabel=" + getArtifactLabel() + ", artifactCreator=" - + getArtifactCreator() + ", description=" + getDescription() + ", mandatory=" + getMandatory() + ", artifactDisplayName=" - + getArtifactDisplayName() + ", apiUrl=" + getApiUrl() + ", serviceApi=" + getServiceApi() + ", artifactGroupType=" - + getArtifactGroupType() + ", timeout=" + getTimeout() + ", artifactVersion=" + getArtifactVersion() + ", artifactUUID=" - + getArtifactUUID() - + ", payloadUpdateDate=" + getPayloadUpdateDate() + ", heatParamsUpdateDate=" + getHeatParamsUpdateDate() + ", requiredArtifacts=" - + getRequiredArtifacts() + "]"; + + getCreatorFullName() + ", updaterFullName=" + getUpdaterFullName() + ", creationDate=" + getCreationDate() + ", lastUpdateDate=" + + getLastUpdateDate() + ", esId=" + getEsId() + ", artifactLabel=" + getArtifactLabel() + ", artifactCreator=" + getArtifactCreator() + + ", description=" + getDescription() + ", mandatory=" + getMandatory() + ", artifactDisplayName=" + getArtifactDisplayName() + + ", apiUrl=" + getApiUrl() + ", serviceApi=" + getServiceApi() + ", artifactGroupType=" + getArtifactGroupType() + ", timeout=" + + getTimeout() + ", artifactVersion=" + getArtifactVersion() + ", artifactUUID=" + getArtifactUUID() + ", payloadUpdateDate=" + + getPayloadUpdateDate() + ", heatParamsUpdateDate=" + getHeatParamsUpdateDate() + ", requiredArtifacts=" + getRequiredArtifacts() + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; - String apiUrl = getApiUrl(); String artifactChecksum = getArtifactChecksum(); String artifactCreator = getArtifactCreator(); @@ -392,27 +380,23 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { String artifactRef = getArtifactRef(); String artifactRepository = getArtifactRepository(); String artifactType = getArtifactType(); - String artifactUUID = getArtifactUUID(); String artifactVersion = getArtifactVersion(); String userIdCreator = getUserIdCreator(); String userIdLastUpdater = getUserIdLastUpdater(); Long creationDate = getCreationDate(); - String creatorFullName = getCreatorFullName(); String description = getDescription(); String esId = getEsId(); Long heatParamsUpdateDate = getHeatParamsUpdateDate(); Long lastUpdateDate = getLastUpdateDate(); Boolean mandatory = getMandatory(); - Long payloadUpdateDate = getPayloadUpdateDate(); List<String> requiredArtifacts = getRequiredArtifacts(); Boolean serviceApi = getServiceApi(); Integer timeout = getTimeout(); String uniqueId = getUniqueId(); String updaterFullName = getUpdaterFullName(); - result = prime * result + ((apiUrl == null) ? 0 : apiUrl.hashCode()); result = prime * result + ((artifactChecksum == null) ? 0 : artifactChecksum.hashCode()); result = prime * result + ((artifactCreator == null) ? 0 : artifactCreator.hashCode()); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java index 7be02e77e7..c16efe9c65 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java @@ -61,7 +61,6 @@ public class AttributeDataDefinition extends ToscaDataDefinition { if (CollectionUtils.isNotEmpty(attributeDataDefinition.getGetOutputValues())) { this.getOutputValues = new ArrayList<>(attributeDataDefinition.getGetOutputValues()); } - } public String getUniqueId() { @@ -126,5 +125,4 @@ public class AttributeDataDefinition extends ToscaDataDefinition { public String getParentUniqueId() { return getOwnerId(); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CINodeFilterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CINodeFilterDataDefinition.java index 1a9c7e55af..14becbf647 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CINodeFilterDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CINodeFilterDataDefinition.java @@ -44,8 +44,7 @@ public class CINodeFilterDataDefinition extends ToscaDataDefinition implements S } public ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> getProperties() { - return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue( - JsonPresentationFields.PROPERTIES); + return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES); } public void setProperties(ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> properties) { @@ -68,5 +67,4 @@ public class CINodeFilterDataDefinition extends ToscaDataDefinition implements S public void setID(String name) { setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, name); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java index cc8131b13e..92bfe593b4 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.google.common.collect.Lists; @@ -55,32 +54,27 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { this.setName(other.getName()); this.setParentName(other.getParentName()); this.setPreviousName(other.getPreviousName()); - if (other.getValidSourceTypes() == null) { this.setValidSourceTypes(Lists.newArrayList()); } else { this.setValidSourceTypes(Lists.newArrayList(other.getValidSourceTypes())); } - if (other.getCapabilitySources() == null) { this.setCapabilitySources(Lists.newArrayList()); } else { this.setCapabilitySources(Lists.newArrayList(other.getCapabilitySources())); } - this.setOwnerId(other.getOwnerId()); this.setOwnerName(other.getOwnerName()); this.setOwnerType(other.getOwnerType()); this.setMinOccurrences(other.getMinOccurrences()); this.setMaxOccurrences(other.getMaxOccurrences()); this.setLeftOccurrences(other.getLeftOccurrences()); - if (other.getPath() == null) { this.setPath(Lists.newArrayList()); } else { this.setPath(Lists.newArrayList(other.getPath())); } - this.setSource(other.getSource()); this.setOwnerType(other.getOwnerType()); } @@ -244,12 +238,10 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { setPath(path); } - @Override public int hashCode() { final int prime = 31; int result = 1; - String uniqueId = this.getUniqueId(); String description = this.getDescription(); String name = this.getName(); @@ -257,14 +249,12 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { List<String> validSourceTypes = this.getValidSourceTypes(); List<String> capabilitySources = this.getCapabilitySources(); List<String> path = this.getPath(); - String ownerId = this.getOwnerId(); String ownerName = this.getOwnerName(); String minOccurrences = this.getMinOccurrences(); String maxOccurrences = this.getMaxOccurrences(); String leftOccurrences = getLeftOccurrences(); String source = getSource(); - result = prime * result + ((capabilitySources == null) ? 0 : capabilitySources.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((maxOccurrences == null) ? 0 : maxOccurrences.hashCode()); @@ -272,7 +262,6 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode()); result = prime * result + ((ownerName == null) ? 0 : ownerName.hashCode()); - result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode()); result = prime * result + ((validSourceTypes == null) ? 0 : validSourceTypes.hashCode()); @@ -284,7 +273,6 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { @Override public boolean equals(Object obj) { - String uniqueId = this.getUniqueId(); String description = this.getDescription(); String name = this.getName(); @@ -298,7 +286,6 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { String leftOccurrences = getLeftOccurrences(); List<String> path = this.getPath(); String source = getSource(); - if (this == obj) { return true; } @@ -414,18 +401,13 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { String minOccurrences = this.getMinOccurrences(); String maxOccurrences = this.getMaxOccurrences(); String source = this.getSource(); - - return "CapabilityDefinition [uniqueId=" + uniqueId + ", description=" + description + ", name=" + name - + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources=" - + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName - + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source + "]"; + return "CapabilityDefinition [uniqueId=" + uniqueId + ", description=" + description + ", name=" + name + ", type=" + type + + ", validSourceTypes=" + validSourceTypes + ", capabilitySources=" + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + + ownerName + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source + "]"; } public enum OwnerType { - GROUP("group"), - COMPONENT_INSTANCE("component instance"), - RESOURCE("resource"); - + GROUP("group"), COMPONENT_INSTANCE("component instance"), RESOURCE("resource"); private String value; OwnerType(String value) { @@ -444,7 +426,5 @@ public class CapabilityDataDefinition extends ToscaDataDefinition { public String getValue() { return value; } - } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java index 7c04e57904..9369616710 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -106,10 +105,7 @@ public class CapabilityTypeDataDefinition extends ToscaDataDefinition { String version = getVersion(); Long creationTime = getCreationTime(); Long modificationTime = getModificationTime(); - - return "CapabilityTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type - + ", validSourceTypes=" + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime - + ", modificationTime=" + modificationTime + "]"; + return "CapabilityTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes=" + + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime + ", modificationTime=" + modificationTime + "]"; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java index c049d77872..46e6687cd6 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.ArrayList; @@ -180,7 +179,6 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition { OriginTypeEnum originType = null; String origType = (String) getToscaPresentationValue(JsonPresentationFields.CI_ORIGIN_TYPE); if (origType != null && !origType.isEmpty()) { - originType = OriginTypeEnum.findByValue(origType); } return originType; @@ -333,15 +331,12 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition { @Override public String toString() { - return "ComponentInstanceDataDefinition [icon=" + getIcon() + ", uniqueId=" + getUniqueId() + ", name=" - + getName() + ", normalizedName=" + getNormalizedName() + ", componentUid=" + getComponentUid() - + ", creationTime=" + getCreationTime() + ", modificationTime=" + getModificationTime() - + ", description=" + getDescription() + ", posX=" + getPosX() + ", posY=" + getPosY() - + ", propertyValueCounter=" + getPropertyValueCounter() + ", attributeValueCounter=" - + getAttributeValueCounter() + ", inputValueCounter=" + getInputValueCounter() + ", originType=" - + getOriginType() + ", customizationUUID=" + getCustomizationUUID() + ", componentName=" - + getComponentName() + ", componentVersion=" + getComponentVersion() + ", toscaComponentName=" - + getToscaComponentName() + ", directives =" + getDirectivesString() + "]"; + return "ComponentInstanceDataDefinition [icon=" + getIcon() + ", uniqueId=" + getUniqueId() + ", name=" + getName() + ", normalizedName=" + + getNormalizedName() + ", componentUid=" + getComponentUid() + ", creationTime=" + getCreationTime() + ", modificationTime=" + + getModificationTime() + ", description=" + getDescription() + ", posX=" + getPosX() + ", posY=" + getPosY() + ", propertyValueCounter=" + + getPropertyValueCounter() + ", attributeValueCounter=" + getAttributeValueCounter() + ", inputValueCounter=" + getInputValueCounter() + + ", originType=" + getOriginType() + ", customizationUUID=" + getCustomizationUUID() + ", componentName=" + getComponentName() + + ", componentVersion=" + getComponentVersion() + ", toscaComponentName=" + getToscaComponentName() + ", directives =" + + getDirectivesString() + "]"; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java index 5ea3b789dd..5a3c8921fd 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.HashMap; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinition.java index a2ac3c5ac1..1bf19c0043 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.EqualsAndHashCode; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java index 672f2d6d73..8220ebfc1c 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -34,24 +33,18 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class DataTypeDataDefinition extends ToscaDataDefinition { private String name; - private String uniqueId; - // "boolean", "string", "float", "integer", "version" }) private String derivedFromName; - private String description; - /** * Timestamp of data type creation */ private Long creationTime; - /** * Timestamp of the data type last update */ private Long modificationTime; - private List<PropertyDataDefinition> propertiesData; public DataTypeDataDefinition(DataTypeDataDefinition p) { @@ -62,6 +55,4 @@ public class DataTypeDataDefinition extends ToscaDataDefinition { this.creationTime = p.creationTime; this.modificationTime = p.modificationTime; } - - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java index c549d8f10c..4f28aee1ad 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.DESCRIPTION; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java index f56a13b16b..42e9c78313 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -110,8 +109,8 @@ public class ForwardingPathElementDataDefinition extends ToscaDataDefinition { return false; } ForwardingPathElementDataDefinition that = (ForwardingPathElementDataDefinition) o; - return Objects.equals(getFromNode(), that.getFromNode()) && Objects.equals(getToNode(), that.getToNode()) - && Objects.equals(getFromCPOriginId(), that.getFromCPOriginId()) && Objects.equals(getToCPOriginId(), that.getToCPOriginId()); + return Objects.equals(getFromNode(), that.getFromNode()) && Objects.equals(getToNode(), that.getToNode()) && Objects + .equals(getFromCPOriginId(), that.getFromCPOriginId()) && Objects.equals(getToCPOriginId(), that.getToCPOriginId()); } @Override @@ -121,9 +120,7 @@ public class ForwardingPathElementDataDefinition extends ToscaDataDefinition { @Override public String toString() { - return MoreObjects.toStringHelper(this) - .add("fromNode", getFromNode()).add("toNode", getToNode()) - .add("fromCPOriginId", getFromCPOriginId()).add("toCPOriginId", getToCPOriginId()) - .add("fromCPName", getFromCP()).add("toCPName", getToCP()).toString(); + return MoreObjects.toStringHelper(this).add("fromNode", getFromNode()).add("toNode", getToNode()).add("fromCPOriginId", getFromCPOriginId()) + .add("toCPOriginId", getToCPOriginId()).add("fromCPName", getFromCP()).add("toCPName", getToCP()).toString(); } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java index a409c7f5ef..df0c105999 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.Map; @@ -37,14 +36,11 @@ public class GetInputValueDataDefinition extends ToscaDataDefinition { private String propName; private String inputName; - @EqualsAndHashCode.Exclude @ToString.Exclude private String inputId; - private Integer indexValue; private GetInputValueDataDefinition getInputIndex; - private boolean isList = false; public GetInputValueDataDefinition(Map<String, Object> pr) { @@ -59,5 +55,4 @@ public class GetInputValueDataDefinition extends ToscaDataDefinition { this.setGetInputIndex(p.getGetInputIndex()); this.setList(p.isList()); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java index 7318dbd5d3..a3d32c6dfa 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.Map; @@ -54,5 +53,4 @@ public class GetOutputValueDataDefinition extends ToscaDataDefinition { this.setGetOutputIndex(p.getGetOutputIndex()); this.setList(p.isList()); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetPolicyValueDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetPolicyValueDataDefinition.java index f752949ad9..3393a79e20 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetPolicyValueDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetPolicyValueDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.EqualsAndHashCode; @@ -25,7 +24,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; - @Getter @Setter @NoArgsConstructor @@ -35,5 +33,4 @@ public class GetPolicyValueDataDefinition { private String policyId; private String propertyName; private String origPropertyValue; - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java index f61801288f..ec92ae6bf0 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import static java.util.Collections.emptyMap; @@ -60,14 +59,12 @@ public class GroupDataDefinition extends ToscaDataDefinition { this.setGroupUUID(other.getGroupUUID()); this.setInvariantName(other.getInvariantName()); this.setCreatedFrom(other.getCreatedFrom()); - if (other.getMembers() != null) { this.setMembers(new HashMap<>(other.getMembers())); } if (other.getArtifacts() != null) { this.setArtifacts(new ArrayList<>(other.getArtifacts())); } - if (other.getArtifactsUuid() != null) { this.setArtifactsUuid(new ArrayList<>(other.getArtifactsUuid())); } @@ -161,7 +158,6 @@ public class GroupDataDefinition extends ToscaDataDefinition { return members; } return emptyMap(); - } public List<String> getArtifacts() { @@ -199,12 +195,10 @@ public class GroupDataDefinition extends ToscaDataDefinition { @Override public String toString() { return "GroupDataDefinition [propertyValueCounter=" + propertyValueCounter + ", toscaPresentation=" + toscaPresentation + ", getName()=" - + getName() + ", getUniqueId()=" + getUniqueId() + ", getType()=" + getType() + ", getVersion()=" - + getVersion() + ", getInvariantUUID()=" + getInvariantUUID() + ", getDescription()=" + getDescription() + ", getPropertyValueCounter()=" - + getPropertyValueCounter() + ", getGroupUUID()=" + getGroupUUID() + ", getMembers()=" - + getMembers() + ", getArtifacts()=" + getArtifacts() + ", getArtifactsUuid()=" + getArtifactsUuid() + ", getClass()=" + getClass() - + ", hashCode()=" + hashCode() + ", toString()=" - + super.toString() + "]"; + + getName() + ", getUniqueId()=" + getUniqueId() + ", getType()=" + getType() + ", getVersion()=" + getVersion() + ", getInvariantUUID()=" + + getInvariantUUID() + ", getDescription()=" + getDescription() + ", getPropertyValueCounter()=" + getPropertyValueCounter() + + ", getGroupUUID()=" + getGroupUUID() + ", getMembers()=" + getMembers() + ", getArtifacts()=" + getArtifacts() + ", getArtifactsUuid()=" + + getArtifactsUuid() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]"; } public boolean containsInstanceAsMember(String instanceId) { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java index 5f62b75c43..82305a60c3 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.ArrayList; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java index 1014023639..0bc318238f 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -40,12 +39,10 @@ public class GroupTypeDataDefinition extends ToscaTypeDataDefinition { private Map<String, String> metadata; private String description; private boolean highestVersion; - /** * Timestamp of data type creation */ private Long creationTime; - /** * Timestamp of the data type last update */ @@ -63,5 +60,4 @@ public class GroupTypeDataDefinition extends ToscaTypeDataDefinition { this.highestVersion = other.highestVersion; this.derivedFrom = other.derivedFrom; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java index e3e4191385..aa9c7c88ae 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.EqualsAndHashCode; @@ -35,11 +34,9 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class HeatParameterDataDefinition extends ToscaDataDefinition { private String uniqueId; - private String name; private String type; private String description; - private String currentValue; private String defaultValue; @@ -51,5 +48,4 @@ public class HeatParameterDataDefinition extends ToscaDataDefinition { this.currentValue = hp.currentValue; this.defaultValue = hp.defaultValue; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java index e70f52cedb..38083837f2 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.Map; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputsValueDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputsValueDataDefinition.java index 4f3de0c1c6..23992ef319 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputsValueDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputsValueDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.Getter; @@ -39,5 +38,4 @@ public class InputsValueDataDefinition extends ToscaDataDefinition { this.name = name; this.value = value; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java index e93deab7fc..0047765f76 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceInstanceDataDefinition.java index 42a7dbafe7..5430c37f80 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceInstanceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceInstanceDataDefinition.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.elements; import java.io.Serializable; @@ -25,8 +24,7 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class InterfaceInstanceDataDefinition extends ToscaDataDefinition implements Serializable { - public InterfaceInstanceDataDefinition( - InterfaceInstanceDataDefinition inter) { + public InterfaceInstanceDataDefinition(InterfaceInstanceDataDefinition inter) { this.toscaPresentation = null; setInputs(inter.getInputs() == null ? new HashMap<String, Object>() : new HashMap<>(inter.getInputs())); setOperations(new HashMap<>(inter.getOperations())); @@ -66,8 +64,6 @@ public class InterfaceInstanceDataDefinition extends ToscaDataDefinition impleme @Override public int hashCode() { - return Objects.hash(this.getInputs()); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java index 9c92c350a7..720971795d 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -30,7 +29,6 @@ public class ListCapabilityDataDefinition extends ListDataDefinition<CapabilityD public ListCapabilityDataDefinition(ListCapabilityDataDefinition cdt) { super(cdt); - } @JsonCreator @@ -44,9 +42,7 @@ public class ListCapabilityDataDefinition extends ListDataDefinition<CapabilityD return listToscaDataDefinition; } - public void setListToscaDataDefinition(List<CapabilityDataDefinition> listToscaDataDefinition) { this.listToscaDataDefinition = listToscaDataDefinition; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java index 892448d9d8..f28654e5fd 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -36,7 +35,6 @@ public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaData public ListDataDefinition(ListDataDefinition<T> cdt) { listToscaDataDefinition = cdt.listToscaDataDefinition; - } public ListDataDefinition(List<T> listToscaDataDefinition) { @@ -93,14 +91,12 @@ public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaData public <T extends ToscaDataDefinition> T removeByOwnerId(Set<String> ownerIdList) { List<T> collect1 = (List<T>) listToscaDataDefinition.stream().filter(e -> ownerIdList.contains(e.getOwnerId())).collect(Collectors.toList()); ListDataDefinition listDef = new ListDataDefinition(collect1); - listToscaDataDefinition.removeIf(e -> ownerIdList.contains(e.getOwnerId())); return (T) listDef; } @Override public <T extends ToscaDataDefinition> T updateIfExist(T other, boolean allowDefaultValueOverride) { - List<T> list = ((ListDataDefinition) other).getListToscaDataDefinition(); list.forEach(e -> { String nameFromPrev = (String) e.getToscaPresentationValue(JsonPresentationFields.NAME); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java index 8ce14044fa..149a757e71 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,7 +33,6 @@ public class ListMapPropertiesDataDefinition extends ListDataDefinition<MapPrope public ListMapPropertiesDataDefinition(ListMapPropertiesDataDefinition cdt) { super(cdt); - } @JsonCreator @@ -48,10 +46,7 @@ public class ListMapPropertiesDataDefinition extends ListDataDefinition<MapPrope return listToscaDataDefinition; } - public void setMapToscaDataDefinition(List<MapPropertiesDataDefinition> listToscaDataDefinition) { this.listToscaDataDefinition = listToscaDataDefinition; } - - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java index 594f6eb28b..7dd699c52e 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -30,7 +29,6 @@ public class ListRequirementDataDefinition extends ListDataDefinition<Requiremen public ListRequirementDataDefinition(ListRequirementDataDefinition cdt) { super(cdt); - } @JsonCreator @@ -44,10 +42,7 @@ public class ListRequirementDataDefinition extends ListDataDefinition<Requiremen return listToscaDataDefinition; } - public void setListToscaDataDefinition(List<RequirementDataDefinition> listToscaDataDefinition) { this.listToscaDataDefinition = listToscaDataDefinition; } - - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java index 9f025d2d05..ba174bd68a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -50,9 +49,7 @@ public class MapArtifactDataDefinition extends MapDataDefinition<ArtifactDataDef return mapToscaDataDefinition; } - public void setMapToscaDataDefinition(Map<String, ArtifactDataDefinition> mapToscaDataDefinition) { this.mapToscaDataDefinition = mapToscaDataDefinition; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapAttributesDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapAttributesDataDefinition.java index d89ecca142..1425007a75 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapAttributesDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapAttributesDataDefinition.java @@ -17,16 +17,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - import java.util.HashMap; import java.util.Map; import lombok.Getter; @@ -60,6 +54,7 @@ public class MapAttributesDataDefinition extends MapDataDefinition<AttributeData this.mapToscaDataDefinition = toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition == null ? null : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition); } + @JsonValue @Override public Map<String, AttributeDataDefinition> getMapToscaDataDefinition() { @@ -69,5 +64,4 @@ public class MapAttributesDataDefinition extends MapDataDefinition<AttributeData public void setMapToscaDataDefinition(Map<String, AttributeDataDefinition> mapToscaDataDefinition) { this.mapToscaDataDefinition = mapToscaDataDefinition; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java index 2ed37aee80..89dd793ede 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java @@ -17,10 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Map; @@ -43,5 +41,4 @@ public class MapCapabilityProperty extends MapDataDefinition<MapPropertiesDataDe public void setMapToscaDataDefinition(Map<String, MapPropertiesDataDefinition> mapToscaDataDefinition) { this.mapToscaDataDefinition = mapToscaDataDefinition; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java index 2a23ff84e3..b90a406abb 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.ArrayList; @@ -62,27 +61,21 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { * @param ref to add */ public boolean addExternalRef(String objectType, String ref) { - List<String> refList = this.getExternalRefsByObjectType(objectType); - if (refList == null) { //Create list if does not exist and add it to map refList = new ArrayList<>(); this.getComponentInstanceExternalRefs().put(objectType, refList); } - //Add reference to list if does not exist if (!refList.contains(ref)) { return refList.add(ref); } - return false; - } public boolean deleteExternalRef(String objectType, String ref) { List<String> refList = this.getExternalRefsByObjectType(objectType); - if (refList != null) { return refList.remove(ref); } else { @@ -92,12 +85,10 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { public boolean replaceExternalRef(String objectType, String oldRef, String newRef) { List<String> refList = this.getExternalRefsByObjectType(objectType); - if (refList != null && !refList.contains(newRef)) { return Collections.replaceAll(refList, oldRef, newRef); } else { return false; } } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java index 062e5aa53d..4c5e17c87a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -37,7 +36,6 @@ public class MapDataDefinition<T extends ToscaDataDefinition> extends ToscaDataD public MapDataDefinition(MapDataDefinition<T> cdt) { super(); mapToscaDataDefinition = cdt.mapToscaDataDefinition; - } @JsonCreator @@ -83,9 +81,7 @@ public class MapDataDefinition<T extends ToscaDataDefinition> extends ToscaDataD if (null == mapToscaDataDefinition || uid == null) { return null; } - Map.Entry<String, T> entry = mapToscaDataDefinition.entrySet().stream().filter(e -> - e.getValue().findUidMatch(uid)) - .findAny().orElse(null); + Map.Entry<String, T> entry = mapToscaDataDefinition.entrySet().stream().filter(e -> e.getValue().findUidMatch(uid)).findAny().orElse(null); if (null == entry) { return null; } @@ -95,12 +91,9 @@ public class MapDataDefinition<T extends ToscaDataDefinition> extends ToscaDataD @Override public <T extends ToscaDataDefinition> T removeByOwnerId(Set<String> ownerIdList) { if (mapToscaDataDefinition != null) { - Map<String, T> collect = (Map<String, T>) mapToscaDataDefinition.entrySet() - .stream() + Map<String, T> collect = (Map<String, T>) mapToscaDataDefinition.entrySet().stream() .filter(e -> ownerIdList.contains(e.getValue().getOwnerId())).collect(Collectors.toMap(Map.Entry::getKey, (Map.Entry::getValue))); - MapDataDefinition collectMap = new MapDataDefinition<>(collect); - mapToscaDataDefinition.entrySet().removeIf(e -> ownerIdList.contains(e.getValue().getOwnerId())); return (T) collectMap; } @@ -109,7 +102,6 @@ public class MapDataDefinition<T extends ToscaDataDefinition> extends ToscaDataD @Override public <T extends ToscaDataDefinition> T updateIfExist(T other, boolean allowDefaultValueOverride) { - Map<String, T> map = ((MapDataDefinition) other).getMapToscaDataDefinition(); if (map != null) { map.entrySet().forEach(e -> { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java index 813da54c72..34674bf66f 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java @@ -17,10 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Map; @@ -51,9 +49,7 @@ public class MapGroupsDataDefinition extends MapDataDefinition<GroupInstanceData return mapToscaDataDefinition; } - public void setMapToscaDataDefinition(Map<String, GroupInstanceDataDefinition> mapToscaDataDefinition) { this.mapToscaDataDefinition = mapToscaDataDefinition; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapInterfaceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapInterfaceDataDefinition.java index 772eb71ee5..1b7c80b980 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapInterfaceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapInterfaceDataDefinition.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java index b8b899aa09..1bb394d118 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java @@ -17,10 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; @@ -32,7 +30,6 @@ public class MapListCapabilityDataDefinition extends MapDataDefinition<ListCapab public MapListCapabilityDataDefinition(MapListCapabilityDataDefinition cdt) { super(cdt); - } @JsonCreator diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java index 1f830b53b5..b15135b096 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java @@ -17,10 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; @@ -32,7 +30,6 @@ public class MapListRequirementDataDefinition extends MapDataDefinition<ListRequ public MapListRequirementDataDefinition(MapListRequirementDataDefinition cdt) { super(cdt); - } @JsonCreator @@ -63,5 +60,4 @@ public class MapListRequirementDataDefinition extends MapDataDefinition<ListRequ } } } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java index 456ac7f75f..8483b695af 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java @@ -17,10 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; @@ -66,6 +64,4 @@ public class MapPropertiesDataDefinition extends MapDataDefinition<PropertyDataD public void setMapToscaDataDefinition(Map<String, PropertyDataDefinition> mapToscaDataDefinition) { this.mapToscaDataDefinition = mapToscaDataDefinition; } - - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java index eb7b6af3b3..17b0131ec6 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ASSOCIATION_TYPE; @@ -74,8 +73,7 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri } public ListDataDefinition<OperationInputDefinition> getInputs() { - return (ListDataDefinition<OperationInputDefinition>) getToscaPresentationValue( - JsonPresentationFields.OPERATION_INPUTS); + return (ListDataDefinition<OperationInputDefinition>) getToscaPresentationValue(JsonPresentationFields.OPERATION_INPUTS); } public void setInputs(ListDataDefinition<OperationInputDefinition> inputs) { @@ -83,8 +81,7 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri } public ListDataDefinition<OperationOutputDefinition> getOutputs() { - return (ListDataDefinition<OperationOutputDefinition>) getToscaPresentationValue( - JsonPresentationFields.OPERATION_OUTPUTS); + return (ListDataDefinition<OperationOutputDefinition>) getToscaPresentationValue(JsonPresentationFields.OPERATION_OUTPUTS); } public void setOutputs(ListDataDefinition<OperationOutputDefinition> outputs) { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationImplementation.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationImplementation.java index ef3d8f943c..6bc88b5c41 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationImplementation.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationImplementation.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -30,5 +29,4 @@ public class OperationImplementation { private String primary; private List<String> dependencies; - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java index 53b1a1e036..3a91094028 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java @@ -15,7 +15,6 @@ */ package org.openecomp.sdc.be.datatypes.elements; - import com.fasterxml.jackson.annotation.JsonCreator; import lombok.Getter; import lombok.Setter; @@ -65,5 +64,4 @@ public class OperationInputDefinition extends InputDataDefinition { public void setLabel(String name) { setToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL, name); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInstance.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInstance.java index aae9f724df..7caedacd40 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInstance.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInstance.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.Map; @@ -30,5 +29,4 @@ public class OperationInstance { private OperationImplementation implementation; private Map<String, Object> inputs; - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java index dc2ea93b01..2579bca7be 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonCreator; @@ -45,5 +44,4 @@ public class OperationOutputDefinition extends InputDataDefinition { public void setLabel(String name) { setToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL, name); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java index b0760c7d55..438b756925 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import static java.util.Collections.emptyList; @@ -203,5 +202,4 @@ public class PolicyDataDefinition extends PropertyDataDefinition { Map<PolicyTargetType, List<String>> targets = getTargets(); return targets == null || !targets.containsKey(targetType) ? emptyList() : targets.get(targetType); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTargetType.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTargetType.java index 187e4d4bfc..3193d276da 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTargetType.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTargetType.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.AllArgsConstructor; @@ -25,11 +24,7 @@ import lombok.Getter; @AllArgsConstructor public enum PolicyTargetType { - - GROUPS("GROUPS"), - COMPONENT_INSTANCES("COMPONENT_INSTANCES"), - TYPE_DOES_NOT_EXIST("TYPE_DOES_NOT_EXIST"); - + GROUPS("GROUPS"), COMPONENT_INSTANCES("COMPONENT_INSTANCES"), TYPE_DOES_NOT_EXIST("TYPE_DOES_NOT_EXIST"); @Getter private final String name; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java index 197260bc0b..82f0869869 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -37,12 +36,10 @@ public class PolicyTypeDataDefinition extends ToscaTypeDataDefinition { private List<String> targets; private Map<String, String> metadata; private String description; - /** * Timestamp of data type creation */ private Long creationTime; - /** * Timestamp of the data type last update */ @@ -65,9 +62,7 @@ public class PolicyTypeDataDefinition extends ToscaTypeDataDefinition { @Override public String toString() { return "PolicyTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + getType() + ", name=" + getName() + ", icon=" + getIcon() + ", version=" - + version - + ", targets=" + targets + ", metadata=" + metadata + ", description=" + description + ", creationTime=" - + creationTime + ", modificationTime=" + modificationTime + "]"; + + version + ", targets=" + targets + ", metadata=" + metadata + ", description=" + description + ", creationTime=" + creationTime + + ", modificationTime=" + modificationTime + "]"; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java index 5e1c42cc62..0f6524d868 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.ArrayList; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertiesOwner.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertiesOwner.java index fd9ea26922..902e263736 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertiesOwner.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertiesOwner.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; public interface PropertiesOwner { @@ -27,5 +26,4 @@ public interface PropertiesOwner { String getName(); String getNormalizedName(); - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java index 3a0d08c2c8..c7307833b4 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import static org.apache.commons.collections.CollectionUtils.isNotEmpty; @@ -54,7 +53,6 @@ public class PropertyDataDefinition extends ToscaDataDefinition { private String label; private Boolean immutable = Boolean.FALSE; private Boolean mappedToComponentProperty = Boolean.TRUE; - private String inputPath; private String status; private String inputId; @@ -62,21 +60,15 @@ public class PropertyDataDefinition extends ToscaDataDefinition { private String propertyId; private String parentPropertyType; private String subPropertyInputPath; - private List<Annotation> annotations; /** * The resource id which this property belongs to */ private String parentUniqueId; - private List<GetInputValueDataDefinition> getInputValues; - private Boolean isDeclaredListInput = Boolean.FALSE; - private List<GetPolicyValueDataDefinition> getPolicyValues; - private List<String> propertyConstraints; - private Map<String, String> metadata; public PropertyDataDefinition() { @@ -157,7 +149,6 @@ public class PropertyDataDefinition extends ToscaDataDefinition { if (schema != null) { return schema.getProperty(); } - return null; } @@ -169,7 +160,9 @@ public class PropertyDataDefinition extends ToscaDataDefinition { return immutable; } - public Boolean isMappedToComponentProperty() { return mappedToComponentProperty; } + public Boolean isMappedToComponentProperty() { + return mappedToComponentProperty; + } public String getParentUniqueId() { return getOwnerId(); @@ -267,13 +260,10 @@ public class PropertyDataDefinition extends ToscaDataDefinition { @Override public <T extends ToscaDataDefinition> T mergeFunction(T other, boolean allowDefaultValueOverride) { - if (this.getType() != null - && this.getType().equals(other.getToscaPresentationValue(JsonPresentationFields.TYPE)) - && compareSchemaType(other)) { + if (this.getType() != null && this.getType().equals(other.getToscaPresentationValue(JsonPresentationFields.TYPE)) && compareSchemaType( + other)) { other.setOwnerId(getOwnerId()); - if (allowDefaultValueOverride - && getDefaultValue() != null - && !getDefaultValue().isEmpty()) { + if (allowDefaultValueOverride && getDefaultValue() != null && !getDefaultValue().isEmpty()) { other.setToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE, getDefaultValue()); } return other; @@ -301,7 +291,6 @@ public class PropertyDataDefinition extends ToscaDataDefinition { if (this.annotations != null) { annotationSet.addAll(this.annotations); } - this.annotations = new ArrayList<>(annotationSet); setToscaPresentationValue(JsonPresentationFields.ANNOTATIONS, this.annotations); } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java index 8a99bf812d..8a20c16d38 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -62,12 +61,10 @@ public class PropertyRule extends ToscaDataDefinition { } public String getToken(int tokenNumber) { - int index = tokenNumber - 1; if (rule == null || index >= rule.size() || index < 0) { return null; } - return rule.get(index); } @@ -85,16 +82,13 @@ public class PropertyRule extends ToscaDataDefinition { } public boolean compareRule(PropertyRule comparedPropertyRule) { - if (comparedPropertyRule == null) { return false; } - List<String> comparedRule = comparedPropertyRule.getRule(); if (rule == null && comparedRule == null) { return true; } - if (rule != null && comparedRule != null) { if (rule.size() != comparedRule.size()) { return false; @@ -114,15 +108,11 @@ public class PropertyRule extends ToscaDataDefinition { } else { return false; } - } public void replaceFirstToken(String token) { - if (rule != null && rule.size() > 0) { rule.set(0, token); } - } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java index 8c1d44b7b2..539914c496 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -176,7 +175,6 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition { public Long getCreationTime() { return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_TIME); - } public void setCreationTime(Long creationTime) { @@ -210,10 +208,8 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition { Boolean originUI = isOriginUI(); Long creationTime = getCreationTime(); Long modificationTime = getModificationTime(); - return "RelationshipTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes=" - + validSourceTypes - + ", version=" + version + ", originUI=" + originUI + ", creationTime=" + creationTime + ", modificationTime=" + modificationTime + "]"; + + validSourceTypes + ", version=" + version + ", originUI=" + originUI + ", creationTime=" + creationTime + ", modificationTime=" + + modificationTime + "]"; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java index ae289b7e36..40dd517e60 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import com.google.common.collect.Lists; @@ -40,7 +39,6 @@ public class RequirementDataDefinition extends ToscaDataDefinition { public static final String MIN_OCCURRENCES = "0"; public static final String MAX_OCCURRENCES = "UNBOUNDED"; public static final String MAX_DEFAULT_OCCURRENCES = "1"; - @Getter @Setter public boolean external = false; @@ -111,7 +109,6 @@ public class RequirementDataDefinition extends ToscaDataDefinition { /** * specify the capability type */ - public String getCapability() { return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY); } @@ -219,5 +216,4 @@ public class RequirementDataDefinition extends ToscaDataDefinition { } setPath(path); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterCapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterCapabilityDataDefinition.java index 8ce9865880..afec4d4a72 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterCapabilityDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterCapabilityDataDefinition.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.elements; import java.io.Serializable; @@ -25,8 +24,7 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class RequirementNodeFilterCapabilityDataDefinition extends ToscaDataDefinition implements Serializable { public ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> getProperties() { - return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue( - JsonPresentationFields.PROPERTIES); + return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES); } public void setProperties(ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> properties) { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterPropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterPropertyDataDefinition.java index 1ee33eeafe..ed3056cca7 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterPropertyDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementNodeFilterPropertyDataDefinition.java @@ -22,7 +22,6 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class RequirementNodeFilterPropertyDataDefinition extends ToscaDataDefinition implements Serializable { - public List<String> getConstraints() { return (List<String>) getToscaPresentationValue(JsonPresentationFields.PROPERTY_FILTER_CONSTRAINT); } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterCapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterCapabilityDataDefinition.java index 21f133a25d..d6c9a86561 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterCapabilityDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterCapabilityDataDefinition.java @@ -16,7 +16,6 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.io.Serializable; @@ -28,8 +27,7 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class RequirementSubstitutionFilterCapabilityDataDefinition extends ToscaDataDefinition implements Serializable { public ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> getProperties() { - return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue( - JsonPresentationFields.PROPERTIES); + return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES); } public void setProperties(final ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> properties) { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterPropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterPropertyDataDefinition.java index 75efd123bc..b1b53bb4ae 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterPropertyDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementSubstitutionFilterPropertyDataDefinition.java @@ -25,7 +25,6 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class RequirementSubstitutionFilterPropertyDataDefinition extends ToscaDataDefinition implements Serializable { - public List<String> getConstraints() { return (List<String>) getToscaPresentationValue(JsonPresentationFields.PROPERTY_FILTER_CONSTRAINT); } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java index c17e7fa3b5..5e7b0abadf 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import java.util.List; @@ -42,12 +41,10 @@ public class SchemaDefinition extends ToscaDataDefinition { private Map<String, PropertyDataDefinition> properties; private PropertyDataDefinition property; - public SchemaDefinition(String derivedFrom, List<String> constraints, - Map<String, PropertyDataDefinition> properties) { + public SchemaDefinition(String derivedFrom, List<String> constraints, Map<String, PropertyDataDefinition> properties) { this.setDerivedFrom(derivedFrom); this.setConstraints(constraints); this.setProperties(properties); - } public void addProperty(String key, PropertyDataDefinition property) { @@ -56,7 +53,7 @@ public class SchemaDefinition extends ToscaDataDefinition { @Override public String toString() { - return "SchemaDefinition [" + "derivedFrom='" + derivedFrom + ", constraints=" + constraints + ", properties=" - + properties + ", property=" + property + ']'; + return "SchemaDefinition [" + "derivedFrom='" + derivedFrom + ", constraints=" + constraints + ", properties=" + properties + ", property=" + + property + ']'; } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SubstitutionFilterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SubstitutionFilterDataDefinition.java index d51822b27d..7efeb0fea5 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SubstitutionFilterDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SubstitutionFilterDataDefinition.java @@ -47,8 +47,7 @@ public class SubstitutionFilterDataDefinition extends ToscaDataDefinition implem } public ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition> getProperties() { - return (ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition>) getToscaPresentationValue( - JsonPresentationFields.PROPERTIES); + return (ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES); } public void setProperties(final ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition> properties) { @@ -71,5 +70,4 @@ public class SubstitutionFilterDataDefinition extends ToscaDataDefinition implem public void setID(final String name) { setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, name); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaArtifactDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaArtifactDataDefinition.java index b0a73a27df..058f8aac77 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaArtifactDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaArtifactDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.Getter; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java index c4ca549a85..a21510be45 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; import lombok.Getter; @@ -39,5 +38,4 @@ public class ToscaTypeDataDefinition extends ToscaDataDefinition { this.icon = other.icon; this.type = other.type; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/AssetTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/AssetTypeEnum.java index 2094699534..497077eaba 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/AssetTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/AssetTypeEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -22,7 +21,6 @@ import lombok.Getter; @AllArgsConstructor public enum AssetTypeEnum { RESOURCES("resources", "Resource"), SERVICES("services", "Service"), PRODUCTS("products", "Product"); - private final String value; private final String correspondingComponent; @@ -33,7 +31,6 @@ public enum AssetTypeEnum { return ComponentTypeEnum.findByValue(curr.correspondingComponent); } } - return ret; } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java index ac6d1bba82..435e51b86c 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -21,7 +20,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ComponentFieldsEnum { - + // @formatter:off PROPERTIES("properties"), INPUTS("inputs"), OUTPUTS("outputs"), @@ -55,6 +54,7 @@ public enum ComponentFieldsEnum { SUBSTITUTION_FILTER("substitutionFilter"), COMPONENT_INSTANCES_INTERFACES("componentInstancesInterfaces"), DATA_TYPES("data_types"); + // @formatter:on private final String value; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentTypeEnum.java index e4e689a967..44956ceb17 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentTypeEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -21,13 +20,9 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ComponentTypeEnum { - RESOURCE("Resource"), - SERVICE("Service"), - RESOURCE_INSTANCE("Resource Instance"), - PRODUCT("Product"), - SERVICE_INSTANCE("Service Instance"); - + RESOURCE("Resource"), SERVICE("Service"), RESOURCE_INSTANCE("Resource Instance"), PRODUCT("Product"), SERVICE_INSTANCE("Service Instance"); // Those values cannot be another field in enum, because they are needed + // as constants for Swagger allowedValues param public static final String RESOURCE_PARAM_NAME = "resources"; public static final String SERVICE_PARAM_NAME = "services"; @@ -68,7 +63,6 @@ public enum ComponentTypeEnum { if (type == null) { return ret; } - switch (type) { case RESOURCE: ret = RESOURCE_PARAM_NAME; @@ -86,7 +80,6 @@ public enum ComponentTypeEnum { } public NodeTypeEnum getNodeType() { - switch (this) { case RESOURCE: return NodeTypeEnum.Resource; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ConnectionPointEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ConnectionPointEnum.java index 2791055ed5..56ad18e786 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ConnectionPointEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ConnectionPointEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import java.util.Arrays; @@ -23,9 +22,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ConnectionPointEnum { - CAPABILITY("capability"), REQUIREMENT("requirement"); - private static List<ConnectionPointEnum> connectionPointEnums = Arrays.asList(values()); private final String data; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/CreatedFrom.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/CreatedFrom.java index 9c61120f94..fd9f7c238c 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/CreatedFrom.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/CreatedFrom.java @@ -12,15 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.Getter; @Getter -public enum CreatedFrom { - - UI, - CSAR - -} +public enum CreatedFrom {UI, CSAR} diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java index 76ce9cd44b..116171d9c5 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java @@ -17,14 +17,9 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.Getter; @Getter -public enum DeclarationTypeEnum { - INPUT, - OUTPUT, - POLICY -} +public enum DeclarationTypeEnum {INPUT, OUTPUT, POLICY} diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/EnvironmentStatusEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/EnvironmentStatusEnum.java index 635574b413..c8c94b9a1f 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/EnvironmentStatusEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/EnvironmentStatusEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -21,11 +20,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum EnvironmentStatusEnum { - UNKNOWN("unknown"), - IN_PROGRESS("in_progress"), - FAILED("failed"), - COMPLETED("completed"); - + UNKNOWN("unknown"), IN_PROGRESS("in_progress"), FAILED("failed"), COMPLETED("completed"); private final String name; public static EnvironmentStatusEnum getByName(final String name) { @@ -40,5 +35,4 @@ public enum EnvironmentStatusEnum { return UNKNOWN; } } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ExternalCategoryTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ExternalCategoryTypeEnum.java index 4b466dd724..a5ee6173dc 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ExternalCategoryTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ExternalCategoryTypeEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -26,9 +25,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ExternalCategoryTypeEnum { - PARTNER_DOMAIN_SERVICE("Partner Domain Service", true); - private final String value; private final boolean isAtomicType; @@ -72,7 +69,6 @@ public enum ExternalCategoryTypeEnum { * @return */ public static boolean containsName(String type) { - for (ExternalCategoryTypeEnum e : ExternalCategoryTypeEnum.values()) { if (e.getValue().equals(type)) { return true; @@ -88,7 +84,6 @@ public enum ExternalCategoryTypeEnum { * @return */ public static boolean containsIgnoreCase(String type) { - for (ExternalCategoryTypeEnum e : ExternalCategoryTypeEnum.values()) { if (e.getValue().equalsIgnoreCase(type)) { return true; @@ -96,6 +91,4 @@ public enum ExternalCategoryTypeEnum { } return false; } - } - diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnum.java index e4245f37fd..a4dc0084cc 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import java.util.Arrays; @@ -26,7 +25,6 @@ import lombok.Getter; public enum FilterKeyEnum { RESOURCE_TYPE("resourceType"), SUB_CATEGORY("subCategory"), CATEGORY("category"), DISTRIBUTION_STATUS("distributionStatus"), NAME_FRAGMENT( "nameFragment"); - private static final int NUMBER_OF_RESOURCES_FILTERED = 3; private static final int NUMBER_OF_SERVICES_FILTERED = 4; private final String name; @@ -47,6 +45,5 @@ public enum FilterKeyEnum { default: return null; } - } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java index 44a0d23d1c..0ed0bd21fa 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import java.util.ArrayList; @@ -24,7 +23,7 @@ import lombok.Getter; @AllArgsConstructor @Getter public enum GraphPropertyEnum { - + // @formatter:off // field name ,class type ,unique ,indexed UNIQUE_ID("uid", String.class, true, true), LABEL("nodeLabel", String.class, false, true), @@ -60,14 +59,12 @@ public enum GraphPropertyEnum { DATA_TYPES("data_types", Map.class, false, false), //Archive/Restore - IS_ARCHIVED("isArchived", Boolean.class, false, true), - IS_VSP_ARCHIVED("isVspArchived", Boolean.class, false, true), - ARCHIVE_TIME("archiveTime", Long.class, false, true), - PREV_CATALOG_UPDATE_TIME("previousUpdateTime", Long.class, false, true), - CURRENT_CATALOG_UPDATE_TIME("currentUpdateTime", Long.class, false, true), - + IS_ARCHIVED("isArchived", Boolean.class, false, true), IS_VSP_ARCHIVED("isVspArchived", Boolean.class, false, true), ARCHIVE_TIME("archiveTime", + Long.class, false, true), PREV_CATALOG_UPDATE_TIME("previousUpdateTime", Long.class, false, true), CURRENT_CATALOG_UPDATE_TIME( + "currentUpdateTime", Long.class, false, true), //Healing HEALING_VERSION("healVersion", Integer.class, false, true); + // @formatter:on private final String property; private final Class<?> clazz; @@ -84,13 +81,10 @@ public enum GraphPropertyEnum { } public static List<String> getAllProperties() { - List<String> arrayList = new ArrayList<>(); - for (GraphPropertyEnum graphProperty : GraphPropertyEnum.values()) { arrayList.add(graphProperty.getProperty()); } - return arrayList; } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GroupTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GroupTypeEnum.java index 4801706a05..915ce35072 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GroupTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GroupTypeEnum.java @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -23,7 +21,5 @@ import lombok.Getter; @AllArgsConstructor public enum GroupTypeEnum { VF_MODULE("org.openecomp.groups.VfModule"), HEAT_STACK("org.openecomp.groups.HeatStack"); - private final String groupTypeName; - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/InstantiationTypes.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/InstantiationTypes.java index dc0908be8d..d16dc55b70 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/InstantiationTypes.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/InstantiationTypes.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import java.util.stream.Stream; @@ -22,10 +21,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum InstantiationTypes { - - A_LA_CARTE("A-la-carte"), - MACRO("Macro"); - + A_LA_CARTE("A-la-carte"), MACRO("Macro"); private final String value; /** @@ -34,9 +30,7 @@ public enum InstantiationTypes { * @param type * @return bool */ - public static boolean containsName(String type) { - return Stream.of(InstantiationTypes.values()) - .anyMatch(instType -> type.equals(instType.getValue())); + return Stream.of(InstantiationTypes.values()).anyMatch(instType -> type.equals(instType.getValue())); } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index 36d0f40311..4cdf0508c7 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import com.fasterxml.jackson.annotation.JsonCreator; @@ -25,7 +24,7 @@ import lombok.ToString; @Getter @ToString(onlyExplicitlyIncluded = true) public enum JsonPresentationFields { - + // @formatter:off UNIQUE_ID("uniqueId", GraphPropertyEnum.UNIQUE_ID), HIGHEST_VERSION("highestVersion", GraphPropertyEnum.IS_HIGHEST_VERSION), LIFECYCLE_STATE("lifecycleState", GraphPropertyEnum.STATE), @@ -74,7 +73,6 @@ public enum JsonPresentationFields { ////Inputs ANNOTATIONS("annotations", null), - ////Artifact ARTIFACT_TYPE("artifactType", null), ARTIFACT_REF("artifactRef", null), @@ -160,13 +158,8 @@ public enum JsonPresentationFields { TOSCA_ID("tosca_id", null), //Relation - CAPABILTY_OWNER_ID("capabilityOwnerId", null), - REQUIREMENT_OWNER_ID("requirementOwnerId", null), - FROM_ID("fromId", null), - TO_ID("toId", null), - REQUIREMENT("requirement", null), - ORIGIN_UI("originUI", null), - + CAPABILTY_OWNER_ID("capabilityOwnerId", null), REQUIREMENT_OWNER_ID("requirementOwnerId", null), FROM_ID("fromId", null), TO_ID("toId", + null), REQUIREMENT("requirement", null), ORIGIN_UI("originUI", null), //Groups GROUP_INVARIANT_UUID("invariantUUID", null), @@ -225,9 +218,7 @@ public enum JsonPresentationFields { TARGETS("targets", null), //External Refs - EXTERNAL_REF("externalRef", null), - CREATED_FROM("createdFrom", null), - + EXTERNAL_REF("externalRef", null), CREATED_FROM("createdFrom", null), //Archive IS_ARCHIVED("isArchived", GraphPropertyEnum.IS_ARCHIVED), ARCHIVE_TIME("archiveTime", GraphPropertyEnum.ARCHIVE_TIME), @@ -266,6 +257,7 @@ public enum JsonPresentationFields { ATTRIBUTES("attributes", null), TOSCA_DEFINITIONS_VERSION("tosca_definitions_version", null); + // @formatter:on @ToString.Include private final String presentation; @@ -295,5 +287,4 @@ public enum JsonPresentationFields { public String getPresentation() { return presentation; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFieldsExtractor.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFieldsExtractor.java index b3e55ac930..c5eb86559e 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFieldsExtractor.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFieldsExtractor.java @@ -19,7 +19,6 @@ * Modifications copyright (c) 2019 Nokia * ================================================================================ */ - package org.openecomp.sdc.be.datatypes.enums; import java.util.List; @@ -166,5 +165,4 @@ public class JsonPresentationFieldsExtractor { public String getServiceFunction() { return (String) properties.get(JsonPresentationFields.SERVICE_FUNCTION.getPresentation()); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/MetadataKeyEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/MetadataKeyEnum.java index aab37d1ff0..45da51164e 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/MetadataKeyEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/MetadataKeyEnum.java @@ -24,12 +24,6 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum MetadataKeyEnum { - METADATA_KEYS("metadataKeys"), - NAME("name"), - MANDATORY("mandatory"), - VALID_VALUES("validValues"), - DEFAULT("default"); - + METADATA_KEYS("metadataKeys"), NAME("name"), MANDATORY("mandatory"), VALID_VALUES("validValues"), DEFAULT("default"); private final String name; - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeFilterConstraintType.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeFilterConstraintType.java index 13b6629b3c..607001648a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeFilterConstraintType.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeFilterConstraintType.java @@ -28,10 +28,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum NodeFilterConstraintType { - - PROPERTIES(NodeFilterConstraintType.PROPERTIES_PARAM_NAME), - CAPABILITIES(NodeFilterConstraintType.CAPABILITIES_PARAM_NAME); - + PROPERTIES(NodeFilterConstraintType.PROPERTIES_PARAM_NAME), CAPABILITIES(NodeFilterConstraintType.CAPABILITIES_PARAM_NAME); // Those values are needed as constants for Swagger allowedValues param public static final String PROPERTIES_PARAM_NAME = "properties"; public static final String CAPABILITIES_PARAM_NAME = "capabilities"; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeTypeEnum.java index 592bdc45b4..75a2177250 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/NodeTypeEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -21,6 +20,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum NodeTypeEnum { + // @formatter:off User("user"), Service("service"), Resource("resource"), @@ -64,6 +64,7 @@ public enum NodeTypeEnum { GroupInstance("groupInstance"), AnnotationType("annotationType"), Component("component"); + // @formatter:on private final String name; diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java index 5fad178090..6cf663fcd9 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -21,6 +20,7 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum OriginTypeEnum { + // @formatter:off PRODUCT("Product", "Product", "product instance", ComponentTypeEnum.PRODUCT, false), SERVICE("Service", "Service", "service instance", ComponentTypeEnum.SERVICE, false), VF("VF", "VF (Virtual Function)", "resource instance", ComponentTypeEnum.RESOURCE, false), @@ -34,6 +34,7 @@ public enum OriginTypeEnum { CR("CR", "CR (Complex Resource)", "resource instance", ComponentTypeEnum.RESOURCE, false), ServiceProxy("Service Proxy", "Service Proxy", "service proxy", ComponentTypeEnum.RESOURCE, false), ServiceSubstitution("Service Substitution", "Service Substitution", "service substitution", ComponentTypeEnum.RESOURCE, false); + // @formatter:on private final String value; private final String displayValue; @@ -51,5 +52,4 @@ public enum OriginTypeEnum { } return ret; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PortMirroringEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PortMirroringEnum.java index a75ee15239..e938e26528 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PortMirroringEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PortMirroringEnum.java @@ -19,7 +19,6 @@ * Modifications copyright (c) 2019 Nokia * ================================================================================ */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.AllArgsConstructor; @@ -28,9 +27,6 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum PortMirroringEnum { - CISCO_VENDOR_NAME("CISCO"), - CISCO_VENDOR_MODEL_NUMBER("4500x"); - + CISCO_VENDOR_NAME("CISCO"), CISCO_VENDOR_MODEL_NUMBER("4500x"); private final String value; - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PromoteVersionEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PromoteVersionEnum.java index 379ef69381..46f3375a49 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PromoteVersionEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/PromoteVersionEnum.java @@ -19,16 +19,9 @@ * Modifications copyright (c) 2019 Nokia * ================================================================================ */ - package org.openecomp.sdc.be.datatypes.enums; import lombok.Getter; @Getter -public enum PromoteVersionEnum { - - NONE, - MINOR, - MAJOR - -} +public enum PromoteVersionEnum {NONE, MINOR, MAJOR} diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java index d0f1c23545..88ff61b6d1 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.be.datatypes.enums; import java.util.Arrays; @@ -27,20 +26,23 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ResourceTypeEnum { - + // @formatter:off VFC("VFC"/* (Virtual Function Component)"*/, true), VF("VF"/* (Virtual Function)" */, false), + CR("CR"/* (Complex Resource"*/, false), CP("CP"/* (Connection Point)"*/, true), + PNF("PNF"/* (Physical Network Function)" */, false), CVFC("CVFC"/* Complex Virtual Function Component*/, false), + VL("VL"/* (Virtual Link)"*/, true), VFCMT("VFCMT"/* (VFC Monitoring Template)"*/, true), - Configuration("Configuration", true), - ServiceProxy("ServiceProxy", true), + Configuration("Configuration", true), ServiceProxy("ServiceProxy", true), //Generic VFC/VF/PNF/Service Type ABSTRACT("Abstract", true), SERVICE("Service"/*(Network Service)"*/, false); + // @formatter:on private final String value; private final boolean isAtomicType; @@ -75,9 +77,7 @@ public enum ResourceTypeEnum { if (type == null) { return null; } - return Arrays.stream(ResourceTypeEnum.values()) - .filter(resourceTypeEnum -> resourceTypeEnum.name().equalsIgnoreCase(type)) - .findFirst() + return Arrays.stream(ResourceTypeEnum.values()).filter(resourceTypeEnum -> resourceTypeEnum.name().equalsIgnoreCase(type)).findFirst() .orElse(null); } @@ -91,8 +91,7 @@ public enum ResourceTypeEnum { if (type == null) { return false; } - return Arrays.stream(ResourceTypeEnum.values()) - .anyMatch(resourceTypeEnum -> resourceTypeEnum.name().equals(type)); + return Arrays.stream(ResourceTypeEnum.values()).anyMatch(resourceTypeEnum -> resourceTypeEnum.name().equals(type)); } /** @@ -105,8 +104,6 @@ public enum ResourceTypeEnum { if (type == null) { return false; } - return Arrays.stream(ResourceTypeEnum.values()) - .anyMatch(resourceTypeEnum -> resourceTypeEnum.name().equalsIgnoreCase(type)); + return Arrays.stream(ResourceTypeEnum.values()).anyMatch(resourceTypeEnum -> resourceTypeEnum.name().equalsIgnoreCase(type)); } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java index e89537deef..a5ac0c71d6 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.tosca; import com.fasterxml.jackson.annotation.JsonCreator; @@ -44,6 +43,32 @@ public abstract class ToscaDataDefinition { toscaPresentation = art; } + public static <T extends ToscaDataDefinition> Either<Map<String, T>, String> mergeDataMaps(Map<String, T> map1, Map<String, T> map2) { + return mergeDataMaps(map1, map2, false); + } + + // return Either.right(item key) if an illegal merge was attempted (overriding data type is forbidden) + public static <T extends ToscaDataDefinition> Either<Map<String, T>, String> mergeDataMaps(Map<String, T> map1, Map<String, T> map2, + boolean allowDefaultValueOverride) { + for (Entry<String, T> entry : map2.entrySet()) { + map1.merge(entry.getKey(), entry.getValue(), (item1, item2) -> item1.mergeFunction(item2, allowDefaultValueOverride)); + // validate merge success + if (!map1.containsKey(entry.getKey())) { + return Either.right(entry.getKey()); + } + } + return Either.left(map1); + } + + public static <T extends ToscaDataDefinition> Map<String, T> listToMapByName(List<T> dataList) { + return null == dataList ? new HashMap<>() + : dataList.stream().collect(Collectors.toMap(p -> (String) p.getToscaPresentationValue(JsonPresentationFields.NAME), p -> p)); + } + + public static <T extends ToscaDataDefinition> T removeAndCollectByOwnerId(T complexStructure, Set<String> ownerIdList) { + return complexStructure.removeByOwnerId(ownerIdList); + } + @JsonValue public Object getToscaPresentationValue(JsonPresentationFields name) { if (toscaPresentation != null && toscaPresentation.containsKey(name.getPresentation())) { @@ -61,13 +86,12 @@ public abstract class ToscaDataDefinition { } public void setToscaPresentationValue(JsonPresentationFields name, Object value) { - if(name !=null) { + if (name != null) { if (toscaPresentation == null) { toscaPresentation = new HashMap<>(); } toscaPresentation.put(name.getPresentation(), value); } - } public void setOwnerIdIfEmpty(String ownerId) { @@ -80,62 +104,36 @@ public abstract class ToscaDataDefinition { return (String) getToscaPresentationValue(JsonPresentationFields.TYPE); } - public String getVersion() { - return (String) getToscaPresentationValue(JsonPresentationFields.VERSION); - } - public void setType(String type) { setToscaPresentationValue(JsonPresentationFields.TYPE, type); } - public void setOwnerId(String ownerId) { - setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId); + public String getVersion() { + return (String) getToscaPresentationValue(JsonPresentationFields.VERSION); } public String getOwnerId() { return (String) getToscaPresentationValue(JsonPresentationFields.OWNER_ID); } + public void setOwnerId(String ownerId) { + setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId); + } + // default merge function for merging data maps - implement where needed and use mergeDataMaps method where applicable instead of map1.putAll(map2) public <T extends ToscaDataDefinition> T mergeFunction(T other, boolean allowDefaultValueOverride) { other.setOwnerId(getOwnerId()); return other; } - public static <T extends ToscaDataDefinition> Either<Map<String, T>, String> mergeDataMaps(Map<String, T> map1, Map<String, T> map2) { - return mergeDataMaps(map1, map2, false); - } - - // return Either.right(item key) if an illegal merge was attempted (overriding data type is forbidden) - public static <T extends ToscaDataDefinition> Either<Map<String, T>, String> mergeDataMaps(Map<String, T> map1, Map<String, T> map2, boolean allowDefaultValueOverride) { - for (Entry<String, T> entry : map2.entrySet()) { - map1.merge(entry.getKey(), entry.getValue(), (item1, item2) -> item1.mergeFunction(item2, allowDefaultValueOverride)); - // validate merge success - if (!map1.containsKey(entry.getKey())) { - return Either.right(entry.getKey()); - } - } - return Either.left(map1); - } - - public static <T extends ToscaDataDefinition> Map<String, T> listToMapByName(List<T> dataList) { - return null == dataList ? new HashMap<>() : dataList.stream() - .collect(Collectors.toMap(p -> (String) p.getToscaPresentationValue(JsonPresentationFields.NAME), p -> p)); - } - public boolean findUidMatch(String uid) { return uid.equals(getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID)); - } public <T extends ToscaDataDefinition> T removeByOwnerId(Set<String> ownerIdList) { return (T) this; } - public static <T extends ToscaDataDefinition> T removeAndCollectByOwnerId(T complexStructure, Set<String> ownerIdList) { - return complexStructure.removeByOwnerId(ownerIdList); - } - public <T extends ToscaDataDefinition> T updateIfExist(T other, boolean allowDefaultValueOverride) { return other; } @@ -143,5 +141,4 @@ public abstract class ToscaDataDefinition { public boolean isEmpty() { return false; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java b/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java index b2697235b8..bc60eb9be4 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.togglz; import java.util.Arrays; @@ -26,17 +25,10 @@ import org.togglz.core.annotation.Label; import org.togglz.core.context.FeatureContext; public enum ToggleableFeature implements Feature { - @Label("Default Feature") - DEFAULT_FEATURE, - - @Label("Healing") - HEALING; + @Label("Default Feature") DEFAULT_FEATURE, @Label("Healing") HEALING; public static Feature getFeatureByName(String featureName) { - return Arrays.stream(values()). - filter(e -> e.name().equals(featureName)) - .findFirst() - .orElse(null); + return Arrays.stream(values()).filter(e -> e.name().equals(featureName)).findFirst().orElse(null); } public boolean isActive() { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java b/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java index 830449ca9e..9278b4fb44 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,9 +17,9 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.togglz; +import java.io.File; import org.togglz.core.Feature; import org.togglz.core.manager.TogglzConfig; import org.togglz.core.repository.StateRepository; @@ -27,24 +27,22 @@ import org.togglz.core.repository.file.FileBasedStateRepository; import org.togglz.core.user.SimpleFeatureUser; import org.togglz.core.user.UserProvider; -import java.io.File; - public class TogglzConfiguration implements TogglzConfig { - private static final String TOGGLZ_FILE_LOCATION = "/tmp/features.properties"; + private static final String TOGGLZ_FILE_LOCATION = "/tmp/features.properties"; - @Override - public Class<? extends Feature> getFeatureClass() { - return ToggleableFeature.class; - } + @Override + public Class<? extends Feature> getFeatureClass() { + return ToggleableFeature.class; + } - @Override - public StateRepository getStateRepository() { - return new FileBasedStateRepository(new File(TOGGLZ_FILE_LOCATION)); - } + @Override + public StateRepository getStateRepository() { + return new FileBasedStateRepository(new File(TOGGLZ_FILE_LOCATION)); + } - @Override - public UserProvider getUserProvider() { - return () -> new SimpleFeatureUser("admin", true); - } + @Override + public UserProvider getUserProvider() { + return () -> new SimpleFeatureUser("admin", true); + } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/utils/CommonBeUtils.java b/common-be/src/main/java/org/openecomp/sdc/be/utils/CommonBeUtils.java index 0539e32cc8..ec3fb92c37 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/utils/CommonBeUtils.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/utils/CommonBeUtils.java @@ -17,20 +17,19 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.utils; import org.openecomp.sdc.common.api.Constants; public class CommonBeUtils { + /** * Compares two ASDC versions of a component. It's for internal usage, so the assumption is that the versions are in valid format. * * @param firstVersion - version in format major.minor or just major (e.g, 2.0 or 2) * @param secondVersion - version in format major.minor or just major (e.g, 2.0 or 2) - * @return Returns true iff:<br> - * 1) first version's major number is higher than second's (e.g., firstVersion = 1.1, secondVersion = 0.3)<br> - * 2) major version are equal, but first's minor version is higher than second's (e.g., firstVersion = 0.10, secondVersion = 0.9) <br> + * @return Returns true iff:<br> 1) first version's major number is higher than second's (e.g., firstVersion = 1.1, secondVersion = 0.3)<br> 2) + * major version are equal, but first's minor version is higher than second's (e.g., firstVersion = 0.10, secondVersion = 0.9) <br> */ public static boolean compareAsdcComponentVersions(String firstVersion, String secondVersion) { String[] firstVersionNums = firstVersion.split("\\."); @@ -48,18 +47,15 @@ public class CommonBeUtils { } } - /** * Compares two version strings. - * - * Use this instead of String.compareTo() for a non-lexicographical - * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). + * <p> + * Use this instead of String.compareTo() for a non-lexicographical comparison that works for version strings. e.g. "1.10".compareTo("1.6"). * * @param str1 a string of ordinal numbers separated by decimal points. * @param str2 a string of ordinal numbers separated by decimal points. - * @return The result is a negative integer if str1 is _numerically_ less than str2. - * The result is a positive integer if str1 is _numerically_ greater than str2. - * The result is zero if the strings are _numerically_ equal. + * @return The result is a negative integer if str1 is _numerically_ less than str2. The result is a positive integer if str1 is _numerically_ + * greater than str2. The result is zero if the strings are _numerically_ equal. * @note It does not work if "1.10" is supposed to be equal to "1.10.0". */ public static int conformanceLevelCompare(String str1, String str2) { @@ -76,6 +72,7 @@ public class CommonBeUtils { return Integer.signum(diff); } // the strings are equal or one string is a substring of the other + // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" return Integer.signum(vals1.length - vals2.length); } @@ -83,5 +80,4 @@ public class CommonBeUtils { public static String generateToscaResourceName(String resourceType, String resourceSystemName) { return Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX + resourceType.toLowerCase() + "." + resourceSystemName; } - } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/utils/PropertyDefinitionUtils.java b/common-be/src/main/java/org/openecomp/sdc/be/utils/PropertyDefinitionUtils.java index 600401bd07..21ac7c7571 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/utils/PropertyDefinitionUtils.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/utils/PropertyDefinitionUtils.java @@ -19,14 +19,13 @@ */ package org.openecomp.sdc.be.utils; -import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import static java.util.Collections.emptyMap; +import static java.util.stream.Collectors.toList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; - -import static java.util.Collections.emptyMap; -import static java.util.stream.Collectors.toList; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; public class PropertyDefinitionUtils { @@ -41,16 +40,10 @@ public class PropertyDefinitionUtils { if (properties == null) { return emptyMap(); } - return properties.entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, - entry -> filterGetInputProps(entry.getValue()))); + return properties.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> filterGetInputProps(entry.getValue()))); } private static <T extends PropertyDataDefinition> List<PropertyDataDefinition> filterGetInputProps(List<T> propDefinitions) { - return propDefinitions - .stream() - .filter(PropertyDataDefinition::isGetInputProperty) - .collect(Collectors.toList()); + return propDefinitions.stream().filter(PropertyDataDefinition::isGetInputProperty).collect(Collectors.toList()); } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java index 7535fbd5b6..be6a8c270b 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java @@ -43,6 +43,7 @@ public class TypeUtils { @Getter @AllArgsConstructor public enum ToscaTagNamesEnum { + // @formatter:off DERIVED_FROM("derived_from"), IS_PASSWORD("is_password"), // Properties PROPERTIES("properties"), TYPE("type"), STATUS("status"), @@ -63,7 +64,8 @@ public class TypeUtils { // Heat env Validation PARAMETERS("parameters"), // Import Validations - TOSCA_VERSION("tosca_definitions_version"), TOPOLOGY_TEMPLATE("topology_template"), OCCURRENCES("occurrences"), NODE_TEMPLATES("node_templates"), GROUPS("groups"), INPUTS("inputs"), + TOSCA_VERSION("tosca_definitions_version"), TOPOLOGY_TEMPLATE("topology_template"), OCCURRENCES("occurrences"), NODE_TEMPLATES( + "node_templates"), GROUPS("groups"), INPUTS("inputs"), SUBSTITUTION_MAPPINGS("substitution_mappings"), NODE_TYPE("node_type"), DIRECTIVES("directives"), // Attributes ATTRIBUTES("attributes"), LABEL("label"), HIDDEN("hidden"), IMMUTABLE("immutable"), ANNOTATIONS("annotations"), @@ -76,6 +78,7 @@ public class TypeUtils { IMPLEMENTATION("implementation"), DERIVED_FROM_NAME("derivedFromName"); + // @formatter:om private final String elementName; |