From 6e4f04afea4c2d07fdd9c15eda38438c7baeb308 Mon Sep 17 00:00:00 2001 From: "mark.j.leonard" Date: Thu, 26 Apr 2018 16:53:12 +0100 Subject: [PATCH] Convert project from AJSC to Spring Boot Remove all AJSC configuration and dependencies. Update the pom.xml to use oparent and to depend on Spring Boot. Refactor the main class to introduce a minimal set of Spring annotations. Note that the license text was corrected in this change. Issue-ID: AAI-1039 Change-Id: I16385db3216ec39bfd2881f2278e340ec3795199 Signed-off-by: mark.j.leonard --- License.txt | 13 +- Readme.md | 13 +- ajsc-shared-config/README.txt | 6 - ajsc-shared-config/etc/PartnerProfile.xml | 2408 -------------------- ajsc-shared-config/etc/aft.properties | 35 - .../etc/basic-logback_root_logger_level_off.xml | 104 - ajsc-shared-config/etc/spm2.jks | Bin 62008 -> 0 bytes antBuild/build.xml | 248 -- .../etc/appprops/AAFUserRoles.properties | 32 - .../appprops/PostProcessorInterceptors.properties | 22 - .../appprops/PreProcessorInterceptors.properties | 23 - .../etc/appprops/app-intercepts.properties | 27 - .../etc/appprops/methodMapper.properties | 9 - .../etc/sysprops/sys-props.properties | 135 -- pom.xml | 534 ++--- src/main/bin/start.sh | 42 +- src/main/docker/Dockerfile | 8 +- .../aai/modelloader/config/ModelLoaderConfig.java | 555 ++--- .../org/onap/aai/modelloader/entity/Artifact.java | 12 +- .../aai/modelloader/entity/ArtifactHandler.java | 20 +- .../onap/aai/modelloader/entity/ArtifactType.java | 12 +- .../entity/catalog/VnfCatalogArtifact.java | 12 +- .../entity/catalog/VnfCatalogArtifactHandler.java | 12 +- .../entity/catalog/VnfImageException.java | 14 +- .../entity/model/AbstractModelArtifact.java | 13 +- .../entity/model/AbstractModelArtifactParser.java | 15 +- .../model/BabelArtifactParsingException.java | 13 +- .../modelloader/entity/model/IModelArtifact.java | 13 +- .../aai/modelloader/entity/model/IModelId.java | 17 +- .../aai/modelloader/entity/model/IModelParser.java | 13 +- .../modelloader/entity/model/ModelArtifact.java | 20 +- .../entity/model/ModelArtifactHandler.java | 19 +- .../entity/model/ModelArtifactParser.java | 18 +- .../aai/modelloader/entity/model/ModelSorter.java | 28 +- .../entity/model/NamedQueryArtifact.java | 23 +- .../entity/model/NamedQueryArtifactParser.java | 26 +- .../onap/aai/modelloader/entity/model/Pair.java | 13 +- .../extraction/ArtifactInfoExtractor.java | 18 +- .../extraction/InvalidArchiveException.java | 12 +- .../notification/ArtifactDeploymentManager.java | 18 +- .../notification/ArtifactDownloadManager.java | 24 +- .../notification/BabelArtifactConverter.java | 12 +- .../modelloader/notification/BasicStatusMsg.java | 57 + .../notification/CompDoneStatusMessageBuilder.java | 27 +- .../notification/CompDoneStatusMsg.java | 49 +- .../DistributionStatusMessageBuilder.java | 30 +- .../notification/DistributionStatusMsg.java | 123 +- .../notification/DownloadFailureException.java | 12 +- .../modelloader/notification/EventCallback.java | 21 +- .../notification/NotificationPublisher.java | 34 +- .../ProcessToscaArtifactsException.java | 12 +- .../aai/modelloader/restclient/AaiRestClient.java | 12 +- .../modelloader/restclient/BabelServiceClient.java | 15 +- .../restclient/BabelServiceClientFactory.java | 12 +- .../aai/modelloader/service/ArtifactInfoImpl.java | 25 +- .../service/ModelLoaderApplication.java | 37 + .../modelloader/service/ModelLoaderInterface.java | 94 +- .../aai/modelloader/service/ModelLoaderMsgs.java | 14 +- .../modelloader/service/ModelLoaderService.java | 138 +- .../modelloader/service/NotificationDataImpl.java | 18 +- .../aai/modelloader/service/SdcConnectionJob.java | 18 +- .../aai/modelloader/util/JsonXmlConverter.java | 12 +- src/main/resources/application.properties | 20 + .../etc => src/main/resources}/logback.xml | 7 - .../modelloader/service/ModelLoaderMsgs.properties | 2 +- .../modelloader/config/ModelLoaderConfigTest.java | 385 ++-- .../entity/catalog/TestVnfImageException.java | 49 + .../catalog/VnfCatalogArtifactHandlerTest.java | 12 +- .../entity/model/ModelArtifactParserTest.java | 12 +- .../modelloader/entity/model/ModelSorterTest.java | 213 +- .../entity/model/NamedQueryArtifactParserTest.java | 12 +- .../entity/model/TestModelArtifactHandler.java | 124 + .../extraction/ArtifactInfoExtractorTest.java | 17 +- .../modelloader/fixture/ArtifactInfoBuilder.java | 15 +- .../fixture/NotificationDataFixtureBuilder.java | 22 +- .../fixture/ResourceInstanceBuilder.java | 16 +- .../fixture/TestNotificationDataImpl.java | 21 +- .../fixture/TestResourceInstanceImpl.java | 16 +- .../ArtifactDeploymentManagerTest.java | 20 +- .../notification/ArtifactDownloadManagerTest.java | 24 +- .../notification/BabelArtifactConverterTest.java | 22 +- .../notification/EventCallbackTest.java | 232 +- .../notification/TestNotificationPublisher.java | 86 + .../restclient/TestAaiServiceClient.java | 106 + .../restclient/TestBabelServiceClient.java | 97 +- .../modelloader/service/TestArtifactInfoImpl.java | 123 + .../service/TestModelLoaderApplication.java | 41 + .../service/TestNotificationDataImpl.java | 83 + .../aai/modelloader/util/ArtifactTestUtils.java | 12 +- .../aai/modelloader/util/JsonXmlConverterTest.java | 157 +- src/test/resources/model-loader.properties | 21 +- 91 files changed, 2349 insertions(+), 4989 deletions(-) delete mode 100644 ajsc-shared-config/README.txt delete mode 100644 ajsc-shared-config/etc/PartnerProfile.xml delete mode 100644 ajsc-shared-config/etc/aft.properties delete mode 100644 ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml delete mode 100644 ajsc-shared-config/etc/spm2.jks delete mode 100644 antBuild/build.xml delete mode 100644 bundleconfig-local/etc/appprops/AAFUserRoles.properties delete mode 100644 bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties delete mode 100644 bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties delete mode 100644 bundleconfig-local/etc/appprops/app-intercepts.properties delete mode 100644 bundleconfig-local/etc/appprops/methodMapper.properties delete mode 100644 bundleconfig-local/etc/sysprops/sys-props.properties create mode 100644 src/main/java/org/onap/aai/modelloader/notification/BasicStatusMsg.java create mode 100644 src/main/java/org/onap/aai/modelloader/service/ModelLoaderApplication.java create mode 100644 src/main/resources/application.properties rename {ajsc-shared-config/etc => src/main/resources}/logback.xml (96%) create mode 100644 src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfImageException.java create mode 100644 src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactHandler.java create mode 100644 src/test/java/org/onap/aai/modelloader/notification/TestNotificationPublisher.java create mode 100644 src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java create mode 100644 src/test/java/org/onap/aai/modelloader/service/TestArtifactInfoImpl.java create mode 100644 src/test/java/org/onap/aai/modelloader/service/TestModelLoaderApplication.java create mode 100644 src/test/java/org/onap/aai/modelloader/service/TestNotificationDataImpl.java diff --git a/License.txt b/License.txt index 58e7e79..8aa6a4d 100644 --- a/License.txt +++ b/License.txt @@ -1,19 +1,18 @@ -============LICENSE_START========================================== +============LICENSE_START======================================================= org.onap.aai -=================================================================== +================================================================================ Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -Copyright © 2017-2018 Amdocs -=================================================================== +Copyright © 2017-2018 European Software Marketing Ltd. +================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -============LICENSE_END============================================ - +============LICENSE_END========================================================= diff --git a/Readme.md b/Readme.md index 0d5e4e9..5456fc9 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,7 @@ # Introduction The A&AI Model Loader Service is an application that facilitates -distribution, ingestion of new service and resource models, and vnf -catalogs from the SDC to the A&AI. +distribution and ingestion of new service and resource models from SDC to A&AI. ## Features @@ -16,13 +15,13 @@ The Model Loader: ## Compiling Model Loader Model Loader can be compiled by running `mvn clean install` -A Model Loader docker image can be created by running `docker build -t openecomp/model-loader target` +A Model Loader docker image can be created by running `docker build -t onap/model-loader target` ## Running Model Loader -### Deploying The Micro Service +### Deploying The MicroService -Push the Docker image that you have built to your Docker repository and pull it down to the location that you will be running the search service from. +Push the Docker image to your Docker repository. Pull this down to the host machine. **Create the following directories on the host machine:** @@ -74,7 +73,7 @@ _model-loader.properties_ ml.distribution.USER= # Artifact type we want to download from the SDC (the values below will typically suffice) - ml.distribution.ARTIFACT_TYPES=MODEL_INVENTORY_PROFILE,MODEL_QUERY_SPEC,VNF_CATALOG + ml.distribution.ARTIFACT_TYPES=MMODEL_QUERY_SPEC,TOSCA_CSAR # List of message bus addresses on which to listen for distribution events ml.distribution.MSG_BUS_ADDRESSES=, @@ -89,7 +88,7 @@ _model-loader.properties_ ml.aai.NAMED_QUERY_URL=/aai/v*/service-design-and-creation/named-queries/named-query/ # A&AI endpoint to post vnf images - ml.aai.VNF_IMAGE_URL=/aai/v8/service-design-and-creation/vnf-images + ml.aai.VNF_IMAGE_URL=/aai/v*/service-design-and-creation/vnf-images # Name of certificate to use in connecting to the A&AI ml.aai.KEYSTORE_FILE=aai-os-cert.p12 diff --git a/ajsc-shared-config/README.txt b/ajsc-shared-config/README.txt deleted file mode 100644 index a82eb64..0000000 --- a/ajsc-shared-config/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -The ajsc-shared-config folder is included in the service project to provide the functionality of the AJSC_SHARED_CONFIG -location that will exist in CSI envs. This includes the logback.xml for logging configurations, and some csm related -artifacts necessary for proper functionality of the csm framework within the CSI env. Within the 2 profiles that can -be utilized to run the AJSC locally, "runLocal" and "runAjsc", the system propery, "AJSC_SHARED_CONFIG", has been set -to point to this directory. The files in this folder will NOT be copied/moved anywhere within the AJSC SWM package. These -files will already be in existence within the CSI env. \ No newline at end of file diff --git a/ajsc-shared-config/etc/PartnerProfile.xml b/ajsc-shared-config/etc/PartnerProfile.xml deleted file mode 100644 index de9ca07..0000000 --- a/ajsc-shared-config/etc/PartnerProfile.xml +++ /dev/null @@ -1,2408 +0,0 @@ - - - - - - - sg7477 - 2013-06-30T00:06:07+05:30 - - - - - - - 100 - 110 - - - AddAccount - - 10 - - - - AddNote - - 90 - 110 - - - - - - 5000 - 300000 - 600000 - - - AddNote - - 5000 - 250000 - 300000 - - - - CreateFiberServiceVOIPNumber - - 120000 - 300000 - 300000 - - - - InquireAccountProfile - - 5000 - 100000 - 250000 - - - - InquireUnbilledUsageDetail - - 5000 - 250000 - 300000 - - - - InquireWirelinePortEligibility - - 5000 - 330000 - 600000 - - - - QualifyAndQuoteFiberServiceProducts - - 120000 - 300000 - 300000 - - - - SendSms - - 5000 - 150000 - 180000 - - - - ValidateFiberServiceFacility - - 120000 - 1200000 - 1200000 - - - - ValidateFiberServiceFacilityResponse - - 120000 - 1200000 - 1200000 - - - - ExecuteWirelineMechanizedLoopTest - - 120000 - 1200000 - 1200000 - - - - ExecuteWirelineMechanizedLoopTestResponse - - 120000 - 1200000 - 1200000 - - - - AppDev_NetworkPerformance - - 60000 - 100000 - 250000 - - - - - BW - - 25 - 10 - 10 - 10 - 10 - - csitest - testingcsi - csitest - false - false - WALMART - false - - 500 - 300000 - 600000 - - - accountdetails - v1 - get - - - AddContentProviderSponsor - - - AddEmployeeDetails - - - InquireEmployeeDetails - - - InquireVoiceUsageDetails - - - UpdateContentProviderSponsor - - - InquireContentProviderSponsor - - - InquireCircuitTestResults - - - InquireAccountProfileV78 - - - InquireSubscriberProfileV78 - - - ScheduleCircuitTest - - - CancelScheduledCircuitTest - - - InquireAvailableCircuitTestList - - - SubmitCircuitTest - - - InquireCustomerTroubleTicketDetails - - - UpdateCustomerTroubleTicketDetails - - - AddCustomerTroubleTicket - - - ManageBusinessServices - - - InquireMobileUsageDetails - - - UpdateEnterpriseEndUserPermissions - - - SwapCrossUpgradeEquipment - - - ManageMobilePaymentProfile - - - InquireCustomerAlarmList - - - InquireCustomerAlarmCount - - - UpdateCustomerAlarmAcknowledgment - - - InquireRatingModel - - - InquireCustomerPurchaseEligibility - - - InquireCustomerTroubleTicketList - - - InquireCustomerTroubleTicketCount - - - InquireResellerAccountProfile - - - SubmitResellerContractInformation - - - InquireInternationalOfferings - - - InquireAccessCircuitSummary - - - InquireEnterpriseOrderDetails - - - InquireEnterpriseOrderList - - - InquireEnterpriseOrderStatus - - - InquireEthernetDetails - - - InquireCustomerDigitalLifeInstallationProfile - - - InquireDirectoryListingHeadings - - - ManageDigitalLifeDevice - - - SendDigitalLifeDeviceNotification - - - ExecuteWirelineMechanizedLoopTest - - - ExecuteWirelineMechanizedLoopTestResponse - - - InquireNetworkAssetDetails - - - InquireVOIPProbeDetails - - - InquireVOIPAssetDetails - - - InquireManagedAssetDetails - - - ExecuteExternalIdVerificationQA - - - InquireIPNetworkServiceLocationDetails - - - InquireUnifiedCreditCheckResult - - - ProcessDeviceUnlock - - - InquireWirelessDashboard - - - InquireWirelineServiceAppointmentReservations - - - UpdateWirelineServiceAppointmentReservation - - - InquireTechnicianDispatchStatus - - - UpdateIDDBAutoGroup - - - UpdateIDDBDailyRules - - - UpdateIDDBGeography - - - UpdateIDDBMasterTemplate - - - ValidateOpenDeviceEligibility - - - ValidateOpenDeviceEmailAddressAvailability - - - RetrieveAvailableOpenDeviceProducts - - - RetrieveOpenDeviceDetails - - - ValidateAndQualifyOpenDeviceAddress - - - RetrieveOpenDeviceTax - - - CreateOpenDeviceCustomer - - - CreateOpenDeviceCustomerOrder - - - AddRetailStoreAppointment - - - ValidateAddressServiceAvailability - - - InquireAvailableRetailStoreAppointments - - - InquireRetailStoreAppointmentReferenceDetails - - - UpdateFanProfile - - - InquireRetailStoreAppointmentList - - - InquireKeyValueStore - - - UpdateKeyValueStore - - - AppDev_NetworkPerformance - wireless - get - - - InquireUnifiedCustomerIdentifiers - - - InquireNetworkLatency - - - InquireNetworkTrafficDensity - - - InquireReferenceCodeList - - - InquireBillList - - - InquireSubscriberBilledCallDetails - - - InquireSubscriberCharges - - - InquireSubscriberHistory - - - InquireSwitchCircuitDetails - - - InquireSwitchCircuitList - - - AddBillAccounts - - - AddUCOrder - - - OrderDeviceProtectionPlan - - - ResetEwalletSecurityProfile - - - UpdateCustomerSalesSupportDetails - - - UpdatePartnerServicesProductStatus - - - UpdateSubscriberParentalControls - false - - - InquireOrderDetails - - - UpdateCPEDetails - - - InquireNonSBSInventory - - - UpdateUCCustomerProfile - - - InquireUCCustomerProfile - - - CreateUCCustomerNumber - - - AuthorizeLOAUpdate - - - ReleaseInquiredTelephoneNumbers - - - ValidateTelephoneNumbers - - - UpdateLOADetails - - - ValidateOrder - - - UpdateBVOIPSiteProfile - - - InquireUpsellEligibility - - - InquireIncompatibleOfferings - - - UpdateBVOIPSubscriberAssociation - - - SendBVOIPSubscriberAssociationNotification - - - CreateWirelineServiceOrder - - - InquireWirelineDirectoryAvailability - - - InquireAvailableCustomerSparePairsSummary - - - UpdateUnifiedCustomerLoginProfile - - - InquireEnterpriseDetails - - - InquirePaymentProductApplicationResult - - - InquireTroubleTicketStatus - - - InquireTroubleReferenceDetails - - - InquireTroubleTicketHistory - - - UpdateTroubleTicketDetails - - - AddEnterpriseTroubleTicket - - - InquireContractTerminationDetails - - - UpdatePaymentPreferences - - - InquireWirelineServiceAppointments - - - ReserveWirelineServiceAppointment - - - InquireWirelinePendingOrderDetails - - - SubmitWirelineFacilityAssignmentOrder - - - InquireWirelinePendingOrderDetailsResponse - - - AddTroubleTicket - - - InquireFemtocellDevice - - - UpdateFemtocellDevice - - - SendTroubleTicketStatusNotice - - - InquireWirelineTechnicianAssignments - - - InquireAvailableFiberServiceAppointments - - - SubmitMechanizedLoopTest - - - InquirePortedTNList - - - InquireWirelinePortDetails - - - InquireHostRoutingDetails - - - InquireBundledOrder - - - InquireBundledAccountServices - - - UpdateBundledAccountServices - - - UpdateWirelineWorkOrder - - - InquireSubscriberCallList - - - UpdateSubscriberCallList - - - ValidateCreditPolicy - - - AddPaymentProfile - true - - - ActivateSwitchFeatures - - - AddTechnicianTroubleNote - - - UpdatePaymentProfile - true - - - InquireSBSBundledDiscountSubscriberList - - - ExchangePerformanceMetrics - - - InquireBundledOrderStatus - - - InquireAvailableBundlePackages - - - InquireBundledOrderList - - - DeletePaymentProfile - - - UpdateBillingPreferences - - - SendBillingPreferencesNotification - - - InquirePaymentProfile - - - InquireServiceAvailabilityForLocation - - - ActivateCustomer - - - ActivateDevice - - - ActivateFemtocellService - - - ActivateFiberServiceResidentialGateway - - - ActivateFiberServiceTNPort - - - ActivatePendingEquipmentUpgrade - - - ActivateSubscriber - - - ActivateSubscriberReseller - - - ActivateSubscriberResellerResponse - - - ActivateSubscriberResponse - - - Add3PPOrderNotes - - - Add3PPOrderShipment - - - AddAccount - - 25 - - - - AddAffiliateDiscount - - - AddATTConnectAccount - - - AddCombinedBilling - - - AddCreditPolicyProfile - - - AddCustomerDeviceSalesData - - - AddBundledOrder - - - UpdateBundledOrder - - - AddFemtocellAddress - - - AddFemtocellCALEALocation - - - AddFemtocellProfile - - - AddFiberServiceAccount - - - AddFiberServiceCreditPolicy - true - - - AddFiberServiceTNPort - - - AddInsuranceClaimOrder - - - AddNetworkElementTroubleReport - - - AddNote - - - AddOrderEmail - - - AddOtherChargesCredits - - - AddPayment - true - - - AddPort - - - AddPrepaidFeature - - - AddPrepaidPayment - - 5000 - 300000 - 300000 - - - - AddPromiseToPay - - - AddRemoveProductCodeIndicator - - - AddSbcCombinedBilling - - - AddSbcSaleInformation - - - AddSmsPayment - - - AddWirelineNote - - - AddWirelineOrder - - - AddWirelinePayment - true - - - AddWirelinePaymentPlan - true - - - ApplyDataTreatment - - - ApplyFiberServiceCreditPolicy - - - ApplyPrepaidPayment - - - ApplyPrepaidVoucher - - - AuthenticateFanPassword - - - AuthenticateFanPin - - - AuthorizeCreditCard - true - - - CalculateSatelliteServiceTaxes - - - CalculateTaxes - - - Cancel3PPOrder - - - CancelCombinedBilling - - - CancelCopay - - - CancelFemtocellE911Service - - - CancelFemtocellNetwork - - - CancelFemtocellService - - - CancelFiberServiceWorkOrder - - - CancelHLRRegistration - - - CancelInsuranceClaimOrder - - - CancelPendingEquipmentUpgrade - - - CancelPort - - - CancelReservedFiberServiceVOIPNumber - - - CancelWirelinePayment - - - ChangeSubscriberNumber - - - CheckEligibility - - - ConfirmHLRRegistration - - - ConfirmWirelineTNReservation - - - CreateFiberServiceAccount - - - CreateFiberServiceVOIPNumber - - - CreateFiberServiceWorkOrder - - - CreateSatelliteServiceOrder - - - DeleteFemtocellAddress - - - DeleteFemtocellProfile - - - DetermineFiberServiceAccountHistoryList - - - DetermineFiberServiceDuplicateApplicationList - - - Echo - - - ExecuteAffiliateCreditCheck - - - ExecuteCreditCheck - - - ExecuteFiberServiceCreditCheck - - - ExecuteNBIMigration - - - ExecuteSalesOpportunityCreditCheck - - - ExecuteWirelineCreditCheck - - - ExecuteWirelineTroubleReportFunction - - - Generic - - - InitiateFiberServiceOrder - - - InitiateUnifiedCreditPolicyRetrieval - - - InquireAccessoryPricing - - - InquireAccountList - true - - - InquireAccountPaymentHistory - - - InquireAccountProfile - true - - - InquireAccountSubscribers - - - InquireActivationCommissionCodes - - - InquireAdditionalOfferings - - - InquireAddressMatch - - - InquireAffiliateAccountPaymentBalance - - - InquireAffiliateAccountProfile - - - InquireAffiliateCustomerAccount - - - InquireAffiliateEligibility - - - InquireAffiliateGeneralMessages - - - InquireAffiliateOrderStatus - - - InquireAffiliateProductCatalog - - - InquireAffiliateProductConfiguration - - - InquireAffiliateProductDetails - - - InquireAffiliateProductOfferingEligibility - - - InquireAffiliateServiceQualification - - - InquireAffiliateServiceScheduling - - - InquireARRemittance - - - InquireATTCreditCardOffer - - - InquireATTCreditCardOfferList - - - InquireAutomaticPayment - true - - - InquireAvailableAccessory - - - InquireAvailableFiberServiceAppointments - - - InquireAvailableCircuitSparePairs - - - InquireAvailableDevice - - - InquireAvailableFees - - - InquireAvailableFiberServiceAppointments - - - InquireAvailableFiberServiceCustomers - - - InquireAvailableFiberServiceVOIPNumbers - - - InquireAvailableItemQuantity - - - InquireAvailableOfferDetails - - - InquireAvailableOffers - - - InquireAvailablePortInSubscriber - - - InquireAvailableSatelliteServiceAppointments - - - InquireAvailableSubscriberNumbers - - - InquireCollectionData - - - InquireCombinedBillingEligibility - true - - - InquireContractedConversionFee - - - InquireCopayEligibility - - - InquireCopaySubscriber - - - InquireCopaySubscriberHistory - - - InquireCPNIContactInformation - - - InquireCpniPreferenceHistory - - - InquireCreditCheckResult - - - InquireCreditPolicyProfile - - - InquireCustomerDeviceSalesData - - - InquireDataAccessEligibility - - - InquireDataTreatmentHistory - - - InquireDepositPaymentStatus - - - InquireDeviceDetails - - - InquireDeviceShippingInformation - - - InquireDuplicateOfferings - - - InquireEquipmentOrder - - - InquireEquipmentOrderInvoice - - - InquireEquipmentPricing - - - InquireEstimatedFulfillmentTime - - - InquireExistingCustomer - - - InquireFanProfile - - - InquireFemtocellAddressList - - - InquireFemtocellDeviceList - - - InquireFemtocellEligibility - - - InquireFemtocellProfile - - - InquireFiberServiceAccountDetails - - false - - - InquireFiberServiceAssignedProductDetails - - - InquireFiberServiceCircuitDetails - - - InquireFiberServiceCreditVerificationQuestions - - - InquireFiberServiceCrossProductPackages - - - InquireFiberServiceEquipmentDetails - - - InquireFiberServiceOfferEligibility - - - InquireFiberServiceOrderDetail - - - InquireFiberServiceOrderList - - - InquireFiberServiceOrderStatus - - - InquireFiberServiceProductDetails - - - InquireFiberServiceQualification - - - InquireFiberServiceQuotation - - - InquireFiberServiceSubscriptionAccount - - - InquireFiberServicePendingAdjustments - - - InquireFiberServiceTNPortStatus - - - InquireFiberServiceUsageDetails - - - InquireFiberServiceVOIPPortEligibility - - - InquireInsuranceClaimOrder - - - InquireInsuranceClaimReplacementProducts - - - InquireInternationalRoamingMinutes - - - InquireInternationalRoamingUsageParameters - - - InquireLandLinePaymentServiceFee - - - InquireLastSuccessfulPayment - true - - - InquireMarketByZip - - - InquireMarketServiceAreas - - - InquireMaximumDryLoopFTNAllowed - - - InquireMessagingCapabilities - - - InquireNBIMigrationEligibility - - - InquireOfferHistory - - - InquireOfferingEligibility - - - InquireOTAHistory - - - InquireOTAProfile - - - InquirePaymentLocationDetails - - - InquirePendingPricePlan - - - InquirePort - - - InquirePortActivationStatus - - - InquirePortEligibilityByRange - - - InquirePortEligibilityBySubscriberNumber - - - InquirePrepaidBalance - - - InquirePrepaidFeatures - - - InquirePrepaidFeaturesHistory - - - InquirePrepaidPaymentEligibility - - - InquirePrepaidPricePlans - - - InquirePrepaidPINDetails - - - InquirePrepaidSubscriberProfile - - - InquirePricePlanList - - - InquirePricePlans - - - InquirePurchaseOrder - - - InquireSatelliteServiceOrderDetails - - - InquireSatelliteServiceProducts - - - InquireSatelliteServiceQualification - - - InquireSatelliteServiceQuotation - - - InquireSbcCombinedBillingEligibility - - - InquireServiceAreaByZip - - - InquireServiceOrderActivationStatus - - - InquireSharedGroupUpdateStatus - - - InquireShippingZipBySubscriberNumber - - - InquireSIMStatus - - - InquireSubscriberList - - - InquireSubscriberParentalControls - - - InquireSubscriberPin - - - InquireSubscriberProfile - true - - - InquireSubscriberServiceStatus - - - InquireSubscriberTransactionData - - - InquireSubscriptionAccountIdentifiers - - - InquireWirelineSwitchProfile - - - InquireSwitchTransactionStatus - - - InquireUnbilledUsageDetail - - - InquireUnifiedCustomerProfileByServiceLocation - - - InquireUnifiedCustomerServiceProfile - - - InquireUpgradeEligibility - - - InquireUnifiedOrderDetails - - - InquireWiFiEligibility - - - InquireWirelineAccountProfile - - - InquireWirelineAccountAssociations - - - InquireInternetSubscriptionAccounts - - - InquireWirelineBillingAccountList - - - InquireWirelineCreditApplicationList - - - InquireWirelineCreditVerificationQuestions - - - InquireWirelineCustomerAccount - - - InquireWirelineDSLandConnectTechOrderDetail - - - InquireWirelineDTVOrderDetail - - - InquireWirelineFiberServiceAppointments - - - InquireWirelineGeneralMessages - - - InquireWirelineNetworkChannelDetails - - - InquireWirelineNonRecurringCharges - - - InquireWirelineOpenTroubleReports - - - InquireWirelineOrderDetails - - - InquireWirelineOrderStatus - - - InquireWirelinePaymentHistory - - - InquireWirelinePaymentPlan - true - - - InquireWirelinePortEligibility - - - InquireAvailableTelephoneNumbers - - - ReserveTelephoneNumbers - - - InquireWirelineProductCatalog - - - InquireWirelineProductConfiguration - - - InquireWirelineProductCount - - - InquireWirelineProductDetails - - - InquireWirelineProductsForResource - - - InquireWirelineRegion - - - InquireWirelineServiceQualification - - - InquireWirelineServiceScheduling - - - InquireWirelineQualifiedProducts - - - InquireWirelineServiceOrderDetails - - - InquireWirelineTelcoOrderDetail - - - InquireWirelineTransportDetails - - - InquireWirelineUsageDetail - - - InquireWirelineWholesaleProductFamilies - - - MaintainAffiliateAccountAssociation - - - ManageAutomaticPayments - true - - - ManageCopay - - - ManageSubscriberPin - - - ModifySatelliteServiceOrder - - - CancelSatelliteServiceOrder - - - MoveSubscriber - - - NotifyFemtocellAction - - - OrderEquipment - - - OrderEquipmentWithValidation - - - OrderFiberService - - - ParseUnfieldedWirelineAddress - - - PortFiberServiceTelephoneNumber - - - ProcessEcho - - - ProcessEchoBackOffice - - - ProcessEchoFrontOffice - - - ProcessWirelineCPNIElection - - - ProvisionAddressBookService - - - ProvisionFemtocellE911Service - - - ProvisionFemtocellNetwork - - - ProvisionFemtocellRegistration - - - PublishUnifiedCreditPolicy - - - QualifyAndQuoteFiberServiceProducts - - - QualifyProducts - - - RegisterFemtocellService - - - ReleaseAvailableFiberServiceVOIPNumbers - - - ReleaseDryLoopFTN - - - ReleaseSubscriberNumber - - - RemoveCustomerDeviceSalesData - - - ResendOTAProfile - - - ReserveFiberServiceAppointments - - - ReserveFiberServiceVOIPNumber - - - ReserveSubscriberNumber - - - ResetVoiceMailPassword - - - RetrieveAbandonedFiberServiceOrder - - - RetrieveFiberServiceAccount - - - RetrieveFiberServiceAppointments - - - RetrieveFiberServiceOrderStatus - - - RetrieveFiberServiceProducts - - - RetrieveOrderDetails - - - RetrieveProducts - - - RetrieveQuotation - - - RetrieveUnifiedCreditPolicy - - - ScheduleAppointments - - - ScheduleSatelliteServiceInstallation - - - SendAccountNotification - - - SendCPNINotification - - - SendEmail - - - SendFanProfileNotification - - - SendFiberServiceTNPortNotification - - - SendFiberServiceWorkOrderNotification - - - SendFiberServiceWorkOrderNotificationAsync - - - SendSms - - - SendSmsResponse - - - SendTreatmentNotification - - - SubmitATTCreditCard - - - SubmitCreditCheck - - - SubmitFiberServiceOrder - - - SubmitFiberServiceTNAssignmentOrder - - - SubmitOrder - - - SubmitWalmartProxy - - - SwapEquipment - - - SwapFemtocellDevice - - - UpdateAccountDisputeDetails - - - UpdateAccountManager - - - UpdateAccountProfile - true - - - UpdateAccountStatus - - - UpdateAffiliateProductOffering - - - UpdateBillMedia - - - UpdateCpniPreference - - - UpdateCreditPolicyProfile - - - UpdateDepositPaymentStatus - - - UpdateDeviceInventory - - - UpdateDeviceProfile - - - UpdateEwalletStatus - - - InquireEwalletEventHistory - - - InquireEwalletSubscriberProfile - - - InquireCustomerSnapshot - - - UpdateFemtocellCALEALocation - - - UpdateFemtocellProfile - - - UpdateFiberServiceAccount - - - UpdateFiberServiceAccountDetails - - - UpdateFiberServiceCreditApplication - - - UpdateInternationalRoamingUsageParameters - - - UpdateOfferDisposition - - - UpdatePort - - - UpdatePrepaidFeature - - - UpdatePrepaidSubscriberProfile - - - UpdateSalesOpportunityCreditCheck - - - UpdateSatelliteServiceAccountAssociation - - - UpdateSubscriberAddressBookIdentifier - - - UpdateSubscriberProfile - - 5000 - 100000 - 120000 - - - - UpdateSubscriberStatus - - - UpdateVoiceMailProfile - - - UpdateWirelineAccountProfile - - - UpdateWirelineCPNIPreference - - - UpdateWirelineCreditApplication - - - UpdateWirelineTroubleReport - - - UpgradeEquipment - - - UpqueryAffiliateOfferingEligibility - - - ValidateAddress - - - ValidateAffiliateCustomer - - - ValidateAffiliateOrder - - - ValidateCreditCard - - - ValidateFemtocellCoverageArea - - - ValidateFemtocellE911Coverage - - - ValidateFemtocellEquipmentIdentifier - - - ValidateFemtocellWhitelist - - - ValidateFiberServiceCreditPolicy - - - ValidateFiberServiceCreditVerificationAnswers - - - ValidateFiberServiceFacility - - - ValidateFiberServiceFacilityResponse - - - ValidateFiberServiceFacilityNotification - - - ValidateFiberServiceProductDetails - - - ValidateSatelliteServiceProducts - - - ValidateShippingPriority - - - ValidateWirelineCreditVerificationAnswers - - - ValidateWirelineCustomer - - - ValidateWirelineOrder - - - InquireWirelineFutureAvailability - - - ValidateWirelinePostalAddress - - - CancelMobileContent - - - InquireMobileContentDetails - - - UpdateFiberServiceOrder - - - ExecuteUnifiedCreditCheck - - - SendPaymentProductApplicationResultNotification - - - ConfirmUnifiedCreditAccountDebtPayment - - - InquireUnifiedCreditAccountDebtDetails - - - InquireUnifiedCreditVerificationQuestions - - - SubmitUnifiedCreditApplication - - - UpdateUnifiedCreditApplication - - - ValidateUnifiedCreditVerificationAnswers - - - InquireUnifiedCreditAdverseActionLetter - - - InquireUnifiedCreditPolicyDecision - - - NotifyUnifiedCreditOrderSubmission - - - AssignAvailableWorkOrder - - - SendNetworkPathWorkOrderStatusNotification - - - ProcessNetworkPathWorkOrder - - - CreateCentralOfficeWorkOrder - - - UpdateCentralOfficeWorkOrder - - - CreateFiberServiceRepairWorkOrder - - - CreateFiberServiceRepairWorkOrderAsnyc - - - SendRepairWorkOrderNotification - - - CancelFiberServiceRepairWorkOrder - - - CancelFiberServiceRepairWorkOrderAsnyc - - - InquireUnifiedCustomerLoginProfile - - - InquireCustomerSubscriptionDetails - - - SendCancelWorkOrderNotification - - - InquireWirelineAccountLevelCSR - - - InquireWirelineServiceLevelCSR - - - InquireUnifiedPaymentProfile - true - - - UpdateCloudServiceDetails - - - InquireNote - - - ValidateSubscriberOfferings - - - AddBundledOrderV48 - - - UpdateBundledAccountServicesV48 - - - UpdateBundledOrderV48 - - - ValidateBundledOrder - - - InquireBundledAccountProfile - - - InquireRecommendationDetails - - - InquireEnterpriseEndUserPermissions - - - InquireNCIMigrationEligibility - - - ExecuteNCIMigration - - - UpdateCommonOrder - - - InquireBillCycleDetails - - - InquireCommonOrderListDetails - - - ValidateWirelineTroubleReportCompletion - - - InquireSubscriberContractDetails - - - ExecuteExternalCreditCheck - - - InquireExternalApplicantKey - - - UpdateExternalCreditApplication - - - SendExternalCreditResultNotification - - - InquireAvailableRetailStoresByLocation - - - UpdateEnterpriseEndUserPermissions - - - InquireSubscriberServiceEligibility - - - UpdateFemtocellWhiteLists - - - InquireNetworkProductCatalog - - - InquireNetworkProductPriceQuote - - - SubmitSLACreditClaim - - - InquireSLACreditClaimStatus - - - InquireSLANetworkCreditClaimStatus - - - WHOLESALE-CUSTOMER-IDDELETE - walmartID - - - WHOLESALE-CUSTOMER-NAME - walmart - - - WHOLESALE-CUSTOMER-RESTRICTED-STATES - alaska - - - BID_ID - PlatinumSP - - - EBM_ORGID - o3hevdtz - - - REMOTE-CALL - true - - - CALL_NUMERITRACK - true - - - HEARTBEAT-INTERVAL - 20 - - - AP-CALL-RSN-FOR-WLNP-TLG - false - - - AS-PROCESS-DISCOUNTS - false - - - AS-RETRY-ON-TRANSIENT-ERROR - true - - - AS-STORE-MARKET - true - - - CATALOG_TYPE - WALMART Catalog - - - - CHECK-FOR-MARKETLOOKUP-SOFTERROR - true - - - EQUIPMENT-UPGRADE-MAX-RETRY-INTERVAL - 0 - - - EQUIPMENT-UPGRADE-TRACKING-REQUIRED - false - - - IAL-AV-REQUIRED - false - - - IAP-ALLOWED-MASK-VALUES - CR:TD:SL:SN:SC:DC:UD:VU:VU+PT:VU+PR:VU+PT+PR:DU:DU+PR:UE - - - IAP-AV-REQUIRED - false - - - INFO-RESTRICT-LEVEL - Unrestricted - - - ISP-ALLOWED-MASK-VALUES - DI:DC:UD:VU:VU+PT:VU+PR:VU+PT+PR:DU:DU+PR:UE - - - IUCSP-MAX-ALLOWED-CTNS - 10 - - - IUCSP-NEW-KIT-WARRANTY-DAYS - 366 - - - IUCSP-REFURBISHED-KIT-WARRANTY-DAYS - 90 - - - IUCSP-SEED-KIT-WARRANTY-DAYS - 366 - - - IUUD-ALLOWED-MASK-VALUES - VU:VU+HO:VU+RO:VU+TO:VU+AL:VU+PT:VU+PT+HO:VU+PT+RO:VU+PT+TO:VU+PT+AL:VU+PR:VU+PR+HO:VU+PR+RO:VU+PR+TO:VU+PR+AL:VU+PT+PR:VU+PT+PR+HO:VU+PT+PR+RO:VU+PT+PR+TO:VU+PT+PR+AL:DU:DU+PR - - - IWPE-LSR11-ACCESS-DENIED - false - - - TN-REQUEST-CATEGORY - MCSICVOIP - - - MARKET-STATUS-LOOKUP - false - - - MEMO-NOTE-USER - WEB - - - NBI-ACCESS-DECLINED - false - - - PREAUTHORIZED-CREDIT-CHECK - true - - - - RESTRICTED-TO-TEST-CALLS - true - - - RESELLER-TEST-DEALER-CODE - IJX57 - - - UPGRADE-EQUIPMENT-NEW-SALES-CHANNEL - U2 - - - UPGRADE-EQUIPMENT-UPGRADE-SECURITY-CODE - III - - - USE-GENERIC-ASYNC-RESPONSE - true - - - USOC-INFO-DATA-SOURCE - CURRENT - - - VFSF-OAT-REQUIRED-MSG-LOOKUP - false - - - VFSF-CLIENT-REQ-TYPE - Negotiation - - - VFSF-CLIENT-ID - BBNMS - - - SMS-DESTINATION-PORT - -1 - - - CTVCODE-SERVICE-MAINTENANCE - true - - - XI-APPLICATION-CONTEXT - OPSS - - - IN-MAX-BILLING-NOTE-QUANTITY - 300 - - - ITTH-TL-MAX-RECORDS-TO-FETCH - 50 - - - ITTH-ITH-MAX-RECORDS-TO-FETCH - 30 - - - IEEUP-SYSTEM-ID - premier - - - SUBSCRIPTION_CLASS - S - - - MOBILE_PAYMENTS_PARTNER_ID - S - - - - IUCPBYSL-GRID-CLIENT - true - - - APPLICATION_ID - ONSTAR - - - AES - NRETLTEL - NRETLTEL - - - BOSS - testcsi - - - RACFID - pb1975 - - - RACFPASSWORD - Light@1 - - - - - BSTECSC - CSI - a2p2!!b1 - - - CAM - CSIQC - CSIQC - - AccountType - S - - - SubAccountType - T - - - WaiveActivationFee - true - - - WaiveUpgradeFee - true - - - - CBS - ZCINGP1 - - - - CPSOS - c48794 - 7941!c48 - - - DLC - CSIQC - - - DLC_APP_ID - ASURION - - - - GCS - CSIQC - - - GCS_MERCHANT_ID - 001342 - - - - InterconnectRC - csitest - - - interconnectUSERID - SBC001T - - - interconnectPASSWORD - GC@\u0011W4\#""6/\u001172OK - - - interconnectLightSpeedUSERID - SBC002T - - - interconnectLightSpeedPASSWORD - GAN\u0016T4\#""6/\u001072OK - - - interconnectConsumerUSERID - SBC003T - - - interconnectConsumerPASSWORD - GCC\u0017P4\#""6/\u001372OK - - - - LNPSOA - - - - LNPSOA_APP_ID - QC - - - - - MRE - OPUS - OPUS - - - NSM - ACME - - - - OrderTrack - csitest - - - - PDC - RS - - - - QPAY - CSI_FDC - CSI_FDC - - - SWOT-LITE - cingultest - j9WWuopev9 - - - TLGAPI - rimprov1 - unix11 - - APP_ID - TLGAPI - - - CALLER_IND - FR - - - - YODA - WTS - CSITest - - - EDGE - WMS - WMS - - - true - - 30000 - 3 - 3000 - - - false - false - - /opt/app/sg_q7/tibco/jre/lib/security/cacerts - changeit - - - /opt/app/sg_q7/gateway_a/config/ActingAsClient.keystore - client - - - - true - - diff --git a/ajsc-shared-config/etc/aft.properties b/ajsc-shared-config/etc/aft.properties deleted file mode 100644 index ab6d84e..0000000 --- a/ajsc-shared-config/etc/aft.properties +++ /dev/null @@ -1,35 +0,0 @@ -### -# ============LICENSE_START========================================== -# org.onap.aai -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -### -# Flow test 319 -# The DEFAULT setup for this file is for deployment to soa cloud node which will use the "bundleconfig/etc/spm2.jks" location -# For Testing Locally, you can set the system property, csiEnable=true, found within bundleconfig-local/etc/sysprops/sys-props.properties -# and switch com.att.aft.keyStore and com.att.aft.trustStore values commented out below to "ajsc-shared-config/etc/spm2.jks" - -#replace proper values for the dummy values. -com.att.aft.discovery.client.environment=TEST -com.att.aft.discovery.client.latitude=35.318900 -com.att.aft.discovery.client.longitude=-80.762200 -com.att.aft.alias=fusionbus -com.att.aft.keyStore=bundleconfig/etc/key.jks -com.att.aft.keyStorePassword=password -com.att.aft.trustStore=bundleconfig/etc/key.jks -com.att.aft.trustStorePassword=password - diff --git a/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml b/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml deleted file mode 100644 index f1dcfee..0000000 --- a/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - ERROR - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n - - - - - - - DEBUG - - ${logDirectory}/info_ajsc.log - - ${logDirectory}/info_ajsc.%i.log.zip - - 1 - 9 - - - 5MB - - - "%d [%thread] %-5level %logger{1024} - %msg%n" - - - - - ERROR - - ${logDirectory}/error_ajsc.log - - ${logDirectory}/error_ajsc.%i.log.zip - - 1 - 9 - - - 5MB - - - - "%d [%thread] %-5level %logger{1024} - %msg%n" - - - - - - INFO - - localhost - USER - - AJSC_AUDIT: [%thread] [%logger] %msg - - - - INFO - - localhost - USER - - AJSC_AUDIT: [%thread] [%logger] mdc:[%mdc] %msg - - - - - - - - - diff --git a/ajsc-shared-config/etc/spm2.jks b/ajsc-shared-config/etc/spm2.jks deleted file mode 100644 index 8ff2a00a105aab80a301cb1e67b567d272d71466..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62008 zcmeFa1yojRw+2dgck|H=9}UvoA)V6QozkUrgLEST(o%v7(xK8Qf=G9xB5)T7d+Xl& z|M$6foVe$V?HCB_`&PUw=6s*|%xBJZv3;=(0RaI8{E%G##`LsswQ;ktax~+#;%0G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- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bundleconfig-local/etc/appprops/AAFUserRoles.properties b/bundleconfig-local/etc/appprops/AAFUserRoles.properties deleted file mode 100644 index 99dc91e..0000000 --- a/bundleconfig-local/etc/appprops/AAFUserRoles.properties +++ /dev/null @@ -1,32 +0,0 @@ -### -# ============LICENSE_START========================================== -# org.onap.aai -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -### - -#If using AAF for Role based authentication/authorization, define your routes/services which will utilize AAF. The AJSC will -#read this file and protect the routes given with the AAF role defined. - -#The following example would protect the JAXRS echo example service provided with the archetype. -#/services/${namespace}/v1/jaxrs-services/jaxrsExample/echo/*=com.att.ajsc.myper|mymachine|manage - -#The following example would protect ALL AJSC services running within your project. -#/**=com.att.ajsc.myperm|mymachine|manage - -#The following example would protect ALL REST services utilizing the Camel restlet routes. -#/rest/**=com.att.ajsc.myperm|mymachine|manage diff --git a/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties b/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties deleted file mode 100644 index 684d65e..0000000 --- a/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties +++ /dev/null @@ -1,22 +0,0 @@ -### -# ============LICENSE_START========================================== -# org.onap.aai -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -### -#This properties file is for defining any PostProcessorInterceptors that have been created for your AJSC service. - diff --git a/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties b/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties deleted file mode 100644 index b5cc0f4..0000000 --- a/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties +++ /dev/null @@ -1,23 +0,0 @@ -### -# ============LICENSE_START========================================== -# org.onap.aai -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -### -#This properties file is for defining any PreProcessorInterceptors that have been created for your AJSC service. - -/**=com.att.ajsc.csi.restmethodmap.RestMethodMapInterceptor diff --git a/bundleconfig-local/etc/appprops/app-intercepts.properties b/bundleconfig-local/etc/appprops/app-intercepts.properties deleted file mode 100644 index 00da3f6..0000000 --- a/bundleconfig-local/etc/appprops/app-intercepts.properties +++ /dev/null @@ -1,27 +0,0 @@ -### -# ============LICENSE_START========================================== -# org.onap.aai -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -### - -#This is where all your application intercept strategies must be configured. AJSC reads this property file and adds -#the list of intercepts specified here to the camel context. This can be useful for accessing every exchange object transferred from/to -#each endpoint in the request/response flow and can allow for more precise debugging and/or processing of the exchange. - -#e.g. -#intercepts=org.openecomp.modelloader.JaxrsEchoService,packagename.class1name,packagename.class2name diff --git a/bundleconfig-local/etc/appprops/methodMapper.properties b/bundleconfig-local/etc/appprops/methodMapper.properties deleted file mode 100644 index 7b71acf..0000000 --- a/bundleconfig-local/etc/appprops/methodMapper.properties +++ /dev/null @@ -1,9 +0,0 @@ -{ - "helloWorld": [ - { - "method": "get", - "url": "/rest/model-loader/v1/helloWorld", - "logicalName": "GetMethod(Logical)" - } - ] -} diff --git a/bundleconfig-local/etc/sysprops/sys-props.properties b/bundleconfig-local/etc/sysprops/sys-props.properties deleted file mode 100644 index 50c4271..0000000 --- a/bundleconfig-local/etc/sysprops/sys-props.properties +++ /dev/null @@ -1,135 +0,0 @@ -### -# ============LICENSE_START========================================== -# org.onap.aai -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -### - -#This file is used for defining AJSC system properties for different configuration schemes and is necessary for the AJSC to run properly. -#The sys-props.properties file is used for running locally. The template.sys-props.properties file will be used when deployed -#to a SOA/CSI Cloud node. - -#AJSC System Properties. The following properties are required for ALL AJSC services. If you are adding System Properties for your -#particular service, please add them AFTER all AJSC related System Properties. - -#For Cadi Authorization, use value="authentication-scheme-1 -CadiAuthN=authentication-scheme-1 - -#For Basic Authorization, use value="authentication-scheme-1 -authN=authentication-scheme-2 - -#Persistence used for AJSC meta-data storage. For most environments, "file" should be used. -ajscPersistence=file - -#For Direct Invocation to be enabled (values=true/false) -directInvocationEnable=false - -# If using hawtio for local development, these properties will allow for faster server startup and usage for local development - -hawtio.authenticationEnabled=false -hawtio.config.pullOnStartup=false - -#Removes the extraneous restlet console output -org.restlet.engine.loggerFacadeClass=org.restlet.ext.slf4j.Slf4jLoggerFacade - -#server.host property to be enabled for local DME2 related testing -#server.host= - -#Enable/disable SSL (values=true/false). This property also determines which protocol to use (https if true, http otherwise), to register services into GRM through DME2. -enableSSL=false - - -#Enable/disable EJB Container -ENABLE_EJB=false - -#Enable/disable OSGI -isOSGIEnable=false - -#Generate/Skip api docs -isApiDoc=false - -#CSI related variables for CSM framework -csm.hostname=servername - - -#SOA_CLOUD_ENV is used to register your service with dme2 and can be turned off for local development (values=true/false). -SOA_CLOUD_ENV=false - -#CONTINUE_ON_LISTENER_EXCEPTION will exit the application if there is a DME2 exception at the time of registration. -CONTINUE_ON_LISTENER_EXCEPTION=false - -#Jetty Container ThreadCount Configuration Variables -AJSC_JETTY_ThreadCount_MIN=1 -AJSC_JETTY_ThreadCount_MAX=200 -AJSC_JETTY_IDLETIME_MAX=3000 - -#Camel Context level default threadPool Profile configuration -CAMEL_POOL_SIZE=10 -CAMEL_MAX_POOL_SIZE=20 -CAMEL_KEEP_ALIVE_TIME=60 -CAMEL_MAX_QUEUE_SIZE=1000 - -#GRM/DME2 System Properties -AFT_DME2_CONN_IDLE_TIMEOUTMS=5000 -AJSC_ENV=SOACLOUD - -SOACLOUD_NAMESPACE=com.att.ajsc -SOACLOUD_ENV_CONTEXT=DEV -SOACLOUD_PROTOCOL=http -SOACLOUD_ROUTE_OFFER=DEFAULT - -AFT_LATITUDE=23.4 -AFT_LONGITUDE=33.6 -AFT_ENVIRONMENT=AFTUAT - -#Restlet Component Default Properties -RESTLET_COMPONENT_CONTROLLER_DAEMON=true -RESTLET_COMPONENT_CONTROLLER_SLEEP_TIME_MS=100 -RESTLET_COMPONENT_INBOUND_BUFFER_SIZE=8192 -RESTLET_COMPONENT_MIN_THREADS=1 -RESTLET_COMPONENT_MAX_THREADS=10 -RESTLET_COMPONENT_LOW_THREADS=8 -RESTLET_COMPONENT_MAX_QUEUED=0 -RESTLET_COMPONENT_MAX_CONNECTIONS_PER_HOST=-1 -RESTLET_COMPONENT_MAX_TOTAL_CONNECTIONS=-1 -RESTLET_COMPONENT_OUTBOUND_BUFFER_SIZE=8192 -RESTLET_COMPONENT_PERSISTING_CONNECTIONS=true -RESTLET_COMPONENT_PIPELINING_CONNECTIONS=false -RESTLET_COMPONENT_THREAD_MAX_IDLE_TIME_MS=60000 -RESTLET_COMPONENT_USE_FORWARDED_HEADER=false -RESTLET_COMPONENT_REUSE_ADDRESS=true - -#Externalized jar and properties file location. In CSI environments, there are a few libs that have been externalized to aid -#in CSTEM maintenance of the versions of these libs. The most important to the AJSC is the DME2 lib. Not only is this lib necessary -#for proper registration of your AJSC service on a node, but it is also necessary for running locally as well. Another framework -#used in CSI envs is the CSM framework. These 2 framework libs are shown as "provided" dependencies within the pom.xml. These -#dependencies will be copied into the target/commonLibs folder with the normal "mvn clean package" goal of the AJSC. They will -#then be added to the classpath via AJSC_EXTERNAL_LIB_FOLDERS system property. Any files (mainly property files) that need -#to be on the classpath should be added to the AJSC_EXTERNAL_PROPERTIES_FOLDERS system property. The default scenario when -#testing your AJSC service locally will utilize the target/commonLibs directory for DME2 and CSM related artifacts and 2 -#default csm properties files will be used for local testing with anything CSM knorelated. -#NOTE: we are using maven-replacer-plugin to replace "(doubleUnderscore)basedir(doubleUnderscore)" with ${basedir} within the -#target directory for running locally. Multiple folder locations can be separated by the pipe ("|") character. -#Please, NOTE: for running locally, we are setting this system property in the antBuild/build.xml "runLocal" target and in the -#"runAjsc" profile within the pom.xml. This is to most effectively use maven variables (${basedir}, most specifically. Therefore, -#when running locally, the following 2 properties should be set within the profile(s) themselves. -#Example: target/commonLibs|target/otherLibs -#AJSC_EXTERNAL_LIB_FOLDERS=__basedir__/target/commonLibs -#AJSC_EXTERNAL_PROPERTIES_FOLDERS=__basedir__/ajsc-shared-config/etc -#End of AJSC System Properties - -#Service System Properties. Please, place any Service related System Properties below. diff --git a/pom.xml b/pom.xml index f45e580..7ac73ba 100644 --- a/pom.xml +++ b/pom.xml @@ -1,103 +1,80 @@ + + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= +--> 4.0.0 - ajsc-archetype-parent - com.att.ajsc - 2.0.0 + org.onap.oparent + oparent + 1.1.0 + org.onap.aai.model-loader model-loader 1.2.0-SNAPSHOT + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + org.onap.aai.modelloader.service.ModelLoaderApplication + https://nexus.onap.org ${basedir}/target - model-loader - v1 - 2.0.0 - /appl/${project.artifactId} - /appl/${project.artifactId}/${project.version} - ${basedir}/target/swm/package/nix/dist_files${distFilesRoot} - - 2.0.1 - 3.6 + 1.5.12.RELEASE 1.1 - 1.14 - 2.8.1 - 1.10.19 - 1.1.1 - 1.18 - 2.7 1.3 - 0.7.9 - - - 9500 - 0 - - - - aaiadmin - aaiadmin - org.openecomp.aai.dev - - workstation - DEV - - provided - google_checks.xml - 1.8 - 1.8 - java - jacoco - ${project.build.directory}/surefire-reports - ${project.build.directory}/coverage-reports/jacoco.exec - false - ${project.version} - https://nexus.onap.org 1.2.0-SNAPSHOT 1.2.1 - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - - + + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}/content/repositories/releases/ + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}/content/repositories/snapshots/ + + + + + org.springframework.boot + spring-boot-starter-web + org.onap.aai babel @@ -111,20 +88,9 @@ - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api.version} - - - javax.ws.rs - jsr311-api - ${jsr311-api.version} - - - - com.sun.jersey - jersey-client - ${jersey-client.version} + org.glassfish.jersey.core + jersey-common + test org.onap.aai @@ -134,10 +100,14 @@ com.google.code.gson gson - ${gson.version} + + junit + junit + test + org.hamcrest hamcrest-all @@ -147,41 +117,8 @@ org.mockito mockito-core - ${mockito.version} test - - org.javassist - javassist - 3.19.0-GA - - - com.fasterxml.jackson.core - jackson-core - ${fasterxml.version} - - - - - javax.xml.bind - jaxb-api - 2.2.11 - - - com.sun.xml.bind - jaxb-impl - 2.2.11 - - - com.sun.xml.bind - jaxb-core - 2.2.11 - - - com.sun.xml.bind - jaxb-xjc - 2.2.11 - org.eclipse.persistence org.eclipse.persistence.moxy @@ -204,17 +141,11 @@ ch.qos.logback logback-core - 1.1.7 - org.openecomp.sdc.sdc-distribution-client + org.onap.sdc.sdc-distribution-client sdc-distribution-client - 1.2.2 - - - org.apache.httpcomponents - httpclient - 4.5 + 1.3.0 org.json @@ -224,7 +155,6 @@ org.eclipse.jetty jetty-security - 9.3.8.RC0 org.springframework @@ -235,26 +165,10 @@ jline 2.12.1 - - org.yaml - snakeyaml - 1.18 - - - - - org.apache.commons - commons-compress - ${commons-compress.version} - commons-io commons-io - - - org.apache.commons - commons-lang3 - ${apache.lang3.version} + 2.4 org.apache.commons @@ -263,157 +177,60 @@ - - - - central - http://repo1.maven.org/maven2 - - - EvoSuite - EvoSuite Repository - http://www.evosuite.org/m2 - - - - - - central - Maven 2 repository 2 - http://repo2.maven.org/maven2/ - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - - ecomp-staging - ECOMP Staging Repository - ${nexusproxy}/content/repositories/staging/ - - + + + + central + http://repo1.maven.org/maven2 + + + EvoSuite + EvoSuite Repository + http://www.evosuite.org/m2 + + - - - runAjsc - - initialize - - - org.codehaus.mojo - exec-maven-plugin - 1.3.2 - - - initialize - - java - - - false - true - java - com.att.ajsc.runner.Runner - - com.att.ajsc - ajsc-runner - - - ${basedir}/ajsc-shared-config/etc - - - - ${runAjscHome} - - - - - - AJSC_HOME - ${runAjscHome} - - - CONFIG_HOME - ${basedir}/appconfig-local/ - - - AJSC_CONF_HOME - ${basedir}/bundleconfig-local - - - logback.configurationFile - ${basedir}/ajsc-shared-config/etc/logback.xml - - - AJSC_SHARED_CONFIG - ${basedir}/ajsc-shared-config - - - - AJSC_EXTERNAL_LIB_FOLDERS - ${basedir}/target/commonLibs - - - AJSC_EXTERNAL_PROPERTIES_FOLDERS - ${basedir}/ajsc-shared-config/etc - - - AJSC_SERVICE_NAMESPACE - ${module.ajsc.namespace.name} - - - AJSC_SERVICE_VERSION - ${module.ajsc.namespace.version} - - - SOACLOUD_SERVICE_VERSION - ${project.version} - - - server.port - ${serverPort} - - - - - - context=// - port=${serverPort} - sslport=${sslport} - - - - - - java - - - - com.att.ajsc - ajsc-runner - ${ajscRuntimeVersion} - - - - - - - + + + central + Maven 2 repository 2 + http://repo2.maven.org/maven2/ + + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}/content/repositories/releases/ + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}/content/repositories/snapshots/ + + + ecomp-staging + ECOMP Staging Repository + ${nexusproxy}/content/repositories/staging/ + + + model-loader + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + true + + + + + repackage + + + + org.apache.maven.plugins maven-resources-plugin @@ -444,6 +261,30 @@ + + com.mycila + license-maven-plugin + 3.0 + +

