X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fxml%2Fgenerator%2FModelGenerator.java;h=c5ea37a068ecf2bd53999cb37326150b7199744e;hb=e3de90587ada88dcb3cb0a87fbfe283b2ae9f08b;hp=bbd1ff358b45a70420a62994bb22ca685c88382e;hpb=4217e6f7018d08b11291490b3ad5c54064cdc031;p=aai%2Fbabel.git diff --git a/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java b/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java index bbd1ff3..c5ea37a 100644 --- a/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java +++ b/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2019 European Software Marketing Ltd. + * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (c) 2017-2019 European Software Marketing Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ import org.onap.aai.cl.api.Logger; */ public class ModelGenerator implements ArtifactGenerator { - private static final Logger logger = LogHelper.INSTANCE; private static final String VERSION_DELIMITER = "."; @@ -55,10 +54,10 @@ public class ModelGenerator implements ArtifactGenerator { * * @param csarArchive * @param csarArtifacts - * the input artifacts + * the input artifacts * @return {@link List} of output artifacts * @throws XmlArtifactGenerationException - * if there is an error trying to generate XML artifacts + * if there is an error trying to generate XML artifacts */ @Override public List generateArtifacts(byte[] csarArchive, List csarArtifacts) @@ -94,11 +93,11 @@ public class ModelGenerator implements ArtifactGenerator { * Creates an instance of an input artifact for the generator. * * @param payload - * the payload downloaded from SDC + * the payload downloaded from SDC * @param artifactName - * name of the artifact to create + * name of the artifact to create * @param artifactVersion - * version of the artifact to create + * version of the artifact to create * @return an {@link Artifact} object constructed from the payload and artifactInfo */ public static Artifact createArtifact(byte[] payload, String artifactName, String artifactVersion) { @@ -116,11 +115,12 @@ public class ModelGenerator implements ArtifactGenerator { } private static String getServiceVersion(String artifactVersion) { - logger.debug("Artifact version=" + artifactVersion); - String serviceVersion; + logger.debug("Artifact version=" + artifactVersion ); + + // As of 1902, AAI-16260, we no longer edit the passed in artifact/service version. try { - int majorVersion = Integer.parseInt(artifactVersion.split(VERSION_DELIMITER_REGEXP)[0]); - serviceVersion = majorVersion + VERSION_DELIMITER + "0"; + // just make sure it's an integer + Integer.parseInt(artifactVersion.split(VERSION_DELIMITER_REGEXP)[0]); } catch (Exception e) { logger.warn(ApplicationMsgs.DISTRIBUTION_EVENT, "Error generating service version from artifact version: " + artifactVersion @@ -129,6 +129,7 @@ public class ModelGenerator implements ArtifactGenerator { return DEFAULT_SERVICE_VERSION; } - return serviceVersion; + logger.debug("Use Artifact version as the serviceVersion=" + artifactVersion ); + return artifactVersion; } }