diff --git a/.github/linters/sun_checks.xml b/.github/linters/sun_checks.xml index 1c1adffc7..76ecbcbc4 100644 --- a/.github/linters/sun_checks.xml +++ b/.github/linters/sun_checks.xml @@ -188,13 +188,11 @@ https://www.oracle.com/java/technologies/javase/codeconventions-contents.html - + + - - - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4df9f18d5..786904a34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,10 @@ on: - "main" # trigger the workflow for main branch workflow_dispatch: +permissions: + actions: write + contents: write + jobs: build: strategy: @@ -31,7 +35,7 @@ jobs: node-version: ${{ matrix.node }} - name: Setup Maven Action - uses: s4u/setup-maven-action@v1.17.0 + uses: s4u/setup-maven-action@4f7fb9d9675e899ca81c6161dadbba0189a4ebb1 #v1.18.0 with: java-version: ${{ matrix.java }} java-distribution: "temurin" @@ -74,7 +78,7 @@ jobs: - name: Import GPG Key if: ${{ github.ref == 'refs/heads/main' }} - uses: crazy-max/ghaction-import-gpg@v6 + uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/codeql-java.yml b/.github/workflows/codeql-java.yml deleted file mode 100644 index fc55f5364..000000000 --- a/.github/workflows/codeql-java.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "CodeQL Java" - -on: - pull_request: - workflow_dispatch: - -jobs: - analyze: - name: Analyze - runs-on: 'ubuntu-latest' - permissions: - actions: read - contents: read - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Use Node.js '16.20.2' - uses: actions/setup-node@v4 - with: - node-version: '16.20.2' - - - name: Setup Maven Action - uses: s4u/setup-maven-action@v1.17.0 - with: - java-version: '21' - java-distribution: 'temurin' - maven-version: '3.9.2' - - - name: Get Prev Released IAC version - run: echo "IAC_PREV_VERSION=$(mvn -U --batch-mode -N -q -DforceStdout help:evaluate -Dexpression=project.version -Dartifact=com.vmware.pscoe:iac:RELEASE)" >> $GITHUB_ENV - - - name: Get version - run: echo "IAC_VERSION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)" >> $GITHUB_ENV - - - name: Replace variables in settings.xml - run: | - sed -i "s/{{ IAC_VERSION }}/${{ env.IAC_PREV_VERSION }}/g" .m2/settings.xml - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: java - - - name: Cache Maven dependencies - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Build 'keystore-example' - run: mvn -T 1C clean install -f common/keystore-example/pom.xml -s $PWD/.m2/settings.xml - - name: Build 'npmlib' - run: mvn -T 1C clean install -f maven/npmlib/pom.xml -s $PWD/.m2/settings.xml - - name: Build 'iac' - run: mvn -T 1C clean install -f pom.xml -s $PWD/.m2/settings.xml - - name: Build 'base-package' - run: mvn -T 1C clean install -f maven/base-package/pom.xml -s $PWD/.m2/settings.xml - - name: Build 'packages' - run: mvn -T 1C clean install -f packages/pom.xml -s $PWD/.m2/settings.xml - - name: Build 'typescript-project-all' - run: mvn -T 1C clean install -f maven/typescript-project-all/pom.xml -s $PWD/.m2/settings.xml - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/codeql-js.yml b/.github/workflows/codeql-js.yml deleted file mode 100644 index 453a6f73c..000000000 --- a/.github/workflows/codeql-js.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "CodeQL JS" - -on: - pull_request: - workflow_dispatch: - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: javascript - - # Perform the CodeQL Analysis. - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 2e637e7b7..a77154322 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "main" - - uses: release-drafter/release-drafter@v6 + - uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6 with: config-name: release-drafter.yml env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea1112a53..bef4e7880 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,9 @@ jobs: release: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest + permissions: + actions: write + contents: write steps: - name: Validate actor permissions @@ -48,7 +51,7 @@ jobs: run: sudo apt-get install libxml2-utils - name: Setup Maven Action - uses: s4u/setup-maven-action@v1.17.0 + uses: s4u/setup-maven-action@4f7fb9d9675e899ca81c6161dadbba0189a4ebb1 #v1.18.0 with: java-version: 17 java-distribution: "temurin" diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index ea9e93b67..20de89251 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -3,10 +3,16 @@ on: pull_request: workflow_dispatch: +permissions: {} + jobs: super-linter: name: Lint all code runs-on: ubuntu-latest + permissions: + contents: read + packages: read + statuses: write steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 4f08c2744..f0b951846 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -9,6 +9,10 @@ jobs: build: name: Run vulnerability scan runs-on: ubuntu-22.04 + permissions: + contents: write + actions: write + security-events: write env: TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db,aquasec/trivy-db,ghcr.io/aquasecurity/trivy-db TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db,aquasec/trivy-java-db,ghcr.io/aquasecurity/trivy-java-db @@ -17,7 +21,7 @@ jobs: uses: actions/checkout@v4 - name: Run Trivy vulnerability scanner in fs mode - uses: aquasecurity/trivy-action@0.29.0 + uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0 with: scan-type: 'fs' scan-ref: '.' diff --git a/common/artifact-manager/pom.xml b/common/artifact-manager/pom.xml index 213493084..075bf0574 100644 --- a/common/artifact-manager/pom.xml +++ b/common/artifact-manager/pom.xml @@ -97,7 +97,7 @@ org.apache.httpcomponents.core5 httpcore5 - 5.3.1 + 5.3.2 com.jayway.jsonpath @@ -186,7 +186,7 @@ org.mockito mockito-core - 5.14.2 + 5.15.2 test diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxPackageStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxPackageStore.java index aa31ecf06..65a8beaa7 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxPackageStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxPackageStore.java @@ -21,8 +21,8 @@ import com.vmware.pscoe.iac.artifact.model.abx.AbxConstant; import com.vmware.pscoe.iac.artifact.model.abx.AbxPackageContent; import com.vmware.pscoe.iac.artifact.model.abx.AbxPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSecret; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSecret; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.apache.commons.lang3.NotImplementedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxReleaseManager.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxReleaseManager.java index 12be198a5..f0ee7ce9f 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxReleaseManager.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/AbxReleaseManager.java @@ -31,7 +31,7 @@ import com.vmware.pscoe.iac.artifact.model.abx.AbxAction; import com.vmware.pscoe.iac.artifact.model.abx.AbxActionVersion; import com.vmware.pscoe.iac.artifact.model.abx.AbxPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; public class AbxReleaseManager { private final Logger logger = LoggerFactory.getLogger(AbxReleaseManager.class); diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/IMPORTANT.md b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/IMPORTANT.md new file mode 100644 index 000000000..3e8201b35 --- /dev/null +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/IMPORTANT.md @@ -0,0 +1,14 @@ +# What? + +The structure of this folder is being reworked. Classes are being moved based on solution. + +## Progress + +- [x] Aria Automation +- [ ] Aria Orchestrator +- [ ] Aria Logs +- [ ] Aria Operations +- [ ] SSH +- [ ] vCD +- [ ] CS +- [ ] ABX diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/PackageStoreFactory.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/PackageStoreFactory.java index f58892c25..d15ebe316 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/PackageStoreFactory.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/PackageStoreFactory.java @@ -25,6 +25,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.cli.CliManagerFactory; import com.vmware.pscoe.iac.artifact.cli.CliManagerVrops; import com.vmware.pscoe.iac.artifact.model.Version; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVraNg.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/configuration/ConfigurationVraNg.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVraNg.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/configuration/ConfigurationVraNg.java index ecb8ef52d..903930fdd 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVraNg.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/configuration/ConfigurationVraNg.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.configuration; +package com.vmware.pscoe.iac.artifact.aria.automation.configuration; import java.net.URISyntaxException; import java.util.Properties; @@ -22,6 +22,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.vmware.pscoe.iac.artifact.configuration.Configuration; +import com.vmware.pscoe.iac.artifact.configuration.ConfigurationException; import com.vmware.pscoe.iac.artifact.model.PackageType; /** diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/rest/vrang/package-info.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/configuration/package-info.java similarity index 78% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/rest/vrang/package-info.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/configuration/package-info.java index 7a60f0bfa..8f7a163da 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/rest/vrang/package-info.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/configuration/package-info.java @@ -1,8 +1,13 @@ +/** + * Configuration classes for ARIA. + */ +package com.vmware.pscoe.iac.artifact.aria.automation.configuration; + /*- * #%L * artifact-manager * %% - * Copyright (C) 2023 VMware + * Copyright (C) 2023 - 2024 VMware * %% * Build Tools for VMware Aria * Copyright 2023 VMware, Inc. @@ -12,9 +17,3 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ - -/** - * Package that represents IAC Artifact. - * - */ -package com.vmware.pscoe.iac.artifact.rest.vrang; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/Identifiable.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/Identifiable.java similarity index 92% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/Identifiable.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/Identifiable.java index b980dfed4..e5d78c696 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/Identifiable.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/Identifiable.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; /** * Interface that makes a Aria automation resource identifiable. diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgApprovalPolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgApprovalPolicy.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgApprovalPolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgApprovalPolicy.java index ae611521f..1a5737fe2 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgApprovalPolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgApprovalPolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonObject; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgBlueprint.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgBlueprint.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgBlueprint.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgBlueprint.java index a71eb1fb1..b237adfe0 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgBlueprint.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgBlueprint.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import org.apache.commons.lang3.builder.HashCodeBuilder; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlement.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlement.java similarity index 99% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlement.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlement.java index 27d3a15f6..a5c2ce285 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlement.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlement.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.ArrayList; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlementDto.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlementDto.java similarity index 75% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlementDto.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlementDto.java index e68ad406f..ea210df67 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlementDto.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlementDto.java @@ -12,39 +12,59 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.LinkedHashMap; import java.util.Map; +/** + * VraNgCatalogEntitlementDto is used to store the entitlement details of the + * VraNgCatalog. + */ public class VraNgCatalogEntitlementDto { - private String id; private String projectId; private Map definition = new LinkedHashMap(); + /** + * @return the id + */ public String getId() { return id; } + /** + * @param id the id to set + */ public void setId(String id) { this.id = id; } + /** + * @return the project id + */ public String getProjectId() { return projectId; } + /** + * @param projectId to set + */ public void setProjectId(String projectId) { this.projectId = projectId; } + /** + * @return the definition + */ public Map getDefinition() { return definition; } + /** + * @param definition to set + */ public void setDefinition(Map definition) { this.definition = definition; } - } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlementType.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlementType.java similarity index 95% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlementType.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlementType.java index 89b0079cd..592cdc895 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogEntitlementType.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogEntitlementType.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.annotations.SerializedName; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogItem.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogItem.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogItem.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogItem.java index 9847ffed6..9118159f3 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogItem.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogItem.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; /** * Service Broker catalog item. diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogItemType.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogItemType.java similarity index 94% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogItemType.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogItemType.java index 8cd78dbe1..230c871c9 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCatalogItemType.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCatalogItemType.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; public class VraNgCatalogItemType { /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCloudAccount.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCloudAccount.java similarity index 58% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCloudAccount.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCloudAccount.java index 7021f40f4..b8b52dcb4 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCloudAccount.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCloudAccount.java @@ -12,19 +12,39 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.Collections; import java.util.List; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * VraNgCloudAccount is the Aria Automation > Infrastructire > Cloud Account + * representation. + */ public class VraNgCloudAccount { + /** + * @param Prime Number 17. + */ + private static final int PRIME_NUMBER_17 = 17; + /** + * @param Prime Number 31. + */ + private static final int PRIME_NUMBER_31 = 31; private final String id; private final String name; private final String type; private final List regionIds; private final List tags; + /** + * @param id - the id of the CA + * @param name - the name of the CA + * @param type - the type of the CA + * @param regionIds - all the region IDs for the cloud account + */ public VraNgCloudAccount(String id, String name, String type, List regionIds, List tags) { this.id = id; this.name = name; @@ -33,26 +53,44 @@ public VraNgCloudAccount(String id, String name, String type, List regio this.tags = tags; } + /** + * @return the id of the cloud account + */ public String getId() { return this.id; } + /** + * @return the name of the CA + */ public String getName() { return this.name; } + /** + * @return the type of the CA + */ public String getType() { return this.type; } + /** + * @return the region ids associated with the CA + */ public List getRegionIds() { return Collections.unmodifiableList(this.regionIds); } + /** + * @return the tags associated with the CA + */ public List getTags() { return Collections.unmodifiableList(this.tags); } + /** + * @param obj - object to check if it equals to this one + */ @Override public boolean equals(Object obj) { if (obj == null || !this.getClass().equals(obj.getClass())) { @@ -63,4 +101,15 @@ public boolean equals(Object obj) { return this.id.equals(other.getId()); } + /** + * @return the hash code of the object + */ + @Override + public int hashCode() { + return new HashCodeBuilder(PRIME_NUMBER_17, PRIME_NUMBER_31) + .append(name) + .append(type) + .toHashCode(); + } + } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgConfig.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgConfig.java similarity index 87% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgConfig.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgConfig.java index 2d355d958..1d296a9d7 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgConfig.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgConfig.java @@ -13,7 +13,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.io.Serializable; import java.util.ArrayList; @@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +/** + * Content Source Configuration. + */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "workflows" }) public class VraNgConfig implements Serializable { @@ -31,11 +34,17 @@ public class VraNgConfig implements Serializable { @JsonProperty("workflows") private List workflows = new ArrayList<>(); + /** + * @return the workflows + */ @JsonProperty("workflows") public List getWorkflows() { return workflows; } + /** + * @param workflows - the workflows to set + */ @JsonProperty("workflows") public void setWorkflows(List workflows) { this.workflows = workflows; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSharingPolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSharingPolicy.java similarity index 99% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSharingPolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSharingPolicy.java index 5b9d582d6..b94f61489 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSharingPolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSharingPolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSource.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSource.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSource.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSource.java index 864ab1711..bbc4251a5 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSource.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSource.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.List; import java.util.Map; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSourceBase.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSourceBase.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSourceBase.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSourceBase.java index 597d9ce28..df64ea9bc 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSourceBase.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSourceBase.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.ArrayList; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSourceType.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSourceType.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSourceType.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSourceType.java index 4e85bf881..739a7b748 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgContentSourceType.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgContentSourceType.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.annotations.SerializedName; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomForm.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomForm.java similarity index 99% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomForm.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomForm.java index 82bff277e..f05dbfaa1 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomForm.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomForm.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomFormAndData.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomFormAndData.java similarity index 99% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomFormAndData.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomFormAndData.java index 5eb79701e..85e7728ec 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomFormAndData.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomFormAndData.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonParser; import com.google.gson.JsonElement; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomResource.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomResource.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomResource.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomResource.java index 2d9d95a41..641aac7ed 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgCustomResource.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgCustomResource.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import org.apache.commons.lang3.builder.HashCodeBuilder; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDay2ActionsPolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDay2ActionsPolicy.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDay2ActionsPolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDay2ActionsPolicy.java index 0967b05d2..5400365d8 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDay2ActionsPolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDay2ActionsPolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonObject; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDefinition.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDefinition.java similarity index 95% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDefinition.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDefinition.java index 0b450917b..77bdc4f84 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDefinition.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDefinition.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDeploymentLimitPolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDeploymentLimitPolicy.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDeploymentLimitPolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDeploymentLimitPolicy.java index f504f9540..38c53f387 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgDeploymentLimitPolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgDeploymentLimitPolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonObject; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgEntitledUser.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgEntitledUser.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgEntitledUser.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgEntitledUser.java index c1e1d49ce..59459d6f4 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgEntitledUser.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgEntitledUser.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgIntegration.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgIntegration.java similarity index 78% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgIntegration.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgIntegration.java index bfada0334..33cf74b00 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgIntegration.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgIntegration.java @@ -13,7 +13,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.io.Serializable; import java.util.HashMap; @@ -26,6 +26,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +/** + * Aria Automation > Infrastructure > Integration implementation. + */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "name", "endpointUri", "endpointConfigurationLink" }) public class VraNgIntegration implements Serializable { @@ -43,41 +46,66 @@ public class VraNgIntegration implements Serializable { @JsonIgnore private transient Map additionalProperties = new HashMap<>(); + /** + * @return the name of the integration + */ @JsonProperty("name") public String getName() { return name; } + /** + * @param name - the integration name to set + */ @JsonProperty("name") public void setName(String name) { this.name = name; } + /** + * @return the endpoint of the integration + */ @JsonProperty("endpointUri") public String getEndpointUri() { return endpointUri; } + /** + * @param endpointUri - the endpoint uri to set + */ @JsonProperty("endpointUri") public void setEndpointUri(String endpointUri) { this.endpointUri = endpointUri; } + /** + * @return the endpoint configuration link + */ @JsonProperty("endpointConfigurationLink") public String getEndpointConfigurationLink() { return endpointConfigurationLink; } + /** + * @param endpointConfigurationLink - the endpoint config link + */ @JsonProperty("endpointConfigurationLink") public void setEndpointConfigurationLink(String endpointConfigurationLink) { this.endpointConfigurationLink = endpointConfigurationLink; } + /** + * @return a map of the additional properties + */ @JsonAnyGetter public Map getAdditionalProperties() { return this.additionalProperties; } + /** + * @param name - name of an additional property to set + * @param value - the value of the additional prop to add + */ @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgItem.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgItem.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgItem.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgItem.java index 63c166947..e62ecb5ae 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgItem.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgItem.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; public class VraNgItem { /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgLeasePolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgLeasePolicy.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgLeasePolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgLeasePolicy.java index 356507da1..f681dd2f9 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgLeasePolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgLeasePolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonObject; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgOrganization.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgOrganization.java similarity index 75% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgOrganization.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgOrganization.java index e1bed6f43..b0af66f82 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgOrganization.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgOrganization.java @@ -13,14 +13,17 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.fasterxml.jackson.annotation.*; import java.io.Serializable; +/** + * Model for Organizations in Aria. + */ @JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({"id", "name", "refLink"}) +@JsonPropertyOrder({ "id", "name", "refLink" }) public class VraNgOrganization implements Serializable { private static final long serialVersionUID = -3313748896114761975L; @@ -33,6 +36,9 @@ public class VraNgOrganization implements Serializable { @JsonProperty("refLink") private String refLink; + /** + * @return the project id + */ @JsonProperty("id") public String getId() { if (id == null) { @@ -41,25 +47,40 @@ public String getId() { return id; } + /** + * @param id - the project id to set + */ @JsonProperty("id") public void setId(String id) { this.id = id; } + /** + * @return the name of the project + */ @JsonProperty("name") public String getName() { return name; } + /** + * @param name - the project name to set + */ @JsonProperty("name") public void setName(String name) { this.name = name; } + /** + * @return the reference link of the project + */ public String getRefLink() { return refLink; } + /** + * @param refLink - the reference link of the project to set + */ public void setRefLink(String refLink) { this.refLink = refLink; } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgOrganizations.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgOrganizations.java similarity index 92% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgOrganizations.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgOrganizations.java index 1c3f1d156..14d3180e2 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgOrganizations.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgOrganizations.java @@ -13,7 +13,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -23,7 +23,7 @@ import java.util.List; @JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({"items"}) +@JsonPropertyOrder({ "items" }) public class VraNgOrganizations implements Serializable { private static final long serialVersionUID = -3313748896114761975L; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageAdapter.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageAdapter.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageAdapter.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageAdapter.java index 2b5bb9cba..f0e852f6d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageAdapter.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageAdapter.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.io.IOException; import java.nio.file.Files; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageContent.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageContent.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageContent.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageContent.java index 8f606a443..c1215d468 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageContent.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageContent.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageDescriptor.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageDescriptor.java similarity index 99% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageDescriptor.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageDescriptor.java index c7793ce62..0631d3e5a 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageDescriptor.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageDescriptor.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.io.File; import java.util.ArrayList; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageMemberType.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageMemberType.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageMemberType.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageMemberType.java index 8e4f3a7c9..530c4a2a1 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPackageMemberType.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPackageMemberType.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; public enum VraNgPackageMemberType { BLUEPRINT("blueprint"), diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPolicy.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPolicy.java index 4e4d85d41..9e4fb02e0 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.util.List; import java.util.ArrayList; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPolicyFolderName.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPolicyFolderName.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPolicyFolderName.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPolicyFolderName.java index 3de23c9cb..4d99a0c2b 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPolicyFolderName.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPolicyFolderName.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; public enum VraNgPolicyFolderName { /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPrincipal.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPrincipal.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPrincipal.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPrincipal.java index 84d80fec1..d70559540 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPrincipal.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPrincipal.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; public class VraNgPrincipal { /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgProject.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgProject.java similarity index 94% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgProject.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgProject.java index 25a0e64f5..82e66e298 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgProject.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgProject.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; /** * Represents a VraNgProject. diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPropertyGroup.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPropertyGroup.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPropertyGroup.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPropertyGroup.java index 3cfaa9dc1..1ae81f31c 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgPropertyGroup.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgPropertyGroup.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgRegion.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgRegion.java similarity index 56% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgRegion.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgRegion.java index 491fd6516..0613bad32 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgRegion.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgRegion.java @@ -12,26 +12,53 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * Aria automation > Infrastructure > Region. + */ public class VraNgRegion { + /** + * @param Prime Number 17. + */ + private static final int PRIME_NUMBER_17 = 17; + + /** + * @param Prime Number 31. + */ + private static final int PRIME_NUMBER_31 = 31; private final String id; private final String cloudAccountId; + /** + * @param id - the id of the region + * @param cloudAccountId - the cloud account id for the region + */ public VraNgRegion(String id, String cloudAccountId) { this.id = id; this.cloudAccountId = cloudAccountId; } + /** + * @return the id of the region + */ public String getId() { return id; } + /** + * @return the cloud account id + */ public String getCloudAccountId() { return cloudAccountId; } + /** + * @param obj - obj to check if it equals + */ @Override public boolean equals(Object obj) { if (obj == null || !this.getClass().equals(obj.getClass())) { @@ -42,4 +69,13 @@ public boolean equals(Object obj) { return this.id.equals(other.getId()); } + /** + * @return the hashcode representation of the object + */ + @Override + public int hashCode() { + return new HashCodeBuilder(PRIME_NUMBER_17, PRIME_NUMBER_31) + .append(cloudAccountId) + .toHashCode(); + } } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgResourceAction.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgResourceAction.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgResourceAction.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgResourceAction.java index 1ef2faba6..fe560adbf 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgResourceAction.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgResourceAction.java @@ -15,7 +15,7 @@ /** * Package. */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; public class VraNgResourceAction implements Identifiable { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgResourceQuotaPolicy.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgResourceQuotaPolicy.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgResourceQuotaPolicy.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgResourceQuotaPolicy.java index 3952bc4de..b5db729f1 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgResourceQuotaPolicy.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgResourceQuotaPolicy.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import com.google.gson.JsonObject; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgSecret.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgSecret.java similarity index 69% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgSecret.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgSecret.java index ac3007bc2..34ae1ba01 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgSecret.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgSecret.java @@ -12,11 +12,29 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; +/** + * Represents an ABX secret + */ public class VraNgSecret { + /** + * The id of the secret. + */ public String id; + + /** + * The name of the secret. + */ public String name; + + /** + * The orgId associated with the secret. + */ public String orgId; + + /** + * the project ID associated with the secret. + */ public String projectId; } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgSubscription.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgSubscription.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgSubscription.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgSubscription.java index 6bab32f9a..f16209452 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgSubscription.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgSubscription.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import org.apache.commons.lang3.builder.HashCodeBuilder; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgWorkflow.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgWorkflow.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgWorkflow.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgWorkflow.java index 0e65f8b0b..51e8d1e52 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgWorkflow.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgWorkflow.java @@ -13,7 +13,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.io.Serializable; import java.util.HashMap; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgWorkflowContentSource.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgWorkflowContentSource.java similarity index 98% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgWorkflowContentSource.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgWorkflowContentSource.java index c1e76952d..d736ea15d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/VraNgWorkflowContentSource.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/VraNgWorkflowContentSource.java @@ -13,7 +13,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; import java.io.Serializable; import java.util.HashMap; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/VraNgCloudAccountTag.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/VraNgCloudAccountTag.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/VraNgCloudAccountTag.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/VraNgCloudAccountTag.java index 62bf7bb8c..cbb35b489 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/VraNgCloudAccountTag.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/VraNgCloudAccountTag.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang.objectmapping; +package com.vmware.pscoe.iac.artifact.aria.automation.models.objectmapping; import java.util.ArrayList; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/VraNgCloudRegionProfile.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/VraNgCloudRegionProfile.java similarity index 94% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/VraNgCloudRegionProfile.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/VraNgCloudRegionProfile.java index 6ade6f991..55216f377 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/VraNgCloudRegionProfile.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/VraNgCloudRegionProfile.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.model.vrang.objectmapping; +package com.vmware.pscoe.iac.artifact.aria.automation.models.objectmapping; import java.util.List; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/package-info.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/package-info.java similarity index 88% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/package-info.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/package-info.java index 74b258f0b..561203d59 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/objectmapping/package-info.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/objectmapping/package-info.java @@ -15,4 +15,4 @@ /** * Represents cloud account details. */ -package com.vmware.pscoe.iac.artifact.model.vrang.objectmapping; +package com.vmware.pscoe.iac.artifact.aria.automation.models.objectmapping; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/package-info.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/package-info.java similarity index 90% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/package-info.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/package-info.java index 6481113fc..e18628e2b 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/model/vrang/package-info.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/models/package-info.java @@ -16,4 +16,4 @@ * Package that represents vRA 8 model. * */ -package com.vmware.pscoe.iac.artifact.model.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.models; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/VraNgPackageStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/package/VraNgPackageStore.java similarity index 95% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/VraNgPackageStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/package/VraNgPackageStore.java index 373208b19..ec5777083 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/VraNgPackageStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/package/VraNgPackageStore.java @@ -25,14 +25,14 @@ import java.util.Collections; import java.util.List; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageContent.Content; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageAdapter; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; -import com.vmware.pscoe.iac.artifact.store.vrang.VraNgTypeStoreFactory; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageAdapter; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgTypeStoreFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNg.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNg.java similarity index 94% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNg.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNg.java index d47934e8e..d62019dd0 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNg.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNg.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.rest; +package com.vmware.pscoe.iac.artifact.aria.automation.rest; import java.io.File; import java.net.URISyntaxException; @@ -27,28 +27,28 @@ import com.vmware.pscoe.iac.artifact.model.abx.AbxActionVersion; import com.vmware.pscoe.iac.artifact.model.abx.AbxConstant; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgApprovalPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlement; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCloudAccount; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDay2ActionsPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDeploymentLimitPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgIntegration; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgLeasePolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgRegion; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceQuotaPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSecret; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSubscription; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgWorkflowContentSource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgApprovalPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlement; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCloudAccount; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDay2ActionsPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDeploymentLimitPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgIntegration; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgLeasePolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgRegion; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceQuotaPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSecret; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSubscription; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgWorkflowContentSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,7 +56,7 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.client.HttpClientErrorException; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; public class RestClientVraNg extends RestClientVraNgPrimitive { private static final String SUBSCRIPTION_BASE_QUERY = "type ne 'SUBSCRIBABLE'"; @@ -73,7 +73,7 @@ public class RestClientVraNg extends RestClientVraNgPrimitive { * @param configuration configuration vra * @param restTemplate rest template */ - protected RestClientVraNg(final ConfigurationVraNg configuration, final RestTemplate restTemplate) { + public RestClientVraNg(final ConfigurationVraNg configuration, final RestTemplate restTemplate) { super(configuration, restTemplate); } @@ -411,6 +411,10 @@ public Map getSubscriptionsByOrgIdAndName(final Strin /** * getCloudAccounts. + * + * NOTE: This is not used anymore. It's a leftoever from the deprecation of + * regional content. + * Leaving it here for now in case it's needed. * * @return cloudAccounts */ @@ -425,6 +429,10 @@ public List getCloudAccounts() { /** * getCloudAccount. * + * NOTE: This is not used anymore. It's a leftoever from the deprecation of + * regional content. + * Leaving it here for now in case it's needed. + * * @param id cloud account id * @return cloudAccount */ diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNgAuthNInterceptor.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNgAuthNInterceptor.java similarity index 84% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNgAuthNInterceptor.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNgAuthNInterceptor.java index 239abd17b..61359c23d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNgAuthNInterceptor.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNgAuthNInterceptor.java @@ -12,13 +12,14 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.rest; +package com.vmware.pscoe.iac.artifact.aria.automation.rest; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.jayway.jsonpath.DocumentContext; import com.jayway.jsonpath.JsonPath; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.rest.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.*; @@ -47,7 +48,7 @@ public class RestClientVraNgAuthNInterceptor extends RestClientRequestIntercepto private String tokenType; private LocalDateTime tokenExpirationDate; - protected RestClientVraNgAuthNInterceptor(ConfigurationVraNg configuration, RestTemplate restTemplate) { + public RestClientVraNgAuthNInterceptor(ConfigurationVraNg configuration, RestTemplate restTemplate) { super(configuration, restTemplate); this.tokenType = DEFAULT_TOKEN_TYPE; } @@ -60,9 +61,9 @@ public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttp acquireToken(request); } if (this.token != null) { - request.getHeaders().add("Authorization", this.tokenType + " " + this.token); + request.getHeaders().add("Authorization", this.tokenType + " " + this.token); } - + return execution.execute(request, body); } catch (Exception e) { throw new RuntimeException(e); @@ -77,7 +78,8 @@ private void acquireToken(HttpRequest request) throws JsonProcessingException { } else { logger.info("Acquiring refresh token with credentials"); ResponseEntity requestWithCredentialsResponse = this.requestWithCredentials(request); - DocumentContext requestWithCredentialsResponseBody = JsonPath.parse(requestWithCredentialsResponse.getBody()); + DocumentContext requestWithCredentialsResponseBody = JsonPath + .parse(requestWithCredentialsResponse.getBody()); refreshToken = requestWithCredentialsResponseBody.read("$.refresh_token"); } @@ -87,16 +89,18 @@ private void acquireToken(HttpRequest request) throws JsonProcessingException { final int expiresIn = responseBody.jsonString().contains("expires_in") ? responseBody.read("$.expires_in") : 0; this.tokenExpirationDate = now.plus(expiresIn, ChronoField.SECOND_OF_MINUTE.getBaseUnit()); this.token = responseBody.jsonString().contains("access_token") ? responseBody.read("$.access_token") : null; - String tokenTypeFromResponse = responseBody.jsonString().contains("token_type") ? responseBody.read("$.token_type") : null; + String tokenTypeFromResponse = responseBody.jsonString().contains("token_type") + ? responseBody.read("$.token_type") + : null; this.setTokenType(tokenTypeFromResponse); } private ResponseEntity requestWithRefreshToken(HttpRequest request, String refreshToken) { final URI tokenUri = UriComponentsBuilder.newInstance() - .scheme(request.getURI().getScheme()) - .host(this.getConfiguration().getAuthHost()) - .port(this.getConfiguration().getPort()) - .path(SERVICE_REFRESH_TOKEN).build().toUri(); + .scheme(request.getURI().getScheme()) + .host(this.getConfiguration().getAuthHost()) + .port(this.getConfiguration().getPort()) + .path(SERVICE_REFRESH_TOKEN).build().toUri(); logger.info("Token URI: {}", tokenUri); // Prepare Headers @@ -114,12 +118,12 @@ private ResponseEntity requestWithRefreshToken(HttpRequest request, Stri private ResponseEntity requestWithCredentials(HttpRequest request) throws JsonProcessingException { final URI tokenUri = UriComponentsBuilder.newInstance() - .scheme(request.getURI().getScheme()) - .host(this.getConfiguration().getAuthHost()) - .port(this.getConfiguration().getPort()) - .path(SERVICE_CREDENTIALS) - .queryParam("access_token") - .build().toUri(); + .scheme(request.getURI().getScheme()) + .host(this.getConfiguration().getAuthHost()) + .port(this.getConfiguration().getPort()) + .path(SERVICE_CREDENTIALS) + .queryParam("access_token") + .build().toUri(); logger.info("Auth URL: {}", tokenUri); @@ -147,7 +151,8 @@ private ResponseEntity requestWithCredentials(HttpRequest request) throw } private boolean isRequestInBlackList(HttpRequest request) { - return request.getURI().getPath().contains(SERVICE_REFRESH_TOKEN) || request.getURI().getPath().contains(SERVICE_CREDENTIALS); + return request.getURI().getPath().contains(SERVICE_REFRESH_TOKEN) + || request.getURI().getPath().contains(SERVICE_CREDENTIALS); } private boolean hasValidToken() { @@ -161,7 +166,7 @@ private boolean isValidTokenType(String tokenType) { private void setTokenType(String newTokenType) { if (this.isValidTokenType(newTokenType)) { // Capitalized for case sensitive Auth schemes - this.tokenType = newTokenType.substring(0,1).toUpperCase() + newTokenType.substring(1).toLowerCase(); + this.tokenType = newTokenType.substring(0, 1).toUpperCase() + newTokenType.substring(1).toLowerCase(); } else if (this.tokenType == null) { this.tokenType = DEFAULT_TOKEN_TYPE; } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNgPrimitive.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNgPrimitive.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNgPrimitive.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNgPrimitive.java index 3ac07c321..4904c8bde 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVraNgPrimitive.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/rest/RestClientVraNgPrimitive.java @@ -15,7 +15,7 @@ /** * Package. */ -package com.vmware.pscoe.iac.artifact.rest; +package com.vmware.pscoe.iac.artifact.aria.automation.rest; import java.io.File; import java.io.IOException; @@ -38,37 +38,37 @@ import com.vmware.pscoe.iac.artifact.model.abx.AbxAction; import com.vmware.pscoe.iac.artifact.model.abx.AbxActionVersion; import com.vmware.pscoe.iac.artifact.model.abx.AbxConstant; - -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgApprovalPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlement; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlementDto; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlementType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItemType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCloudAccount; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDay2ActionsPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDeploymentLimitPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgIntegration; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgLeasePolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganizations; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgRegion; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceQuotaPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSecret; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSubscription; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgWorkflowContentSource; - -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.rest.RestClient; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgApprovalPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlement; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlementDto; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlementType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItemType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCloudAccount; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDay2ActionsPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDeploymentLimitPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgIntegration; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgLeasePolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganizations; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgRegion; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceQuotaPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSecret; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSubscription; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgWorkflowContentSource; + +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.apache.commons.lang3.StringUtils; import org.apache.hc.core5.net.URIBuilder; @@ -98,7 +98,7 @@ import com.google.gson.JsonSyntaxException; import com.jayway.jsonpath.JsonPath; import com.vmware.pscoe.iac.artifact.configuration.Configuration; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; public class RestClientVraNgPrimitive extends RestClient { /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/AbstractVraNgDeleteStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/AbstractVraNgDeleteStore.java similarity index 94% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/AbstractVraNgDeleteStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/AbstractVraNgDeleteStore.java index bf34f90e1..ed39ccbb6 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/AbstractVraNgDeleteStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/AbstractVraNgDeleteStore.java @@ -12,13 +12,13 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.vmware.pscoe.iac.artifact.model.vrang.Identifiable; +import com.vmware.pscoe.iac.artifact.aria.automation.models.Identifiable; /** * The purpose of this class is to provide a way to delete content from the diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/AbstractVraNgStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/AbstractVraNgStore.java similarity index 92% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/AbstractVraNgStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/AbstractVraNgStore.java index b053f5151..a05387a2c 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/AbstractVraNgStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/AbstractVraNgStore.java @@ -12,15 +12,15 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationException; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgIntegration; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; -import com.vmware.pscoe.iac.artifact.utils.VraNgIntegrationUtils; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgIntegration; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgIntegrationUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/IVraNgStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/IVraNgStore.java similarity index 93% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/IVraNgStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/IVraNgStore.java index e3f8c2772..a3480ba66 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/IVraNgStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/IVraNgStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgApprovalPolicyStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgApprovalPolicyStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgApprovalPolicyStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgApprovalPolicyStore.java index c708faf3b..ac4b1e58d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgApprovalPolicyStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgApprovalPolicyStore.java @@ -12,15 +12,15 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgApprovalPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgApprovalPolicy; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -84,11 +84,11 @@ protected void deleteResourceById(String resId) { @Override public void importContent(File sourceDirectory) { logger.info("Importing files from the '{}' directory", - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES); + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES); // verify directory exists File policyFolder = Paths .get(sourceDirectory.getPath(), - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES, + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES, APPROVAL) .toFile(); if (!policyFolder.exists()) { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgBlueprintStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgBlueprintStore.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgBlueprintStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgBlueprintStore.java index a99f4610c..ee44bf979 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgBlueprintStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgBlueprintStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,11 +21,11 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.VraNgReleaseManager; +import com.vmware.pscoe.iac.artifact.aria.automation.store.helpers.VraNgReleaseManager; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFolderFilter; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_BLUEPRINTS; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_BLUEPRINTS; import java.io.File; import java.io.FileReader; import java.io.FileNotFoundException; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCatalogItemStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCatalogItemStore.java index abb0a986c..e28e6c955 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCatalogItemStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,11 +20,11 @@ import com.google.gson.JsonParser; import com.google.gson.stream.JsonReader; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomFormAndData; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomFormAndData; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; @@ -74,7 +74,7 @@ public class VraNgCatalogItemStore extends AbstractVraNgStore { /** * Sub directory of. - * com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs#DIR_CATALOG_ITEMS where + * com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs#DIR_CATALOG_ITEMS where * custom forms are stored */ protected static final String CUSTOM_FORMS_SUBDIR = "forms"; @@ -86,7 +86,7 @@ public class VraNgCatalogItemStore extends AbstractVraNgStore { /** * Sub directory of. - * com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs#DIR_CATALOG_ITEMS where + * com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs#DIR_CATALOG_ITEMS where * icons are stored */ private static final String ICONS_SUBDIR = "icons"; @@ -346,13 +346,13 @@ protected VraNgCustomForm storeCustomFormOnFileSystem(final Package serverPackag * Attempts to store an icon to the file system under {{catalog_item_dir}}/icons * The correct file extension will be fetched from the content-type header. * - * @NOTE Due to issue when GET .../icon/api/icons/iconId for vRA 8.4 (IAC-482), - * we are not going to save svgs - * Also this will result in the iconId to be stored in the file, but the - * check in: - * com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem#hasIcon() is - * iconExtension dependent, - * so logic should hold fine. + * NOTE Due to issue when GET .../icon/api/icons/iconId for vRA 8.4 (IAC-482), + * we are not going to save svgs + * Also this will result in the iconId to be stored in the file, but the + * check in: + * com.vmware.pscoe.iac.artifact.aria.automation.model.VraNgCatalogItem#hasIcon() is + * iconExtension dependent, + * so logic should hold fine. * * @throws RuntimeException if the file cannot be created for some reason * diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStore812.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCatalogItemStore812.java similarity index 95% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStore812.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCatalogItemStore812.java index 7b9e04a5b..670738737 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStore812.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCatalogItemStore812.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,11 +21,11 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomFormAndData; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomFormAndData; import org.apache.commons.lang3.StringUtils; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSharingPolicyStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgContentSharingPolicyStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSharingPolicyStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgContentSharingPolicyStore.java index 097d23a1a..4fba8eb7d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSharingPolicyStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgContentSharingPolicyStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; import java.io.FileReader; @@ -34,12 +34,12 @@ import com.google.gson.JsonIOException; import com.google.gson.JsonSyntaxException; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgItem; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; public class VraNgContentSharingPolicyStore extends AbstractVraNgStore { /** @@ -89,10 +89,10 @@ protected void deleteResourceById(String resId) { @Override public void importContent(final File sourceDirectory) { logger.info("Importing files from the '{}' directory", - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES); + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES); // verify directory exists File contentSharingPolicyFolder = Paths - .get(sourceDirectory.getPath(), com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES, + .get(sourceDirectory.getPath(), com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES, CONTENT_SHARING_POLICY) .toFile(); if (!contentSharingPolicyFolder.exists()) { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSourceStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgContentSourceStore.java similarity index 93% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSourceStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgContentSourceStore.java index 6764f4c50..31d58aa87 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSourceStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgContentSourceStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; import java.io.FileReader; @@ -25,18 +25,18 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgIntegration; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgWorkflow; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgWorkflowContentSource; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgIntegration; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgWorkflow; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgWorkflowContentSource; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgIntegrationUtils; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgIntegrationUtils; import org.apache.commons.lang3.StringUtils; /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomResourceStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCustomResourceStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomResourceStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCustomResourceStore.java index 72b01d149..17be5c335 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomResourceStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgCustomResourceStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,14 +21,14 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationException; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; -import com.vmware.pscoe.iac.artifact.utils.VraNgProjectUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgProjectUtil; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; @@ -48,7 +48,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_CUSTOM_RESOURCES; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_CUSTOM_RESOURCES; public class VraNgCustomResourceStore extends AbstractVraNgStore { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDay2ActionsPolicyStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDay2ActionsPolicyStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDay2ActionsPolicyStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDay2ActionsPolicyStore.java index 20e7ec30e..cb27c3cf1 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDay2ActionsPolicyStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDay2ActionsPolicyStore.java @@ -12,15 +12,15 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDay2ActionsPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDay2ActionsPolicy; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,11 +78,11 @@ protected void deleteResourceById(String resId) { @Override public void importContent(File sourceDirectory) { logger.info("Importing files from the '{}' directory", - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES); + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES); // verify directory exists File policyFolder = Paths .get(sourceDirectory.getPath(), - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES, + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES, DAY2_ACTIONS_POLICY) .toFile(); if (!policyFolder.exists()) { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDeploymentLimitPolicyStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDeploymentLimitPolicyStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDeploymentLimitPolicyStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDeploymentLimitPolicyStore.java index f567da2b3..82048af5d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDeploymentLimitPolicyStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDeploymentLimitPolicyStore.java @@ -12,15 +12,15 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDeploymentLimitPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDeploymentLimitPolicy; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,11 +79,11 @@ protected void deleteResourceById(String resId) { @Override public void importContent(File sourceDirectory) { logger.info("Importing files from the '{}' directory", - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES); + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES); // verify directory exists File policyFolder = Paths .get(sourceDirectory.getPath(), - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES, + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES, DEPLOYMENT_LIMIT) .toFile(); if (!policyFolder.exists()) { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDirs.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDirs.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDirs.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDirs.java index 6e5b23f23..191211217 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDirs.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgDirs.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; public final class VraNgDirs { /** diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgEntitlementStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgEntitlementStore.java similarity index 93% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgEntitlementStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgEntitlementStore.java index 685207609..cf358d420 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgEntitlementStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgEntitlementStore.java @@ -12,11 +12,11 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlementType.CATALOG_ITEM_IDENTIFIER; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlementType.CATALOG_SOURCE_IDENTIFIER; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_ENTITLEMENTS; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlementType.CATALOG_ITEM_IDENTIFIER; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlementType.CATALOG_SOURCE_IDENTIFIER; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_ENTITLEMENTS; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -30,16 +30,16 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlement; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlementType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlement; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlementType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; import org.apache.commons.lang3.StringUtils; import org.yaml.snakeyaml.DumperOptions; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgLeasePolicyStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgLeasePolicyStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgLeasePolicyStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgLeasePolicyStore.java index 0022444b0..bdfacd1d9 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgLeasePolicyStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgLeasePolicyStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; import java.io.FileReader; @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,7 +33,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgLeasePolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgLeasePolicy; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; public final class VraNgLeasePolicyStore extends AbstractVraNgStore { @@ -66,11 +66,11 @@ protected void deleteResourceById(String resId) { @Override public void importContent(final File sourceDirectory) { logger.info("Importing files from the '{}' directory", - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES); + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES); // verify directory exists File leasePolicyFolder = Paths .get(sourceDirectory.getPath(), - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES, + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES, LEASE_POLICY) .toFile(); if (!leasePolicyFolder.exists()) { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgPropertyGroupStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgPropertyGroupStore.java similarity index 95% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgPropertyGroupStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgPropertyGroupStore.java index 867603300..e9d33e71d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgPropertyGroupStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgPropertyGroupStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; import java.io.FileReader; @@ -27,16 +27,16 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_PROPERTY_GROUPS; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_PROPERTY_GROUPS; /** * Store responsible for exporting and importing Property groups from vRA 8.3+. diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceActionStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgResourceActionStore.java similarity index 97% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceActionStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgResourceActionStore.java index a2d529d42..b78619887 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceActionStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgResourceActionStore.java @@ -15,16 +15,16 @@ /** * Package */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationException; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgProjectUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgProjectUtil; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; @@ -38,7 +38,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_RESOURCE_ACTIONS; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_RESOURCE_ACTIONS; public class VraNgResourceActionStore extends AbstractVraNgStore { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceQuotaPolicyStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgResourceQuotaPolicyStore.java similarity index 96% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceQuotaPolicyStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgResourceQuotaPolicyStore.java index 7f826620f..7dfcbe031 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceQuotaPolicyStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgResourceQuotaPolicyStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; import java.io.FileReader; @@ -29,10 +29,10 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceQuotaPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceQuotaPolicy; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,11 +79,11 @@ protected void deleteResourceById(String resId) { @Override public void importContent(File sourceDirectory) { logger.info("Importing files from the '{}' directory", - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES); + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES); // verify directory exists File policyFolder = Paths .get(sourceDirectory.getPath(), - com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_POLICIES, + com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_POLICIES, RESOURCE_QUOTA_POLICY) .toFile(); if (!policyFolder.exists()) { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgSubscriptionStore.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgSubscriptionStore.java similarity index 95% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgSubscriptionStore.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgSubscriptionStore.java index bb6bdbad0..ebaafc60c 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgSubscriptionStore.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgSubscriptionStore.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,15 +20,15 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.abx.AbxAction; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSubscription; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSubscription; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.vmware.pscoe.iac.artifact.store.filters.CustomFolderFileFilter; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; import org.apache.commons.io.FileUtils; @@ -43,7 +43,7 @@ import java.util.Objects; import java.util.stream.Collectors; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_SUBSCRIPTIONS; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_SUBSCRIPTIONS; public class VraNgSubscriptionStore extends AbstractVraNgStore { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgTypeStoreFactory.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgTypeStoreFactory.java similarity index 74% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgTypeStoreFactory.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgTypeStoreFactory.java index 66e8b43eb..dd22be904 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgTypeStoreFactory.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VraNgTypeStoreFactory.java @@ -16,28 +16,28 @@ * LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.APPROVAL_POLICY; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.BLUEPRINT; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.CATALOG_ENTITLEMENT; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.CATALOG_ITEM; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.CONTENT_SHARING_POLICY; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.CONTENT_SOURCE; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.CUSTOM_RESOURCE; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.DAY2_ACTIONS_POLICY; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.DEPLOYMENT_LIMIT_POLICY; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.LEASE_POLICY; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.PROPERTY_GROUP; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.RESOURCE_ACTION; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.RESOURCE_QUOTA_POLICY; -import static com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageContent.ContentType.SUBSCRIPTION; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.APPROVAL_POLICY; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.BLUEPRINT; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.CATALOG_ENTITLEMENT; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.CATALOG_ITEM; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.CONTENT_SHARING_POLICY; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.CONTENT_SOURCE; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.CUSTOM_RESOURCE; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.DAY2_ACTIONS_POLICY; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.DEPLOYMENT_LIMIT_POLICY; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.LEASE_POLICY; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.PROPERTY_GROUP; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.RESOURCE_ACTION; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.RESOURCE_QUOTA_POLICY; +import static com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageContent.ContentType.SUBSCRIPTION; /** * Factory to select and setup the store (handler) and determine the order of diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VrangContentSourceUtils.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VrangContentSourceUtils.java similarity index 92% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VrangContentSourceUtils.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VrangContentSourceUtils.java index 8ab29bfd8..09992f5a6 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/VrangContentSourceUtils.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/VrangContentSourceUtils.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import java.io.File; import java.io.IOException; @@ -22,10 +22,10 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.vmware.pscoe.iac.artifact.model.Package; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/VraNgReleaseManager.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/helpers/VraNgReleaseManager.java similarity index 78% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/VraNgReleaseManager.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/helpers/VraNgReleaseManager.java index ac4cf8fc6..2e9f517be 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/VraNgReleaseManager.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/helpers/VraNgReleaseManager.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact; +package com.vmware.pscoe.iac.artifact.aria.automation.store.helpers; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -27,11 +27,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; - +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; public class VraNgReleaseManager { + private static final int THIRD_SEGMENT = 3; + private static final int SECOND_SEGMENT = 2; + private static final int FIRST_SEGMENT = 1; RestClientVraNg restClient; @@ -41,16 +43,17 @@ public VraNgReleaseManager(RestClientVraNg restClient) { this.restClient = restClient; } - public void releaseContent(String contentType, List contentNames, String version, boolean releaseIfNotUpdated) { + public void releaseContent(String contentType, List contentNames, String version, + boolean releaseIfNotUpdated) { if (contentType.equals("blueprint") || contentType.equals("all")) { List blueprints = this.restClient.getAllBlueprints(); if (contentNames.size() > 0) { blueprints = blueprints.stream() - .filter(bp -> contentNames.contains(bp.getName())) - .collect(Collectors.toList()); + .filter(bp -> contentNames.contains(bp.getName())) + .collect(Collectors.toList()); } - + List invalidBlueprints = new ArrayList<>(); blueprints.forEach(bp -> { if (this.restClient.isBlueprintVersionPresent(bp.getId(), version)) { @@ -59,11 +62,12 @@ public void releaseContent(String contentType, List contentNames, String }); if (invalidBlueprints.size() > 0) { - throw new RuntimeException("Blueprints [" + String.join(", ", invalidBlueprints) + "] already have a released version " + version); + throw new RuntimeException("Blueprints [" + String.join(", ", invalidBlueprints) + + "] already have a released version " + version); } blueprints.forEach(bp -> { - if (releaseIfNotUpdated == true) { + if (releaseIfNotUpdated) { this.restClient.releaseBlueprintVersion(bp.getId(), version); logger.info("Released blueprint " + bp.getName() + " version " + version); } else { @@ -76,6 +80,7 @@ public void releaseContent(String contentType, List contentNames, String /** * Attempt to generate a next version and release it. + * * @param blueprint blueprint */ public void releaseNextVersion(VraNgBlueprint blueprint) { @@ -86,17 +91,20 @@ public void releaseNextVersion(VraNgBlueprint blueprint) { try { this.releaseVersion(blueprint, nextVersion); } catch (Exception e) { - // Attempt to fix versions imported in reverse order, which produces an Error on imports + // Attempt to fix versions imported in reverse order, which produces an Error on + // imports logger.warn("Couldn't release version '{}'. Attempting to release date version", nextVersion); this.releaseVersion(blueprint, this.getDateVersion()); } } /** - * Release a new version of the blueprint provided that there is no previous version or there are + * Release a new version of the blueprint provided that there is no previous + * version or there are * changes in the content since the latest released version. + * * @param blueprint blueprint - * @param version new version + * @param version new version */ public void releaseVersion(VraNgBlueprint blueprint, String version) { String latestVersion = this.restClient.getBlueprintLastUpdatedVersion(blueprint.getId()); @@ -109,8 +117,10 @@ public void releaseVersion(VraNgBlueprint blueprint, String version) { } /** - * Perform a check whether the blueprint content has been updated since the latest released version. - * @param blueprint blueprint + * Perform a check whether the blueprint content has been updated since the + * latest released version. + * + * @param blueprint blueprint * @param latestVersion latest version * @return true if there are changes */ @@ -130,8 +140,10 @@ private boolean isUpdated(VraNgBlueprint blueprint, String latestVersion) { * * MAJOR * * MAJOR.MINOR * * MAJOR.MINOR.PATCH - * A datetime-based version will be returned if the previous version format does not match + * A datetime-based version will be returned if the previous version format does + * not match * any of the supported formats. + * * @param version previous version * @return next version */ @@ -147,17 +159,21 @@ private String getNextVersion(String version) { Matcher majorMinorPatch = Pattern.compile("([0-9]+)\\.([0-9]+)\\.([0-9]+)").matcher(version); if (majorMinorPatch.matches()) { - logger.debug("Detected version pattern MAJOR.MINOR.PATCH from {} with incrementable segment '{}'", version, majorMinorPatch.group(3)); + logger.debug("Detected version pattern MAJOR.MINOR.PATCH from {} with incrementable segment '{}'", version, + majorMinorPatch.group(THIRD_SEGMENT)); // increment the patch segment - return majorMinorPatch.group(1) + "." + majorMinorPatch.group(2) + "." + (Integer.parseInt(majorMinorPatch.group(3)) + 1); + return majorMinorPatch.group(FIRST_SEGMENT) + "." + majorMinorPatch.group(SECOND_SEGMENT) + "." + + (Integer.parseInt(majorMinorPatch.group(THIRD_SEGMENT)) + 1); } else if (majorMinor.matches()) { - logger.debug("Detected version pattern MAJOR.MINOR from '{}' with incrementable segment '{}'", version, majorMinor.group(2)); + logger.debug("Detected version pattern MAJOR.MINOR from '{}' with incrementable segment '{}'", version, + majorMinor.group(SECOND_SEGMENT)); // increment the minor segment - return majorMinor.group(1) + "." + (Integer.parseInt(majorMinor.group(2)) + 1); + return majorMinor.group(FIRST_SEGMENT) + "." + (Integer.parseInt(majorMinor.group(SECOND_SEGMENT)) + 1); } else if (major.matches()) { - logger.debug("Detected version pattern MAJOR from '{}' with incrementable segment '{}'", version, major.group(1)); + logger.debug("Detected version pattern MAJOR from '{}' with incrementable segment '{}'", version, + major.group(FIRST_SEGMENT)); // increment the major segment - return Integer.toString(Integer.parseInt(major.group(1)) + 1); + return Integer.toString(Integer.parseInt(major.group(FIRST_SEGMENT)) + 1); } else { logger.debug("Could not determine version pattern from {}", version); return getDateVersion(); @@ -167,6 +183,7 @@ private String getNextVersion(String version) { /** * Create a version based on the current date and time. + * * @return datetime-based version */ private String getDateVersion() { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/package-info.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/package-info.java similarity index 90% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/package-info.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/package-info.java index 26d6ca185..8f6b71a48 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/store/vrang/package-info.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/store/package-info.java @@ -17,4 +17,4 @@ * Package that represents vRA 8 Vrang Store. * */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgIntegrationUtils.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgIntegrationUtils.java similarity index 63% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgIntegrationUtils.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgIntegrationUtils.java index 11f91ee61..5fcb7bde3 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgIntegrationUtils.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgIntegrationUtils.java @@ -12,34 +12,39 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.utils; +package com.vmware.pscoe.iac.artifact.aria.automation.utils; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgIntegration; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgIntegration; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import java.util.List; import java.util.Optional; -public class VraNgIntegrationUtils { +/** + * VraNgIntegrationUtils is used to get the default VraNgIntegration. + */ +public final class VraNgIntegrationUtils { public static final String DEFAULT_INTEGRATION_NAME = "embedded-VRO"; - private static final VraNgIntegrationUtils instance = new VraNgIntegrationUtils(); + private static final VraNgIntegrationUtils INSTANCE = new VraNgIntegrationUtils(); private Optional retVal = Optional.empty(); - private VraNgIntegrationUtils() {} + private VraNgIntegrationUtils() { + } public static VraNgIntegrationUtils getInstance() { - return instance; + return INSTANCE; } public VraNgIntegration getDefaultVraIntegration(RestClientVraNg restClient) { - if(this.retVal.isPresent()) { + if (this.retVal.isPresent()) { return this.retVal.get(); } List integrations = restClient.getVraWorkflowIntegrations(); - this.retVal = integrations.stream().filter(integration -> DEFAULT_INTEGRATION_NAME.equalsIgnoreCase(integration.getName())) + this.retVal = integrations.stream() + .filter(integration -> DEFAULT_INTEGRATION_NAME.equalsIgnoreCase(integration.getName())) .findFirst(); return this.retVal.orElse(new VraNgIntegration()); diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgOrganizationUtil.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgOrganizationUtil.java similarity index 78% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgOrganizationUtil.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgOrganizationUtil.java index a623276c5..214b36e53 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgOrganizationUtil.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgOrganizationUtil.java @@ -12,11 +12,11 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.utils; +package com.vmware.pscoe.iac.artifact.aria.automation.utils; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNgPrimitive; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNgPrimitive; import org.apache.commons.lang3.StringUtils; public final class VraNgOrganizationUtil { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgProjectUtil.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgProjectUtil.java similarity index 91% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgProjectUtil.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgProjectUtil.java index dda4bffce..c9e16b1f3 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/VraNgProjectUtil.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/VraNgProjectUtil.java @@ -12,9 +12,9 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.utils; +package com.vmware.pscoe.iac.artifact.aria.automation.utils; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/package-info.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/package-info.java similarity index 90% rename from common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/package-info.java rename to common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/package-info.java index 7eefaa9e4..4cdeecd8e 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/utils/package-info.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/aria/automation/utils/package-info.java @@ -17,4 +17,4 @@ * Package that represents IAC Artifact. * */ -package com.vmware.pscoe.iac.artifact.utils; +package com.vmware.pscoe.iac.artifact.aria.automation.utils; diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationAbx.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationAbx.java index dfa69a0d6..6264f0cb4 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationAbx.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationAbx.java @@ -14,6 +14,7 @@ */ package com.vmware.pscoe.iac.artifact.configuration; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.PackageType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,8 +22,7 @@ import java.util.Properties; public class ConfigurationAbx extends ConfigurationVraNg { - - private final static Logger logger = LoggerFactory.getLogger(ConfigurationAbx.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationAbx.class); protected ConfigurationAbx(Properties props) { super(PackageType.ABX, props); diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationCs.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationCs.java index 598e68030..3601a37ca 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationCs.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationCs.java @@ -16,10 +16,10 @@ import java.util.Properties; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.PackageType; -public class ConfigurationCs extends ConfigurationVraNg { - +public final class ConfigurationCs extends ConfigurationVraNg { private ConfigurationCs(Properties props) { super(PackageType.CS, props); } diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVroNg.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVroNg.java index 841cf9de1..e993d2a4e 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVroNg.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/configuration/ConfigurationVroNg.java @@ -16,6 +16,8 @@ import org.springframework.util.StringUtils; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; + import java.util.Properties; public final class ConfigurationVroNg extends ConfigurationVraNg implements ConfigurationNg { diff --git a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientFactory.java b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientFactory.java index 4f0801ec2..48bd4068d 100644 --- a/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientFactory.java +++ b/common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientFactory.java @@ -23,6 +23,8 @@ import javax.net.ssl.SSLContext; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNgAuthNInterceptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import com.vmware.pscoe.iac.artifact.rest.client.vrli.RestClientVrliAuthInterceptor; import com.vmware.pscoe.iac.artifact.rest.client.vrli.RestClientVrliV1; import com.vmware.pscoe.iac.artifact.rest.client.vrli.RestClientVrliV2; @@ -50,7 +52,7 @@ import com.vmware.pscoe.iac.artifact.configuration.Configuration; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVcd; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVrli; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVro; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVroNg; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/rest/vrang/RestClientVraNgPrimitiveTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/rest/RestClientVraNgPrimitiveTest.java similarity index 96% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/rest/vrang/RestClientVraNgPrimitiveTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/rest/RestClientVraNgPrimitiveTest.java index d6c59b754..2787c06a8 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/rest/vrang/RestClientVraNgPrimitiveTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/rest/RestClientVraNgPrimitiveTest.java @@ -12,9 +12,9 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.rest.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.rest; -import static com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil.getOrganization; +import static com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil.getOrganization; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -52,7 +52,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.stubs.AbxActionMockBuilder; import com.vmware.pscoe.iac.artifact.helpers.stubs.ContentSharingPolicyMockBuilder; import com.vmware.pscoe.iac.artifact.helpers.stubs.CustomResourceMockBuilder; @@ -60,15 +60,15 @@ import com.vmware.pscoe.iac.artifact.helpers.vrang.RestClientVraNgPrimitiveTestDouble; import com.vmware.pscoe.iac.artifact.helpers.vrang.RestClientVraNgPrimitiveTestResponseProvider; import com.vmware.pscoe.iac.artifact.model.abx.AbxAction; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCloudAccount; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; -import com.vmware.pscoe.iac.artifact.utils.VraNgOrganizationUtil; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCloudAccount; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.utils.VraNgOrganizationUtil; @SuppressWarnings("unchecked") class RestClientVraNgPrimitiveTest { diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgApprovalPolicyStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgApprovalPolicyStoreTest.java similarity index 96% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgApprovalPolicyStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgApprovalPolicyStoreTest.java index df99afa91..7e3c5c430 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgApprovalPolicyStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgApprovalPolicyStoreTest.java @@ -12,22 +12,22 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgApprovalPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPolicy; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgApprovalPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgBlueprintStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgBlueprintStoreTest.java similarity index 96% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgBlueprintStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgBlueprintStoreTest.java index 41eb580a9..7b4e36396 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgBlueprintStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgBlueprintStoreTest.java @@ -12,18 +12,18 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.BlueprintMockBuilder; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.internal.runners.statements.ExpectException; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCatalogItemStoreTest.java similarity index 99% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCatalogItemStoreTest.java index 58542e260..c2c87646b 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCatalogItemStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCatalogItemStoreTest.java @@ -12,11 +12,11 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.JsonArray; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.GeneralMocks; @@ -26,8 +26,8 @@ import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSharingPolicyStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgContentSharingPolicyStoreTest.java similarity index 98% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSharingPolicyStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgContentSharingPolicyStoreTest.java index 253b86c86..9eaf11652 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSharingPolicyStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgContentSharingPolicyStoreTest.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; @@ -32,7 +32,7 @@ import java.util.List; import java.util.Objects; -import com.vmware.pscoe.iac.artifact.model.vrang.*; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -40,13 +40,13 @@ import org.junit.rules.TemporaryFolder; import org.mockito.Mockito; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; public class VraNgContentSharingPolicyStoreTest { /** diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSourceStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgContentSourceStoreTest.java similarity index 95% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSourceStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgContentSourceStoreTest.java index 26cea44ed..bbff3702d 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgContentSourceStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgContentSourceStoreTest.java @@ -12,18 +12,18 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.ContentSourceBaseMockBuilder; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; import com.vmware.pscoe.iac.artifact.rest.RestClient; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomFormTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCustomFormTest.java similarity index 96% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomFormTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCustomFormTest.java index 9b64d5a0c..aee471d77 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomFormTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCustomFormTest.java @@ -16,7 +16,7 @@ * LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; @@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test; import com.google.gson.JsonElement; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomFormAndData; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomFormAndData; import java.io.IOException; public class VraNgCustomFormTest { diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomResourceStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCustomResourceStoreTest.java similarity index 97% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomResourceStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCustomResourceStoreTest.java index f40487245..dfccddebc 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgCustomResourceStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgCustomResourceStoreTest.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; @@ -21,7 +21,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; import com.google.gson.*; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -33,17 +33,17 @@ import java.io.IOException; import java.util.*; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.CustomResourceMockBuilder; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgIntegration; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgIntegration; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.apache.commons.io.FileUtils; import org.junit.Rule; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDay2ActionsPolicyStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgDay2ActionsPolicyStoreTest.java similarity index 98% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDay2ActionsPolicyStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgDay2ActionsPolicyStoreTest.java index 52d0a0883..7cc66d2b2 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDay2ActionsPolicyStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgDay2ActionsPolicyStoreTest.java @@ -12,17 +12,17 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.JsonObject; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDeploymentLimitPolicyStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgDeploymentLimitPolicyStoreTest.java similarity index 98% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDeploymentLimitPolicyStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgDeploymentLimitPolicyStoreTest.java index f5f26e593..945a40f9c 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgDeploymentLimitPolicyStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgDeploymentLimitPolicyStoreTest.java @@ -12,17 +12,17 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.JsonObject; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgEntitlementStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgEntitlementStoreTest.java similarity index 95% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgEntitlementStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgEntitlementStoreTest.java index f2f01cdb8..ecd2c9596 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgEntitlementStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgEntitlementStoreTest.java @@ -12,18 +12,18 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.CatalogEntitlementMockBuilder; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; import com.vmware.pscoe.iac.artifact.rest.RestClient; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgLeasePolicyStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgLeasePolicyStoreTest.java similarity index 98% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgLeasePolicyStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgLeasePolicyStoreTest.java index abbcfbd18..78c2cf3a5 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgLeasePolicyStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgLeasePolicyStoreTest.java @@ -12,17 +12,17 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.JsonObject; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgPropertyGroupStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgPropertyGroupStoreTest.java similarity index 95% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgPropertyGroupStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgPropertyGroupStoreTest.java index 28a679660..96a11db8c 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgPropertyGroupStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgPropertyGroupStoreTest.java @@ -12,19 +12,19 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.PropertyGroupMockBuilder; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgReleaseManagerTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgReleaseManagerTest.java similarity index 86% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgReleaseManagerTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgReleaseManagerTest.java index 0002b17d2..ebd5212cb 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgReleaseManagerTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgReleaseManagerTest.java @@ -12,11 +12,11 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.VraNgReleaseManager; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.store.helpers.VraNgReleaseManager; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceActionStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgResourceActionStoreTest.java similarity index 95% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceActionStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgResourceActionStoreTest.java index 151e886de..df8258eda 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceActionStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgResourceActionStoreTest.java @@ -12,18 +12,18 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.ResourceActionMockBuilder; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceQuotaPolicyStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgResourceQuotaPolicyStoreTest.java similarity index 98% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceQuotaPolicyStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgResourceQuotaPolicyStoreTest.java index 94a411c34..433d4bff4 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgResourceQuotaPolicyStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgResourceQuotaPolicyStoreTest.java @@ -12,17 +12,17 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import com.google.gson.JsonObject; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.model.Package; import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; -import com.vmware.pscoe.iac.artifact.model.vrang.*; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.*; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.Rule; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgSubscriptionStoreTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgSubscriptionStoreTest.java similarity index 96% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgSubscriptionStoreTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgSubscriptionStoreTest.java index 106a88929..16fbaa9ad 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/VraNgSubscriptionStoreTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/store/VraNgSubscriptionStoreTest.java @@ -12,7 +12,7 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.store.vrang; +package com.vmware.pscoe.iac.artifact.aria.automation.store; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -44,7 +44,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonReader; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.helpers.AssertionsHelper; import com.vmware.pscoe.iac.artifact.helpers.FsMocks; import com.vmware.pscoe.iac.artifact.helpers.stubs.SubscriptionMockBuilder; @@ -52,11 +52,11 @@ import com.vmware.pscoe.iac.artifact.model.PackageFactory; import com.vmware.pscoe.iac.artifact.model.PackageType; import com.vmware.pscoe.iac.artifact.model.abx.AbxAction; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgOrganization; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSubscription; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgOrganization; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPackageDescriptor; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSubscription; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; public class VraNgSubscriptionStoreTest { @Rule diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/utils/VraNgProjectUtilTest.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/utils/VraNgProjectUtilTest.java similarity index 95% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/utils/VraNgProjectUtilTest.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/utils/VraNgProjectUtilTest.java index 764a4766c..eca684265 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/utils/VraNgProjectUtilTest.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/utils/VraNgProjectUtilTest.java @@ -12,14 +12,14 @@ * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. * #L% */ -package com.vmware.pscoe.iac.artifact.utils; +package com.vmware.pscoe.iac.artifact.aria.automation.utils; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.vmware.pscoe.iac.artifact.helpers.stubs.ResourceActionMockBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/utils/package-info.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/utils/package-info.java similarity index 90% rename from common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/utils/package-info.java rename to common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/utils/package-info.java index b14a181ef..7f9c12fa9 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/utils/package-info.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/aria/utils/package-info.java @@ -17,4 +17,4 @@ * Package that represents ProjectUtil Tests. * */ -package com.vmware.pscoe.iac.artifact.utils; +package com.vmware.pscoe.iac.artifact.aria.automation.utils; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ApprovalPolicyFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ApprovalPolicyFsMocks.java index 72b105380..7eb3e4108 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ApprovalPolicyFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ApprovalPolicyFsMocks.java @@ -16,7 +16,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgApprovalPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgApprovalPolicy; import java.io.File; import java.nio.file.Path; @@ -34,6 +34,7 @@ public class ApprovalPolicyFsMocks extends VraNgFsMock { /** * Constructor. + * * @param tempDir temporary folder for test data. */ @@ -43,6 +44,7 @@ public ApprovalPolicyFsMocks(File tempDir) { /** * Getter. + * * @return the full path where test policy json files are stored during tests. */ @Override @@ -52,17 +54,16 @@ public File getWorkdir() { /** * JSON encodes a policy and adds it to the resource actions directory. - * @param policy - The policy to store + * + * @param policy - The policy to store */ public void addPolicy(VraNgApprovalPolicy policy) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - policy.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + policy.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); writeFileToPath(itemName, gson.toJson(policy).getBytes()); } } - diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/BlueprintFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/BlueprintFsMocks.java index 77306bdc4..3b4d68f21 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/BlueprintFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/BlueprintFsMocks.java @@ -18,7 +18,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; import java.io.File; import java.nio.file.Paths; @@ -40,8 +40,7 @@ public BlueprintFsMocks(File tempDir) { super(tempDir); } - - /** + /** * @return File */ @Override @@ -49,13 +48,13 @@ public File getWorkdir() { return Paths.get(this.tempDir.getPath(), WORKDIR).toFile(); } - /** * JSON encodes a blueprint and adds it to the blueprints directory. - * This will also create the content.yaml based on the blueprint and alternatively accepts a versions' data containing + * This will also create the content.yaml based on the blueprint and + * alternatively accepts a versions' data containing * information about the versions. * - * @param blueprint - The blueprint to store + * @param blueprint - The blueprint to store */ public void addBlueprint(final VraNgBlueprint blueprint) { addBlueprint(blueprint, blueprint.getName()); @@ -63,9 +62,11 @@ public void addBlueprint(final VraNgBlueprint blueprint) { /** * JSON encodes a blueprint and adds it to the blueprint directory. - * This will also create the content.yaml based on the blueprint and alternatively accepts a versions' data containing + * This will also create the content.yaml based on the blueprint and + * alternatively accepts a versions' data containing * information about the versions. - * @param blueprint - Blueprint to store + * + * @param blueprint - Blueprint to store * @param folderName - Blueprint folder name */ public void addBlueprint(final VraNgBlueprint blueprint, String folderName) { @@ -78,14 +79,12 @@ public void addBlueprint(final VraNgBlueprint blueprint, String folderName) { } File blueprintContent = Paths.get( - blueprintFolder.getAbsolutePath(), - "content.yaml" - ).toFile(); + blueprintFolder.getAbsolutePath(), + "content.yaml").toFile(); File blueprintDetails = Paths.get( - blueprintFolder.getAbsolutePath(), - "details.json" - ).toFile(); + blueprintFolder.getAbsolutePath(), + "details.json").toFile(); JsonObject bpDetails = new JsonObject(); bpDetails.add("id", new JsonPrimitive(blueprint.getId())); @@ -95,13 +94,11 @@ public void addBlueprint(final VraNgBlueprint blueprint, String folderName) { Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); writeFileToPath( - Paths.get(blueprintContent.getPath()), - blueprint.getContent().getBytes() - ); + Paths.get(blueprintContent.getPath()), + blueprint.getContent().getBytes()); writeFileToPath( - Paths.get(blueprintDetails.getPath()), - gson.toJson(gson.fromJson(bpDetails.toString(), JsonObject.class)).getBytes() - ); + Paths.get(blueprintDetails.getPath()), + gson.toJson(gson.fromJson(bpDetails.toString(), JsonObject.class)).getBytes()); } } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CatalogItemFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CatalogItemFsMocks.java index 0b81ffb0b..12c8c98ed 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CatalogItemFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CatalogItemFsMocks.java @@ -16,144 +16,141 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_CATALOG_ITEMS; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_CATALOG_ITEMS; public class CatalogItemFsMocks extends VraNgFsMock { - private final static String WORKDIR = "catalog-items"; + private static final String WORKDIR = "catalog-items"; + public CatalogItemFsMocks(File tempDir) { - super( tempDir ); + super(tempDir); } @Override public File getWorkdir() { - return Paths.get( this.tempDir.getPath(), WORKDIR ).toFile(); + return Paths.get(this.tempDir.getPath(), WORKDIR).toFile(); } @Override protected void ensureWorkdirExists() { super.ensureWorkdirExists(); - File iconsDir = getIconDir(); + File iconsDir = getIconDir(); - if ( iconsDir.exists() ) { - return ; + if (iconsDir.exists()) { + return; } - if ( ! iconsDir.mkdirs() ) { - throw new RuntimeException( "Error while creating " + iconsDir.getAbsolutePath() + " dir" ); + if (!iconsDir.mkdirs()) { + throw new RuntimeException("Error while creating " + iconsDir.getAbsolutePath() + " dir"); } - File formsDir = getFormDir(); - if ( formsDir.exists() ) { + File formsDir = getFormDir(); + if (formsDir.exists()) { return; } - if ( ! formsDir.mkdirs() ) { - throw new RuntimeException( "Error while creating " + formsDir.getAbsolutePath() + " dir" ); + if (!formsDir.mkdirs()) { + throw new RuntimeException("Error while creating " + formsDir.getAbsolutePath() + " dir"); } } /** - * @return File + * @return File */ public File getCatalogItemsDir() { - return Paths.get( tempDir.getPath(), DIR_CATALOG_ITEMS ).toFile(); + return Paths.get(tempDir.getPath(), DIR_CATALOG_ITEMS).toFile(); } /** * JSON encodes a catalog item and adds it to the DIR_CATALOG_ITEMS. * Adds the catalog items dir if it does not exist * - * @param catalogItem - The catalog item to add + * @param catalogItem - The catalog item to add */ - public void addCatalogItem( VraNgCatalogItem catalogItem ) { - File customCatalogItemFile = Paths.get( - getCatalogItemsDir().getAbsolutePath(), - getCatalogItemResourceName( catalogItem ) + ".json" - ).toFile(); - - Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); - Path itemName = Paths.get( customCatalogItemFile.getPath() ); - writeFileToPath( itemName, gson.toJson( catalogItem ).getBytes() ); + public void addCatalogItem(VraNgCatalogItem catalogItem) { + File customCatalogItemFile = Paths.get( + getCatalogItemsDir().getAbsolutePath(), + getCatalogItemResourceName(catalogItem) + ".json").toFile(); + + Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); + Path itemName = Paths.get(customCatalogItemFile.getPath()); + writeFileToPath(itemName, gson.toJson(catalogItem).getBytes()); } /** - * @return File + * @return File */ private File getIconDir() { - return Paths.get( getCatalogItemsDir().getAbsolutePath(), "icons" ).toFile(); + return Paths.get(getCatalogItemsDir().getAbsolutePath(), "icons").toFile(); } /** * Adds an icon with a body with the given information in the catalog item * - * @param catalogItem -> must contain an icon id and icon extension + * @param catalogItem -> must contain an icon id and icon extension */ - public void addCatalogItemIcon( VraNgCatalogItem catalogItem ) { - if ( ! catalogItem.hasIcon() ) { + public void addCatalogItemIcon(VraNgCatalogItem catalogItem) { + if (!catalogItem.hasIcon()) { throw new RuntimeException( - String.format( "Trying to store an icon for catalog item %s but no icon found", catalogItem.getName() ) - ); + String.format("Trying to store an icon for catalog item %s but no icon found", + catalogItem.getName())); } - File customIconFile = Paths.get( - getIconDir().getAbsolutePath(), - getCatalogItemResourceName( catalogItem ) + "." + catalogItem.getIconExtension() - ).toFile(); + File customIconFile = Paths.get( + getIconDir().getAbsolutePath(), + getCatalogItemResourceName(catalogItem) + "." + catalogItem.getIconExtension()).toFile(); - Path itemName = Paths.get( customIconFile.getPath() ); - writeFileToPath( itemName, "iconBody".getBytes() ); + Path itemName = Paths.get(customIconFile.getPath()); + writeFileToPath(itemName, "iconBody".getBytes()); } /** - * @return File + * @return File */ private File getFormDir() { - return Paths.get( getCatalogItemsDir().getAbsolutePath(), "forms" ).toFile(); + return Paths.get(getCatalogItemsDir().getAbsolutePath(), "forms").toFile(); } /** * Adds a form with a body with the given information in the catalog item * - * @param catalogItem -> must contain a formId + * @param catalogItem -> must contain a formId */ - public void addCatalogItemForm( VraNgCatalogItem catalogItem ) { - if ( ! catalogItem.hasForm() ) { + public void addCatalogItemForm(VraNgCatalogItem catalogItem) { + if (!catalogItem.hasForm()) { throw new RuntimeException( - String.format( "Trying to store a a form for catalog item %s but no form found", catalogItem.getName() ) - ); + String.format("Trying to store a a form for catalog item %s but no form found", + catalogItem.getName())); } - File customFormItem = Paths.get( - getFormDir().getAbsolutePath(), - getCatalogItemResourceName( catalogItem ) + ".json" - ).toFile(); - - Path itemName = Paths.get( customFormItem.getPath() ); - writeFileToPath( itemName, - ( - "{\"id\": \"342f2e18-ff1d-40cd-a1ba-8ec4ce8c3c87\",\"name\": \"Sum two numbers\",\"form\": \"{\\\"test\\\":" + - "\\\"test\\\"}\",\"styles\": null,\"sourceType\": \"com.vmw.vro.workflow\",\"type\": \"requestForm\"," + - "\"status\": \"ON\",\"formFormat\": \"JSON\"}" - ).getBytes() - ); + File customFormItem = Paths.get( + getFormDir().getAbsolutePath(), + getCatalogItemResourceName(catalogItem) + ".json").toFile(); + + Path itemName = Paths.get(customFormItem.getPath()); + writeFileToPath(itemName, + ("{\"id\": \"342f2e18-ff1d-40cd-a1ba-8ec4ce8c3c87\",\"name\": \"Sum two numbers\",\"form\": \"{\\\"test\\\":" + + + "\\\"test\\\"}\",\"styles\": null,\"sourceType\": \"com.vmw.vro.workflow\",\"type\": \"requestForm\"," + + + "\"status\": \"ON\",\"formFormat\": \"JSON\"}").getBytes()); } - /** - * Returns custom catalog item resource name that can be used for catalog items, forms and icons + * Returns custom catalog item resource name that can be used for catalog items, + * forms and icons * - * @param catalogItem + * @param catalogItem * - * @return String + * @return String */ - private String getCatalogItemResourceName( VraNgCatalogItem catalogItem ) { + private String getCatalogItemResourceName(VraNgCatalogItem catalogItem) { return catalogItem.getSourceName() + "__" + catalogItem.getName(); } } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ContentSharingPolicyFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ContentSharingPolicyFsMocks.java index 61283cfe2..c1a6d06f1 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ContentSharingPolicyFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ContentSharingPolicyFsMocks.java @@ -16,7 +16,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; import java.io.File; import java.nio.file.Paths; import java.nio.file.Path; @@ -33,6 +33,7 @@ public final class ContentSharingPolicyFsMocks extends VraNgFsMock { /** * Constructor. + * * @param tempDir a folder to store temporary test data */ public ContentSharingPolicyFsMocks(File tempDir) { @@ -41,6 +42,7 @@ public ContentSharingPolicyFsMocks(File tempDir) { /** * Calculates working directory path. + * * @return the working directory folder as a File object. */ @Override @@ -49,14 +51,15 @@ public File getWorkdir() { } /** - * JSON encodes a content sharing policy and adds it to the policies/content-sharing directory. - * @param csPolicy - The resource action to store + * JSON encodes a content sharing policy and adds it to the + * policies/content-sharing directory. + * + * @param csPolicy - The resource action to store */ public void addContentSharingPolicy(VraNgContentSharingPolicy csPolicy) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - csPolicy.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + csPolicy.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CustomResourceFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CustomResourceFsMocks.java index 47d312beb..aa6054584 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CustomResourceFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/CustomResourceFsMocks.java @@ -14,34 +14,34 @@ */ package com.vmware.pscoe.iac.artifact.helpers.filesystem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; public class CustomResourceFsMocks extends VraNgFsMock { - private final static String WORKDIR = "custom-resources"; + private static final String WORKDIR = "custom-resources"; public CustomResourceFsMocks(File tempDir) { - super( tempDir ); + super(tempDir); } @Override public File getWorkdir() { - return Paths.get( this.tempDir.getPath(), WORKDIR ).toFile(); + return Paths.get(this.tempDir.getPath(), WORKDIR).toFile(); } /** * JSON encodes a CR item and adds it to the DIR_CUSTOM_RESOURCES. * Adds the CR items dir if it does not exist * - * @param cr - The custom resource to add + * @param cr - The custom resource to add */ public void addCustomResource(VraNgCustomResource cr) { File crFile = Paths.get( - this.getWorkdir().getAbsolutePath(), - cr.getName() + ".json").toFile(); + this.getWorkdir().getAbsolutePath(), + cr.getName() + ".json").toFile(); Path crName = Paths.get(crFile.getPath()); writeFileToPath(crName, cr.getJson().getBytes()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/Day2ActionsPolicyFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/Day2ActionsPolicyFsMocks.java index bc31bf5ab..b271463b1 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/Day2ActionsPolicyFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/Day2ActionsPolicyFsMocks.java @@ -16,7 +16,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDay2ActionsPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDay2ActionsPolicy; import java.io.File; import java.nio.file.Path; @@ -34,6 +34,7 @@ public class Day2ActionsPolicyFsMocks extends VraNgFsMock { /** * Constructor. + * * @param tempDir temporary folder for test data. */ @@ -43,6 +44,7 @@ public Day2ActionsPolicyFsMocks(File tempDir) { /** * Getter. + * * @return the full path where test policy json files are stored during tests. */ @Override @@ -52,13 +54,13 @@ public File getWorkdir() { /** * JSON encodes a policy and adds it to the resource actions directory. - * @param policy - The policy to store + * + * @param policy - The policy to store */ public void addPolicy(VraNgDay2ActionsPolicy policy) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - policy.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + policy.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/DeploymentLimitPolicyFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/DeploymentLimitPolicyFsMocks.java index 84885d6df..206783b68 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/DeploymentLimitPolicyFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/DeploymentLimitPolicyFsMocks.java @@ -16,7 +16,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDeploymentLimitPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDeploymentLimitPolicy; import java.io.File; import java.nio.file.Path; @@ -34,6 +34,7 @@ public class DeploymentLimitPolicyFsMocks extends VraNgFsMock { /** * Constructor. + * * @param tempDir temporary folder for test data. */ @@ -43,6 +44,7 @@ public DeploymentLimitPolicyFsMocks(File tempDir) { /** * Getter. + * * @return the full path where test policy json files are stored during tests. */ @Override @@ -52,17 +54,16 @@ public File getWorkdir() { /** * JSON encodes a policy and adds it to the resource actions directory. - * @param policy - The policy to store + * + * @param policy - The policy to store */ public void addPolicy(VraNgDeploymentLimitPolicy policy) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - policy.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + policy.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); writeFileToPath(itemName, gson.toJson(policy).getBytes()); } } - diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/EntitlementFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/EntitlementFsMocks.java index a144c798a..dcad784f7 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/EntitlementFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/EntitlementFsMocks.java @@ -16,14 +16,14 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlement; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlement; import java.io.File; import java.nio.file.Paths; import java.nio.file.Path; public class EntitlementFsMocks extends VraNgFsMock { - private final static String WORKDIR = "entitlements"; + private static final String WORKDIR = "entitlements"; public EntitlementFsMocks(File tempDir) { super(tempDir); @@ -36,18 +36,18 @@ public File getWorkdir() { /** * JSON encodes a entitlement and adds it to the entitlements directory. - * This will also create the content.yaml based on the entitlement and alternatively accepts a versions' data containing + * This will also create the content.yaml based on the entitlement and + * alternatively accepts a versions' data containing * information about the versions. * - * @see com.vmware.pscoe.iac.artifact.helpers.stubs.entitlementVersionsMockBuilder - * @param entitlement - The entitlement to store - * @param versionsData - A string containing the versioning data + * @see com.vmware.pscoe.iac.artifact.helpers.stubs.entitlementVersionsMockBuilder + * @param entitlement - The entitlement to store + * @param versionsData - A string containing the versioning data */ public void addEntitlement(VraNgCatalogEntitlement entitlement) { - File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - entitlement.getName() + ".json" - ).toFile(); + File file = Paths.get( + this.getWorkdir().getAbsolutePath(), + entitlement.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/LeasePolicyFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/LeasePolicyFsMocks.java index 9400175b2..4d1820091 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/LeasePolicyFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/LeasePolicyFsMocks.java @@ -16,7 +16,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgLeasePolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgLeasePolicy; import java.io.File; import java.nio.file.Path; @@ -34,6 +34,7 @@ public class LeasePolicyFsMocks extends VraNgFsMock { /** * Constructor. + * * @param tempDir temporary folder for test data. */ @@ -43,6 +44,7 @@ public LeasePolicyFsMocks(File tempDir) { /** * Getter. + * * @return the full path where test policy json files are stored during tests. */ @Override @@ -52,20 +54,19 @@ public File getWorkdir() { /** * JSON encodes a resource action and adds it to the resource actions directory. - * This will also create the content.yaml based on the resource action and alternatively accepts a versions' data containing + * This will also create the content.yaml based on the resource action and + * alternatively accepts a versions' data containing * information about the versions. * - * @param policy - The policy to store + * @param policy - The policy to store */ public void addPolicy(VraNgLeasePolicy policy) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - policy.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + policy.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); writeFileToPath(itemName, gson.toJson(policy).getBytes()); } } - diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/PropertyGroupFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/PropertyGroupFsMocks.java index b383875e1..dcbe3438c 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/PropertyGroupFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/PropertyGroupFsMocks.java @@ -16,37 +16,36 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; public class PropertyGroupFsMocks extends VraNgFsMock { - private final static String WORKDIR = "property-groups"; + private static final String WORKDIR = "property-groups"; public PropertyGroupFsMocks(File tempDir) { - super( tempDir ); + super(tempDir); } @Override public File getWorkdir() { - return Paths.get( this.tempDir.getPath(), WORKDIR ).toFile(); + return Paths.get(this.tempDir.getPath(), WORKDIR).toFile(); } /** * Adds the property group dir if it does not exist * - * @param propertyGroup - The Property group to add + * @param propertyGroup - The Property group to add */ - public void addPropertyGroup( VraNgPropertyGroup propertyGroup ) { - File customPropertyGroupFile = Paths.get( - this.getWorkdir().getAbsolutePath(), - propertyGroup.getName() + ".json" - ).toFile(); + public void addPropertyGroup(VraNgPropertyGroup propertyGroup) { + File customPropertyGroupFile = Paths.get( + this.getWorkdir().getAbsolutePath(), + propertyGroup.getName() + ".json").toFile(); - Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); - Path itemName = Paths.get( customPropertyGroupFile.getPath() ); - writeFileToPath( itemName, gson.toJson( propertyGroup ).getBytes() ); + Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); + Path itemName = Paths.get(customPropertyGroupFile.getPath()); + writeFileToPath(itemName, gson.toJson(propertyGroup).getBytes()); } } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceActionFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceActionFsMocks.java index 6a90a93db..02bcdfa5d 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceActionFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceActionFsMocks.java @@ -16,14 +16,14 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; import java.io.File; import java.nio.file.Paths; import java.nio.file.Path; public class ResourceActionFsMocks extends VraNgFsMock { - private final static String WORKDIR = "resource-actions"; + private static final String WORKDIR = "resource-actions"; public ResourceActionFsMocks(File tempDir) { super(tempDir); @@ -36,18 +36,19 @@ public File getWorkdir() { /** * JSON encodes a resource action and adds it to the resource actions directory. - * This will also create the content.yaml based on the resource action and alternatively accepts a versions' data containing + * This will also create the content.yaml based on the resource action and + * alternatively accepts a versions' data containing * information about the versions. * - * @see com.vmware.pscoe.iac.artifact.helpers.stubs.resource actionVersionsMockBuilder - * @param resourceAction - The resource action to store - * @param versionsData - A string containing the versioning data + * @see com.vmware.pscoe.iac.artifact.helpers.stubs.resource + * actionVersionsMockBuilder + * @param resourceAction - The resource action to store + * @param versionsData - A string containing the versioning data */ public void addResourceAction(VraNgResourceAction resourceAction) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - resourceAction.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + resourceAction.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceQuotaPolicyFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceQuotaPolicyFsMocks.java index 4a2187358..cf05906b5 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceQuotaPolicyFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/ResourceQuotaPolicyFsMocks.java @@ -16,7 +16,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceQuotaPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceQuotaPolicy; import java.io.File; import java.nio.file.Path; @@ -34,33 +34,36 @@ public class ResourceQuotaPolicyFsMocks extends VraNgFsMock { /** * Constructor. + * * @param tempDir temporary folder for test data. */ public ResourceQuotaPolicyFsMocks(File tempDir) { super(tempDir); } + /** * Getter. + * * @return the full path where test policy json files are stored during tests. */ @Override public File getWorkdir() { return Paths.get(this.tempDir.getPath(), - DIR_POLICIES, RESOURCE_QUOTA_POLICY).toFile(); + DIR_POLICIES, RESOURCE_QUOTA_POLICY).toFile(); } /** * JSON encodes a resource action and adds it to the resource actions directory. - * This will also create the content.yaml based on the resource action and alternatively accepts a versions' data containing + * This will also create the content.yaml based on the resource action and + * alternatively accepts a versions' data containing * information about the versions. * - * @param rqPolicy - The resource quota policy to store + * @param rqPolicy - The resource quota policy to store */ public void addResourceQuotaPolicy(VraNgResourceQuotaPolicy rqPolicy) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - rqPolicy.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + rqPolicy.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/SubscriptionFsMocks.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/SubscriptionFsMocks.java index 826679e2a..ea18066b7 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/SubscriptionFsMocks.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/SubscriptionFsMocks.java @@ -16,9 +16,9 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSubscription; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSubscription; -import static com.vmware.pscoe.iac.artifact.store.vrang.VraNgDirs.DIR_SUBSCRIPTIONS; +import static com.vmware.pscoe.iac.artifact.aria.automation.store.VraNgDirs.DIR_SUBSCRIPTIONS; import java.io.File; import java.nio.file.Paths; @@ -27,11 +27,13 @@ public class SubscriptionFsMocks extends VraNgFsMock { /** * SubscriptionFsMocks constructor. + * * @param tempDir temporary directory. */ public SubscriptionFsMocks(File tempDir) { super(tempDir); } + /** * Returns working directory. */ @@ -42,13 +44,13 @@ public File getWorkdir() { /** * Save subscription file to temporary directory. + * * @param subscription subscription object */ public void addSubscription(VraNgSubscription subscription) { File file = Paths.get( - this.getWorkdir().getAbsolutePath(), - subscription.getName() + ".json" - ).toFile(); + this.getWorkdir().getAbsolutePath(), + subscription.getName() + ".json").toFile(); Gson gson = new GsonBuilder().setLenient().setPrettyPrinting().serializeNulls().create(); Path itemName = Paths.get(file.getPath()); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/VraNgFsMock.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/VraNgFsMock.java index 0f989c0b3..834b37868 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/VraNgFsMock.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/filesystem/VraNgFsMock.java @@ -23,7 +23,7 @@ /** * Abstract class to be implemented by the other FS Mocks. */ -abstract public class VraNgFsMock { +public abstract class VraNgFsMock { protected final File tempDir; public VraNgFsMock(File tempDir) { @@ -33,7 +33,8 @@ public VraNgFsMock(File tempDir) { } /** - * Ensures the workdir exists. Will throw an error if the workdir cannot be created + * Ensures the workdir exists. Will throw an error if the workdir cannot be + * created */ protected void ensureWorkdirExists() { File workdir = this.getWorkdir(); @@ -50,18 +51,18 @@ protected void ensureWorkdirExists() { /** * Writes a given byte array body to path * - * @param path - the absolute path to the file ( with filename ) - * @param body - body to save + * @param path - the absolute path to the file ( with filename ) + * @param body - body to save */ protected void writeFileToPath(Path path, byte[] body) { try { Files.write( - path, - body, - StandardOpenOption.CREATE - ); + path, + body, + StandardOpenOption.CREATE); } catch (IOException e) { - throw new RuntimeException(String.format("Error while creating \"%s\". Message was: %s", path, e.getMessage())); + throw new RuntimeException( + String.format("Error while creating \"%s\". Message was: %s", path, e.getMessage())); } } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintMockBuilder.java index c9f6246bf..38fd62f67 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintMockBuilder.java @@ -14,7 +14,7 @@ */ package com.vmware.pscoe.iac.artifact.helpers.stubs; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; public class BlueprintMockBuilder { private String id; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintVersionsMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintVersionsMockBuilder.java index 99b110783..2019c47bf 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintVersionsMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/BlueprintVersionsMockBuilder.java @@ -1,6 +1,6 @@ /* * #%L - * artifact-manager + * artifact-manaer * %% * Copyright (C) 2023 VMware * %% @@ -15,7 +15,7 @@ package com.vmware.pscoe.iac.artifact.helpers.stubs; import com.google.gson.*; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgBlueprint; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgBlueprint; import org.apache.commons.io.IOUtils; import java.io.IOException; @@ -25,6 +25,7 @@ public class BlueprintVersionsMockBuilder { public static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"; + private static final long SECOND_IN_MS = 1000L; private final JsonElement mockData; private int versionsCount = 1; @@ -35,7 +36,8 @@ public BlueprintVersionsMockBuilder(VraNgBlueprint blueprint) throws IOException ClassLoader cl = getClass().getClassLoader(); try { - String read = IOUtils.toString(cl.getResourceAsStream("test/fixtures/blueprintVersion.json"), StandardCharsets.UTF_8); + String read = IOUtils.toString(cl.getResourceAsStream("test/fixtures/blueprintVersion.json"), + StandardCharsets.UTF_8); this.mockData = JsonParser.parseString(read); } catch (IOException ex) { throw ex; @@ -72,7 +74,7 @@ public JsonArray build() { newVersion.addProperty("version", String.valueOf(i)); newVersion.addProperty("id", String.valueOf(i)); newVersion.addProperty("createdAt", new SimpleDateFormat(DATE_FORMAT).format( - new Date(i*1000L))); + new Date(i * SECOND_IN_MS))); versionsArray.add(newVersion); } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogEntitlementMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogEntitlementMockBuilder.java index 1625cf775..86dafe883 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogEntitlementMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogEntitlementMockBuilder.java @@ -17,7 +17,7 @@ import java.util.ArrayList; import java.util.List; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogEntitlement; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogEntitlement; public class CatalogEntitlementMockBuilder { private String name = "mockedEntitlementName"; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogItemMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogItemMockBuilder.java index 0cc303195..7adfc8fad 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogItemMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CatalogItemMockBuilder.java @@ -14,9 +14,9 @@ */ package com.vmware.pscoe.iac.artifact.helpers.stubs; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItemType; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItemType; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceType; public class CatalogItemMockBuilder { /** diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CloudAccountMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CloudAccountMockBuilder.java index 96c0f29d7..945567c43 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CloudAccountMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CloudAccountMockBuilder.java @@ -17,56 +17,58 @@ import java.util.ArrayList; import java.util.List; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCloudAccount; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCloudAccount; public class CloudAccountMockBuilder { -/*{ - "numberOfElements": 1, - "content": [ - { - "owner": "csp@vmware.com", - "cloudAccountProperties": "{ \"hostName\": \"vcenter.mycompany.com\" }", - "enabledRegionIds": "[ \"us-east-1\", \"ap-northeast-1\" ]", - "_links": { - "additionalProp1": { - "hrefs": [ - "string" - ], - "href": "string" - }, - "additionalProp2": { - "hrefs": [ - "string" - ], - "href": "string" - }, - "additionalProp3": { - "hrefs": [ - "string" - ], - "href": "string" - } - }, - "cloudAccountType": "vsphere, aws, azure, nsxv, nsxt", - "description": "my-description", - "orgId": "9e49", - "tags": "[ { \"key\" : \"env\", \"value\": \"dev\" } ]", - "organizationId": "deprecated", - "createdAt": "2012-09-27", - "customProperties": "{ \"isExternal\" : \"false\" }", - "name": "my-name", - "id": "9e49", - "updatedAt": "2012-09-27" - } - ], - "totalElements": 1 -}*/ + /* + * { + * "numberOfElements": 1, + * "content": [ + * { + * "owner": "csp@vmware.com", + * "cloudAccountProperties": "{ \"hostName\": \"vcenter.mycompany.com\" }", + * "enabledRegionIds": "[ \"us-east-1\", \"ap-northeast-1\" ]", + * "_links": { + * "additionalProp1": { + * "hrefs": [ + * "string" + * ], + * "href": "string" + * }, + * "additionalProp2": { + * "hrefs": [ + * "string" + * ], + * "href": "string" + * }, + * "additionalProp3": { + * "hrefs": [ + * "string" + * ], + * "href": "string" + * } + * }, + * "cloudAccountType": "vsphere, aws, azure, nsxv, nsxt", + * "description": "my-description", + * "orgId": "9e49", + * "tags": "[ { \"key\" : \"env\", \"value\": \"dev\" } ]", + * "organizationId": "deprecated", + * "createdAt": "2012-09-27", + * "customProperties": "{ \"isExternal\" : \"false\" }", + * "name": "my-name", + * "id": "9e49", + * "updatedAt": "2012-09-27" + * } + * ], + * "totalElements": 1 + * } + */ private String id = "mockedCloudAccountId"; private String name = "mockedCloudAccount"; private String type = "vsphere, aws, azure, nsxv, nsxt"; private List regionIds; - private List tags; + private List tags; public CloudAccountMockBuilder() { this.regionIds = new ArrayList(); @@ -98,7 +100,7 @@ public CloudAccountMockBuilder setTags(List tags) { return this; } - public VraNgCloudAccount build(){ + public VraNgCloudAccount build() { return new VraNgCloudAccount(this.id, this.name, this.type, this.regionIds, this.tags); } } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSharingPolicyMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSharingPolicyMockBuilder.java index 75f74cad3..00c73578d 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSharingPolicyMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSharingPolicyMockBuilder.java @@ -15,11 +15,11 @@ package com.vmware.pscoe.iac.artifact.helpers.stubs; import java.util.ArrayList; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgDefinition; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgEntitledUser; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPrincipal; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgDefinition; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgEntitledUser; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPrincipal; public final class ContentSharingPolicyMockBuilder { diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSourceBaseMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSourceBaseMockBuilder.java index 0fa16f549..4086335fd 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSourceBaseMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ContentSourceBaseMockBuilder.java @@ -14,30 +14,29 @@ */ package com.vmware.pscoe.iac.artifact.helpers.stubs; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSourceBase; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSourceBase; public class ContentSourceBaseMockBuilder { private String id = "mockedSourceId"; private String name = "mockedSourceName"; private String typeId = "com.vmw.vro.workflow"; - - public ContentSourceBaseMockBuilder setName(String name){ + public ContentSourceBaseMockBuilder setName(String name) { this.name = name; return this; } - public ContentSourceBaseMockBuilder setId(String id){ + public ContentSourceBaseMockBuilder setId(String id) { this.id = id; return this; } - public ContentSourceBaseMockBuilder setTypeId(String typeId){ + public ContentSourceBaseMockBuilder setTypeId(String typeId) { this.typeId = typeId; return this; } - public VraNgContentSourceBase build(){ + public VraNgContentSourceBase build() { VraNgContentSourceBase contentSource = new VraNgContentSourceBase(); contentSource.setId(this.id); contentSource.setName(this.name); diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomFormMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomFormMockBuilder.java index 361fd8ab8..3e1486016 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomFormMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomFormMockBuilder.java @@ -14,7 +14,7 @@ */ package com.vmware.pscoe.iac.artifact.helpers.stubs; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomForm; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomForm; public class CustomFormMockBuilder { /** diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomResourceMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomResourceMockBuilder.java index 10a9000b5..859521798 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomResourceMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/CustomResourceMockBuilder.java @@ -18,7 +18,7 @@ import java.nio.charset.StandardCharsets; import com.google.gson.*; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCustomResource; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCustomResource; import org.apache.commons.io.IOUtils; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/PropertyGroupMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/PropertyGroupMockBuilder.java index ecadb81ef..00771076e 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/PropertyGroupMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/PropertyGroupMockBuilder.java @@ -20,39 +20,39 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgPropertyGroup; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgPropertyGroup; import org.apache.commons.io.IOUtils; public class PropertyGroupMockBuilder { private JsonElement mockData; - private String id = "mockedId"; - private String name = "mockedPropertyGroup"; + private String id = "mockedId"; + private String name = "mockedPropertyGroup"; public PropertyGroupMockBuilder() throws IOException { ClassLoader cl = getClass().getClassLoader(); try { - String read = IOUtils.toString( cl.getResourceAsStream("test/fixtures/propertyGroup.json"), StandardCharsets.UTF_8 );; + String read = IOUtils.toString(cl.getResourceAsStream("test/fixtures/propertyGroup.json"), + StandardCharsets.UTF_8); this.mockData = JsonParser.parseString(read); - } - catch (IOException ex) { + } catch (IOException ex) { throw ex; } } - public PropertyGroupMockBuilder setName(String name){ + public PropertyGroupMockBuilder setName(String name) { this.name = name; return this; } - public PropertyGroupMockBuilder setId(String id){ + public PropertyGroupMockBuilder setId(String id) { this.id = id; return this; } public PropertyGroupMockBuilder setPropertyInRawData(String key, String value) { JsonObject propertyGroup = this.mockData.getAsJsonObject(); - if(propertyGroup.has(key)) { + if (propertyGroup.has(key)) { propertyGroup.remove(key); propertyGroup.addProperty(key, value); } @@ -63,14 +63,14 @@ public PropertyGroupMockBuilder setPropertyInRawData(String key, String value) { public VraNgPropertyGroup build() { JsonObject propertyGroup = this.mockData.getAsJsonObject(); - if(!this.name.isEmpty()){ + if (!this.name.isEmpty()) { this.setPropertyInRawData("name", this.name); } - if(!this.id.isEmpty()){ + if (!this.id.isEmpty()) { this.setPropertyInRawData("id", this.id); } - + return new VraNgPropertyGroup(this.name, this.id, propertyGroup.toString()); } } diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ResourceActionMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ResourceActionMockBuilder.java index eb25b9c26..48cb38c2d 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ResourceActionMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/ResourceActionMockBuilder.java @@ -23,7 +23,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgResourceAction; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgResourceAction; import org.apache.commons.io.IOUtils; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/SubscriptionMockBuilder.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/SubscriptionMockBuilder.java index ddb1d6fd7..e577b0768 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/SubscriptionMockBuilder.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/stubs/SubscriptionMockBuilder.java @@ -20,7 +20,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgSubscription; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgSubscription; import org.apache.commons.io.IOUtils; diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/vrang/RestClientVraNgPrimitiveTestDouble.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/vrang/RestClientVraNgPrimitiveTestDouble.java index b68334c8c..f4ffa0526 100644 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/vrang/RestClientVraNgPrimitiveTestDouble.java +++ b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/helpers/vrang/RestClientVraNgPrimitiveTestDouble.java @@ -14,8 +14,8 @@ */ package com.vmware.pscoe.iac.artifact.helpers.vrang; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNgPrimitive; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNgPrimitive; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import org.apache.hc.core5.net.URIBuilder; import org.springframework.http.HttpEntity; @@ -29,10 +29,10 @@ import com.vmware.pscoe.iac.artifact.model.Version; import com.vmware.pscoe.iac.artifact.model.abx.AbxAction; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgContentSharingPolicy; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgProject; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCatalogItem; -import com.vmware.pscoe.iac.artifact.model.vrang.VraNgCloudAccount; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgContentSharingPolicy; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgProject; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCatalogItem; +import com.vmware.pscoe.iac.artifact.aria.automation.models.VraNgCloudAccount; public class RestClientVraNgPrimitiveTestDouble extends RestClientVraNgPrimitive { diff --git a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/package-info.java b/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/package-info.java deleted file mode 100644 index 2f8c3af2f..000000000 --- a/common/artifact-manager/src/test/java/com/vmware/pscoe/iac/artifact/store/vrang/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/*- - * #%L - * artifact-manager - * %% - * Copyright (C) 2023 VMware - * %% - * Build Tools for VMware Aria - * Copyright 2023 VMware, Inc. - * - * This product is licensed to you under the BSD-2 license (the "License"). You may not use this product except in compliance with the BSD-2 License. - * - * This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. - * #L% - */ - -/** - * Package that represents Store Tests. - * - */ -package com.vmware.pscoe.iac.artifact.store.vrang; diff --git a/docs/versions/latest/Release.md b/docs/versions/latest/Release.md index 5fb13d07c..ad31c6df2 100644 --- a/docs/versions/latest/Release.md +++ b/docs/versions/latest/Release.md @@ -120,6 +120,23 @@ There was a `(Y/N)` hardcoded in the question which resulted in double entry: The question is updated: `Is single tenant environment? (Y/N) [Y]:` +### *Moved Aria Automation components to own folder* + +This is jut an internal restructuring effort, no functionality was changed. + ## Upgrade procedure +### *Dynamic type definitions for the unit tests framework.* + +The package name and version of the type definitions are being installed dynamically based on the configuration of the solution. +This ensures the type definitions available for type hinting / autocomplete in the IDE and for the transpilation are matching the actual code definitions of the unit test framework. + +#### Previous Behavior + +The type definitions installed were always the same package and version - the [BTVA built-in Jasmine definitions](https://github.com/vmware/build-tools-for-vmware-aria/tree/v3.1.1/vro-types/jasmine) (link is to v3.1.1, might be outdated at later point in time). + +#### New Behavior + +The configuration in the pom file affects both the framework being used and its type definitions being made available. + [//]: # (Explain in details if something needs to be done) diff --git a/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractIacMojo.java b/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractIacMojo.java index e939b57fd..2cae76698 100644 --- a/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractIacMojo.java +++ b/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractIacMojo.java @@ -15,6 +15,7 @@ package com.vmware.pscoe.maven.plugins; import com.vmware.pscoe.iac.artifact.configuration.*; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.PackageType; import com.vmware.pscoe.iac.artifact.rest.RestClientFactory; import com.vmware.pscoe.iac.artifact.rest.RestClientVro; diff --git a/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractInstallNodeDepsMojo.java b/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractInstallNodeDepsMojo.java index a79166604..e6917427c 100644 --- a/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractInstallNodeDepsMojo.java +++ b/maven/plugins/common/src/main/java/com/vmware/pscoe/maven/plugins/AbstractInstallNodeDepsMojo.java @@ -24,6 +24,7 @@ import java.io.File; import java.util.LinkedList; import java.util.List; +import java.util.Properties; /** * Executes the external project's dependency list. @@ -50,7 +51,6 @@ public abstract class AbstractInstallNodeDepsMojo extends AbstractIacMojo { @Override public final void execute() throws MojoExecutionException, MojoFailureException { boolean allTgzLibsResolved = true; - int commandLength = 0; File nodeModules = new File(project.getBasedir(), "node_modules"); if (skipInstallNodeDeps) { if (nodeModules.exists()) { @@ -58,8 +58,7 @@ public final void execute() throws MojoExecutionException, MojoFailureException return; } else { getLog().info("Ignoring the flag skipInstallNodeDeps," - + - "as node dependencies doesn't exist and are required for the successful build..."); + + "as node dependencies doesn't exist and are required for the successful build..."); } } @@ -67,13 +66,33 @@ public final void execute() throws MojoExecutionException, MojoFailureException getLog().debug("node_modules doesn't exists. Creating it..."); nodeModules.mkdirs(); } - + + // TODO: Think of a way to put the logic for unit test framework in one place instead of two separate components. + // Checking if there's specific unit test framework specified. If there is - it will be added to the dependencies list. + // If not - the default Jasmine type definitions will be kept from the original dependencies list. + + Properties projectProperties = project.getProperties(); + String unitTestFrameworkPackage = projectProperties.getProperty("test.framework.package"); + String unitTestFrameworkVersion = projectProperties.getProperty("test.framework.version"); + String unitTestFrameworkTypes = projectProperties.getProperty("test.framework.types.version"); + boolean useDefaultUnitTestFramework = unitTestFrameworkPackage == null + || unitTestFrameworkPackage.equals(new String("jasmine")) && unitTestFrameworkVersion == null; + + getLog().debug("unitTestFrameworkPackage => " + unitTestFrameworkPackage); + getLog().debug("unitTestFrameworkVersion => " + unitTestFrameworkVersion); + getLog().debug("unitTestFrameworkTypes => " + unitTestFrameworkTypes); + List deps = new LinkedList<>(); for (Object o : project.getArtifacts()) { Artifact a = (Artifact) o; if ("tgz".equals(a.getType())) { - + if ( + !useDefaultUnitTestFramework + && a.getArtifactId().equals(new String("jasmine")) + ) { + continue; + } deps.add(a.getFile().getAbsolutePath()); allTgzLibsResolved = allTgzLibsResolved && a.isResolved(); } @@ -111,6 +130,54 @@ public final void execute() throws MojoExecutionException, MojoFailureException String npmExec = SystemUtils.IS_OS_WINDOWS ? "npm.cmd" : "npm"; + // Add a dependency for the unit test framework type + // definitions according to the project configuration. + if (!useDefaultUnitTestFramework) { + if (unitTestFrameworkVersion == null) { + getLog().info( + "No specific versions of the unit testing framework received, will be using the" + + " latest available for both the framework dependency and its type definitions." + ); + unitTestFrameworkTypes = "latest"; + unitTestFrameworkVersion = "latest"; + } else if (unitTestFrameworkTypes == null) { + if (unitTestFrameworkVersion.equals(new String("latest"))) { + unitTestFrameworkTypes = "latest"; + } else { + int dotPosition = unitTestFrameworkVersion.lastIndexOf('.'); + getLog().warn("dotPosition: " + dotPosition); + unitTestFrameworkTypes = unitTestFrameworkVersion.substring(0, dotPosition) + ".X"; + } + getLog().warn( + "Received specific version for the unit testing framework, but not for its type definitions, " + + "attempting to use [" + unitTestFrameworkTypes + "], generated from the framework version. " + + "Please, be aware the type definitions are handled by the DefinitelyTyped project " + + "(https://definitelytyped.org/). In case there are any issues with installing the generated types " + + "version, please try specifying which version should be applied." + ); + } else { + getLog().warn( + "Received specific versions for unit test framework and framework type definition," + + " will attempt to install those. Please, be aware these need to be a proper match" + + " and are handled by the DefinitelyTyped project (https://definitelytyped.org/)." + ); + } + + unitTestFrameworkPackage = unitTestFrameworkPackage != null ? unitTestFrameworkPackage : "jasmine"; + String unitTestFrameworkTypeDefsPackage = "@types/" + unitTestFrameworkPackage + "@" + unitTestFrameworkTypes; + + getLog().info( + "Adding dependency to be installed for the unit tests framework " + + "type definitions: " + unitTestFrameworkTypeDefsPackage + ); + + List framework = new LinkedList<>(); + framework.add(unitTestFrameworkTypeDefsPackage); + dependencies.add(framework); + } + + // Idea: Should we separate dependencies as dev deps and regular ones? + for (List dependency: dependencies) { getLog().debug("Dependency size: " + dependency.size()); dependency.add(0, npmExec); diff --git a/maven/plugins/vrealize/src/main/java/com/vmware/pscoe/maven/plugins/ReleaseMojo.java b/maven/plugins/vrealize/src/main/java/com/vmware/pscoe/maven/plugins/ReleaseMojo.java index ff2795fb5..ae04615ae 100644 --- a/maven/plugins/vrealize/src/main/java/com/vmware/pscoe/maven/plugins/ReleaseMojo.java +++ b/maven/plugins/vrealize/src/main/java/com/vmware/pscoe/maven/plugins/ReleaseMojo.java @@ -17,12 +17,12 @@ import java.util.Arrays; import com.vmware.pscoe.iac.artifact.AbxReleaseManager; -import com.vmware.pscoe.iac.artifact.VraNgReleaseManager; +import com.vmware.pscoe.iac.artifact.aria.automation.store.helpers.VraNgReleaseManager; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationException; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.model.PackageType; import com.vmware.pscoe.iac.artifact.rest.RestClientFactory; -import com.vmware.pscoe.iac.artifact.rest.RestClientVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.rest.RestClientVraNg; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; diff --git a/package-installer/src/main/java/com/vmware/pscoe/iac/installer/Installer.java b/package-installer/src/main/java/com/vmware/pscoe/iac/installer/Installer.java index 843831f18..091ed176e 100644 --- a/package-installer/src/main/java/com/vmware/pscoe/iac/installer/Installer.java +++ b/package-installer/src/main/java/com/vmware/pscoe/iac/installer/Installer.java @@ -59,7 +59,7 @@ import com.vmware.pscoe.iac.artifact.configuration.ConfigurationException; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationSsh; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVcd; -import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVraNg; +import com.vmware.pscoe.iac.artifact.aria.automation.configuration.ConfigurationVraNg; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVrli; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVro; import com.vmware.pscoe.iac.artifact.configuration.ConfigurationVroNg; diff --git a/typescript/vrotest/readme.md b/typescript/vrotest/readme.md index f23a8e0ec..9723cda5f 100644 --- a/typescript/vrotest/readme.md +++ b/typescript/vrotest/readme.md @@ -31,6 +31,10 @@ Supported properties: - `test.framework.version` - the version of the framework npm package to use, should be one of the versions available for the specified framework npm package. If not provided will use: - `^4.0.2` for `jasmine` for backward comaptibility. - `latest` for `jest`. +- `test.framework.types.version` - optional value, will be used to install a specific version of the type definitions for the unit test framework. This is related to the [DefinitelyTyped project](https://definitelytyped.org/) and the versions need to be aligned with the available ones originating from it. If not value is provided: + - And the Jasmine framework is used with the default framework version, the solution will install the default type definitions as well - ensures backward compatibility. + - If the latest version of any framework is used the solution will install the latest available type definitions for it. + - If a specific version of any framework is used the solution will attempt to install the `major.minor.X` version of the type definitions. In case there is no such version, the user needs to specify which version should be used via the `test.framework.types.version` property. - `test.framework.runner` - enables using a specific runner, currently only used for `jest`, optional, supported values: `swc`, if omitted will use the default runner. - `test.framework.jasmine.reporters.version` - version of the Jasmine reporters package to use when using the `jasmine` option for the framework selection, optional, defaults to `^2.5.2` for backward compatibility if omitted. - `test.ansicolors.version` - The `ansi-colors` npm package is used in the Jasmine reporters configured for the tests, optional, defaults to `^4.1.1` for backward compatibility if omitted.