License.txt
+ + src/main/java/** + src/test/java/** + version/properties + pom.xml + + true + + + + + + check + + process-sources + + + com.spotify docker-maven-plugin @@ -459,66 +300,6 @@ true - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - -noverify ${argLine} - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.3 - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - - - checkstyle - - - - - - - - - - - com.mycila - license-maven-plugin - 3.0 - -
License.txt
- - src/main/java/** - src/test/java/** - -
- - - - format - - process-sources - - -
- org.apache.maven.plugins maven-deploy-plugin @@ -526,43 +307,6 @@ true - - org.codehaus.mojo - sonar-maven-plugin - 3.2 - - - org.jacoco - jacoco-maven-plugin - ${version.jacoco.maven.plugin} - - - jacoco-initialize-unit-tests - - prepare-agent - - - - report - package - - report - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - ${nexusproxy} - 176c31dfe190a - ecomp-staging - - - diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh index f7b20c4..038f4df 100644 --- a/src/main/bin/start.sh +++ b/src/main/bin/start.sh @@ -4,7 +4,7 @@ # org.onap.aai # =================================================================== # Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs +# Copyright © 2017-2018 European Software Marketing Ltd. # =================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,27 +20,37 @@ # ============LICENSE_END============================================ #******************************************************************************* -BASEDIR="/opt/app/model-loader/" -AJSC_HOME="$BASEDIR" +# AJSC_HOME is required for EELF logging. +# This path is referenced in the file logback.xml. +AJSC_HOME="${AJSC_HOME-/opt/app/model-loader}" if [ -z "$CONFIG_HOME" ]; then - echo "CONFIG_HOME must be set in order to start up process" - exit 1 + echo "CONFIG_HOME must be set in order to start up the process" + echo "The expected value is a folder containing the model-loader.properties file" + exit 1 fi -CLASSPATH="$AJSC_HOME/lib/*" -CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/" -CLASSPATH="$CLASSPATH:$AJSC_HOME/etc/" +JARFILE="$AJSC_HOME/model-loader.jar" + +# Some properties are repeated here for debugging purposes. PROPS="-DAJSC_HOME=$AJSC_HOME" -PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/" -PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml" -PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME" -PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=model-loader" -PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1" -PROPS="$PROPS -Dserver.port=9500" PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" +PROPS="$PROPS -Dcom.att.eelf.logging.path=$AJSC_HOME" +PROPS="$PROPS -Dcom.att.eelf.logging.file=logback.xml" +PROPS="$PROPS -Dlogback.configurationFile=$AJSC_HOME/logback.xml" +PROPS="$PROPS -Dserver.port=9500" JVM_MAX_HEAP=${MAX_HEAP:-1024} -echo $CLASSPATH +if [ -z "${java_runtime_arguments}" ]; then + java_runtime_arguments="-Xms75m -Xmx${JVM_MAX_HEAP}m \ + -Dcom.sun.management.jmxremote \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote.ssl=false \ + -Dcom.sun.management.jmxremote.local.only=false \ + -Dcom.sun.management.jmxremote.port=1099 \ + -Dcom.sun.management.jmxremote.rmi.port=1099 \ + -Djava.rmi.server.hostname=127.0.0.1" +fi -exec java -Xmx${JVM_MAX_HEAP}m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=// port=9500 +echo "java $java_runtime_arguments $PROPS -jar $JARFILE" +java $java_runtime_arguments $PROPS -jar $JARFILE diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 9aafdda..db67dd9 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -2,20 +2,22 @@ FROM ubuntu:14.04 ARG MICRO_HOME=/opt/app/model-loader ARG BIN_HOME=$MICRO_HOME/bin +ARG JAR_FILE=model-loader.jar RUN apt-get update # Install and setup java8 RUN apt-get update && apt-get install -y software-properties-common -## sudo -E is required to preserve the environment. If you remove that line, it will most like freeze at this step +## sudo -E is required to preserve the environment. If you remove that line, it will most likely freeze at this step RUN sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk -## Setup JAVA_HOME, this is useful for docker commandline +## Set up JAVA_HOME for docker command-line ENV JAVA_HOME usr/lib/jvm/java-8-openjdk-amd64 RUN export JAVA_HOME # Build up the deployment folder structure RUN mkdir -p $MICRO_HOME -ADD swm/package/nix/dist_files/appl/model-loader/* $MICRO_HOME/ +COPY ${JAR_FILE} $MICRO_HOME/ +COPY classes/logback.xml $MICRO_HOME/ RUN mkdir -p $BIN_HOME COPY *.sh $BIN_HOME RUN chmod 755 $BIN_HOME/* diff --git a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java index 692f412..3f03bb5 100644 --- a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java +++ b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.config; @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Properties; import org.eclipse.jetty.util.security.Password; -import org.openecomp.sdc.api.consumer.IConfiguration; +import org.onap.sdc.api.consumer.IConfiguration; /** * Properties for the Model Loader @@ -33,267 +33,286 @@ import org.openecomp.sdc.api.consumer.IConfiguration; */ public class ModelLoaderConfig implements IConfiguration { - // Configuration file structure - public static final String PREFIX_MODEL_LOADER_CONFIG = "ml"; - public static final String PREFIX_DISTRIBUTION_CLIENT = PREFIX_MODEL_LOADER_CONFIG + ".distribution."; - public static final String PREFIX_AAI = PREFIX_MODEL_LOADER_CONFIG + ".aai."; - public static final String PREFIX_BABEL = PREFIX_MODEL_LOADER_CONFIG + ".babel."; - public static final String PREFIX_DEBUG = PREFIX_MODEL_LOADER_CONFIG + ".debug."; - - private static final String SUFFIX_KEYSTORE_FILE = "KEYSTORE_FILE"; - private static final String SUFFIX_KEYSTORE_PASS = "KEYSTORE_PASSWORD"; - - // Configuration file properties - protected static final String PROP_ML_DISTRIBUTION_ACTIVE_SERVER_TLS_AUTH = - PREFIX_DISTRIBUTION_CLIENT + "ACTIVE_SERVER_TLS_AUTH"; - protected static final String PROP_ML_DISTRIBUTION_ASDC_CONNECTION_DISABLED = PREFIX_DISTRIBUTION_CLIENT + "ASDC_CONNECTION_DISABLE"; - protected static final String PROP_ML_DISTRIBUTION_ASDC_ADDRESS = PREFIX_DISTRIBUTION_CLIENT + "ASDC_ADDRESS"; - protected static final String PROP_ML_DISTRIBUTION_CONSUMER_GROUP = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_GROUP"; - protected static final String PROP_ML_DISTRIBUTION_CONSUMER_ID = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_ID"; - protected static final String PROP_ML_DISTRIBUTION_ENVIRONMENT_NAME = - PREFIX_DISTRIBUTION_CLIENT + "ENVIRONMENT_NAME"; - protected static final String PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD = - PREFIX_DISTRIBUTION_CLIENT + SUFFIX_KEYSTORE_PASS; - protected static final String PROP_ML_DISTRIBUTION_KEYSTORE_FILE = - PREFIX_DISTRIBUTION_CLIENT + SUFFIX_KEYSTORE_FILE; - protected static final String PROP_ML_DISTRIBUTION_PASSWORD = PREFIX_DISTRIBUTION_CLIENT + "PASSWORD"; - protected static final String PROP_ML_DISTRIBUTION_POLLING_INTERVAL = - PREFIX_DISTRIBUTION_CLIENT + "POLLING_INTERVAL"; - protected static final String PROP_ML_DISTRIBUTION_POLLING_TIMEOUT = PREFIX_DISTRIBUTION_CLIENT + "POLLING_TIMEOUT"; - protected static final String PROP_ML_DISTRIBUTION_USER = PREFIX_DISTRIBUTION_CLIENT + "USER"; - protected static final String PROP_ML_DISTRIBUTION_ARTIFACT_TYPES = PREFIX_DISTRIBUTION_CLIENT + "ARTIFACT_TYPES"; - protected static final String PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES = PREFIX_DISTRIBUTION_CLIENT + "MSG_BUS_ADDRESSES"; - protected static final String PROP_ML_DISTRIBUTION_HTTPS_WITH_DMAAP = - PREFIX_DISTRIBUTION_CLIENT + "USE_HTTPS_WITH_DMAAP"; - - protected static final String PROP_AAI_BASE_URL = PREFIX_AAI + "BASE_URL"; - protected static final String PROP_AAI_KEYSTORE_FILE = PREFIX_AAI + SUFFIX_KEYSTORE_FILE; - protected static final String PROP_AAI_KEYSTORE_PASSWORD = PREFIX_AAI + SUFFIX_KEYSTORE_PASS; - protected static final String PROP_AAI_MODEL_RESOURCE_URL = PREFIX_AAI + "MODEL_URL"; - protected static final String PROP_AAI_NAMED_QUERY_RESOURCE_URL = PREFIX_AAI + "NAMED_QUERY_URL"; - protected static final String PROP_AAI_VNF_IMAGE_RESOURCE_URL = PREFIX_AAI + "VNF_IMAGE_URL"; - protected static final String PROP_AAI_AUTHENTICATION_USER = PREFIX_AAI + "AUTH_USER"; - protected static final String PROP_AAI_AUTHENTICATION_PASSWORD = PREFIX_AAI + "AUTH_PASSWORD"; - - protected static final String PROP_BABEL_BASE_URL = PREFIX_BABEL + "BASE_URL"; - protected static final String PROP_BABEL_KEYSTORE_FILE = PREFIX_BABEL + SUFFIX_KEYSTORE_FILE; - protected static final String PROP_BABEL_KEYSTORE_PASSWORD = PREFIX_BABEL + SUFFIX_KEYSTORE_PASS; - protected static final String PROP_BABEL_GENERATE_RESOURCE_URL = PREFIX_BABEL + "GENERATE_ARTIFACTS_URL"; - - protected static final String PROP_DEBUG_INGEST_SIMULATOR = PREFIX_DEBUG + "INGEST_SIMULATOR"; - - private Properties modelLoaderProperties = null; - - private String certLocation = "."; - - private List artifactTypes = null; - - private List msgBusAddrs = null; - - private String modelVersion = null; - - - /** - * This is the class constructor. - * - * @param modelLoaderProperties properties needed to be configured for the model loader - * @param certLocation location of the certificate - */ - public ModelLoaderConfig(Properties modelLoaderProperties, String certLocation) { - this.modelLoaderProperties = modelLoaderProperties; - this.certLocation = certLocation; - - // Get list of artifacts - artifactTypes = new ArrayList<>(); - if (modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ARTIFACT_TYPES) != null) { - String[] artTypeList = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ARTIFACT_TYPES).split(","); - for (String artType : artTypeList) { - artifactTypes.add(artType); - } - } - - // Get list of message bus addresses - msgBusAddrs = new ArrayList<>(); - if (modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES) != null) { - String[] msgBusList = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES).split(","); - for (String addr : msgBusList) { - msgBusAddrs.add(addr); - } - } - } - - @Override - public boolean activateServerTLSAuth() { - String value = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ACTIVE_SERVER_TLS_AUTH); - return value == null ? false : Boolean.parseBoolean(value); - } - - @Override - public String getAsdcAddress() { - return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ASDC_ADDRESS); - } - - @Override - public String getConsumerGroup() { - return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_CONSUMER_GROUP); - } - - @Override - public String getConsumerID() { - return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_CONSUMER_ID); - } - - @Override - public String getEnvironmentName() { - return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ENVIRONMENT_NAME); - } - - @Override - public String getKeyStorePassword() { - return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD)); - } - - @Override - public String getKeyStorePath() { - return certLocation + modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_KEYSTORE_FILE); - } - - @Override - public String getPassword() { - return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_PASSWORD)); - } - - @Override - public int getPollingInterval() { - return Integer.parseInt(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_POLLING_INTERVAL)); - } - - @Override - public int getPollingTimeout() { - return Integer.parseInt(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_POLLING_TIMEOUT)); - } - - @Override - public List getRelevantArtifactTypes() { - return artifactTypes; - } - - @Override - public String getUser() { - return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_USER); - } - - @Override - public boolean isFilterInEmptyResources() { - return false; - } - - @Override - public Boolean isUseHttpsWithDmaap() { - String useHTTPS = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_HTTPS_WITH_DMAAP); - return useHTTPS == null ? false : Boolean.valueOf(useHTTPS); - } - - @Override - public List getMsgBusAddress() { - return msgBusAddrs; - } - - public String getAaiKeyStorePath() { - return certLocation + File.separator + modelLoaderProperties.getProperty(PROP_AAI_KEYSTORE_FILE); - } - - public String getBabelKeyStorePath() { - return certLocation + File.separator + modelLoaderProperties.getProperty(PROP_BABEL_KEYSTORE_FILE); - } - - public String getAaiKeyStorePassword() { - return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_AAI_KEYSTORE_PASSWORD)); - } - - public String getBabelKeyStorePassword() { - return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_BABEL_KEYSTORE_PASSWORD)); - } - - public String getAaiBaseUrl() { - return modelLoaderProperties.getProperty(PROP_AAI_BASE_URL); - } - - public String getBabelBaseUrl() { - return modelLoaderProperties.getProperty(PROP_BABEL_BASE_URL); - } - - public String getBabelGenerateArtifactsUrl() { - return modelLoaderProperties.getProperty(PROP_BABEL_GENERATE_RESOURCE_URL); - } - - public String getAaiModelUrl(String version) { - setModelVersion(version); - return updatePropertyOXMVersion(modelLoaderProperties, PROP_AAI_MODEL_RESOURCE_URL, version); - } - - public String getAaiNamedQueryUrl(String version) { - return updatePropertyOXMVersion(modelLoaderProperties, PROP_AAI_NAMED_QUERY_RESOURCE_URL, version); - } - - public String getAaiVnfImageUrl() { - return updatePropertyOXMVersion(modelLoaderProperties, PROP_AAI_VNF_IMAGE_RESOURCE_URL, getModelVersion()); - } - - public String getAaiAuthenticationUser() { - return modelLoaderProperties.getProperty(PROP_AAI_AUTHENTICATION_USER); - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - /** - * @return password for AAI authentication that has been reverse-engineered from its obfuscated form. - */ - public String getAaiAuthenticationPassword() { - String password = Password.deobfuscate(modelLoaderProperties.getProperty(PROP_AAI_AUTHENTICATION_PASSWORD)); - - if (password != null && password.isEmpty()) { - password = null; - } - - return password; - } - - /** - * @return a boolean value indicating whether the simulator is enabled. - */ - public boolean getIngestSimulatorEnabled() { - String propValue = modelLoaderProperties.getProperty(PROP_DEBUG_INGEST_SIMULATOR); - return propValue != null && "enabled".equalsIgnoreCase(propValue); - } - - /** - * @return a String value of the defined property with the oxm version - */ - private String updatePropertyOXMVersion(Properties modelLoaderProperties, String propertyName, String version) { - if (version != null) - return modelLoaderProperties.getProperty(propertyName).replace("v*", version); - else - return modelLoaderProperties.getProperty(propertyName); - } - - - - - /** - * @return a boolean value indicating whether model loader is connected to ASDC. - */ - public boolean getASDCConnectionDisabled(){ - String propValue = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ASDC_CONNECTION_DISABLED); - return propValue != null && "true".equalsIgnoreCase(propValue); - - } + // Configuration file structure + public static final String PREFIX_MODEL_LOADER_CONFIG = "ml"; + public static final String PREFIX_DISTRIBUTION_CLIENT = PREFIX_MODEL_LOADER_CONFIG + ".distribution."; + public static final String PREFIX_AAI = PREFIX_MODEL_LOADER_CONFIG + ".aai."; + public static final String PREFIX_BABEL = PREFIX_MODEL_LOADER_CONFIG + ".babel."; + public static final String PREFIX_DEBUG = PREFIX_MODEL_LOADER_CONFIG + ".debug."; + + private static final String SUFFIX_KEYSTORE_FILE = "KEYSTORE_FILE"; + private static final String SUFFIX_KEYSTORE_PASS = "KEYSTORE_PASSWORD"; + + // Configuration file properties + protected static final String PROP_ML_DISTRIBUTION_ACTIVE_SERVER_TLS_AUTH = + PREFIX_DISTRIBUTION_CLIENT + "ACTIVE_SERVER_TLS_AUTH"; + protected static final String PROP_ML_DISTRIBUTION_ASDC_CONNECTION_DISABLED = + PREFIX_DISTRIBUTION_CLIENT + "ASDC_CONNECTION_DISABLE"; + protected static final String PROP_ML_DISTRIBUTION_ASDC_ADDRESS = PREFIX_DISTRIBUTION_CLIENT + "ASDC_ADDRESS"; + protected static final String PROP_ML_DISTRIBUTION_CONSUMER_GROUP = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_GROUP"; + protected static final String PROP_ML_DISTRIBUTION_CONSUMER_ID = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_ID"; + protected static final String PROP_ML_DISTRIBUTION_ENVIRONMENT_NAME = + PREFIX_DISTRIBUTION_CLIENT + "ENVIRONMENT_NAME"; + protected static final String PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD = + PREFIX_DISTRIBUTION_CLIENT + SUFFIX_KEYSTORE_PASS; + protected static final String PROP_ML_DISTRIBUTION_KEYSTORE_FILE = + PREFIX_DISTRIBUTION_CLIENT + SUFFIX_KEYSTORE_FILE; + protected static final String PROP_ML_DISTRIBUTION_PASSWORD = PREFIX_DISTRIBUTION_CLIENT + "PASSWORD"; + protected static final String PROP_ML_DISTRIBUTION_POLLING_INTERVAL = + PREFIX_DISTRIBUTION_CLIENT + "POLLING_INTERVAL"; + protected static final String PROP_ML_DISTRIBUTION_POLLING_TIMEOUT = PREFIX_DISTRIBUTION_CLIENT + "POLLING_TIMEOUT"; + protected static final String PROP_ML_DISTRIBUTION_USER = PREFIX_DISTRIBUTION_CLIENT + "USER"; + protected static final String PROP_ML_DISTRIBUTION_ARTIFACT_TYPES = PREFIX_DISTRIBUTION_CLIENT + "ARTIFACT_TYPES"; + protected static final String PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES = + PREFIX_DISTRIBUTION_CLIENT + "MSG_BUS_ADDRESSES"; + protected static final String PROP_ML_DISTRIBUTION_HTTPS_WITH_DMAAP = + PREFIX_DISTRIBUTION_CLIENT + "USE_HTTPS_WITH_DMAAP"; + + protected static final String PROP_AAI_BASE_URL = PREFIX_AAI + "BASE_URL"; + protected static final String PROP_AAI_KEYSTORE_FILE = PREFIX_AAI + SUFFIX_KEYSTORE_FILE; + protected static final String PROP_AAI_KEYSTORE_PASSWORD = PREFIX_AAI + SUFFIX_KEYSTORE_PASS; + protected static final String PROP_AAI_MODEL_RESOURCE_URL = PREFIX_AAI + "MODEL_URL"; + protected static final String PROP_AAI_NAMED_QUERY_RESOURCE_URL = PREFIX_AAI + "NAMED_QUERY_URL"; + protected static final String PROP_AAI_VNF_IMAGE_RESOURCE_URL = PREFIX_AAI + "VNF_IMAGE_URL"; + protected static final String PROP_AAI_AUTHENTICATION_USER = PREFIX_AAI + "AUTH_USER"; + protected static final String PROP_AAI_AUTHENTICATION_PASSWORD = PREFIX_AAI + "AUTH_PASSWORD"; + + protected static final String PROP_BABEL_BASE_URL = PREFIX_BABEL + "BASE_URL"; + protected static final String PROP_BABEL_KEYSTORE_FILE = PREFIX_BABEL + SUFFIX_KEYSTORE_FILE; + protected static final String PROP_BABEL_KEYSTORE_PASSWORD = PREFIX_BABEL + SUFFIX_KEYSTORE_PASS; + protected static final String PROP_BABEL_GENERATE_RESOURCE_URL = PREFIX_BABEL + "GENERATE_ARTIFACTS_URL"; + + protected static final String PROP_DEBUG_INGEST_SIMULATOR = PREFIX_DEBUG + "INGEST_SIMULATOR"; + private static String configHome; + + private Properties modelLoaderProperties = null; + + private String certLocation = "."; + + private List artifactTypes = null; + + private List msgBusAddrs = null; + + private String modelVersion = null; + + protected static final String FILESEP = + (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); + + public static void setConfigHome(String configHome) { + ModelLoaderConfig.configHome = configHome; + } + + public static String propertiesFile() { + return configHome + FILESEP + "model-loader.properties"; + } + + public ModelLoaderConfig(Properties configProperties) { + this(configProperties, ModelLoaderConfig.configHome + FILESEP + "auth" + FILESEP); + } + + /** + * Original constructor + * + * @param modelLoaderProperties properties needed to be configured for the model loader + * @param certLocation location of the certificate + */ + public ModelLoaderConfig(Properties modelLoaderProperties, String certLocation) { + this.modelLoaderProperties = modelLoaderProperties; + this.certLocation = certLocation; + + // Get list of artifacts + artifactTypes = new ArrayList<>(); + if (modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ARTIFACT_TYPES) != null) { + String[] artTypeList = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ARTIFACT_TYPES).split(","); + for (String artType : artTypeList) { + artifactTypes.add(artType); + } + } + + // Get list of message bus addresses + msgBusAddrs = new ArrayList<>(); + if (modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES) != null) { + String[] msgBusList = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES).split(","); + for (String addr : msgBusList) { + msgBusAddrs.add(addr); + } + } + } + + + @Override + public boolean activateServerTLSAuth() { + String value = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ACTIVE_SERVER_TLS_AUTH); + return value == null ? false : Boolean.parseBoolean(value); + } + + @Override + public String getAsdcAddress() { + return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ASDC_ADDRESS); + } + + @Override + public String getConsumerGroup() { + return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_CONSUMER_GROUP); + } + + @Override + public String getConsumerID() { + return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_CONSUMER_ID); + } + + @Override + public String getEnvironmentName() { + return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ENVIRONMENT_NAME); + } + + @Override + public String getKeyStorePassword() { + return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD)); + } + + @Override + public String getKeyStorePath() { + return certLocation + modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_KEYSTORE_FILE); + } + + @Override + public String getPassword() { + return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_PASSWORD)); + } + + @Override + public int getPollingInterval() { + return Integer.parseInt(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_POLLING_INTERVAL)); + } + + @Override + public int getPollingTimeout() { + return Integer.parseInt(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_POLLING_TIMEOUT)); + } + + @Override + public List getRelevantArtifactTypes() { + return artifactTypes; + } + + @Override + public String getUser() { + return modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_USER); + } + + @Override + public boolean isFilterInEmptyResources() { + return false; + } + + @Override + public Boolean isUseHttpsWithDmaap() { + String useHTTPS = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_HTTPS_WITH_DMAAP); + return useHTTPS == null ? false : Boolean.valueOf(useHTTPS); + } + + @Override + public List getMsgBusAddress() { + return msgBusAddrs; + } + + public String getAaiKeyStorePath() { + return certLocation + File.separator + modelLoaderProperties.getProperty(PROP_AAI_KEYSTORE_FILE); + } + + public String getBabelKeyStorePath() { + String filename = modelLoaderProperties.getProperty(PROP_BABEL_KEYSTORE_FILE); + if (filename == null) { + return null; + } else { + return certLocation + File.separator + filename; + } + } + + public String getAaiKeyStorePassword() { + return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_AAI_KEYSTORE_PASSWORD)); + } + + public String getBabelKeyStorePassword() { + return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_BABEL_KEYSTORE_PASSWORD)); + } + + public String getAaiBaseUrl() { + return modelLoaderProperties.getProperty(PROP_AAI_BASE_URL); + } + + public String getBabelBaseUrl() { + return modelLoaderProperties.getProperty(PROP_BABEL_BASE_URL); + } + + public String getBabelGenerateArtifactsUrl() { + return modelLoaderProperties.getProperty(PROP_BABEL_GENERATE_RESOURCE_URL); + } + + public String getAaiModelUrl(String version) { + setModelVersion(version); + return updatePropertyOXMVersion(modelLoaderProperties, PROP_AAI_MODEL_RESOURCE_URL, version); + } + + public String getAaiNamedQueryUrl(String version) { + return updatePropertyOXMVersion(modelLoaderProperties, PROP_AAI_NAMED_QUERY_RESOURCE_URL, version); + } + public String getAaiVnfImageUrl() { + return updatePropertyOXMVersion(modelLoaderProperties, PROP_AAI_VNF_IMAGE_RESOURCE_URL, getModelVersion()); + } + + public String getAaiAuthenticationUser() { + return modelLoaderProperties.getProperty(PROP_AAI_AUTHENTICATION_USER); + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + /** + * @return password for AAI authentication that has been reverse-engineered from its obfuscated form. + */ + public String getAaiAuthenticationPassword() { + String password = Password.deobfuscate(modelLoaderProperties.getProperty(PROP_AAI_AUTHENTICATION_PASSWORD)); + + if (password != null && password.isEmpty()) { + password = null; + } + + return password; + } + + /** + * @return a boolean value indicating whether the simulator is enabled. + */ + public boolean getIngestSimulatorEnabled() { + String propValue = modelLoaderProperties.getProperty(PROP_DEBUG_INGEST_SIMULATOR); + return propValue != null && "enabled".equalsIgnoreCase(propValue); + } + + /** + * @return a String value of the defined property with the oxm version + */ + private String updatePropertyOXMVersion(Properties modelLoaderProperties, String propertyName, String version) { + if (version != null) + return modelLoaderProperties.getProperty(propertyName).replace("v*", version); + else + return modelLoaderProperties.getProperty(propertyName); + } + + /** + * @return a boolean value indicating whether model loader is connected to ASDC. + */ + public boolean getASDCConnectionDisabled() { + String propValue = modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_ASDC_CONNECTION_DISABLED); + return propValue != null && "true".equalsIgnoreCase(propValue); + + } } diff --git a/src/main/java/org/onap/aai/modelloader/entity/Artifact.java b/src/main/java/org/onap/aai/modelloader/entity/Artifact.java index 4c0e0f1..f576e24 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/Artifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/Artifact.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity; diff --git a/src/main/java/org/onap/aai/modelloader/entity/ArtifactHandler.java b/src/main/java/org/onap/aai/modelloader/entity/ArtifactHandler.java index 9e80e05..b1fed03 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/ArtifactHandler.java +++ b/src/main/java/org/onap/aai/modelloader/entity/ArtifactHandler.java @@ -1,27 +1,26 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity; import java.util.List; - import org.onap.aai.modelloader.config.ModelLoaderConfig; import org.onap.aai.modelloader.restclient.AaiRestClient; @@ -33,9 +32,8 @@ public abstract class ArtifactHandler { this.config = config; } - public abstract boolean pushArtifacts(List artifacts, String distributionId, List completedArtifacts, - AaiRestClient restClient); + public abstract boolean pushArtifacts(List artifacts, String distributionId, + List completedArtifacts, AaiRestClient restClient); - public abstract void rollback(List completedArtifacts, String distributionId, - AaiRestClient aaiClient); + public abstract void rollback(List completedArtifacts, String distributionId, AaiRestClient aaiClient); } diff --git a/src/main/java/org/onap/aai/modelloader/entity/ArtifactType.java b/src/main/java/org/onap/aai/modelloader/entity/ArtifactType.java index 6959936..a58c874 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/ArtifactType.java +++ b/src/main/java/org/onap/aai/modelloader/entity/ArtifactType.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity; diff --git a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifact.java index 3219625..a8f4e60 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifact.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.catalog; diff --git a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java index b224407..85be50b 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java +++ b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.catalog; diff --git a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java index 9459c49..c116abe 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java +++ b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.catalog; @@ -55,4 +55,4 @@ class VnfImageException extends Exception { return resultCode; } -} \ No newline at end of file +} diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java index 3c1152f..35c672a 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java @@ -1,29 +1,28 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; import java.util.HashSet; import java.util.List; import java.util.Set; - import org.onap.aai.modelloader.config.ModelLoaderConfig; import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.entity.ArtifactType; diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifactParser.java b/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifactParser.java index fd6af31..35405e6 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifactParser.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifactParser.java @@ -1,24 +1,23 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ - package org.onap.aai.modelloader.entity.model; import java.io.StringReader; @@ -30,12 +29,10 @@ import java.util.stream.Collector; import java.util.stream.IntStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; - import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.service.ModelLoaderMsgs; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java b/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java index 1426e82..a3f14ba 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java @@ -1,24 +1,23 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ - package org.onap.aai.modelloader.entity.model; /** diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/IModelArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/IModelArtifact.java index 5978b99..a3b0737 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/IModelArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/IModelArtifact.java @@ -1,24 +1,23 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ - package org.onap.aai.modelloader.entity.model; /** diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/IModelId.java b/src/main/java/org/onap/aai/modelloader/entity/model/IModelId.java index 9b635bf..41ac94b 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/IModelId.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/IModelId.java @@ -1,35 +1,34 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ - package org.onap.aai.modelloader.entity.model; /** - * Defines methods for c + * Defines methods for Model Id */ public interface IModelId { /** * This method is responsible for using the values in the supplied Pair to set the id of the model. * - * The definition of what the relationship will be is defined by the implementation. Some model ids would have + * The definition of what the relationship will be is defined by the implementation. Some model ids would have * single key/value pairs, others would have a composite key. * * Where the id of the model is a composite key multiple calls to this method will be required to successfully set diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java b/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java index 758a882..7287142 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java @@ -1,27 +1,26 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; import java.util.List; - import org.onap.aai.modelloader.entity.Artifact; @FunctionalInterface diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java index 896167a..154cda1 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; @@ -31,16 +31,14 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; - +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.modelloader.config.ModelLoaderConfig; +import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.entity.ArtifactType; import org.onap.aai.modelloader.restclient.AaiRestClient; import org.onap.aai.modelloader.service.ModelLoaderMsgs; -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.restclient.client.OperationResult; - import org.w3c.dom.Node; public class ModelArtifact extends AbstractModelArtifact { diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java index 157ac8d..626ca49 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java @@ -1,34 +1,33 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; import java.util.List; - +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.modelloader.config.ModelLoaderConfig; import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.entity.ArtifactHandler; import org.onap.aai.modelloader.restclient.AaiRestClient; import org.onap.aai.modelloader.service.ModelLoaderMsgs; -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; public class ModelArtifactHandler extends ArtifactHandler { @@ -45,7 +44,7 @@ public class ModelArtifactHandler extends ArtifactHandler { List sortedModelArtifacts; try { sortedModelArtifacts = modelSorter.sort(artifacts); - } catch (RuntimeException ex) { + } catch (BabelArtifactParsingException ex) { logger.error(ModelLoaderMsgs.DISTRIBUTION_EVENT_ERROR, "Unable to resolve models: " + ex.getMessage()); return false; } diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactParser.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactParser.java index 17bdd87..e687be0 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactParser.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactParser.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; @@ -25,12 +25,10 @@ import java.util.Objects; import java.util.stream.Collector; import java.util.stream.IntStream; import javax.xml.XMLConstants; - -import org.onap.aai.modelloader.entity.Artifact; -import org.onap.aai.modelloader.service.ModelLoaderMsgs; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; - +import org.onap.aai.modelloader.entity.Artifact; +import org.onap.aai.modelloader.service.ModelLoaderMsgs; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java index e8fcf3f..4c39975 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; @@ -30,7 +30,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import jline.internal.Log; - import org.onap.aai.modelloader.entity.Artifact; /** @@ -115,15 +114,14 @@ public class ModelSorter { * * @param originalList the list that needs to be sorted * @return a list of sorted models + * @throws BabelArtifactParsingException */ - public List sort(List originalList) { - - if (originalList.size() <= 1) { + public List sort(List originalList) throws BabelArtifactParsingException { + if (originalList == null || originalList.size() <= 1) { return originalList; } - Collection nodes = createNodes(originalList); - Collection sortedNodes = sortNodes(nodes); + Collection sortedNodes = sortNodes(createNodes(originalList)); List sortedModelsList = new ArrayList<>(sortedNodes.size()); for (Node node : sortedNodes) { @@ -188,8 +186,9 @@ public class ModelSorter { * * @param unsortedNodes the collection of nodes to be sorted * @return a sorted collection of the given nodes + * @throws BabelArtifactParsingException */ - private Collection sortNodes(Collection unsortedNodes) { + private Collection sortNodes(Collection unsortedNodes) throws BabelArtifactParsingException { // L <- Empty list that will contain the sorted elements List nodeList = new ArrayList<>(); @@ -233,7 +232,8 @@ public class ModelSorter { } } if (cycle) { - throw new RuntimeException("Circular dependency present between models, topological sort not possible"); + throw new BabelArtifactParsingException( + "Circular dependency present between models, topological sort not possible"); } return nodeList; diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java index 668a751..4df9879 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java @@ -1,37 +1,35 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; import java.util.List; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.modelloader.config.ModelLoaderConfig; +import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.entity.ArtifactType; import org.onap.aai.modelloader.restclient.AaiRestClient; import org.onap.aai.modelloader.service.ModelLoaderMsgs; -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; - -import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.restclient.client.OperationResult; public class NamedQueryArtifact extends AbstractModelArtifact { @@ -58,7 +56,8 @@ public class NamedQueryArtifact extends AbstractModelArtifact { } @Override - public boolean push(AaiRestClient aaiClient, ModelLoaderConfig config, String distId, List completedArtifacts) { + public boolean push(AaiRestClient aaiClient, ModelLoaderConfig config, String distId, + List completedArtifacts) { OperationResult getResponse = aaiClient.getResource(getNamedQueryUrl(config), distId, MediaType.APPLICATION_XML_TYPE); if ((getResponse == null) || (getResponse.getResultCode() != Response.Status.OK.getStatusCode())) { diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParser.java b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParser.java index 5b9488e..3a0eada 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParser.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParser.java @@ -1,32 +1,30 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; import java.util.List; - -import org.onap.aai.modelloader.entity.Artifact; -import org.onap.aai.modelloader.service.ModelLoaderMsgs; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; - +import org.onap.aai.modelloader.entity.Artifact; +import org.onap.aai.modelloader.service.ModelLoaderMsgs; import org.w3c.dom.Node; public class NamedQueryArtifactParser extends AbstractModelArtifactParser { @@ -44,15 +42,13 @@ public class NamedQueryArtifactParser extends AbstractModelArtifactParser { boolean valid = false; if (model != null) { - logger.info(ModelLoaderMsgs.DISTRIBUTION_EVENT, - "Named-Query parsed =====>>>> " + "Named-Query-UUID: " + ((NamedQueryArtifact) model) - .getNamedQueryUuid()); + logger.info(ModelLoaderMsgs.DISTRIBUTION_EVENT, "Named-Query parsed =====>>>> " + "Named-Query-UUID: " + + ((NamedQueryArtifact) model).getNamedQueryUuid()); modelList.add((NamedQueryArtifact) model); valid = true; } else { - logger.error(ModelLoaderMsgs.ARTIFACT_PARSE_ERROR, - "Unable to parse named-query artifact " + artifactName); + logger.error(ModelLoaderMsgs.ARTIFACT_PARSE_ERROR, "Unable to parse named-query artifact " + artifactName); } return valid; diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/Pair.java b/src/main/java/org/onap/aai/modelloader/entity/model/Pair.java index ede60eb..e6382b1 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/Pair.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/Pair.java @@ -1,24 +1,23 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ - package org.onap.aai.modelloader.entity.model; /** diff --git a/src/main/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractor.java b/src/main/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractor.java index 7dbc34f..0fde55c 100644 --- a/src/main/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractor.java +++ b/src/main/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractor.java @@ -1,30 +1,30 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.extraction; import java.util.ArrayList; import java.util.List; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IResourceInstance; /** * This class is responsible for extracting implementations of IArtifactInto from an implementation of diff --git a/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java b/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java index 5e6353f..36581df 100644 --- a/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java +++ b/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.extraction; diff --git a/src/main/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManager.java b/src/main/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManager.java index 6d75306..ca17261 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManager.java +++ b/src/main/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManager.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; @@ -27,9 +27,9 @@ import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.entity.catalog.VnfCatalogArtifactHandler; import org.onap.aai.modelloader.entity.model.ModelArtifactHandler; import org.onap.aai.modelloader.restclient.AaiRestClient; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; /** * This class is responsible for deploying model and catalog artifacts. diff --git a/src/main/java/org/onap/aai/modelloader/notification/ArtifactDownloadManager.java b/src/main/java/org/onap/aai/modelloader/notification/ArtifactDownloadManager.java index 3fa0b40..9dbe397 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/ArtifactDownloadManager.java +++ b/src/main/java/org/onap/aai/modelloader/notification/ArtifactDownloadManager.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; @@ -41,12 +41,12 @@ import org.onap.aai.modelloader.extraction.InvalidArchiveException; import org.onap.aai.modelloader.restclient.BabelServiceClient; import org.onap.aai.modelloader.restclient.BabelServiceClientFactory; import org.onap.aai.modelloader.service.ModelLoaderMsgs; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.results.IDistributionClientDownloadResult; -import org.openecomp.sdc.utils.ArtifactTypeEnum; -import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.results.IDistributionClientDownloadResult; +import org.onap.sdc.utils.ArtifactTypeEnum; +import org.onap.sdc.utils.DistributionActionResultEnum; /** * This class is responsible for downloading the artifacts from the ASDC. diff --git a/src/main/java/org/onap/aai/modelloader/notification/BabelArtifactConverter.java b/src/main/java/org/onap/aai/modelloader/notification/BabelArtifactConverter.java index 7eb562a..ad4eb7d 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/BabelArtifactConverter.java +++ b/src/main/java/org/onap/aai/modelloader/notification/BabelArtifactConverter.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; diff --git a/src/main/java/org/onap/aai/modelloader/notification/BasicStatusMsg.java b/src/main/java/org/onap/aai/modelloader/notification/BasicStatusMsg.java new file mode 100644 index 0000000..03f521e --- /dev/null +++ b/src/main/java/org/onap/aai/modelloader/notification/BasicStatusMsg.java @@ -0,0 +1,57 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.notification; + +import org.onap.sdc.api.consumer.IDistributionStatusMessageBasic; +import org.onap.sdc.utils.DistributionStatusEnum; + +public class BasicStatusMsg implements IDistributionStatusMessageBasic { + + private static final String COMPONENT_NAME = "AAI"; + protected DistributionStatusEnum status; + protected String distributionId; + protected String consumerId; + + @Override + public long getTimestamp() { + return System.currentTimeMillis(); + } + + @Override + public DistributionStatusEnum getStatus() { + return status; + } + + @Override + public String getDistributionID() { + return distributionId; + } + + @Override + public String getConsumerID() { + return consumerId; + } + + public String getComponentName() { + return COMPONENT_NAME; + } + +} diff --git a/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMessageBuilder.java b/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMessageBuilder.java index 5660ad0..c389945 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMessageBuilder.java +++ b/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMessageBuilder.java @@ -1,29 +1,29 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.consumer.IComponentDoneStatusMessage; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.IComponentDoneStatusMessage; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.utils.DistributionStatusEnum; /** * This class is responsible for building an instance of {@link DistributionStatusMsg}. @@ -33,15 +33,16 @@ public class CompDoneStatusMessageBuilder { private CompDoneStatusMessageBuilder() {} /** - * Builds an instance of {@link CompDoneStatusMsg} from the given parameters about the status of the - * distribution of the given artifact. + * Builds an instance of {@link CompDoneStatusMsg} from the given parameters about the status of the distribution of + * the given artifact. * * @param client the distribution client this message pertains to * @param data data about the notification that resulted in this message being created * @param status the status of the distribution of the artifact to be reported * @return IComponentDoneStatusMessage implementation of IComponentDoneStatusMessage from the given parameters */ - public static IComponentDoneStatusMessage build(IDistributionClient client, INotificationData data, DistributionStatusEnum status) { + public static IComponentDoneStatusMessage build(IDistributionClient client, INotificationData data, + DistributionStatusEnum status) { return new CompDoneStatusMsg(status, data.getDistributionID(), client.getConfiguration().getConsumerID()); } } diff --git a/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMsg.java b/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMsg.java index db358f3..422052a 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMsg.java +++ b/src/main/java/org/onap/aai/modelloader/notification/CompDoneStatusMsg.java @@ -1,36 +1,32 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; -import org.openecomp.sdc.api.consumer.IComponentDoneStatusMessage; -import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.onap.sdc.api.consumer.IComponentDoneStatusMessage; +import org.onap.sdc.utils.DistributionStatusEnum; -public class CompDoneStatusMsg implements IComponentDoneStatusMessage { - - private DistributionStatusEnum status; - private String distributionId; - private String consumerId; +public class CompDoneStatusMsg extends BasicStatusMsg implements IComponentDoneStatusMessage { /** - * Creates a new DistributionStatusMsg instance. + * Creates a new Component Done Status Message instance. * * @param status - The distribution status to be reported. * @param distributionId - The identifier of the distribution who's status is being rported on. @@ -41,29 +37,4 @@ public class CompDoneStatusMsg implements IComponentDoneStatusMessage { this.distributionId = distributionId; this.consumerId = consumerId; } - - @Override - public long getTimestamp() { - return System.currentTimeMillis(); - } - - @Override - public DistributionStatusEnum getStatus() { - return status; - } - - @Override - public String getDistributionID() { - return distributionId; - } - - @Override - public String getConsumerID() { - return consumerId; - } - - @Override - public String getComponentName() { - return "AAI"; - } } diff --git a/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMessageBuilder.java b/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMessageBuilder.java index fcfd81c..91cd3de 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMessageBuilder.java +++ b/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMessageBuilder.java @@ -1,30 +1,30 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.consumer.IDistributionStatusMessage; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.IDistributionStatusMessage; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.utils.DistributionStatusEnum; /** * This class is responsible for building an instance of {@link DistributionStatusMsg}. @@ -58,9 +58,9 @@ public class DistributionStatusMessageBuilder { * @param status the status of the distribution of the artifact to be reported * @return IDistributionStatusMessage implementation of IDistributionStatusMsg from the given parameters */ - public static IDistributionStatusMessage build(IDistributionClient client, - INotificationData data, DistributionStatusEnum status) { - return new DistributionStatusMsg(status, data.getDistributionID(), - client.getConfiguration().getConsumerID(), ""); + public static IDistributionStatusMessage build(IDistributionClient client, INotificationData data, + DistributionStatusEnum status) { + return new DistributionStatusMsg(status, data.getDistributionID(), client.getConfiguration().getConsumerID(), + ""); } } diff --git a/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMsg.java b/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMsg.java index cc9fb0b..0a2d6a9 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMsg.java +++ b/src/main/java/org/onap/aai/modelloader/notification/DistributionStatusMsg.java @@ -1,73 +1,50 @@ -/** - * ============LICENSE_START========================================== - * org.onap.aai - * =================================================================== - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ -package org.onap.aai.modelloader.notification; - -import org.openecomp.sdc.api.consumer.IDistributionStatusMessage; -import org.openecomp.sdc.utils.DistributionStatusEnum; - -public class DistributionStatusMsg implements IDistributionStatusMessage { - - private DistributionStatusEnum status; - private String distributionId; - private String consumerId; - private String artifactUrl; - - /** - * Creates a new DistributionStatusMsg instance. - * - * @param status - The distribution status to be reported. - * @param distributionId - The identifier of the distribution who's status is being rported on. - * @param consumerId - Identifier of the consumer associated with the distribution. - * @param artifactUrl - Resource identifier for the artifact. - */ - public DistributionStatusMsg(DistributionStatusEnum status, String distributionId, String consumerId, - String artifactUrl) { - this.status = status; - this.distributionId = distributionId; - this.consumerId = consumerId; - this.artifactUrl = artifactUrl; - } - - @Override - public long getTimestamp() { - return System.currentTimeMillis(); - } - - @Override - public DistributionStatusEnum getStatus() { - return status; - } - - @Override - public String getDistributionID() { - return distributionId; - } - - @Override - public String getConsumerID() { - return consumerId; - } - - @Override - public String getArtifactURL() { - return artifactUrl; - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.notification; + +import org.onap.sdc.api.consumer.IDistributionStatusMessage; +import org.onap.sdc.utils.DistributionStatusEnum; + +public class DistributionStatusMsg extends BasicStatusMsg implements IDistributionStatusMessage { + + private String artifactUrl; + + /** + * Creates a new Distribution Status Message instance. + * + * @param status - The distribution status to be reported. + * @param distributionId - The identifier of the distribution who's status is being rported on. + * @param consumerId - Identifier of the consumer associated with the distribution. + * @param artifactUrl - Resource identifier for the artifact. + */ + public DistributionStatusMsg(DistributionStatusEnum status, String distributionId, String consumerId, + String artifactUrl) { + this.status = status; + this.distributionId = distributionId; + this.consumerId = consumerId; + this.artifactUrl = artifactUrl; + } + + @Override + public String getArtifactURL() { + return artifactUrl; + } +} diff --git a/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java b/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java index 73a191a..d39330f 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java +++ b/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; diff --git a/src/main/java/org/onap/aai/modelloader/notification/EventCallback.java b/src/main/java/org/onap/aai/modelloader/notification/EventCallback.java index fe6bf7b..2baa217 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/EventCallback.java +++ b/src/main/java/org/onap/aai/modelloader/notification/EventCallback.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; @@ -30,10 +30,10 @@ import org.onap.aai.modelloader.entity.Artifact; import org.onap.aai.modelloader.extraction.ArtifactInfoExtractor; import org.onap.aai.modelloader.restclient.BabelServiceClientFactory; import org.onap.aai.modelloader.service.ModelLoaderMsgs; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.consumer.INotificationCallback; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.INotificationCallback; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; import org.slf4j.MDC; public class EventCallback implements INotificationCallback { @@ -76,6 +76,7 @@ public class EventCallback implements INotificationCallback { if (artifactDeploymentManager == null) { artifactDeploymentManager = new ArtifactDeploymentManager(client, config); } + return artifactDeploymentManager; } diff --git a/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java b/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java index 447e817..967a290 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java +++ b/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; @@ -31,12 +31,12 @@ import org.onap.aai.cl.mdc.MdcContext; import org.onap.aai.cl.mdc.MdcOverride; import org.onap.aai.modelloader.config.ModelLoaderConfig; import org.onap.aai.modelloader.service.ModelLoaderMsgs; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.utils.DistributionActionResultEnum; -import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.utils.DistributionStatusEnum; /** * This class is responsible for publishing the status of actions performed working with artifacts. @@ -46,24 +46,18 @@ class NotificationPublisher { private static Logger logger = LoggerFactory.getInstance().getLogger(NotificationPublisher.class); private static Logger metricsLogger = LoggerFactory.getInstance().getMetricsLogger(NotificationPublisher.class); - protected static final String FILESEP = - (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); - protected static final String CONFIG_DIR = System.getProperty("CONFIG_HOME") + FILESEP; - protected static final String CONFIG_AUTH_LOCATION = CONFIG_DIR + "auth" + FILESEP; - protected static final String CONFIG_FILE = CONFIG_DIR + "model-loader.properties"; - private boolean publishingEnabled; public NotificationPublisher() { Properties configProperties = new Properties(); try { - configProperties.load(new FileInputStream(CONFIG_FILE)); + configProperties.load(new FileInputStream(ModelLoaderConfig.propertiesFile())); } catch (IOException e) { String errorMsg = "Failed to load configuration: " + e.getMessage(); logger.error(ModelLoaderMsgs.DISTRIBUTION_EVENT_ERROR, e, errorMsg); } - ModelLoaderConfig config = new ModelLoaderConfig(configProperties, CONFIG_AUTH_LOCATION); + ModelLoaderConfig config = new ModelLoaderConfig(configProperties); publishingEnabled = !config.getASDCConnectionDisabled(); } diff --git a/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java b/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java index 6678af6..0d082c1 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java +++ b/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; diff --git a/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java b/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java index 28cd671..5576ea9 100644 --- a/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java +++ b/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.restclient; diff --git a/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClient.java b/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClient.java index a861580..fa677a9 100644 --- a/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClient.java +++ b/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClient.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.restclient; @@ -173,7 +173,8 @@ public class BabelServiceClient { .post(ClientResponse.class, obj.toString()); String sanitizedJson = JsonSanitizer.sanitize(response.getEntity(String.class)); - logger.debug(ModelLoaderMsgs.DISTRIBUTION_EVENT, "Babel response " + response.getStatus() + " " + sanitizedJson); + logger.debug(ModelLoaderMsgs.DISTRIBUTION_EVENT, + "Babel response " + response.getStatus() + " " + sanitizedJson); if (response.getStatus() != Response.Status.OK.getStatusCode()) { throw new BabelServiceException(sanitizedJson); diff --git a/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientFactory.java b/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientFactory.java index 6ce4a60..4354710 100644 --- a/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientFactory.java +++ b/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientFactory.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.restclient; diff --git a/src/main/java/org/onap/aai/modelloader/service/ArtifactInfoImpl.java b/src/main/java/org/onap/aai/modelloader/service/ArtifactInfoImpl.java index e32d92c..9af92be 100644 --- a/src/main/java/org/onap/aai/modelloader/service/ArtifactInfoImpl.java +++ b/src/main/java/org/onap/aai/modelloader/service/ArtifactInfoImpl.java @@ -1,37 +1,38 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.service; import java.util.Collections; -import org.openecomp.sdc.api.notification.IArtifactInfo; +import java.util.List; +import org.onap.sdc.api.notification.IArtifactInfo; /** * This class is an implementation of IArtifactInfo for test purposes. */ public class ArtifactInfoImpl implements IArtifactInfo { - private java.lang.String artifactName; - private java.lang.String artifactType; - private java.lang.String artifactDescription; - private java.lang.String artifactVersion; + private String artifactName; + private String artifactType; + private String artifactDescription; + private String artifactVersion; @Override public String getArtifactName() { @@ -95,7 +96,7 @@ public class ArtifactInfoImpl implements IArtifactInfo { } @Override - public java.util.List getRelatedArtifacts() { + public List getRelatedArtifacts() { return Collections.emptyList(); } diff --git a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderApplication.java b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderApplication.java new file mode 100644 index 0000000..c0eb5f2 --- /dev/null +++ b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderApplication.java @@ -0,0 +1,37 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.service; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Model Loader Spring Boot Application. + */ + +@SpringBootApplication +public class ModelLoaderApplication { + + public static void main(String[] args) { + SpringApplication.run(ModelLoaderApplication.class, args); + } + +} diff --git a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderInterface.java b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderInterface.java index 1b466c8..6796090 100644 --- a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderInterface.java +++ b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderInterface.java @@ -1,49 +1,45 @@ -/** - * ============LICENSE_START========================================== - * org.onap.aai - * =================================================================== - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ -package org.onap.aai.modelloader.service; - -import java.io.IOException; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -public interface ModelLoaderInterface { - - @GET - @Path("/loadModel/{modelid}") - public Response loadModel(@PathParam("modelid") String modelid); - - @PUT - @Path("/saveModel/{modelid}/{modelname}") - public Response saveModel(@PathParam("modelid") String modelid, @PathParam("modelname") String modelname); - - @POST - @Consumes("text/plain") - @Produces("application/xml") - @Path("/ingestModel/{modelName}/{modelVersion}") - public Response ingestModel(@PathParam("modelName") String modelid, @PathParam("modelVersion") String modelVersion, - String payload) throws IOException; -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.service; + +import java.io.IOException; +import javax.ws.rs.core.Response; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +public interface ModelLoaderInterface { + + @RequestMapping(value = "/loadModel/{modelid}", // + method = RequestMethod.GET, produces = "application/json") + @ResponseBody + public Response loadModel(String modelid); + + @RequestMapping(value = "/saveModel/{modelid}/{modelname}", // + method = RequestMethod.PUT, produces = "application/json") + @ResponseBody + public Response saveModel(String modelid, String modelname); + + @RequestMapping(value = "/ingestModel/{modelName}/{modelVersion}", // + method = RequestMethod.POST, produces = "application/json") + @ResponseBody + public Response ingestModel(String modelid, String modelVersion, String payload) throws IOException; +} diff --git a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderMsgs.java b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderMsgs.java index c5f00c0..fd39a9a 100644 --- a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderMsgs.java +++ b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderMsgs.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.service; @@ -74,7 +74,7 @@ public enum ModelLoaderMsgs implements LogMessageEnum { * Arguments: {0} = request type. {1} = endpoint. {2} = error message. */ BABEL_REST_REQUEST_ERROR, - + /** * Arguments: {0} = info request payload. **/ diff --git a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderService.java b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderService.java index a4cc5d1..06d6e30 100644 --- a/src/main/java/org/onap/aai/modelloader/service/ModelLoaderService.java +++ b/src/main/java/org/onap/aai/modelloader/service/ModelLoaderService.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.service; @@ -29,9 +29,8 @@ import java.util.List; import java.util.Properties; import java.util.Timer; import java.util.TimerTask; - +import javax.annotation.PostConstruct; import javax.ws.rs.core.Response; - import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.modelloader.config.ModelLoaderConfig; @@ -40,53 +39,54 @@ import org.onap.aai.modelloader.notification.ArtifactDeploymentManager; import org.onap.aai.modelloader.notification.ArtifactDownloadManager; import org.onap.aai.modelloader.notification.EventCallback; import org.onap.aai.modelloader.restclient.BabelServiceClientFactory; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.impl.DistributionClientFactory; -import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.impl.DistributionClientFactory; +import org.onap.sdc.utils.DistributionActionResultEnum; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * Service class in charge of managing the negotiating model loading capabilities between AAI and an ASDC. */ +@RestController +@RequestMapping("/services/model-loader/v1/model-service") public class ModelLoaderService implements ModelLoaderInterface { + static Logger logger = LoggerFactory.getInstance().getLogger(ModelLoaderService.class.getName()); + protected static final String FILESEP = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); - protected static final String CONFIG_DIR = System.getProperty("CONFIG_HOME") + FILESEP; - protected static final String CONFIG_AUTH_LOCATION = CONFIG_DIR + "auth" + FILESEP; - protected static final String CONFIG_FILE = CONFIG_DIR + "model-loader.properties"; - + @Value("${CONFIG_HOME}") + private String configDir; private IDistributionClient client; private ModelLoaderConfig config; - static Logger logger = LoggerFactory.getInstance().getLogger(ModelLoaderService.class.getName()); - /** * Responsible for loading configuration files and calling initialization. */ - public ModelLoaderService() { - start(); - } - + @PostConstruct protected void start() { // Load model loader system configuration logger.info(ModelLoaderMsgs.LOADING_CONFIGURATION); + ModelLoaderConfig.setConfigHome(configDir); Properties configProperties = new Properties(); try { - configProperties.load(new FileInputStream(CONFIG_FILE)); + configProperties.load(new FileInputStream(configDir + FILESEP + "model-loader.properties")); + config = new ModelLoaderConfig(configProperties); + if (!config.getASDCConnectionDisabled()) { + initSdcClient(); + } } catch (IOException e) { String errorMsg = "Failed to load configuration: " + e.getMessage(); logger.error(ModelLoaderMsgs.ASDC_CONNECTION_ERROR, errorMsg); - shutdown(); } - - config = new ModelLoaderConfig(configProperties, CONFIG_AUTH_LOCATION); - init(); - - Runtime.getRuntime().addShutdownHook(new Thread(this::preShutdownOperations)); } /** @@ -102,18 +102,28 @@ public class ModelLoaderService implements ModelLoaderInterface { /** * Responsible for loading configuration files, initializing model distribution clients, and starting them. */ - protected void init() { - if (!config.getASDCConnectionDisabled()) { - // Initialize distribution client - logger.debug(ModelLoaderMsgs.INITIALIZING, "Initializing distribution client..."); - client = DistributionClientFactory.createDistributionClient(); - EventCallback callback = new EventCallback(client, config); - - IDistributionClientResult initResult = client.init(config, callback); - - if (initResult.getDistributionActionResult() != DistributionActionResultEnum.SUCCESS) { - String errorMsg = - "Failed to initialize distribution client: " + initResult.getDistributionMessageResult(); + protected void initSdcClient() { + // Initialize distribution client + logger.debug(ModelLoaderMsgs.INITIALIZING, "Initializing distribution client..."); + client = DistributionClientFactory.createDistributionClient(); + EventCallback callback = new EventCallback(client, config); + + IDistributionClientResult initResult = client.init(config, callback); + + if (initResult.getDistributionActionResult() != DistributionActionResultEnum.SUCCESS) { + String errorMsg = "Failed to initialize distribution client: " + initResult.getDistributionMessageResult(); + logger.error(ModelLoaderMsgs.ASDC_CONNECTION_ERROR, errorMsg); + + // Kick off a timer to retry the SDC connection + Timer timer = new Timer(); + TimerTask task = new SdcConnectionJob(client, config, callback, timer); + timer.schedule(task, new Date(), 60000); + } else { + // Start distribution client + logger.debug(ModelLoaderMsgs.INITIALIZING, "Starting distribution client..."); + IDistributionClientResult startResult = client.start(); + if (startResult.getDistributionActionResult() != DistributionActionResultEnum.SUCCESS) { + String errorMsg = "Failed to start distribution client: " + startResult.getDistributionMessageResult(); logger.error(ModelLoaderMsgs.ASDC_CONNECTION_ERROR, errorMsg); // Kick off a timer to retry the SDC connection @@ -121,41 +131,10 @@ public class ModelLoaderService implements ModelLoaderInterface { TimerTask task = new SdcConnectionJob(client, config, callback, timer); timer.schedule(task, new Date(), 60000); } else { - // Start distribution client - logger.debug(ModelLoaderMsgs.INITIALIZING, "Starting distribution client..."); - IDistributionClientResult startResult = client.start(); - if (startResult.getDistributionActionResult() != DistributionActionResultEnum.SUCCESS) { - String errorMsg = - "Failed to start distribution client: " + startResult.getDistributionMessageResult(); - logger.error(ModelLoaderMsgs.ASDC_CONNECTION_ERROR, errorMsg); - - // Kick off a timer to retry the SDC connection - Timer timer = new Timer(); - TimerTask task = new SdcConnectionJob(client, config, callback, timer); - timer.schedule(task, new Date(), 60000); - } else { - logger.info(ModelLoaderMsgs.INITIALIZING, "Connection to SDC established"); - } + logger.info(ModelLoaderMsgs.INITIALIZING, "Connection to SDC established"); } } - } - - /** - * Shut down the process. - */ - private void shutdown() { - preShutdownOperations(); - - // TODO: Find a better way to shut down the model loader. - try { - // Give logs time to write to file - Thread.sleep(2000); - } catch (InterruptedException e) { // NOSONAR - // Nothing we can do at this point - logger.debug(e.getMessage()); - } - - Runtime.getRuntime().halt(1); + Runtime.getRuntime().addShutdownHook(new Thread(this::preShutdownOperations)); } /** @@ -164,7 +143,7 @@ public class ModelLoaderService implements ModelLoaderInterface { * @see org.onap.aai.modelloader.service.ModelLoaderInterface#loadModel(java.lang.String) */ @Override - public Response loadModel(String modelid) { + public Response loadModel(@PathVariable String modelid) { return Response.ok("{\"model_loaded\":\"" + modelid + "\"}").build(); } @@ -174,12 +153,13 @@ public class ModelLoaderService implements ModelLoaderInterface { * @see org.onap.aai.modelloader.service.ModelLoaderInterface#saveModel(java.lang.String, java.lang.String) */ @Override - public Response saveModel(String modelid, String modelname) { + public Response saveModel(@PathVariable String modelid, @PathVariable String modelname) { return Response.ok("{\"model_saved\":\"" + modelid + "-" + modelname + "\"}").build(); } @Override - public Response ingestModel(String modelName, String modelVersion, String payload) throws IOException { + public Response ingestModel(@PathVariable String modelName, @PathVariable String modelVersion, + @RequestBody String payload) throws IOException { boolean success; if (config.getIngestSimulatorEnabled()) { diff --git a/src/main/java/org/onap/aai/modelloader/service/NotificationDataImpl.java b/src/main/java/org/onap/aai/modelloader/service/NotificationDataImpl.java index 28611ff..536aa4a 100644 --- a/src/main/java/org/onap/aai/modelloader/service/NotificationDataImpl.java +++ b/src/main/java/org/onap/aai/modelloader/service/NotificationDataImpl.java @@ -1,30 +1,30 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.service; import java.util.Collections; import java.util.List; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IResourceInstance; public class NotificationDataImpl implements INotificationData { diff --git a/src/main/java/org/onap/aai/modelloader/service/SdcConnectionJob.java b/src/main/java/org/onap/aai/modelloader/service/SdcConnectionJob.java index d30e6dd..82e0bc6 100644 --- a/src/main/java/org/onap/aai/modelloader/service/SdcConnectionJob.java +++ b/src/main/java/org/onap/aai/modelloader/service/SdcConnectionJob.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.service; @@ -26,9 +26,9 @@ import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.modelloader.config.ModelLoaderConfig; import org.onap.aai.modelloader.notification.EventCallback; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.utils.DistributionActionResultEnum; public class SdcConnectionJob extends TimerTask { static Logger logger = LoggerFactory.getInstance().getLogger(SdcConnectionJob.class.getName()); diff --git a/src/main/java/org/onap/aai/modelloader/util/JsonXmlConverter.java b/src/main/java/org/onap/aai/modelloader/util/JsonXmlConverter.java index a5a7bc5..48a33b5 100644 --- a/src/main/java/org/onap/aai/modelloader/util/JsonXmlConverter.java +++ b/src/main/java/org/onap/aai/modelloader/util/JsonXmlConverter.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.util; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..4ea6f0a --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,20 @@ +# Note that the start.sh script sets the following System Properties +# We provide default values here for testing purposes +AJSC_HOME=. +CONFIG_HOME=appconfig-local +com.att.eelf.logging.path=src/main/resources +com.att.eelf.logging.file=logback.xml +logback.configurationFile=${com.att.eelf.logging.path}/${com.att.eelf.logging.file} + +server.port=9500 +#server.ssl.key-store= +#server.ssl.key-store-password= +#server.ssl.keyStoreType= +#server.ssl.keyAlias= + +server.tomcat.max-threads=200 +# The minimum number of threads always kept alive +server.tomcat.min-spare-threads=25 + +# Spring Boot logging +logging.config=${logback.configurationFile} diff --git a/ajsc-shared-config/etc/logback.xml b/src/main/resources/logback.xml similarity index 96% rename from ajsc-shared-config/etc/logback.xml rename to src/main/resources/logback.xml index 68c805e..6b7c2c1 100644 --- a/ajsc-shared-config/etc/logback.xml +++ b/src/main/resources/logback.xml @@ -1,12 +1,5 @@ - - - - - - diff --git a/src/main/resources/org/onap/aai/modelloader/service/ModelLoaderMsgs.properties b/src/main/resources/org/onap/aai/modelloader/service/ModelLoaderMsgs.properties index 112b48c..1e5658c 100644 --- a/src/main/resources/org/onap/aai/modelloader/service/ModelLoaderMsgs.properties +++ b/src/main/resources/org/onap/aai/modelloader/service/ModelLoaderMsgs.properties @@ -3,7 +3,7 @@ # org.onap.aai # =================================================================== # Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 Amdocs +# Copyright © 2017-2018 European Software Marketing Ltd. # =================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/test/java/org/onap/aai/modelloader/config/ModelLoaderConfigTest.java b/src/test/java/org/onap/aai/modelloader/config/ModelLoaderConfigTest.java index 1b6b847..e8060e2 100644 --- a/src/test/java/org/onap/aai/modelloader/config/ModelLoaderConfigTest.java +++ b/src/test/java/org/onap/aai/modelloader/config/ModelLoaderConfigTest.java @@ -1,193 +1,192 @@ -/** - * ============LICENSE_START========================================== - * org.onap.aai - * =================================================================== - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ -package org.onap.aai.modelloader.config; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.List; -import java.util.Properties; - -import org.eclipse.jetty.util.security.Password; -import org.junit.Test; -import org.onap.aai.modelloader.restclient.AaiRestClient; -import org.openecomp.sdc.utils.ArtifactTypeEnum; - -/** - * Tests for ModelLoaderConfig class - * - */ -public class ModelLoaderConfigTest { - - @Test - public void testYangModelArtifactType() { - Properties props = new Properties(); - props.setProperty("ml.distribution.ARTIFACT_TYPES", "MODEL_INVENTORY_PROFILE,MODEL_QUERY_SPEC,VNF_CATALOG"); - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - - List types = config.getRelevantArtifactTypes(); - - System.out.println("ArtifactType: " + types.get(0)); - assertEquals(0, types.get(0).compareToIgnoreCase(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.toString())); - - System.out.println("ArtifactType: " + types.get(1)); - assertEquals(0, types.get(1).compareToIgnoreCase(ArtifactTypeEnum.MODEL_QUERY_SPEC.toString())); - - System.out.println("ArtifactType: " + types.get(2)); - assertEquals(0, types.get(2).compareToIgnoreCase(ArtifactTypeEnum.VNF_CATALOG.toString())); - - assertEquals(3, types.size()); - } - - @Test - public void testMsgBusAddrs() { - Properties props = new Properties(); - props.setProperty("ml.distribution.MSG_BUS_ADDRESSES", "host1.onap.com:3904,host2.onap.com:3904"); - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - - List addrs = config.getMsgBusAddress(); - - assertEquals(2, addrs.size()); - assertEquals(0, addrs.get(0).compareToIgnoreCase("host1.onap.com:3904")); - assertEquals(0, addrs.get(1).compareToIgnoreCase("host2.onap.com:3904")); - } - - @Test - public void testDecryptPassword() { - String password = "youshallnotpass"; - ModelLoaderConfig config = - createObfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_PASSWORD, password); - assertEquals(password, config.getPassword()); - } - - @Test - public void testDecryptKeystorePassword() { - String password = "youshallnotpass"; - ModelLoaderConfig config = - createObfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD, password); - assertEquals(password, config.getKeyStorePassword()); - } - - @Test - public void testDecryptAAIAuthenticationPassword() { - String password = "myvoiceismypassword"; - ModelLoaderConfig config = - createObfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_AUTHENTICATION_PASSWORD, password); - assertEquals(password, config.getAaiAuthenticationPassword()); - } - - @Test - public void testDecryptAAIKeystorePassword() { - String password = "myvoiceismypassword"; - ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_KEYSTORE_PASSWORD, password); - assertEquals(password, config.getAaiKeyStorePassword()); - } - - @Test - public void testAaiBaseUrl() { - String url = "http://localhost:1234/"; - Properties props = new Properties(); - props.put(ModelLoaderConfig.PROP_AAI_BASE_URL, url); - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - assertEquals(url, config.getAaiBaseUrl()); - } - - @Test - public void testDecryptBabelKeystorePassword() { - String password = "babelpassword"; - ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_BABEL_KEYSTORE_PASSWORD, password); - assertEquals(password, config.getBabelKeyStorePassword()); - } - - @Test - public void testBabelKeystorePath() { - String root = "path_to_keystore"; - String path = "relative_keystore_path"; - Properties props = new Properties(); - props.put(ModelLoaderConfig.PROP_BABEL_KEYSTORE_FILE, path); - ModelLoaderConfig config = new ModelLoaderConfig(props, root); - assertEquals(root + File.separator + path, config.getBabelKeyStorePath()); - } - - @Test - public void testBabelBaseUrl() { - String url = "http://localhost/"; - Properties props = new Properties(); - props.put(ModelLoaderConfig.PROP_BABEL_BASE_URL, url); - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - assertEquals(url, config.getBabelBaseUrl()); - } - - @Test - public void testBabelGenerateArtifactsUrl() { - String url = "/path/to/the/resource"; - Properties props = new Properties(); - props.put(ModelLoaderConfig.PROP_BABEL_GENERATE_RESOURCE_URL, url); - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - assertEquals(url, config.getBabelGenerateArtifactsUrl()); - } - - @Test - public void testNoAAIAuth() throws IOException { - - Properties props = new Properties(); - props.load(new FileInputStream("src/test/resources/model-loader-empty-auth-password.properties")); - - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - AaiRestClient aaiClient = new AaiRestClient(config); - - assertFalse("Empty AAI Password should result in no basic authentication", aaiClient.useBasicAuth()); - - props.load(new FileInputStream("src/test/resources/model-loader-no-auth-password.properties")); - config = new ModelLoaderConfig(props, null); - aaiClient = new AaiRestClient(config); - - assertFalse("No AAI Password should result in no basic authentication", aaiClient.useBasicAuth()); - } - - @Test - public void testGetUrls() { - Properties props = new Properties(); - props.put(ModelLoaderConfig.PROP_AAI_MODEL_RESOURCE_URL, "/aai/v*/service-design-and-creation/models/model/"); - props.put(ModelLoaderConfig.PROP_AAI_NAMED_QUERY_RESOURCE_URL, - "/aai/v*/service-design-and-creation/named-queries/named-query/"); - ModelLoaderConfig config = new ModelLoaderConfig(props, null); - - assertEquals("/aai/v9/service-design-and-creation/models/model/", config.getAaiModelUrl("v9")); - assertEquals("/aai/v10/service-design-and-creation/named-queries/named-query/", - config.getAaiNamedQueryUrl("v10")); - } - - - /** - * @param propertyName - * @param propertyValue - * @return a new ModelLoaderConfig object containing a single obfuscated property value - */ - private ModelLoaderConfig createObfuscatedTestConfig(String propertyName, String propertyValue) { - Properties props = new Properties(); - props.put(propertyName, Password.obfuscate(propertyValue)); - return new ModelLoaderConfig(props, null); - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.List; +import java.util.Properties; +import org.eclipse.jetty.util.security.Password; +import org.junit.Test; +import org.onap.aai.modelloader.restclient.AaiRestClient; +import org.onap.sdc.utils.ArtifactTypeEnum; + +/** + * Tests for ModelLoaderConfig class + * + */ +public class ModelLoaderConfigTest { + + @Test + public void testYangModelArtifactType() { + Properties props = new Properties(); + props.setProperty("ml.distribution.ARTIFACT_TYPES", "MODEL_INVENTORY_PROFILE,MODEL_QUERY_SPEC,VNF_CATALOG"); + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + + List types = config.getRelevantArtifactTypes(); + + System.out.println("ArtifactType: " + types.get(0)); + assertEquals(0, types.get(0).compareToIgnoreCase(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.toString())); + + System.out.println("ArtifactType: " + types.get(1)); + assertEquals(0, types.get(1).compareToIgnoreCase(ArtifactTypeEnum.MODEL_QUERY_SPEC.toString())); + + System.out.println("ArtifactType: " + types.get(2)); + assertEquals(0, types.get(2).compareToIgnoreCase(ArtifactTypeEnum.VNF_CATALOG.toString())); + + assertEquals(3, types.size()); + } + + @Test + public void testMsgBusAddrs() { + Properties props = new Properties(); + props.setProperty("ml.distribution.MSG_BUS_ADDRESSES", "host1.onap.com:3904,host2.onap.com:3904"); + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + + List addrs = config.getMsgBusAddress(); + + assertEquals(2, addrs.size()); + assertEquals(0, addrs.get(0).compareToIgnoreCase("host1.onap.com:3904")); + assertEquals(0, addrs.get(1).compareToIgnoreCase("host2.onap.com:3904")); + } + + @Test + public void testDecryptPassword() { + String password = "youshallnotpass"; + ModelLoaderConfig config = + createObfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_PASSWORD, password); + assertEquals(password, config.getPassword()); + } + + @Test + public void testDecryptKeystorePassword() { + String password = "youshallnotpass"; + ModelLoaderConfig config = + createObfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD, password); + assertEquals(password, config.getKeyStorePassword()); + } + + @Test + public void testDecryptAAIAuthenticationPassword() { + String password = "myvoiceismypassword"; + ModelLoaderConfig config = + createObfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_AUTHENTICATION_PASSWORD, password); + assertEquals(password, config.getAaiAuthenticationPassword()); + } + + @Test + public void testDecryptAAIKeystorePassword() { + String password = "myvoiceismypassword"; + ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_KEYSTORE_PASSWORD, password); + assertEquals(password, config.getAaiKeyStorePassword()); + } + + @Test + public void testAaiBaseUrl() { + String url = "http://localhost:1234/"; + Properties props = new Properties(); + props.put(ModelLoaderConfig.PROP_AAI_BASE_URL, url); + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + assertEquals(url, config.getAaiBaseUrl()); + } + + @Test + public void testDecryptBabelKeystorePassword() { + String password = "babelpassword"; + ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_BABEL_KEYSTORE_PASSWORD, password); + assertEquals(password, config.getBabelKeyStorePassword()); + } + + @Test + public void testBabelKeystorePath() { + String root = "path_to_keystore"; + String path = "relative_keystore_path"; + Properties props = new Properties(); + props.put(ModelLoaderConfig.PROP_BABEL_KEYSTORE_FILE, path); + ModelLoaderConfig config = new ModelLoaderConfig(props, root); + assertEquals(root + File.separator + path, config.getBabelKeyStorePath()); + } + + @Test + public void testBabelBaseUrl() { + String url = "http://localhost/"; + Properties props = new Properties(); + props.put(ModelLoaderConfig.PROP_BABEL_BASE_URL, url); + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + assertEquals(url, config.getBabelBaseUrl()); + } + + @Test + public void testBabelGenerateArtifactsUrl() { + String url = "/path/to/the/resource"; + Properties props = new Properties(); + props.put(ModelLoaderConfig.PROP_BABEL_GENERATE_RESOURCE_URL, url); + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + assertEquals(url, config.getBabelGenerateArtifactsUrl()); + } + + @Test + public void testNoAAIAuth() throws IOException { + + Properties props = new Properties(); + props.load(new FileInputStream("src/test/resources/model-loader-empty-auth-password.properties")); + + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + AaiRestClient aaiClient = new AaiRestClient(config); + + assertFalse("Empty AAI Password should result in no basic authentication", aaiClient.useBasicAuth()); + + props.load(new FileInputStream("src/test/resources/model-loader-no-auth-password.properties")); + config = new ModelLoaderConfig(props, null); + aaiClient = new AaiRestClient(config); + + assertFalse("No AAI Password should result in no basic authentication", aaiClient.useBasicAuth()); + } + + @Test + public void testGetUrls() { + Properties props = new Properties(); + props.put(ModelLoaderConfig.PROP_AAI_MODEL_RESOURCE_URL, "/aai/v*/service-design-and-creation/models/model/"); + props.put(ModelLoaderConfig.PROP_AAI_NAMED_QUERY_RESOURCE_URL, + "/aai/v*/service-design-and-creation/named-queries/named-query/"); + ModelLoaderConfig config = new ModelLoaderConfig(props, null); + + assertEquals("/aai/v9/service-design-and-creation/models/model/", config.getAaiModelUrl("v9")); + assertEquals("/aai/v10/service-design-and-creation/named-queries/named-query/", + config.getAaiNamedQueryUrl("v10")); + } + + + /** + * @param propertyName + * @param propertyValue + * @return a new ModelLoaderConfig object containing a single obfuscated property value + */ + private ModelLoaderConfig createObfuscatedTestConfig(String propertyName, String propertyValue) { + Properties props = new Properties(); + props.put(propertyName, Password.obfuscate(propertyValue)); + return new ModelLoaderConfig(props, null); + } +} diff --git a/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfImageException.java b/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfImageException.java new file mode 100644 index 0000000..a41ddf9 --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfImageException.java @@ -0,0 +1,49 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.entity.catalog; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import org.junit.Test; + +/** + * Tests for NotificationDataImpl class + * + */ +public class TestVnfImageException { + + @Test + public void testConstructors() { + VnfImageException exception = new VnfImageException("id"); + assertThat(exception.getImageId(), is(equalTo("id"))); + + exception = new VnfImageException("id2", 1); + assertThat(exception.getImageId(), is(equalTo("id2"))); + assertThat(exception.getResultCode().get(), is(equalTo(1))); + + Exception e = new Exception("message"); + exception = new VnfImageException(e); + assertThat(exception.getImageId(), is(equalTo("message"))); + } + +} diff --git a/src/test/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandlerTest.java b/src/test/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandlerTest.java index aa75cd2..b6d4564 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandlerTest.java +++ b/src/test/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandlerTest.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.catalog; diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/ModelArtifactParserTest.java b/src/test/java/org/onap/aai/modelloader/entity/model/ModelArtifactParserTest.java index ec24acb..84a4313 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/model/ModelArtifactParserTest.java +++ b/src/test/java/org/onap/aai/modelloader/entity/model/ModelArtifactParserTest.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java b/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java index d59ddf7..d1d54b7 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java +++ b/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java @@ -1,29 +1,33 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import org.junit.Test; @@ -32,140 +36,101 @@ import org.onap.aai.modelloader.entity.Artifact; public class ModelSorterTest { @Test - public void noModels() { - - List emptyList = Collections.emptyList(); - - ModelSorter sorter = new ModelSorter(); - sorter = new ModelSorter(); - - List sortedList = sorter.sort(emptyList); - assertNotNull(sortedList); - assertEquals(0, sortedList.size()); - + public void edgeEquality() throws BabelArtifactParsingException { + ModelArtifact model = buildTestModel(); + ModelSorter.Node nodeA = new ModelSorter.Node(model); + ModelSorter.Node nodeB = new ModelSorter.Node(model); + ModelSorter.Node nodeC = new ModelSorter.Node(model); + + ModelSorter.Edge edgeA = new ModelSorter.Edge(nodeA, nodeB); + ModelSorter.Edge edgeB = new ModelSorter.Edge(nodeA, nodeB); + ModelSorter.Edge edgeC = new ModelSorter.Edge(nodeB, nodeA); + ModelSorter.Edge edgeD = new ModelSorter.Edge(nodeA, nodeC); + + assertThat(edgeA, is(equalTo(edgeA))); + assertThat(edgeA, is(not(equalTo(null)))); + assertThat(edgeA, is(not(equalTo(model)))); + + assertThat(edgeA, is(equalTo(edgeB))); + assertThat(edgeA, is(not(equalTo(edgeC)))); + assertThat(edgeA, is(not(equalTo(edgeD)))); } @Test - public void singleModel() { - - List modelList = new ArrayList(); - - ModelArtifact model = new ModelArtifact(); - model.setModelInvariantId("aaa"); - model.setModelVerId("111"); - model.addDependentModelId("xyz|123"); - modelList.add(model); - - ModelSorter sorter = new ModelSorter(); - sorter = new ModelSorter(); - - List sortedList = sorter.sort(modelList); - assertNotNull(sortedList); - assertEquals(1, sortedList.size()); - + public void nodeEquality() throws BabelArtifactParsingException { + ModelArtifact model = buildTestModel(); + ModelSorter.Node nodeA = new ModelSorter.Node(model); + ModelSorter.Node nodeB = new ModelSorter.Node(model); + + assertThat(nodeA, is(equalTo(nodeA))); + assertThat(nodeA, is(not(equalTo(null)))); + assertThat(nodeA, is(not(equalTo(model)))); + + assertThat(nodeA, is(equalTo(nodeB))); + assertThat(nodeA.toString(), is(equalTo(nodeB.toString()))); + assertThat(nodeA, is(not(equalTo(new ModelSorter.Node(new ModelArtifact()))))); } - /** - * depends on depends on B ------> A -------> C - * - * - * Input list = a, b, c Sorted list = c, a, b - */ @Test - public void multipleModels() { - - List modelList = new ArrayList(); - - ModelArtifact aaaa = new ModelArtifact(); - aaaa.setModelInvariantId("aaaa"); - aaaa.setModelVerId("mvaaaa"); - aaaa.addDependentModelId("cccc|mvcccc"); - - ModelArtifact bbbb = new ModelArtifact(); - bbbb.setModelInvariantId("bbbb"); - bbbb.setModelVerId("mvbbbb"); - bbbb.addDependentModelId("aaaa|mvaaaa"); - - ModelArtifact cccc = new ModelArtifact(); - cccc.setModelInvariantId("cccc"); - cccc.setModelVerId("mvcccc"); - - modelList.add(aaaa); - modelList.add(bbbb); - modelList.add(cccc); - - ModelSorter sorter = new ModelSorter(); - sorter = new ModelSorter(); - - List sortedList = sorter.sort(modelList); - assertNotNull(sortedList); - assertEquals(3, sortedList.size()); - - assertEquals(cccc, sortedList.get(0)); - assertEquals(aaaa, sortedList.get(1)); - assertEquals(bbbb, sortedList.get(2)); + public void noModels() throws BabelArtifactParsingException { + assertThat(new ModelSorter().sort(null), is(nullValue())); + assertThat(new ModelSorter().sort(Collections.emptyList()).size(), is(0)); } @Test - public void multipleModelsAndNamedQueries() { - - List modelList = new ArrayList(); - - ModelArtifact aaaa = new ModelArtifact(); - aaaa.setModelInvariantId("aaaa"); - aaaa.setModelVerId("1111"); - aaaa.addDependentModelId("cccc|2222"); - - NamedQueryArtifact nq1 = new NamedQueryArtifact(); - nq1.setNamedQueryUuid("nq1"); - nq1.addDependentModelId("aaaa|1111"); - - NamedQueryArtifact nq2 = new NamedQueryArtifact(); - nq2.setNamedQueryUuid("nq2"); - nq2.addDependentModelId("existing-model"); - - modelList.add(nq1); - modelList.add(nq2); - modelList.add(aaaa); - - ModelSorter sorter = new ModelSorter(); - sorter = new ModelSorter(); - - List sortedList = sorter.sort(modelList); - assertNotNull(sortedList); - assertEquals(3, sortedList.size()); + public void singleModel() throws BabelArtifactParsingException { + assertThat(new ModelSorter().sort(Arrays.asList(buildTestModel())).size(), is(1)); + } - System.out.println(sortedList.get(0) + "-" + sortedList.get(1) + "-" + sortedList.get(2)); - assertEquals(aaaa, sortedList.get(0)); - assertEquals(nq2, sortedList.get(1)); - assertEquals(nq1, sortedList.get(2)); + @Test + public void multipleModels() throws BabelArtifactParsingException { + Artifact a = buildTestModel("aaaa", "mvaaaa", "cccc|mvcccc"); + Artifact b = buildTestModel("bbbb", "mvbbbb", "aaaa|mvaaaa"); + Artifact c = buildTestModel("cccc", "mvcccc"); + List expected = Arrays.asList(c, a, b); + assertThat(new ModelSorter().sort(Arrays.asList(a, b, c)), is(expected)); } - @Test(expected = RuntimeException.class) - public void circularDependency() { + @Test + public void multipleModelsAndNamedQueries() throws BabelArtifactParsingException { + Artifact a = buildTestModel("aaaa", "1111", "cccc|2222"); + Artifact nq1 = buildTestNamedQuery("nq1", "aaaa|1111"); + Artifact nq2 = buildTestNamedQuery("nqw", "existing-model"); + List expected = Arrays.asList(a, nq2, nq1); + assertThat(new ModelSorter().sort(Arrays.asList(nq1, nq2, a)), is(expected)); + } + @Test(expected = BabelArtifactParsingException.class) + public void circularDependency() throws BabelArtifactParsingException { List modelList = new ArrayList(); + modelList.add(buildTestModel("aaaa", "1111", "bbbb|1111")); + modelList.add(buildTestModel("bbbb", "1111", "aaaa|1111")); + new ModelSorter().sort(modelList); + } - ModelArtifact aaaa = new ModelArtifact(); - aaaa.setModelInvariantId("aaaa"); - aaaa.setModelVerId("1111"); - aaaa.addDependentModelId("bbbb|1111"); - - ModelArtifact bbbb = new ModelArtifact(); - bbbb.setModelInvariantId("bbbb"); - bbbb.setModelVerId("1111"); - bbbb.addDependentModelId("aaaa|1111"); - - modelList.add(aaaa); - modelList.add(bbbb); + private ModelArtifact buildTestModel() { + return buildTestModel("aaa", "111", "xyz|123"); + } - ModelSorter sorter = new ModelSorter(); - sorter = new ModelSorter(); + private ModelArtifact buildTestModel(String id, String version) { + return buildTestModel(id, version, null); + } - List sortedList = sorter.sort(modelList); - assertNotNull(sortedList); - assertEquals(2, sortedList.size()); + private ModelArtifact buildTestModel(String id, String version, String dependentModel) { + ModelArtifact modelArtifact = new ModelArtifact(); + modelArtifact.setModelInvariantId(id); + modelArtifact.setModelVerId(version); + if (dependentModel != null) { + modelArtifact.addDependentModelId(dependentModel); + } + return modelArtifact; + } + private NamedQueryArtifact buildTestNamedQuery(String uuid, String modelId) { + NamedQueryArtifact nq = new NamedQueryArtifact(); + nq.setNamedQueryUuid(uuid); + nq.addDependentModelId(modelId); + return nq; } } diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParserTest.java b/src/test/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParserTest.java index 4fd6d1e..fa2d2d7 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParserTest.java +++ b/src/test/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifactParserTest.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.entity.model; diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactHandler.java b/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactHandler.java new file mode 100644 index 0000000..82990de --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactHandler.java @@ -0,0 +1,124 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.entity.model; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.ws.rs.core.Response; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.onap.aai.modelloader.config.ModelLoaderConfig; +import org.onap.aai.modelloader.entity.Artifact; +import org.onap.aai.modelloader.restclient.AaiRestClient; +import org.onap.aai.restclient.client.OperationResult; + +/** + * Test the Model Artifact Handler using Mocks + * + */ +public class TestModelArtifactHandler { + + @Mock + private ModelLoaderConfig config; + + @Mock + private AaiRestClient aaiClient; + + @Before + public void setupMocks() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testEmptyLists() { + ModelArtifactHandler handler = new ModelArtifactHandler(config); + handler.pushArtifacts(Collections.emptyList(), "", Collections.emptyList(), aaiClient); + handler.rollback(Collections.emptyList(), "", aaiClient); + } + + @Test + public void testSingleItemList() { + when(config.getAaiBaseUrl()).thenReturn(""); + when(config.getAaiModelUrl(any())).thenReturn(""); + + ModelArtifactHandler handler = new ModelArtifactHandler(config); + List artifacts = Collections.singletonList(new ModelArtifact()); + handler.pushArtifacts(artifacts, "", Collections.emptyList(), aaiClient); + handler.rollback(Collections.emptyList(), "", aaiClient); + } + + @Test + public void testPushExistingModelsWithRollback() { + when(config.getAaiBaseUrl()).thenReturn(""); + when(config.getAaiModelUrl(any())).thenReturn(""); + + OperationResult operationResult = mock(OperationResult.class); + when(aaiClient.getResource(any(), any(), any())).thenReturn(operationResult); + when(operationResult.getResultCode()).thenReturn(Response.Status.OK.getStatusCode()); + + List artifacts = new ArrayList<>(); + Artifact artifact = new ModelArtifact(); + artifacts.add(artifact); + + ModelArtifactHandler handler = new ModelArtifactHandler(config); + boolean pushed = handler.pushArtifacts(artifacts, "", Collections.emptyList(), aaiClient); + assertThat(pushed, is(true)); + handler.rollback(artifacts, "", aaiClient); + } + + @Test + public void testPushNewModelsWithRollback() { + when(config.getAaiBaseUrl()).thenReturn(""); + when(config.getAaiModelUrl(any())).thenReturn(""); + when(config.getAaiNamedQueryUrl(any())).thenReturn(""); + + OperationResult getResult = mock(OperationResult.class); + when(aaiClient.getResource(any(), any(), any())).thenReturn(getResult); + when(getResult.getResultCode()).thenReturn(Response.Status.NOT_FOUND.getStatusCode()); + + OperationResult putResult = mock(OperationResult.class); + when(aaiClient.putResource(any(), any(), any(), any())).thenReturn(putResult); + when(putResult.getResultCode()).thenReturn(Response.Status.CREATED.getStatusCode()); + + List artifacts = new ArrayList<>(); + artifacts.add(new ModelArtifact()); + NamedQueryArtifact namedQueryArtifact = new NamedQueryArtifact(); + namedQueryArtifact.setNamedQueryUuid("fred"); + namedQueryArtifact.setModelNamespace("http://org.onap.aai.inventory/v13"); + artifacts.add(namedQueryArtifact); + + List completedArtifacts = new ArrayList<>(); + ModelArtifactHandler handler = new ModelArtifactHandler(config); + boolean pushed = handler.pushArtifacts(artifacts, "", completedArtifacts, aaiClient); + assertThat(pushed, is(true)); + handler.rollback(artifacts, "", aaiClient); + } +} + diff --git a/src/test/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractorTest.java b/src/test/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractorTest.java index 6de0945..8ae2c7e 100644 --- a/src/test/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractorTest.java +++ b/src/test/java/org/onap/aai/modelloader/extraction/ArtifactInfoExtractorTest.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.extraction; @@ -32,11 +32,10 @@ import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.onap.aai.modelloader.extraction.ArtifactInfoExtractor; import org.onap.aai.modelloader.fixture.ArtifactInfoBuilder; import org.onap.aai.modelloader.fixture.TestNotificationDataImpl; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; /** * Tests {@link ArtifactInfoExtractor} diff --git a/src/test/java/org/onap/aai/modelloader/fixture/ArtifactInfoBuilder.java b/src/test/java/org/onap/aai/modelloader/fixture/ArtifactInfoBuilder.java index 2540865..aa475f3 100644 --- a/src/test/java/org/onap/aai/modelloader/fixture/ArtifactInfoBuilder.java +++ b/src/test/java/org/onap/aai/modelloader/fixture/ArtifactInfoBuilder.java @@ -1,30 +1,29 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.fixture; import java.util.ArrayList; import java.util.List; - import org.onap.aai.modelloader.service.ArtifactInfoImpl; -import org.openecomp.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.IArtifactInfo; /** * This class builds an instance of IArtifactInfo for test purposes. diff --git a/src/test/java/org/onap/aai/modelloader/fixture/NotificationDataFixtureBuilder.java b/src/test/java/org/onap/aai/modelloader/fixture/NotificationDataFixtureBuilder.java index f51a941..44f59a3 100644 --- a/src/test/java/org/onap/aai/modelloader/fixture/NotificationDataFixtureBuilder.java +++ b/src/test/java/org/onap/aai/modelloader/fixture/NotificationDataFixtureBuilder.java @@ -1,30 +1,30 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.fixture; import java.util.ArrayList; import java.util.List; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IResourceInstance; /** * This class is responsible for building NotificationData for use in test classes. @@ -84,7 +84,7 @@ public class NotificationDataFixtureBuilder { private static void buildWithInvalidType() { buildService(INVALID_TYPE, NOTIFICATION_DATA_WITH_INVALID_TYPE); } - + private static void buildwithOneOfEach() { buildService(TOSCA_CSAR, NOTIFICATION_DATA_WITH_ONE_OF_EACH); @@ -139,7 +139,7 @@ public class NotificationDataFixtureBuilder { public static INotificationData getNotificationDataWithInvalidType() { return NOTIFICATION_DATA_WITH_INVALID_TYPE; } - + public static INotificationData getNotificationDataWithOneOfEach() { return NOTIFICATION_DATA_WITH_ONE_OF_EACH; } diff --git a/src/test/java/org/onap/aai/modelloader/fixture/ResourceInstanceBuilder.java b/src/test/java/org/onap/aai/modelloader/fixture/ResourceInstanceBuilder.java index b62519d..01e00f8 100644 --- a/src/test/java/org/onap/aai/modelloader/fixture/ResourceInstanceBuilder.java +++ b/src/test/java/org/onap/aai/modelloader/fixture/ResourceInstanceBuilder.java @@ -1,28 +1,28 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.fixture; import java.util.List; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.IResourceInstance; /** * This class builds an instance of IArtifactInfo for test purposes. diff --git a/src/test/java/org/onap/aai/modelloader/fixture/TestNotificationDataImpl.java b/src/test/java/org/onap/aai/modelloader/fixture/TestNotificationDataImpl.java index b26b0e3..a7defdf 100644 --- a/src/test/java/org/onap/aai/modelloader/fixture/TestNotificationDataImpl.java +++ b/src/test/java/org/onap/aai/modelloader/fixture/TestNotificationDataImpl.java @@ -1,29 +1,29 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.fixture; import java.util.List; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IResourceInstance; /** * This class is an implementation of INotificationData for test purposes. @@ -97,6 +97,5 @@ public class TestNotificationDataImpl implements INotificationData { } @Override - public void setWorkloadContext(String arg0) { - } + public void setWorkloadContext(String arg0) {} } diff --git a/src/test/java/org/onap/aai/modelloader/fixture/TestResourceInstanceImpl.java b/src/test/java/org/onap/aai/modelloader/fixture/TestResourceInstanceImpl.java index 9b5fb19..7eaebb5 100644 --- a/src/test/java/org/onap/aai/modelloader/fixture/TestResourceInstanceImpl.java +++ b/src/test/java/org/onap/aai/modelloader/fixture/TestResourceInstanceImpl.java @@ -1,28 +1,28 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.fixture; import java.util.List; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.IResourceInstance; /** * This class is an implementation of IResourceInstance for test purposes. diff --git a/src/test/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManagerTest.java b/src/test/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManagerTest.java index 0dcff32..9d6f3c4 100644 --- a/src/test/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManagerTest.java +++ b/src/test/java/org/onap/aai/modelloader/notification/ArtifactDeploymentManagerTest.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; @@ -46,9 +46,8 @@ import org.onap.aai.modelloader.entity.model.BabelArtifactParsingException; import org.onap.aai.modelloader.entity.model.ModelArtifactHandler; import org.onap.aai.modelloader.extraction.InvalidArchiveException; import org.onap.aai.modelloader.util.ArtifactTestUtils; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.INotificationData; /** * Tests {@link ArtifactDeploymentManager } @@ -94,10 +93,9 @@ public class ArtifactDeploymentManagerTest { manager = null; } - private List setupTest(byte[] xml, INotificationData data) throws IOException { List toscaArtifacts = new ArrayList<>(); - IArtifactInfo artifactInfo = data.getServiceArtifacts().get(0); + org.onap.sdc.api.notification.IArtifactInfo artifactInfo = data.getServiceArtifacts().get(0); BabelArtifact xmlArtifact = new BabelArtifact(artifactInfo.getArtifactName(), BabelArtifact.ArtifactType.MODEL, new String(xml)); diff --git a/src/test/java/org/onap/aai/modelloader/notification/ArtifactDownloadManagerTest.java b/src/test/java/org/onap/aai/modelloader/notification/ArtifactDownloadManagerTest.java index 71cd8af..2c02487 100644 --- a/src/test/java/org/onap/aai/modelloader/notification/ArtifactDownloadManagerTest.java +++ b/src/test/java/org/onap/aai/modelloader/notification/ArtifactDownloadManagerTest.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; @@ -53,12 +53,12 @@ import org.onap.aai.modelloader.restclient.BabelServiceClient; import org.onap.aai.modelloader.restclient.BabelServiceClient.BabelServiceException; import org.onap.aai.modelloader.restclient.BabelServiceClientFactory; import org.onap.aai.modelloader.util.ArtifactTestUtils; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.results.IDistributionClientDownloadResult; -import org.openecomp.sdc.impl.DistributionClientDownloadResultImpl; -import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.results.IDistributionClientDownloadResult; +import org.onap.sdc.impl.DistributionClientDownloadResultImpl; +import org.onap.sdc.utils.DistributionActionResultEnum; /** * Tests {@link ArtifactDownloadManager} diff --git a/src/test/java/org/onap/aai/modelloader/notification/BabelArtifactConverterTest.java b/src/test/java/org/onap/aai/modelloader/notification/BabelArtifactConverterTest.java index 533a37b..e9e6059 100644 --- a/src/test/java/org/onap/aai/modelloader/notification/BabelArtifactConverterTest.java +++ b/src/test/java/org/onap/aai/modelloader/notification/BabelArtifactConverterTest.java @@ -1,26 +1,25 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.notification; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -29,12 +28,10 @@ import java.util.ArrayList; import java.util.List; import org.junit.Test; import org.onap.aai.babel.service.data.BabelArtifact; -import org.onap.aai.modelloader.entity.Artifact; -import org.onap.aai.modelloader.entity.ArtifactType; import org.onap.aai.modelloader.entity.model.BabelArtifactParsingException; import org.onap.aai.modelloader.fixture.NotificationDataFixtureBuilder; -import org.onap.aai.modelloader.util.ArtifactTestUtils; -import org.openecomp.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; /** * Tests {@link BabelArtifactConverter} @@ -69,7 +66,7 @@ public class BabelArtifactConverterTest { private List setupTest(byte[] xml, INotificationData data) throws IOException { List toscaArtifacts = new ArrayList<>(); - org.openecomp.sdc.api.notification.IArtifactInfo artifactInfo = data.getServiceArtifacts().get(0); + IArtifactInfo artifactInfo = data.getServiceArtifacts().get(0); BabelArtifact xmlArtifact = new BabelArtifact(artifactInfo.getArtifactName(), BabelArtifact.ArtifactType.MODEL, new String(xml)); @@ -77,5 +74,4 @@ public class BabelArtifactConverterTest { return toscaArtifacts; } - } diff --git a/src/test/java/org/onap/aai/modelloader/notification/EventCallbackTest.java b/src/test/java/org/onap/aai/modelloader/notification/EventCallbackTest.java index bc88c85..57a4c09 100644 --- a/src/test/java/org/onap/aai/modelloader/notification/EventCallbackTest.java +++ b/src/test/java/org/onap/aai/modelloader/notification/EventCallbackTest.java @@ -1,116 +1,116 @@ -/** - * ============LICENSE_START========================================== - * org.onap.aai - * =================================================================== - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ -package org.onap.aai.modelloader.notification; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.io.IOException; -import java.util.List; -import java.util.Properties; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; -import org.onap.aai.modelloader.config.ModelLoaderConfig; -import org.onap.aai.modelloader.entity.model.BabelArtifactParsingException; -import org.onap.aai.modelloader.fixture.NotificationDataFixtureBuilder; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.INotificationData; - -/** - * Tests {@link EventCallback} - */ -public class EventCallbackTest { - - private static final String CONFIG_FILE = "model-loader.properties"; - - private ModelLoaderConfig config; - private Properties configProperties; - private EventCallback eventCallback; - - private ArtifactDeploymentManager mockArtifactDeploymentManager; - private ArtifactDownloadManager mockArtifactDownloadManager; - private IDistributionClient mockDistributionClient; - - @Before - public void setup() throws IOException { - configProperties = new Properties(); - configProperties.load(this.getClass().getClassLoader().getResourceAsStream(CONFIG_FILE)); - config = new ModelLoaderConfig(configProperties, null); - - mockArtifactDeploymentManager = mock(ArtifactDeploymentManager.class); - mockArtifactDownloadManager = mock(ArtifactDownloadManager.class); - mockDistributionClient = mock(IDistributionClient.class); - - eventCallback = new EventCallback(mockDistributionClient, config); - - Whitebox.setInternalState(eventCallback, "artifactDeploymentManager", mockArtifactDeploymentManager); - Whitebox.setInternalState(eventCallback, "artifactDownloadManager", mockArtifactDownloadManager); - } - - @After - public void tearDown() { - config = null; - configProperties = null; - eventCallback = null; - mockArtifactDeploymentManager = null; - mockArtifactDownloadManager = null; - mockDistributionClient = null; - } - - @Test - @SuppressWarnings("unchecked") - public void activateCallback_downloadFails() { - INotificationData data = NotificationDataFixtureBuilder.getNotificationDataWithToscaCsarFile(); - - when(mockArtifactDownloadManager.downloadArtifacts(any(INotificationData.class), any(List.class), - any(List.class), any(List.class))).thenReturn(false); - - eventCallback.activateCallback(data); - - verify(mockArtifactDownloadManager).downloadArtifacts(any(INotificationData.class), any(List.class), - any(List.class), any(List.class)); - Mockito.verifyZeroInteractions(mockArtifactDeploymentManager); - } - - @SuppressWarnings("unchecked") - @Test - public void activateCallback() throws BabelArtifactParsingException { - INotificationData data = NotificationDataFixtureBuilder.getNotificationDataWithToscaCsarFile(); - - when(mockArtifactDownloadManager.downloadArtifacts(any(INotificationData.class), any(List.class), - any(List.class), any(List.class))).thenReturn(true); - - when(mockArtifactDeploymentManager.deploy(any(INotificationData.class), any(List.class), any(List.class), - any(List.class))).thenReturn(true); - - eventCallback.activateCallback(data); - - verify(mockArtifactDownloadManager).downloadArtifacts(any(INotificationData.class), any(List.class), - any(List.class), any(List.class)); - verify(mockArtifactDeploymentManager).deploy(any(INotificationData.class), any(List.class), any(List.class), - any(List.class)); - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.notification; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.util.List; +import java.util.Properties; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.mockito.internal.util.reflection.Whitebox; +import org.onap.aai.modelloader.config.ModelLoaderConfig; +import org.onap.aai.modelloader.entity.model.BabelArtifactParsingException; +import org.onap.aai.modelloader.fixture.NotificationDataFixtureBuilder; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.INotificationData; + +/** + * Tests {@link EventCallback} + */ +public class EventCallbackTest { + + private static final String CONFIG_FILE = "model-loader.properties"; + + private ModelLoaderConfig config; + private Properties configProperties; + private EventCallback eventCallback; + + private ArtifactDeploymentManager mockArtifactDeploymentManager; + private ArtifactDownloadManager mockArtifactDownloadManager; + private IDistributionClient mockDistributionClient; + + @Before + public void setup() throws IOException { + configProperties = new Properties(); + configProperties.load(this.getClass().getClassLoader().getResourceAsStream(CONFIG_FILE)); + config = new ModelLoaderConfig(configProperties, null); + + mockArtifactDeploymentManager = mock(ArtifactDeploymentManager.class); + mockArtifactDownloadManager = mock(ArtifactDownloadManager.class); + mockDistributionClient = mock(IDistributionClient.class); + + eventCallback = new EventCallback(mockDistributionClient, config); + + Whitebox.setInternalState(eventCallback, "artifactDeploymentManager", mockArtifactDeploymentManager); + Whitebox.setInternalState(eventCallback, "artifactDownloadManager", mockArtifactDownloadManager); + } + + @After + public void tearDown() { + config = null; + configProperties = null; + eventCallback = null; + mockArtifactDeploymentManager = null; + mockArtifactDownloadManager = null; + mockDistributionClient = null; + } + + @Test + @SuppressWarnings("unchecked") + public void activateCallback_downloadFails() { + INotificationData data = NotificationDataFixtureBuilder.getNotificationDataWithToscaCsarFile(); + + when(mockArtifactDownloadManager.downloadArtifacts(any(INotificationData.class), any(List.class), + any(List.class), any(List.class))).thenReturn(false); + + eventCallback.activateCallback(data); + + verify(mockArtifactDownloadManager).downloadArtifacts(any(INotificationData.class), any(List.class), + any(List.class), any(List.class)); + Mockito.verifyZeroInteractions(mockArtifactDeploymentManager); + } + + @SuppressWarnings("unchecked") + @Test + public void activateCallback() throws BabelArtifactParsingException { + INotificationData data = NotificationDataFixtureBuilder.getNotificationDataWithToscaCsarFile(); + + when(mockArtifactDownloadManager.downloadArtifacts(any(INotificationData.class), any(List.class), + any(List.class), any(List.class))).thenReturn(true); + + when(mockArtifactDeploymentManager.deploy(any(INotificationData.class), any(List.class), any(List.class), + any(List.class))).thenReturn(true); + + eventCallback.activateCallback(data); + + verify(mockArtifactDownloadManager).downloadArtifacts(any(INotificationData.class), any(List.class), + any(List.class), any(List.class)); + verify(mockArtifactDeploymentManager).deploy(any(INotificationData.class), any(List.class), any(List.class), + any(List.class)); + } +} diff --git a/src/test/java/org/onap/aai/modelloader/notification/TestNotificationPublisher.java b/src/test/java/org/onap/aai/modelloader/notification/TestNotificationPublisher.java new file mode 100644 index 0000000..bc91b2f --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/notification/TestNotificationPublisher.java @@ -0,0 +1,86 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.notification; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.when; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.IConfiguration; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.utils.DistributionActionResultEnum; + +/** + * Test the Notification Publisher using Mocks + * + */ +public class TestNotificationPublisher { + + @Mock + private IDistributionClient client; + + @Mock + private INotificationData data; + + @Mock + private IArtifactInfo artifact; + + @Mock + private IConfiguration config; + + @Mock + private IDistributionClientResult clientResult; + + static { + System.setProperty("CONFIG_HOME", "src/test/resources"); + } + + @Before + public void setupMocks() { + MockitoAnnotations.initMocks(this); + when(client.getConfiguration()).thenReturn(config); + when(client.sendDownloadStatus(any())).thenReturn(clientResult); + when(client.sendComponentDoneStatus(any())).thenReturn(clientResult); + when(client.sendComponentDoneStatus(any(), anyString())).thenReturn(clientResult); + when(client.sendDeploymentStatus(any())).thenReturn(clientResult); + when(clientResult.getDistributionActionResult()).thenReturn(DistributionActionResultEnum.SUCCESS); + } + + @Test + public void testPublisher() { + NotificationPublisher publisher = new NotificationPublisher(); + publisher.publishDownloadSuccess(client, data, artifact); + publisher.publishDownloadFailure(client, data, artifact, ""); + publisher.publishComponentSuccess(client, data); + publisher.publishComponentFailure(client, data, ""); + publisher.publishDeploySuccess(client, data, artifact); + publisher.publishDeployFailure(client, data, artifact); + } + +} + diff --git a/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java b/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java new file mode 100644 index 0000000..96620ee --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java @@ -0,0 +1,106 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.restclient; + +import static javax.servlet.http.HttpServletResponse.SC_OK; +import static org.apache.commons.io.IOUtils.write; + +import java.io.IOException; +import java.util.Properties; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.MediaType; +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.modelloader.config.ModelLoaderConfig; + +/** + * Local testing of the Babel service + * + */ +public class TestAaiServiceClient { + + private Server server; + private AaiRestClient aaiClient; + + @Before + public void startJetty() throws Exception { + server = new Server(8080); + server.setHandler(getMockHandler()); + server.start(); + + Properties props = new Properties(); + props.put("ml.aai.KEYSTORE_PASSWORD", "2244"); + ModelLoaderConfig config = new ModelLoaderConfig(props, "."); + aaiClient = new AaiRestClient(config); + } + + @After + public void stopJetty() throws Exception { + server.stop(); + } + + @Test + public void testBuildAaiRestClient() { + Properties props = new Properties(); + ModelLoaderConfig config = new ModelLoaderConfig(props, "."); + new AaiRestClient(config); + } + + @Test + public void testOperations() { + String url = "http://localhost"; + String transId = ""; + MediaType mediaType = MediaType.APPLICATION_JSON_TYPE; + aaiClient.getResource(url, "", mediaType); + aaiClient.deleteResource("http://localhost", transId, ""); + aaiClient.getAndDeleteResource(url, transId); + aaiClient.postResource(url, "", transId, mediaType); + aaiClient.putResource(url, "", transId, mediaType); + } + + + /** + * Creates an {@link AbstractHandler handler} returning an arbitrary String as a response. + * + * @return never null. + */ + private Handler getMockHandler() { + Handler handler = new AbstractHandler() { + @Override + public void handle(String target, Request request, HttpServletRequest servletRequest, + HttpServletResponse response) throws IOException, ServletException { + response.setStatus(SC_OK); + response.setContentType("text/json;charset=utf-8"); + write("", response.getOutputStream()); + request.setHandled(true); + } + }; + return handler; + } +} + diff --git a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java index 974c034..b42fee4 100644 --- a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java +++ b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java @@ -1,40 +1,57 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.restclient; +import static javax.servlet.http.HttpServletResponse.SC_OK; +import static org.apache.commons.io.IOUtils.write; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; +import com.google.gson.Gson; import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Paths; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.util.ArrayList; import java.util.List; import java.util.Properties; -import org.junit.Ignore; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import org.onap.aai.babel.service.data.BabelArtifact; import org.onap.aai.modelloader.config.ModelLoaderConfig; -import org.onap.aai.modelloader.restclient.BabelServiceClient; +import org.onap.aai.modelloader.restclient.BabelServiceClient.BabelServiceException; /** * Local testing of the Babel service @@ -42,27 +59,65 @@ import org.onap.aai.modelloader.restclient.BabelServiceClient; */ public class TestBabelServiceClient { - // Load properties from src/test/resources - protected static String CONFIG_FILE = "model-loader.properties"; + private Server server; + private String responseBody; - // This test requires a running Babel system. To test locally, annotate with org.junit.Test - @Ignore - public void testRestClient() throws Exception { // NOSONAR + { + List response = new ArrayList<>(); + response.add(new BabelArtifact("", null, "")); + response.add(new BabelArtifact("", null, "")); + response.add(new BabelArtifact("", null, "")); + responseBody = new Gson().toJson(response); + } + + @Before + public void startJetty() throws Exception { + server = new Server(8080); + server.setHandler(getMockHandler()); + server.start(); + } + + @After + public void stopJetty() throws Exception { + server.stop(); + } + + @Test + public void testRestClient() throws UnrecoverableKeyException, KeyManagementException, NoSuchAlgorithmException, + KeyStoreException, CertificateException, IOException, BabelServiceException, URISyntaxException { Properties configProperties = new Properties(); - try { - configProperties.load(this.getClass().getClassLoader().getResourceAsStream(CONFIG_FILE)); - } catch (IOException e) { - fail(); - } - BabelServiceClient client = new BabelServiceClient(new ModelLoaderConfig(configProperties, ".")); + configProperties.put("ml.babel.KEYSTORE_PASSWORD", "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0"); + configProperties.put("ml.babel.BASE_URL", "http://localhost:8080/"); + configProperties.put("ml.babel.GENERATE_ARTIFACTS_URL", "generate"); + BabelServiceClient client = + new BabelServiceClientFactory().create(new ModelLoaderConfig(configProperties, ".")); List result = client.postArtifact(readBytesFromFile("compressedArtifacts/service-VscpaasTest-csar.csar"), "service-Vscpass-Test", "1.0", "Test-Transaction-ID-BabelClient"); - assertThat(result.size(), is(equalTo(3))); } private byte[] readBytesFromFile(String resourceFile) throws IOException, URISyntaxException { return Files.readAllBytes(Paths.get(ClassLoader.getSystemResource(resourceFile).toURI())); } + + /** + * Creates an {@link AbstractHandler handler} returning an arbitrary String as a response. + * + * @return never null. + */ + private Handler getMockHandler() { + Handler handler = new AbstractHandler() { + @Override + public void handle(String target, Request request, HttpServletRequest servletRequest, + HttpServletResponse response) throws IOException, ServletException { + response.setStatus(SC_OK); + response.setContentType("text/xml;charset=utf-8"); + write(responseBody, response.getOutputStream()); + request.setHandled(true); + } + }; + return handler; + } } + diff --git a/src/test/java/org/onap/aai/modelloader/service/TestArtifactInfoImpl.java b/src/test/java/org/onap/aai/modelloader/service/TestArtifactInfoImpl.java new file mode 100644 index 0000000..366d5a5 --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/service/TestArtifactInfoImpl.java @@ -0,0 +1,123 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.service; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.empty; +import static org.junit.Assert.assertThat; + +import org.junit.Test; + +/** + * Tests for NotificationDataImpl class + * + */ +public class TestArtifactInfoImpl { + + @Test + public void testGettersAndSetters() { + ArtifactInfoImpl info = new ArtifactInfoImpl(); + String artifactName = "testname"; + String artifactType = "test-type"; + String artifactVersion = "v1"; + String artifactDescription = "test description"; + + info.setArtifactName(artifactName); + assertThat(info.getArtifactName(), is(equalTo(artifactName))); + + info.setArtifactType(artifactType); + assertThat(info.getArtifactType(), is(equalTo(artifactType))); + + info.setArtifactVersion(artifactVersion); + assertThat(info.getArtifactVersion(), is(equalTo(artifactVersion))); + + info.setArtifactDescription(artifactDescription); + assertThat(info.getArtifactDescription(), is(equalTo(artifactDescription))); + + assertThat(info.getArtifactChecksum(), is(nullValue())); + assertThat(info.getArtifactTimeout(), is(nullValue())); + assertThat(info.getArtifactURL(), is(nullValue())); + assertThat(info.getArtifactUUID(), is(nullValue())); + assertThat(info.getGeneratedArtifact(), is(nullValue())); + assertThat(info.getRelatedArtifacts(), is(empty())); + } + + + @Test + public void testEquality() { + ArtifactInfoImpl info = new ArtifactInfoImpl(); + assertThat(info, is(not(equalTo(null)))); + assertThat(info, is(not(equalTo("")))); // NOSONAR + assertThat(info, is(equalTo(info))); + + ArtifactInfoImpl other = new ArtifactInfoImpl(); + assertThat(info, is(equalTo(other))); + assertThat(info.hashCode(), is(equalTo(other.hashCode()))); + + // Artifact Name + other.setArtifactName(""); + assertThat(info, is(not(equalTo(other)))); + + info.setArtifactName("1234"); + assertThat(info, is(not(equalTo(other)))); + + other.setArtifactName("1234"); + assertThat(info, is(equalTo(other))); + assertThat(info.hashCode(), is(equalTo(other.hashCode()))); + + // Artifact Type + other.setArtifactType(""); + assertThat(info, is(not(equalTo(other)))); + + info.setArtifactType("type"); + assertThat(info, is(not(equalTo(other)))); + + other.setArtifactType("type"); + assertThat(info, is(equalTo(other))); + assertThat(info.hashCode(), is(equalTo(other.hashCode()))); + + // Artifact Description + other.setArtifactDescription(""); + assertThat(info, is(not(equalTo(other)))); + + info.setArtifactDescription("type"); + assertThat(info, is(not(equalTo(other)))); + + other.setArtifactDescription("type"); + assertThat(info, is(equalTo(other))); + assertThat(info.hashCode(), is(equalTo(other.hashCode()))); + + // Artifact Version + other.setArtifactVersion(""); + assertThat(info, is(not(equalTo(other)))); + + info.setArtifactVersion("v1"); + assertThat(info, is(not(equalTo(other)))); + + other.setArtifactVersion("v1"); + assertThat(info, is(equalTo(other))); + assertThat(info.hashCode(), is(equalTo(other.hashCode()))); + } + +} diff --git a/src/test/java/org/onap/aai/modelloader/service/TestModelLoaderApplication.java b/src/test/java/org/onap/aai/modelloader/service/TestModelLoaderApplication.java new file mode 100644 index 0000000..0f3ed45 --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/service/TestModelLoaderApplication.java @@ -0,0 +1,41 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.service; + +import org.junit.Test; + +/** + * Tests for ModelLoaderApplication class + * + */ +public class TestModelLoaderApplication { + + static { + System.setProperty("CONFIG_HOME", "src/test/resources"); + } + + @Test + public void testServiceStarts() { + // The SDC Distribution Client is expected to fail to initialise. + ModelLoaderApplication.main(new String[0]); + } + +} diff --git a/src/test/java/org/onap/aai/modelloader/service/TestNotificationDataImpl.java b/src/test/java/org/onap/aai/modelloader/service/TestNotificationDataImpl.java new file mode 100644 index 0000000..395b1f3 --- /dev/null +++ b/src/test/java/org/onap/aai/modelloader/service/TestNotificationDataImpl.java @@ -0,0 +1,83 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.service; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; + +import org.junit.Test; + +/** + * Tests for NotificationDataImpl class + * + */ +public class TestNotificationDataImpl { + + @Test + public void testGettersAndSetters() { + NotificationDataImpl data = new NotificationDataImpl(); + String distributionId = "testid"; + String context = "testcontext"; + + data.setDistributionID(distributionId); + assertThat(data.getDistributionID(), is(equalTo(distributionId))); + + // Getters return empty data + assertThat(data.getArtifactMetadataByUUID(null), is(equalTo(null))); + assertThat(data.getServiceDescription(), is(equalTo(null))); + assertThat(data.getServiceInvariantUUID(), is(equalTo(null))); + assertThat(data.getServiceName(), is(equalTo(null))); + assertThat(data.getServiceUUID(), is(equalTo(null))); + assertThat(data.getServiceVersion(), is(equalTo(null))); + assertThat(data.getResources().size(), is(0)); + assertThat(data.getServiceArtifacts().size(), is(0)); + + // Unsupported method! + data.setWorkloadContext(context); + assertThat(data.getWorkloadContext(), is(equalTo(null))); + } + + + @Test + public void testEquality() { + NotificationDataImpl data = new NotificationDataImpl(); + assertThat(data, is(not(equalTo(null)))); + assertThat(data, is(not(equalTo("")))); // NOSONAR + assertThat(data, is(equalTo(data))); + + NotificationDataImpl other = new NotificationDataImpl(); + assertThat(data, is(equalTo(other))); + assertThat(data.hashCode(), is(equalTo(other.hashCode()))); + + other.setDistributionID(""); + assertThat(data, is(not(equalTo(other)))); + + data.setDistributionID("1234"); + assertThat(data, is(not(equalTo(other)))); + + other.setDistributionID("1234"); + assertThat(data, is(equalTo(other))); + assertThat(data.hashCode(), is(equalTo(other.hashCode()))); + } + +} diff --git a/src/test/java/org/onap/aai/modelloader/util/ArtifactTestUtils.java b/src/test/java/org/onap/aai/modelloader/util/ArtifactTestUtils.java index c7a1506..9b6ea06 100644 --- a/src/test/java/org/onap/aai/modelloader/util/ArtifactTestUtils.java +++ b/src/test/java/org/onap/aai/modelloader/util/ArtifactTestUtils.java @@ -1,22 +1,22 @@ /** - * ============LICENSE_START========================================== + * ============LICENSE_START======================================================= * org.onap.aai - * =================================================================== + * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END============================================ + * ============LICENSE_END========================================================= */ package org.onap.aai.modelloader.util; diff --git a/src/test/java/org/onap/aai/modelloader/util/JsonXmlConverterTest.java b/src/test/java/org/onap/aai/modelloader/util/JsonXmlConverterTest.java index 7a42edf..2271c57 100644 --- a/src/test/java/org/onap/aai/modelloader/util/JsonXmlConverterTest.java +++ b/src/test/java/org/onap/aai/modelloader/util/JsonXmlConverterTest.java @@ -1,79 +1,78 @@ -/** - * ============LICENSE_START========================================== - * org.onap.aai - * =================================================================== - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ -package org.onap.aai.modelloader.util; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.io.ByteArrayInputStream; -import java.nio.file.Files; -import java.nio.file.Paths; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import org.junit.Test; -import org.onap.aai.modelloader.util.JsonXmlConverter; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class JsonXmlConverterTest { - - @Test - public void testConversion() throws Exception { - final String XML_MODEL_FILE = "src/test/resources/models/l3-network-widget.xml"; - final String JSON_MODEL_FILE = "src/test/resources/models/l3-network-widget.json"; - - try { - byte[] encoded = Files.readAllBytes(Paths.get(XML_MODEL_FILE)); - String originalXML = new String(encoded); - - assertFalse(JsonXmlConverter.isValidJson(originalXML)); - - encoded = Files.readAllBytes(Paths.get(JSON_MODEL_FILE)); - String originalJSON = new String(encoded); - - assertTrue(JsonXmlConverter.isValidJson(originalJSON)); - - String xmlFromJson = JsonXmlConverter.convertJsonToXml(originalJSON); - - // Spot check one of the attributes - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = builder.parse(new ByteArrayInputStream(xmlFromJson.getBytes())); - NodeList nodeList = doc.getDocumentElement().getChildNodes(); - - String modelVid = "notFound"; - for (int i = 0; i < nodeList.getLength(); i++) { - Node currentNode = nodeList.item(i); - if (currentNode.getNodeName().equals("model-invariant-id")) { - modelVid = currentNode.getTextContent(); - break; - } - } - - assertTrue(modelVid.equals("3d560d81-57d0-438b-a2a1-5334dba0651a")); - } catch (Exception e) { - e.printStackTrace(); - assertTrue(false); - } - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 European Software Marketing Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.aai.modelloader.util; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.ByteArrayInputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class JsonXmlConverterTest { + + @Test + public void testConversion() throws Exception { + final String XML_MODEL_FILE = "src/test/resources/models/l3-network-widget.xml"; + final String JSON_MODEL_FILE = "src/test/resources/models/l3-network-widget.json"; + + try { + byte[] encoded = Files.readAllBytes(Paths.get(XML_MODEL_FILE)); + String originalXML = new String(encoded); + + assertFalse(JsonXmlConverter.isValidJson(originalXML)); + + encoded = Files.readAllBytes(Paths.get(JSON_MODEL_FILE)); + String originalJSON = new String(encoded); + + assertTrue(JsonXmlConverter.isValidJson(originalJSON)); + + String xmlFromJson = JsonXmlConverter.convertJsonToXml(originalJSON); + + // Spot check one of the attributes + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(new ByteArrayInputStream(xmlFromJson.getBytes())); + NodeList nodeList = doc.getDocumentElement().getChildNodes(); + + String modelVid = "notFound"; + for (int i = 0; i < nodeList.getLength(); i++) { + Node currentNode = nodeList.item(i); + if (currentNode.getNodeName().equals("model-invariant-id")) { + modelVid = currentNode.getTextContent(); + break; + } + } + + assertTrue(modelVid.equals("3d560d81-57d0-438b-a2a1-5334dba0651a")); + } catch (Exception e) { + e.printStackTrace(); + assertTrue(false); + } + } +} diff --git a/src/test/resources/model-loader.properties b/src/test/resources/model-loader.properties index 91fd527..9f3226a 100644 --- a/src/test/resources/model-loader.properties +++ b/src/test/resources/model-loader.properties @@ -1,23 +1,30 @@ # Model Loader Distribution Client Configuration ml.distribution.ACTIVE_SERVER_TLS_AUTH=false -ml.distribution.ASDC_ADDRESS= +ml.distribution.ASDC_ADDRESS=localhost +ml.distribution.MSG_BUS_ADDRESSES=localhost ml.distribution.CONSUMER_GROUP=aai-ml-group-test ml.distribution.CONSUMER_ID=aai-ml-id-test -ml.distribution.ENVIRONMENT_NAME= +ml.distribution.ENVIRONMENT_NAME=env ml.distribution.KEYSTORE_PASSWORD= ml.distribution.KEYSTORE_FILE=asdc-client.jks -ml.distribution.PASSWORD= +ml.distribution.PASSWORD=Aa123456 ml.distribution.POLLING_INTERVAL=30 ml.distribution.POLLING_TIMEOUT=20 ml.distribution.USER=ci ml.distribution.ARTIFACT_TYPES=MODEL_INVENTORY_PROFILE,MODEL_QUERY_SPEC,VNF_CATALOG -# Model Loader AAI REST Client Configuration +# Model Loader Client Configuration for the A&AI REST interface ml.aai.BASE_URL= -ml.aai.MODEL_URL=/aai/v8/service-design-and-creation/models/model/ -ml.aai.NAMED_QUERY_URL=/aai/v8/service-design-and-creation/named-queries/named-query/ -ml.aai.VNF_IMAGE_URL=/aai/v8/service-design-and-creation/vnf-images +ml.aai.MODEL_URL=/aai/v*/service-design-and-creation/models/model/ +ml.aai.NAMED_QUERY_URL=/aai/v*/service-design-and-creation/named-queries/named-query/ +ml.aai.VNF_IMAGE_URL=/aai/v*/service-design-and-creation/vnf-images ml.aai.KEYSTORE_FILE=aai-client-cert.p12 ml.aai.KEYSTORE_PASSWORD= ml.aai.AUTH_USER=ModelLoader ml.aai.AUTH_PASSWORD= + +# Model Loader Client Configuration for the Babel Service +ml.babel.BASE_URL= +ml.babel.GENERATE_ARTIFACTS_URL=/services/babel-service/v1/app/generateArtifacts +ml.babel.KEYSTORE_FILE=aai-client-cert.p12 +ml.babel.KEYSTORE_PASSWORD= -- 2.16.6