diff options
author | mark.j.leonard <mark.j.leonard@gmail.com> | 2018-04-26 16:53:12 +0100 |
---|---|---|
committer | mark.j.leonard <mark.j.leonard@gmail.com> | 2018-04-26 16:53:50 +0100 |
commit | 6e4f04afea4c2d07fdd9c15eda38438c7baeb308 (patch) | |
tree | 8fd7e14ff590adb16f5b49221b3a7b901fd1fa4c | |
parent | 3a1f764b762a91e917e9e14a00c4a7ff3c4e0745 (diff) |
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 <mark.j.leonard@gmail.com>
91 files changed, 2349 insertions, 4989 deletions
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========================================================= @@ -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=<username> # 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=<host1>,<host2> @@ -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 @@ -<!-- edited with XMLSpy v2008 (http://www.altova.com) by AT&T (AT&T) --> -<!-- Edited with XMLSpy v2008 (http://www.altova.com) by Binh Quach (CINGULAR WIRELESS) --> -<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Durshetti (AT&T Wireless Services) --> -<!--Sample XML file generated by XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)--> -<PartnerProfile xmlns="http://csi.cingular.com/CSI/Namespaces/Configuration/PartnerProfile.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://csi.cingular.com/CSI/Namespaces/Configuration/PartnerProfile.xsd C:\csi_projects\CommonServices\Schemas\v36\CSI\Partner\PartnerProfile.xsd"> - <!-- - Each partner will be listed in a unique block below along with a description of the - authorized interfaces, and any parameters describing or required by the interface. - This is valid for Dev & ST, but IST will need to identify the partners expecting to - test the environment and add blocks to authorize them. - --> - <ModifierATTID>sg7477</ModifierATTID> - <UpdateTimeStamp>2013-06-30T00:06:07+05:30</UpdateTimeStamp> - <GlobalConnectionBlocking> - <ClientBlocking/> - <InterfaceBlocking/> - </GlobalConnectionBlocking> - <GlobalConnectionLimitsConfiguration> - <GlobalConnectionLimits> - <alertThreshold>100</alertThreshold> - <maxConnections>110</maxConnections> - </GlobalConnectionLimits> - <GlobalInterfaceConnectionLimits> - <interfaceName>AddAccount</interfaceName> - <InterfaceConnectionLimits> - <maxConnections>10</maxConnections> - </InterfaceConnectionLimits> - </GlobalInterfaceConnectionLimits> - <GlobalInterfaceConnectionLimits> - <interfaceName>AddNote</interfaceName> - <InterfaceConnectionLimits> - <alertThreshold>90</alertThreshold> - <maxConnections>110</maxConnections> - </InterfaceConnectionLimits> - </GlobalInterfaceConnectionLimits> - </GlobalConnectionLimitsConfiguration> - <GlobalTimeoutConfiguration> - <GlobalTimeout> - <minTimeout>5000</minTimeout> - <defaultTimeout>300000</defaultTimeout> - <maxTimeout>600000</maxTimeout> - </GlobalTimeout> - <GlobalInterfaceTimeout> - <interfaceName>AddNote</interfaceName> - <InterfaceTimeout> - <minTimeout>5000</minTimeout> - <defaultTimeout>250000</defaultTimeout> - <maxTimeout>300000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>CreateFiberServiceVOIPNumber</interfaceName> - <InterfaceTimeout> - <minTimeout>120000</minTimeout> - <defaultTimeout>300000</defaultTimeout> - <maxTimeout>300000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>InquireAccountProfile</interfaceName> - <InterfaceTimeout> - <minTimeout>5000</minTimeout> - <defaultTimeout>100000</defaultTimeout> - <maxTimeout>250000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>InquireUnbilledUsageDetail</interfaceName> - <InterfaceTimeout> - <minTimeout>5000</minTimeout> - <defaultTimeout>250000</defaultTimeout> - <maxTimeout>300000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>InquireWirelinePortEligibility</interfaceName> - <InterfaceTimeout> - <minTimeout>5000</minTimeout> - <defaultTimeout>330000</defaultTimeout> - <maxTimeout>600000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>QualifyAndQuoteFiberServiceProducts</interfaceName> - <InterfaceTimeout> - <minTimeout>120000</minTimeout> - <defaultTimeout>300000</defaultTimeout> - <maxTimeout>300000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>SendSms</interfaceName> - <InterfaceTimeout> - <minTimeout>5000</minTimeout> - <defaultTimeout>150000</defaultTimeout> - <maxTimeout>180000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>ValidateFiberServiceFacility</interfaceName> - <InterfaceTimeout> - <minTimeout>120000</minTimeout> - <defaultTimeout>1200000</defaultTimeout> - <maxTimeout>1200000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>ValidateFiberServiceFacilityResponse</interfaceName> - <InterfaceTimeout> - <minTimeout>120000</minTimeout> - <defaultTimeout>1200000</defaultTimeout> - <maxTimeout>1200000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>ExecuteWirelineMechanizedLoopTest</interfaceName> - <InterfaceTimeout> - <minTimeout>120000</minTimeout> - <defaultTimeout>1200000</defaultTimeout> - <maxTimeout>1200000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>ExecuteWirelineMechanizedLoopTestResponse</interfaceName> - <InterfaceTimeout> - <minTimeout>120000</minTimeout> - <defaultTimeout>1200000</defaultTimeout> - <maxTimeout>1200000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - <GlobalInterfaceTimeout> - <interfaceName>AppDev_NetworkPerformance</interfaceName> - <InterfaceTimeout> - <minTimeout>60000</minTimeout> - <defaultTimeout>100000</defaultTimeout> - <maxTimeout>250000</maxTimeout> - </InterfaceTimeout> - </GlobalInterfaceTimeout> - </GlobalTimeoutConfiguration> - <GlobalRuntimeEngineConfiguration> - <runtimeEngine>BW</runtimeEngine> - </GlobalRuntimeEngineConfiguration> - <GlobalIAPMaxAllowedCtns>25</GlobalIAPMaxAllowedCtns> - <GlobalIUCSPMaxAllowedCtns>10</GlobalIUCSPMaxAllowedCtns> - <GlobalACTFSTNPMaxAllowedCtns>10</GlobalACTFSTNPMaxAllowedCtns> - <GlobalADDFSTNPMaxAllowedCtns>10</GlobalADDFSTNPMaxAllowedCtns> - <GlobalIFSTNPSMaxAllowedCtns>10</GlobalIFSTNPSMaxAllowedCtns> - <Partner> - <userName>csitest</userName> - <userPassword>testingcsi</userPassword> - <originatorId>csitest</originatorId> - <isReseller>false</isReseller> - <isBusinessAllianceChannel>false</isBusinessAllianceChannel> - <salesChannelId>WALMART</salesChannelId> - <isBroker>false</isBroker> - <PartnerTimeoutConfiguration> - <minTimeout>500</minTimeout> - <defaultTimeout>300000</defaultTimeout> - <maxTimeout>600000</maxTimeout> - </PartnerTimeoutConfiguration> - <AuthorizedInterface> - <name>accountdetails</name> - <resource>v1</resource> - <allowedMethods>get</allowedMethods> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddContentProviderSponsor</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddEmployeeDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEmployeeDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireVoiceUsageDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateContentProviderSponsor</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireContentProviderSponsor</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCircuitTestResults</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccountProfileV78</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberProfileV78</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ScheduleCircuitTest</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelScheduledCircuitTest</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableCircuitTestList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitCircuitTest</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerTroubleTicketDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCustomerTroubleTicketDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddCustomerTroubleTicket</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ManageBusinessServices</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireMobileUsageDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateEnterpriseEndUserPermissions</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SwapCrossUpgradeEquipment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ManageMobilePaymentProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerAlarmList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerAlarmCount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCustomerAlarmAcknowledgment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireRatingModel</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerPurchaseEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerTroubleTicketList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerTroubleTicketCount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireResellerAccountProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitResellerContractInformation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireInternationalOfferings</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccessCircuitSummary</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEnterpriseOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEnterpriseOrderList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEnterpriseOrderStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEthernetDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerDigitalLifeInstallationProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDirectoryListingHeadings</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ManageDigitalLifeDevice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendDigitalLifeDeviceNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteWirelineMechanizedLoopTest</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteWirelineMechanizedLoopTestResponse</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNetworkAssetDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireVOIPProbeDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireVOIPAssetDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireManagedAssetDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteExternalIdVerificationQA</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireIPNetworkServiceLocationDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCreditCheckResult</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProcessDeviceUnlock</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelessDashboard</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineServiceAppointmentReservations</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateWirelineServiceAppointmentReservation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireTechnicianDispatchStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateIDDBAutoGroup</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateIDDBDailyRules</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateIDDBGeography</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateIDDBMasterTemplate</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateOpenDeviceEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateOpenDeviceEmailAddressAvailability</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveAvailableOpenDeviceProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveOpenDeviceDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateAndQualifyOpenDeviceAddress</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveOpenDeviceTax</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateOpenDeviceCustomer</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateOpenDeviceCustomerOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddRetailStoreAppointment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateAddressServiceAvailability</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableRetailStoreAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireRetailStoreAppointmentReferenceDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFanProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireRetailStoreAppointmentList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireKeyValueStore</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateKeyValueStore</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AppDev_NetworkPerformance</name> - <resource>wireless</resource> - <allowedMethods>get</allowedMethods> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCustomerIdentifiers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNetworkLatency</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNetworkTrafficDensity</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireReferenceCodeList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBillList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberBilledCallDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberCharges</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSwitchCircuitDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSwitchCircuitList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddBillAccounts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddUCOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>OrderDeviceProtectionPlan</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ResetEwalletSecurityProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCustomerSalesSupportDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdatePartnerServicesProductStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSubscriberParentalControls</name> - <voltageEnabledIndicator>false</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCPEDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNonSBSInventory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateUCCustomerProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUCCustomerProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateUCCustomerNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AuthorizeLOAUpdate</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReleaseInquiredTelephoneNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateTelephoneNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateLOADetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBVOIPSiteProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUpsellEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireIncompatibleOfferings</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBVOIPSubscriberAssociation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendBVOIPSubscriberAssociationNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateWirelineServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineDirectoryAvailability</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableCustomerSparePairsSummary</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateUnifiedCustomerLoginProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEnterpriseDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePaymentProductApplicationResult</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireTroubleTicketStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireTroubleReferenceDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireTroubleTicketHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateTroubleTicketDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddEnterpriseTroubleTicket</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireContractTerminationDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdatePaymentPreferences</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReserveWirelineServiceAppointment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelinePendingOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitWirelineFacilityAssignmentOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelinePendingOrderDetailsResponse</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddTroubleTicket</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFemtocellDevice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFemtocellDevice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendTroubleTicketStatusNotice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineTechnicianAssignments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableFiberServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitMechanizedLoopTest</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePortedTNList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelinePortDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireHostRoutingDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBundledOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBundledAccountServices</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBundledAccountServices</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateWirelineWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberCallList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSubscriberCallList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateCreditPolicy</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddPaymentProfile</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateSwitchFeatures</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddTechnicianTroubleNote</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdatePaymentProfile</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSBSBundledDiscountSubscriberList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExchangePerformanceMetrics</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBundledOrderStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableBundlePackages</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBundledOrderList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>DeletePaymentProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBillingPreferences</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendBillingPreferencesNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePaymentProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireServiceAvailabilityForLocation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateCustomer</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateDevice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateFemtocellService</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateFiberServiceResidentialGateway</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateFiberServiceTNPort</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivatePendingEquipmentUpgrade</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateSubscriber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateSubscriberReseller</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateSubscriberResellerResponse</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ActivateSubscriberResponse</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>Add3PPOrderNotes</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>Add3PPOrderShipment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddAccount</name> - <InterfaceConnectionConfiguration> - <maxConnections>25</maxConnections> - </InterfaceConnectionConfiguration> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddAffiliateDiscount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddATTConnectAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddCombinedBilling</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddCreditPolicyProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddCustomerDeviceSalesData</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddBundledOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBundledOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddFemtocellAddress</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddFemtocellCALEALocation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddFemtocellProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddFiberServiceAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddFiberServiceCreditPolicy</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddFiberServiceTNPort</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddInsuranceClaimOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddNetworkElementTroubleReport</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddNote</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddOrderEmail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddOtherChargesCredits</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddPayment</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddPort</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddPrepaidFeature</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddPrepaidPayment</name> - <InterfaceTimeoutConfiguration> - <minTimeout>5000</minTimeout> - <defaultTimeout>300000</defaultTimeout> - <maxTimeout>300000</maxTimeout> - </InterfaceTimeoutConfiguration> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddPromiseToPay</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddRemoveProductCodeIndicator</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddSbcCombinedBilling</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddSbcSaleInformation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddSmsPayment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddWirelineNote</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddWirelineOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddWirelinePayment</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddWirelinePaymentPlan</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ApplyDataTreatment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ApplyFiberServiceCreditPolicy</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ApplyPrepaidPayment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ApplyPrepaidVoucher</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AuthenticateFanPassword</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AuthenticateFanPin</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AuthorizeCreditCard</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CalculateSatelliteServiceTaxes</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CalculateTaxes</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>Cancel3PPOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelCombinedBilling</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelCopay</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelFemtocellE911Service</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelFemtocellNetwork</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelFemtocellService</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelFiberServiceWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelHLRRegistration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelInsuranceClaimOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelPendingEquipmentUpgrade</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelPort</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelReservedFiberServiceVOIPNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelWirelinePayment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ChangeSubscriberNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CheckEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ConfirmHLRRegistration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ConfirmWirelineTNReservation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateFiberServiceAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateFiberServiceVOIPNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateFiberServiceWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateSatelliteServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>DeleteFemtocellAddress</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>DeleteFemtocellProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>DetermineFiberServiceAccountHistoryList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>DetermineFiberServiceDuplicateApplicationList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>Echo</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteAffiliateCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteFiberServiceCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteNBIMigration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteSalesOpportunityCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteWirelineCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteWirelineTroubleReportFunction</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>Generic</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InitiateFiberServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InitiateUnifiedCreditPolicyRetrieval</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccessoryPricing</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccountList</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccountPaymentHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccountProfile</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAccountSubscribers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireActivationCommissionCodes</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAdditionalOfferings</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAddressMatch</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateAccountPaymentBalance</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateAccountProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateCustomerAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateGeneralMessages</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateOrderStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateProductCatalog</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateProductConfiguration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateProductDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateProductOfferingEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateServiceQualification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAffiliateServiceScheduling</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireARRemittance</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireATTCreditCardOffer</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireATTCreditCardOfferList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAutomaticPayment</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableAccessory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableFiberServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableCircuitSparePairs</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableDevice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableFees</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableFiberServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableFiberServiceCustomers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableFiberServiceVOIPNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableItemQuantity</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableOfferDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableOffers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailablePortInSubscriber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableSatelliteServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableSubscriberNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCollectionData</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCombinedBillingEligibility</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireContractedConversionFee</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCopayEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCopaySubscriber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCopaySubscriberHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCPNIContactInformation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCpniPreferenceHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCreditCheckResult</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCreditPolicyProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerDeviceSalesData</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDataAccessEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDataTreatmentHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDepositPaymentStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDeviceDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDeviceShippingInformation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireDuplicateOfferings</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEquipmentOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEquipmentOrderInvoice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEquipmentPricing</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEstimatedFulfillmentTime</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireExistingCustomer</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFanProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFemtocellAddressList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFemtocellDeviceList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFemtocellEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFemtocellProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceAccountDetails</name> - <!-- indicator should be set based on client voltage status--> - <voltageEnabledIndicator>false</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceAssignedProductDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceCircuitDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceCreditVerificationQuestions</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceCrossProductPackages</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceEquipmentDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceOfferEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceOrderDetail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceOrderList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceOrderStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceProductDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceQualification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceQuotation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceSubscriptionAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServicePendingAdjustments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceTNPortStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceUsageDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireFiberServiceVOIPPortEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireInsuranceClaimOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireInsuranceClaimReplacementProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireInternationalRoamingMinutes</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireInternationalRoamingUsageParameters</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireLandLinePaymentServiceFee</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireLastSuccessfulPayment</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireMarketByZip</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireMarketServiceAreas</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireMaximumDryLoopFTNAllowed</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireMessagingCapabilities</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNBIMigrationEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireOfferHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireOfferingEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireOTAHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireOTAProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePaymentLocationDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePendingPricePlan</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePort</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePortActivationStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePortEligibilityByRange</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePortEligibilityBySubscriberNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidBalance</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidFeatures</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidFeaturesHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidPaymentEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidPricePlans</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidPINDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePrepaidSubscriberProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePricePlanList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePricePlans</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquirePurchaseOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSatelliteServiceOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSatelliteServiceProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSatelliteServiceQualification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSatelliteServiceQuotation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSbcCombinedBillingEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireServiceAreaByZip</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireServiceOrderActivationStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSharedGroupUpdateStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireShippingZipBySubscriberNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSIMStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberParentalControls</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberPin</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberProfile</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberServiceStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberTransactionData</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriptionAccountIdentifiers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineSwitchProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSwitchTransactionStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnbilledUsageDetail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCustomerProfileByServiceLocation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCustomerServiceProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUpgradeEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWiFiEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineAccountProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineAccountAssociations</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireInternetSubscriptionAccounts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineBillingAccountList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineCreditApplicationList</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineCreditVerificationQuestions</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineCustomerAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineDSLandConnectTechOrderDetail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineDTVOrderDetail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineFiberServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineGeneralMessages</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineNetworkChannelDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineNonRecurringCharges</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineOpenTroubleReports</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineOrderStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelinePaymentHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelinePaymentPlan</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelinePortEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableTelephoneNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReserveTelephoneNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineProductCatalog</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineProductConfiguration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineProductCount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineProductDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineProductsForResource</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineRegion</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineServiceQualification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineServiceScheduling</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineQualifiedProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineServiceOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineTelcoOrderDetail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineTransportDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineUsageDetail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineWholesaleProductFamilies</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>MaintainAffiliateAccountAssociation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ManageAutomaticPayments</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ManageCopay</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ManageSubscriberPin</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ModifySatelliteServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelSatelliteServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>MoveSubscriber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>NotifyFemtocellAction</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>OrderEquipment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>OrderEquipmentWithValidation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>OrderFiberService</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ParseUnfieldedWirelineAddress</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>PortFiberServiceTelephoneNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProcessEcho</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProcessEchoBackOffice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProcessEchoFrontOffice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProcessWirelineCPNIElection</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProvisionAddressBookService</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProvisionFemtocellE911Service</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProvisionFemtocellNetwork</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProvisionFemtocellRegistration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>PublishUnifiedCreditPolicy</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>QualifyAndQuoteFiberServiceProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>QualifyProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RegisterFemtocellService</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReleaseAvailableFiberServiceVOIPNumbers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReleaseDryLoopFTN</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReleaseSubscriberNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RemoveCustomerDeviceSalesData</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ResendOTAProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReserveFiberServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReserveFiberServiceVOIPNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ReserveSubscriberNumber</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ResetVoiceMailPassword</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveAbandonedFiberServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveFiberServiceAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveFiberServiceAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveFiberServiceOrderStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveFiberServiceProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveOrderDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveQuotation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>RetrieveUnifiedCreditPolicy</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ScheduleAppointments</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ScheduleSatelliteServiceInstallation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendAccountNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendCPNINotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendEmail</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendFanProfileNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendFiberServiceTNPortNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendFiberServiceWorkOrderNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendFiberServiceWorkOrderNotificationAsync</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendSms</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendSmsResponse</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendTreatmentNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitATTCreditCard</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitFiberServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitFiberServiceTNAssignmentOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitWalmartProxy</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SwapEquipment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SwapFemtocellDevice</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateAccountDisputeDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateAccountManager</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateAccountProfile</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateAccountStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateAffiliateProductOffering</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBillMedia</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCpniPreference</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCreditPolicyProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateDepositPaymentStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateDeviceInventory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateDeviceProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateEwalletStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEwalletEventHistory</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEwalletSubscriberProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerSnapshot</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFemtocellCALEALocation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFemtocellProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFiberServiceAccount</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFiberServiceAccountDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFiberServiceCreditApplication</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateInternationalRoamingUsageParameters</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateOfferDisposition</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdatePort</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdatePrepaidFeature</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdatePrepaidSubscriberProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSalesOpportunityCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSatelliteServiceAccountAssociation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSubscriberAddressBookIdentifier</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSubscriberProfile</name> - <InterfaceTimeoutConfiguration> - <minTimeout>5000</minTimeout> - <defaultTimeout>100000</defaultTimeout> - <maxTimeout>120000</maxTimeout> - </InterfaceTimeoutConfiguration> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateSubscriberStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateVoiceMailProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateWirelineAccountProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateWirelineCPNIPreference</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateWirelineCreditApplication</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateWirelineTroubleReport</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpgradeEquipment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpqueryAffiliateOfferingEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateAddress</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateAffiliateCustomer</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateAffiliateOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateCreditCard</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFemtocellCoverageArea</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFemtocellE911Coverage</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFemtocellEquipmentIdentifier</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFemtocellWhitelist</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFiberServiceCreditPolicy</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFiberServiceCreditVerificationAnswers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFiberServiceFacility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFiberServiceFacilityResponse</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFiberServiceFacilityNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateFiberServiceProductDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateSatelliteServiceProducts</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateShippingPriority</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateWirelineCreditVerificationAnswers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateWirelineCustomer</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateWirelineOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineFutureAvailability</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateWirelinePostalAddress</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelMobileContent</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireMobileContentDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFiberServiceOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteUnifiedCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendPaymentProductApplicationResultNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ConfirmUnifiedCreditAccountDebtPayment</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCreditAccountDebtDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCreditVerificationQuestions</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitUnifiedCreditApplication</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateUnifiedCreditApplication</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateUnifiedCreditVerificationAnswers</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCreditAdverseActionLetter</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCreditPolicyDecision</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>NotifyUnifiedCreditOrderSubmission</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AssignAvailableWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendNetworkPathWorkOrderStatusNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ProcessNetworkPathWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateCentralOfficeWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCentralOfficeWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateFiberServiceRepairWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CreateFiberServiceRepairWorkOrderAsnyc</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendRepairWorkOrderNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelFiberServiceRepairWorkOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>CancelFiberServiceRepairWorkOrderAsnyc</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedCustomerLoginProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCustomerSubscriptionDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendCancelWorkOrderNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineAccountLevelCSR</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireWirelineServiceLevelCSR</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireUnifiedPaymentProfile</name> - <voltageEnabledIndicator>true</voltageEnabledIndicator> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCloudServiceDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNote</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateSubscriberOfferings</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>AddBundledOrderV48</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBundledAccountServicesV48</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateBundledOrderV48</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateBundledOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBundledAccountProfile</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireRecommendationDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireEnterpriseEndUserPermissions</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNCIMigrationEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteNCIMigration</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateCommonOrder</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireBillCycleDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireCommonOrderListDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ValidateWirelineTroubleReportCompletion</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberContractDetails</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>ExecuteExternalCreditCheck</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireExternalApplicantKey</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateExternalCreditApplication</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SendExternalCreditResultNotification</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireAvailableRetailStoresByLocation</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateEnterpriseEndUserPermissions</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSubscriberServiceEligibility</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>UpdateFemtocellWhiteLists</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNetworkProductCatalog</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireNetworkProductPriceQuote</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>SubmitSLACreditClaim</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSLACreditClaimStatus</name> - </AuthorizedInterface> - <AuthorizedInterface> - <name>InquireSLANetworkCreditClaimStatus</name> - </AuthorizedInterface> - <ServicePolicy> - <name>WHOLESALE-CUSTOMER-IDDELETE</name> - <value>walmartID</value> - </ServicePolicy> - <ServicePolicy> - <name>WHOLESALE-CUSTOMER-NAME</name> - <value>walmart</value> - </ServicePolicy> - <ServicePolicy> - <name>WHOLESALE-CUSTOMER-RESTRICTED-STATES</name> - <value>alaska</value> - </ServicePolicy> - <ServicePolicy> - <name>BID_ID</name> - <value>PlatinumSP</value> - </ServicePolicy> - <ServicePolicy> - <name>EBM_ORGID</name> - <value>o3hevdtz</value> - </ServicePolicy> - <ServicePolicy> - <name>REMOTE-CALL</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>CALL_NUMERITRACK</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>HEARTBEAT-INTERVAL</name> - <value>20</value> - </ServicePolicy> - <ServicePolicy> - <name>AP-CALL-RSN-FOR-WLNP-TLG</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>AS-PROCESS-DISCOUNTS</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>AS-RETRY-ON-TRANSIENT-ERROR</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>AS-STORE-MARKET</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>CATALOG_TYPE</name> - <value>WALMART Catalog</value> - </ServicePolicy> - <ServicePolicy> - <!-- Should be true only for ACME --> - <name>CHECK-FOR-MARKETLOOKUP-SOFTERROR</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>EQUIPMENT-UPGRADE-MAX-RETRY-INTERVAL</name> - <value>0</value> - </ServicePolicy> - <ServicePolicy> - <name>EQUIPMENT-UPGRADE-TRACKING-REQUIRED</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>IAL-AV-REQUIRED</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>IAP-ALLOWED-MASK-VALUES</name> - <value>CR:TD:SL:SN:SC:DC:UD:VU:VU+PT:VU+PR:VU+PT+PR:DU:DU+PR:UE</value> - </ServicePolicy> - <ServicePolicy> - <name>IAP-AV-REQUIRED</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>INFO-RESTRICT-LEVEL</name> - <value>Unrestricted</value> - </ServicePolicy> - <ServicePolicy> - <name>ISP-ALLOWED-MASK-VALUES</name> - <value>DI:DC:UD:VU:VU+PT:VU+PR:VU+PT+PR:DU:DU+PR:UE</value> - </ServicePolicy> - <ServicePolicy> - <name>IUCSP-MAX-ALLOWED-CTNS</name> - <value>10</value> - </ServicePolicy> - <ServicePolicy> - <name>IUCSP-NEW-KIT-WARRANTY-DAYS</name> - <value>366</value> - </ServicePolicy> - <ServicePolicy> - <name>IUCSP-REFURBISHED-KIT-WARRANTY-DAYS</name> - <value>90</value> - </ServicePolicy> - <ServicePolicy> - <name>IUCSP-SEED-KIT-WARRANTY-DAYS</name> - <value>366</value> - </ServicePolicy> - <ServicePolicy> - <name>IUUD-ALLOWED-MASK-VALUES</name> - <value>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</value> - </ServicePolicy> - <ServicePolicy> - <name>IWPE-LSR11-ACCESS-DENIED</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>TN-REQUEST-CATEGORY</name> - <value>MCSICVOIP</value> - </ServicePolicy> - <ServicePolicy> - <name>MARKET-STATUS-LOOKUP</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>MEMO-NOTE-USER</name> - <value>WEB</value> - </ServicePolicy> - <ServicePolicy> - <name>NBI-ACCESS-DECLINED</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>PREAUTHORIZED-CREDIT-CHECK</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <!-- Should always be true for IST and almost always false for prod --> - <name>RESTRICTED-TO-TEST-CALLS</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>RESELLER-TEST-DEALER-CODE</name> - <value>IJX57</value> - </ServicePolicy> - <ServicePolicy> - <name>UPGRADE-EQUIPMENT-NEW-SALES-CHANNEL</name> - <value>U2</value> - </ServicePolicy> - <ServicePolicy> - <name>UPGRADE-EQUIPMENT-UPGRADE-SECURITY-CODE</name> - <value>III</value> - </ServicePolicy> - <ServicePolicy> - <name>USE-GENERIC-ASYNC-RESPONSE</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>USOC-INFO-DATA-SOURCE</name> - <value>CURRENT</value> - </ServicePolicy> - <ServicePolicy> - <name>VFSF-OAT-REQUIRED-MSG-LOOKUP</name> - <value>false</value> - </ServicePolicy> - <ServicePolicy> - <name>VFSF-CLIENT-REQ-TYPE</name> - <value>Negotiation</value> - </ServicePolicy> - <ServicePolicy> - <name>VFSF-CLIENT-ID</name> - <value>BBNMS</value> - </ServicePolicy> - <ServicePolicy> - <name>SMS-DESTINATION-PORT</name> - <value>-1</value> - </ServicePolicy> - <ServicePolicy> - <name>CTVCODE-SERVICE-MAINTENANCE</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>XI-APPLICATION-CONTEXT</name> - <value>OPSS</value> - </ServicePolicy> - <ServicePolicy> - <name>IN-MAX-BILLING-NOTE-QUANTITY</name> - <value>300</value> - </ServicePolicy> - <ServicePolicy> - <name>ITTH-TL-MAX-RECORDS-TO-FETCH</name> - <value>50</value> - </ServicePolicy> - <ServicePolicy> - <name>ITTH-ITH-MAX-RECORDS-TO-FETCH</name> - <value>30</value> - </ServicePolicy> - <ServicePolicy> - <name>IEEUP-SYSTEM-ID</name> - <value>premier</value> - </ServicePolicy> - <ServicePolicy> - <name>SUBSCRIPTION_CLASS</name> - <value>S</value> - </ServicePolicy> - <ServicePolicy> - <name>MOBILE_PAYMENTS_PARTNER_ID</name> - <value>S</value> - </ServicePolicy> - - <ServicePolicy> - <name>IUCPBYSL-GRID-CLIENT</name> - <value>true</value> - </ServicePolicy> - <ServicePolicy> - <name>APPLICATION_ID</name> - <value>ONSTAR</value> - </ServicePolicy> - <ServiceProviderCredentials> - <system>AES</system> - <userName>NRETLTEL</userName> - <userPassword>NRETLTEL</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>BOSS</system> - <userName>testcsi</userName> - <userPassword/> - <CredentialPolicy> - <name>RACFID</name> - <value>pb1975</value> - </CredentialPolicy> - <CredentialPolicy> - <name>RACFPASSWORD</name> - <value>Light@1</value> - </CredentialPolicy> - <!--CredentialPolicy> - <name>BOSSTYPISTID</name> - <value>1K34</value> - </CredentialPolicy--> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>BSTECSC</system> - <userName>CSI</userName> - <userPassword>a2p2!!b1</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>CAM</system> - <userName>CSIQC</userName> - <userPassword>CSIQC</userPassword> - <CredentialPolicy> - <name>AccountType</name> - <value>S</value> - </CredentialPolicy> - <CredentialPolicy> - <name>SubAccountType</name> - <value>T</value> - </CredentialPolicy> - <CredentialPolicy> - <name>WaiveActivationFee</name> - <value>true</value> - </CredentialPolicy> - <CredentialPolicy> - <name>WaiveUpgradeFee</name> - <value>true</value> - </CredentialPolicy> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>CBS</system> - <userName>ZCINGP1</userName> - <userPassword/> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>CPSOS</system> - <userName>c48794</userName> - <userPassword>7941!c48</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>DLC</system> - <userName>CSIQC</userName> - <userPassword/> - <CredentialPolicy> - <name>DLC_APP_ID</name> - <value>ASURION</value> - </CredentialPolicy> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>GCS</system> - <userName>CSIQC</userName> - <userPassword/> - <CredentialPolicy> - <name>GCS_MERCHANT_ID</name> - <value>001342</value> - </CredentialPolicy> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>InterconnectRC</system> - <userName>csitest</userName> - <userPassword/> - <CredentialPolicy> - <name>interconnectUSERID</name> - <value>SBC001T</value> - </CredentialPolicy> - <CredentialPolicy> - <name>interconnectPASSWORD</name> - <value>GC@\u0011W4\#""6/\u001172OK</value> - </CredentialPolicy> - <CredentialPolicy> - <name>interconnectLightSpeedUSERID</name> - <value>SBC002T</value> - </CredentialPolicy> - <CredentialPolicy> - <name>interconnectLightSpeedPASSWORD</name> - <value>GAN\u0016T4\#""6/\u001072OK</value> - </CredentialPolicy> - <CredentialPolicy> - <name>interconnectConsumerUSERID</name> - <value>SBC003T</value> - </CredentialPolicy> - <CredentialPolicy> - <name>interconnectConsumerPASSWORD</name> - <value>GCC\u0017P4\#""6/\u001372OK</value> - </CredentialPolicy> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>LNPSOA</system> - <userName/> - <userPassword/> - <CredentialPolicy> - <name>LNPSOA_APP_ID</name> - <value>QC</value> - </CredentialPolicy> - <!--CredentialPolicy> - <name>LNPSOA_USER_ID</name> - <value>RMBISQC</value> - </CredentialPolicy--> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>MRE</system> - <userName>OPUS</userName> - <userPassword>OPUS</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>NSM</system> - <userName>ACME</userName> - <userPassword/> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>OrderTrack</system> - <userName>csitest</userName> - <userPassword/> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>PDC</system> - <userName>RS</userName> - <userPassword/> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>QPAY</system> - <userName>CSI_FDC</userName> - <userPassword>CSI_FDC</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>SWOT-LITE</system> - <userName>cingultest</userName> - <userPassword>j9WWuopev9</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>TLGAPI</system> - <userName>rimprov1</userName> - <userPassword>unix11</userPassword> - <CredentialPolicy> - <name>APP_ID</name> - <value>TLGAPI</value> - </CredentialPolicy> - <CredentialPolicy> - <name>CALLER_IND</name> - <value>FR</value> - </CredentialPolicy> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>YODA</system> - <userName>WTS</userName> - <userPassword>CSITest</userPassword> - </ServiceProviderCredentials> - <ServiceProviderCredentials> - <system>EDGE</system> - <userName>WMS</userName> - <userPassword>WMS</userPassword> - </ServiceProviderCredentials> - <AsyncCallbackConfig> - <allowHttp>true</allowHttp> - <RetryPolicy> - <timeout>30000</timeout> - <numRetries>3</numRetries> - <delay>3000</delay> - </RetryPolicy> - <SSLConfig> - <enableHostNameVerification>false</enableHostNameVerification> - <enableTwoWaySSL>false</enableTwoWaySSL> - <ServerCertificateDetails> - <trustStoreLocation>/opt/app/sg_q7/tibco/jre/lib/security/cacerts</trustStoreLocation> - <trustStorePassword>changeit</trustStorePassword> - </ServerCertificateDetails> - <ClientCertificateDetails> - <keyStoreLocation>/opt/app/sg_q7/gateway_a/config/ActingAsClient.keystore</keyStoreLocation> - <keyStorePassword>client</keyStorePassword> - </ClientCertificateDetails> - </SSLConfig> - </AsyncCallbackConfig> - <performPrepaidDeviceCheck>true</performPrepaidDeviceCheck> - </Partner> -</PartnerProfile> 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 @@ -<!-- - ============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============================================ - --> -<configuration scan="true" scanPeriod="3 seconds" debug="true"> - <property name="logDirectory" value="${AJSC_HOME}/log" /> - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>ERROR</level> - </filter> - <encoder> - <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n - </pattern> - </encoder> - </appender> - - <appender name="INFO" - class="ch.qos.logback.core.rolling.RollingFileAppender"> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>DEBUG</level> - </filter> - <file>${logDirectory}/info_ajsc.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${logDirectory}/info_ajsc.%i.log.zip - </fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <triggeringPolicy - class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern> - </encoder> - </appender> - <appender name="ERROR" - class="ch.qos.logback.core.rolling.RollingFileAppender"> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>ERROR</level> - </filter> - <file>${logDirectory}/error_ajsc.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${logDirectory}/error_ajsc.%i.log.zip - </fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <triggeringPolicy - class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <!-- <pattern>"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n"</pattern> --> - <pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern> - </encoder> - </appender> - - <appender name="AJSC-AUDIT" class="ch.qos.logback.classic.net.SyslogAppender"> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>INFO</level> - </filter> - <syslogHost>localhost</syslogHost> - <facility>USER</facility> - <!-- Note the colon character below - it is important part of "TAG" message - format You need a colon to determine where the TAG field ends and the CONTENT - begins --> - <suffixPattern>AJSC_AUDIT: [%thread] [%logger] %msg</suffixPattern> - </appender> - <appender name="CONTROLLER-AUDIT" class="ch.qos.logback.classic.net.SyslogAppender"> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>INFO</level> - </filter> - <syslogHost>localhost</syslogHost> - <facility>USER</facility> - <!-- Note the colon character below - it is important part of "TAG" message - format You need a colon to determine where the TAG field ends and the CONTENT - begins --> - <suffixPattern>AJSC_AUDIT: [%thread] [%logger] mdc:[%mdc] %msg - </suffixPattern> - </appender> - - <root level="off"> - <appender-ref ref="ERROR" /> - <appender-ref ref="INFO" /> - <appender-ref ref="STDOUT" /> - </root> -</configuration> diff --git a/ajsc-shared-config/etc/spm2.jks b/ajsc-shared-config/etc/spm2.jks Binary files differdeleted file mode 100644 index 8ff2a00..0000000 --- a/ajsc-shared-config/etc/spm2.jks +++ /dev/null diff --git a/antBuild/build.xml b/antBuild/build.xml deleted file mode 100644 index 72e4fca..0000000 --- a/antBuild/build.xml +++ /dev/null @@ -1,248 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ============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============================================ - --> -<project> - <target name="runLocal"> - <java dir="${basedir}" fork="yes" newenvironment="true" - failonerror="true" classname="com.att.ajsc.runner.Runner"> - <classpath - path="${classpath}:${basedir}/ajsc-shared-config/etc:${runAjscHome}/lib/ajsc-runner-${ajscRuntimeVersion}.jar" /> - - <!-- Windows Users may need to add a jvmarg arg to create a temp directory - properly. --> - <!-- <jvmarg value="-Djava.io.tmpdir=C:/yourTempDirectory"/> --> - - <!-- Uncomment the following 2 jvmarg values to enable Remote Debugging. - --> - <!-- <jvmarg value="-Xdebug" /> --> - <!-- <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5432" - /> --> - - <jvmarg value="-XX:MaxPermSize=512m" /> - <jvmarg value="-Xmx1024m" /> - - <!-- Main ajsc Variables below (Variables necessary for proper startup - of AJSC) --> - <env key="AJSC_HOME" value="${runAjscHome}" /> - <sysproperty key="AJSC_HOME" value="${runAjscHome}" /> - <!-- you may specify any external location for AJSC_CONF_HOME where etc - folder & all other configs can be found under it. If not specified, it will - default to AJSC_HOME --> - <sysproperty key="AJSC_CONF_HOME" value="${basedir}/bundleconfig-local" /> - <sysproperty key="AJSC_SHARED_CONFIG" value="${basedir}/ajsc-shared-config" /> - - <!-- Location of logback.xml file used for logging configurations. Please, - note, when deploying a service to either CSI or NON-CSI environment, this - system property will be set in sys-props.properties file. We are setting - it here for running locally due to the ease of use of maven variable for - basedir. --> - <sysproperty key="logback.configurationFile" - value="${basedir}/ajsc-shared-config/etc/logback.xml" /> - - <!-- Setting system properties for the AJSC external libs and properties - folders below. When deploying to a node, these properties will be set within - the bundleconfig/etc/sysprops/sys-props.properties file. However, when running - locally, the ${basedir} substitution works more efficiently in this manner. --> - <sysproperty key="AJSC_EXTERNAL_LIB_FOLDERS" value="${basedir}/target/commonLibs" /> - <sysproperty key="AJSC_EXTERNAL_PROPERTIES_FOLDERS" - value="${basedir}/ajsc-shared-config/etc" /> - - <!-- End of Main ajsc Variables below (Variables necessary for proper - startup of AJSC) --> - - <!-- Uncomment the following line to add oauthentication to your Service --> - <!-- <sysproperty key="spring.profiles.active" value="oauth" /> --> - - <!-- If using Cassandra as Database, Enter the ip/host and port below - based on your known configuration --> - <!-- <sysproperty key="cassandra.ip" value="hostname" /> --> - <!-- <sysproperty key="cassandra.port" value="9042" /> --> - - <!-- The APP_SERVLET_URL_PATTERN variable is defaulted to "/services" - within the initial configuration of the AJSC. If you are changing the CamelServlet - Filter within the ajsc-override-web.xml, you should use that url-pattern - here. This is necessary to properly register your service with dme2. An empty - value, "", is used when NO value is wanted (url-pattern would be /* for CamelServlet - Filter) --> - <!-- As of 4.5.1, this property is no longer needed --> - <!-- <sysproperty key="APP_SERVLET_URL_PATTERN" value="/services" /> --> - - <!-- GRM/DME2 System Properties below --> - <sysproperty key="AJSC_SERVICE_NAMESPACE" value="${module.ajsc.namespace.name}" /> - <sysproperty key="AJSC_SERVICE_VERSION" value="${module.ajsc.namespace.version}" /> - <sysproperty key="SOACLOUD_SERVICE_VERSION" value="${project.version}" /> - <!-- End of GRM/DME2 System Property Variables --> - - <!-- The following server.port variable was necessary for the proper registration - of the AJSC to dme2. This value may still need to be used if the Developer - is hardcoding their port (example: 8080). Then, the server.port value="8080". - The default functionality for the AJSC is to use EPHEMERAL ports. In this - case, you do NOT need to set the server.port value. The AJSC will find the - proper port value and register to dme2 correctly --> - <!-- <sysproperty key="server.port" value="${serverPort}" /> --> - - <!-- Command Line Arguments to add to the java command. Here, you can - specify the port as well as the Context you want your service to run in. - Use context=/ to run in an unnamed Context (Root Context). The default configuration - of the AJSC is to run under the /ajsc Context. Setting the port here can - aid during the development phase of your service. However, you can leave - this argument out entirely, and the AJSC will default to using an Ephemeral - port. --> - <arg line="context=/ port=${serverPort} sslport=${sslport}" /> - </java> - </target> - <target name="prep_home_directory_for_swm_pkgcreate"> - -<!-- ********* GENERATE CADI KEY AND ENCRYPTED PASSWORD *********** - - Uncomment the following if your cadi key get corrupted , It would - generate the Cadi key and password in the package phase and keep the key - in the 'src/main/config/ajscKey' and password in the bottom of cadi.properties(you - need to modify the 'aaf_pass' variable with this value . Plese modify the - template.cadi.properties as well before uploading to SOA node ---> - -<!-- - <java jar="${basedir}/target/userjars/cadi-core-1.2.5.jar" fork="true"> - <arg value="keygen" /> <arg value="src/main/config/ajscKey" /> - </java> - - <echo>***Cadi Key file generated ****</echo> - - <java jar="${basedir}/target/userjars/cadi-core-1.2.5.jar" - fork="true" append="true" output="${basedir}/src/main/config/cadi.properties"> - <arg value="digest" /> <arg value="ajscRocks!" /> <arg value="src/main/config/ajscKey" - /> - </java> - ---> - - - - <!-- These tasks are copying contents from the installHomeDirectory into - the eventual $AJSC_HOME directory for running locally and soa cloud installation --> - <echo message="ENTERING 'prep_home_directory_for_swm_pkgcreate' ant tasks" /> - - <!-- Please, NOTE: The ajsc-archetype is setup for a default CSI Env deployment. - If you are deploying to a CSI Env, you should NOT have to change anything - within this build file. However, if you are NOT deploying to a CSI Env, you - should comment OUT the CSI related portion of this build.xml. --> - - <!-- The following code snippet is copying the bundleconfig-csi directory - to the proper installation/bundleconfig directory used in CSI envs. If you - are NOT installing to a CSI node, you should comment out (or delete) the - following snippet, and uncomment the NON-CSI copy task to copy EVERYTHING - to the installation/bundleconfig directory. --> - - <!-- CSI related bundleconfig copy task. If you are NOT deploying to a - CSI Env, please COMMENT OUT or delete the following copy task code snippet. --> - <!--<copy toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/bundleconfig" - failonerror="true"> <fileset dir="${basedir}/bundleconfig-csi" /> </copy> --> - <!-- End of CSI related bundleconfig copy task --> - - <!-- NOTE: If you are NOT deploying to CSI environment, and you are NOT - using an AJSC_SHARED_CONFIG location on a node, you should go ahead and copy - EVERYTHING from bundleconfig and ajsc-shared-config (logback.xml) directory - to utilize proper logging from logback.xml. Simply, uncomment the following - code snippet below to copy EVERYTHING and comment out the CSI related build - script above. --> - <!-- NON-CSI related build copy task. Please, uncomment the following code - snippet to deploy the proper artifacts to a NON-CSI Env. --> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/bundleconfig" - failonerror="true"> - <fileset dir="${basedir}/bundleconfig-local" includes="**/**" /> - </copy> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/bundleconfig/etc" - failonerror="true"> - <fileset dir="${basedir}/ajsc-shared-config/etc" includes="**/**" /> - </copy> - <!-- End of NON-CSI related build copy task. --> - - <!-- Copying any zips (deployment packages) to $AJSC_HOME/services for - auto-deployment --> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/services" - failonerror="false"> - <fileset dir="${basedir}/services" includes="*.zip" /> - </copy> - - <!-- Copying runtimeEnvironment zip file to $AJSC_HOME/runtime and renaming - runtimeEnvironment.zip for proper auto-deployment of ajsc services. - <copy - tofile="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/runtime/runtimeEnvironment.zip"> - <fileset dir="target" includes="*-runtimeEnvironment.zip" /> - </copy>--> - - <!-- Copying dependencies from the service project (not provided by AJSC - Container) to the $AJSC_HOME/extJars folder to be accessible on the classpath --> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extJars" - failonerror="false"> - <fileset dir="target/userjars" includes="*" /> - </copy> - - <!-- extApps directory MUST be created for ajsc-runner to run correctly, - even if empty. DO NOT REMOVE!!! --> - <!-- extApps directory created to deploy other war files on startup or - hot deploy War files after ajsc starts up. --> - <mkdir - dir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extApps" /> - - <!-- Copying any extra wars to $AJSC_HOME/extApps to be deployed within - AJSC --> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extApps" - failonerror="false"> - <fileset dir="${basedir}/src/main/resources/extApps" - includes="*" /> - </copy> - - <!-- staticContent folder is for serving static content within an ajsc - service. Any static content to be served will be copyied to the ultimate - $AJSC_HOME/staticContent folder and can be served with the att-static-content - camel component. --> - <!-- Uncomment the following snippet to copy items from staticContent folder - to ultimate $AJSC_HOME/staticConent --> - <!-- <copy toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/staticContent" - failonerror="false"> <fileset dir="${basedir}/staticContent" includes="**/**" - /> </copy> --> - - <!-- Copying extra jar files that have been labeled as dependencies in - service project to /extJars folder to be made available on the classpath - for your service --> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extJars" - failonerror="false"> - <fileset dir="target" includes="*.jar" /> - </copy> - - <!-- Copying deployment packages created within the project to the $AJSC_HOME/services - folder to be auto deployed. --> - <copy - toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/services"> - <fileset dir="target" includes="*.zip" excludes="*-runtimeEnvironment.zip" /> - </copy> - - <echo message="EXITING 'prep_assembly_output_for_swm_plugin' ant tasks" /> - </target> -</project> 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=<Your network IP address> - -#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. @@ -1,104 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- - ============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 + ============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============================================ - --> + 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========================================================= +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <artifactId>ajsc-archetype-parent</artifactId> - <groupId>com.att.ajsc</groupId> - <version>2.0.0</version> + <groupId>org.onap.oparent</groupId> + <artifactId>oparent</artifactId> + <version>1.1.0</version> + <relativePath /> </parent> <groupId>org.onap.aai.model-loader</groupId> <artifactId>model-loader</artifactId> <version>1.2.0-SNAPSHOT</version> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-dependencies</artifactId> + <version>${spring-boot.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <properties> + <start-class>org.onap.aai.modelloader.service.ModelLoaderApplication</start-class> + <nexusproxy>https://nexus.onap.org</nexusproxy> <docker.location>${basedir}/target</docker.location> - <module.ajsc.namespace.name>model-loader</module.ajsc.namespace.name> - <module.ajsc.namespace.version>v1</module.ajsc.namespace.version> - <ajscRuntimeVersion>2.0.0</ajscRuntimeVersion> - <absoluteDistFilesRoot>/appl/${project.artifactId}</absoluteDistFilesRoot> - <distFilesRoot>/appl/${project.artifactId}/${project.version}</distFilesRoot> - <runAjscHome>${basedir}/target/swm/package/nix/dist_files${distFilesRoot}</runAjscHome> - - <javax.ws.rs-api.version>2.0.1</javax.ws.rs-api.version> - <apache.lang3.version>3.6</apache.lang3.version> + <spring-boot.version>1.5.12.RELEASE</spring-boot.version> <apache.commons-text.version>1.1</apache.commons-text.version> - <commons-compress.version>1.14</commons-compress.version> - <fasterxml.version>2.8.1</fasterxml.version> - <mockito.version>1.10.19</mockito.version> - <jsr311-api.version>1.1.1</jsr311-api.version> - <jersey-client.version>1.18</jersey-client.version> - <gson.version>2.7</gson.version> <hamcrest-all.version>1.3</hamcrest-all.version> - <version.jacoco.maven.plugin>0.7.9</version.jacoco.maven.plugin> - - <!-- Port Selection. A value of 0 will allow for dynamic port selection. - For local testing, you may choose to hardcode this value to something like - 8080 --> - <serverPort>9500</serverPort> - <sslport>0</sslport> - - - <!-- For SOA Cloud Installation --> - <installOwnerUser>aaiadmin</installOwnerUser> - <installOwnerGroup>aaiadmin</installOwnerGroup> - <ownerManagementGroup>org.openecomp.aai.dev</ownerManagementGroup> - - <testRouteOffer>workstation</testRouteOffer> - <testEnv>DEV</testEnv> - - <dependency.scope>provided</dependency.scope> - <checkstyle.config.location>google_checks.xml</checkstyle.config.location> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath> - <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero> - <sonar.projectVersion>${project.version}</sonar.projectVersion> - <nexusproxy>https://nexus.onap.org</nexusproxy> <babel.version>1.2.0-SNAPSHOT</babel.version> <aai.rest.client.version>1.2.1</aai.rest.client.version> </properties> - <distributionManagement> - <repository> - <id>ecomp-releases</id> - <name>ECOMP Release Repository</name> - <url>${nexusproxy}/content/repositories/releases/</url> - </repository> - <snapshotRepository> - <id>ecomp-snapshots</id> - <name>ECOMP Snapshot Repository</name> - <url>${nexusproxy}/content/repositories/snapshots/</url> - </snapshotRepository> - </distributionManagement> - + <distributionManagement> + <repository> + <id>ecomp-releases</id> + <name>ECOMP Release Repository</name> + <url>${nexusproxy}/content/repositories/releases/</url> + </repository> + <snapshotRepository> + <id>ecomp-snapshots</id> + <name>ECOMP Snapshot Repository</name> + <url>${nexusproxy}/content/repositories/snapshots/</url> + </snapshotRepository> + </distributionManagement> + <dependencies> <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> <groupId>org.onap.aai</groupId> <artifactId>babel</artifactId> <version>${babel.version}</version> @@ -111,20 +88,9 @@ </exclusions> </dependency> <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>javax.ws.rs-api</artifactId> - <version>${javax.ws.rs-api.version}</version> - </dependency> - <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>jsr311-api</artifactId> - <version>${jsr311-api.version}</version> - </dependency> - <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-bundle --> - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-client</artifactId> - <version>${jersey-client.version}</version> + <groupId>org.glassfish.jersey.core</groupId> + <artifactId>jersey-common</artifactId> + <scope>test</scope> </dependency> <dependency> <groupId>org.onap.aai</groupId> @@ -134,11 +100,15 @@ <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> - <version>${gson.version}</version> </dependency> <!-- Test dependencies --> <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>${hamcrest-all.version}</version> @@ -147,42 +117,9 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>${mockito.version}</version> <scope>test</scope> </dependency> <dependency> - <groupId>org.javassist</groupId> - <artifactId>javassist</artifactId> - <version>3.19.0-GA</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>${fasterxml.version}</version><!--$NO-MVN-MAN-VER$ --> - </dependency> - - <!-- xjc dependencies --> - <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - <version>2.2.11</version> - </dependency> - <dependency> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-impl</artifactId> - <version>2.2.11</version> - </dependency> - <dependency> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-core</artifactId> - <version>2.2.11</version> - </dependency> - <dependency> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-xjc</artifactId> - <version>2.2.11</version> - </dependency> - <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.moxy</artifactId> <version>2.6.2</version> @@ -204,17 +141,11 @@ <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> - <version>1.1.7</version> </dependency> <dependency> - <groupId>org.openecomp.sdc.sdc-distribution-client</groupId> + <groupId>org.onap.sdc.sdc-distribution-client</groupId> <artifactId>sdc-distribution-client</artifactId> - <version>1.2.2</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>4.5</version> + <version>1.3.0</version> </dependency> <dependency> <groupId>org.json</groupId> @@ -224,7 +155,6 @@ <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-security</artifactId> - <version>9.3.8.RC0</version> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -236,25 +166,9 @@ <version>2.12.1</version> </dependency> <dependency> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> - <version>1.18</version> - </dependency> - - <!-- apache commons --> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>${commons-compress.version}</version> - </dependency> - <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>${apache.lang3.version}</version> + <version>2.4</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> @@ -263,158 +177,61 @@ </dependency> </dependencies> - <!-- Plugins and repositories --> - <pluginRepositories> - <pluginRepository> - <id>central</id> - <url>http://repo1.maven.org/maven2</url> - </pluginRepository> - <pluginRepository> - <id>EvoSuite</id> - <name>EvoSuite Repository</name> - <url>http://www.evosuite.org/m2</url> - </pluginRepository> - </pluginRepositories> - - <repositories> - <repository> - <id>central</id> - <name>Maven 2 repository 2</name> - <url>http://repo2.maven.org/maven2/</url> - </repository> - <repository> - <id>ecomp-releases</id> - <name>ECOMP Release Repository</name> - <url>${nexusproxy}/content/repositories/releases/</url> - </repository> - <repository> - <id>ecomp-snapshots</id> - <name>ECOMP Snapshot Repository</name> - <url>${nexusproxy}/content/repositories/snapshots/</url> - </repository> - <repository> - <id>ecomp-staging</id> - <name>ECOMP Staging Repository</name> - <url>${nexusproxy}/content/repositories/staging/</url> - </repository> - </repositories> + <!-- Plugins and repositories --> + <pluginRepositories> + <pluginRepository> + <id>central</id> + <url>http://repo1.maven.org/maven2</url> + </pluginRepository> + <pluginRepository> + <id>EvoSuite</id> + <name>EvoSuite Repository</name> + <url>http://www.evosuite.org/m2</url> + </pluginRepository> + </pluginRepositories> - <profiles> - <profile> - <id>runAjsc</id> - <build> - <defaultGoal>initialize</defaultGoal> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.3.2</version> - <executions> - <execution> - <phase>initialize</phase> - <goals> - <goal>java</goal> - </goals> - <configuration> - <includeProjectDependencies>false</includeProjectDependencies> - <includePluginDependencies>true</includePluginDependencies> - <executable>java</executable> - <mainClass>com.att.ajsc.runner.Runner</mainClass> - <executableDependency> - <groupId>com.att.ajsc</groupId> - <artifactId>ajsc-runner</artifactId> - </executableDependency> - <additionalClasspathElements> - <additionalClasspathElement>${basedir}/ajsc-shared-config/etc</additionalClasspathElement> - </additionalClasspathElements> - - <environmentVariables> - <AJSC_HOME>${runAjscHome}</AJSC_HOME> - </environmentVariables> - - <!-- Main AJSC System Properties below (necessary for proper startup) --> - <systemProperties> - <systemProperty> - <key>AJSC_HOME</key> - <value>${runAjscHome}</value> - </systemProperty> - <systemProperty> - <key>CONFIG_HOME</key> - <value>${basedir}/appconfig-local/</value> - </systemProperty> - <systemProperty> - <key>AJSC_CONF_HOME</key> - <value>${basedir}/bundleconfig-local</value> - </systemProperty> - <systemProperty> - <key>logback.configurationFile</key> - <value>${basedir}/ajsc-shared-config/etc/logback.xml</value> - </systemProperty> - <systemProperty> - <key>AJSC_SHARED_CONFIG</key> - <value>${basedir}/ajsc-shared-config</value> - </systemProperty> - - <sysproperty> - <key>AJSC_EXTERNAL_LIB_FOLDERS</key> - <value>${basedir}/target/commonLibs</value> - </sysproperty> - <sysproperty> - <key>AJSC_EXTERNAL_PROPERTIES_FOLDERS</key> - <value>${basedir}/ajsc-shared-config/etc</value> - </sysproperty> - <systemProperty> - <key>AJSC_SERVICE_NAMESPACE</key> - <value>${module.ajsc.namespace.name}</value> - </systemProperty> - <systemProperty> - <key>AJSC_SERVICE_VERSION</key> - <value>${module.ajsc.namespace.version}</value> - </systemProperty> - <systemProperty> - <key>SOACLOUD_SERVICE_VERSION</key> - <value>${project.version}</value> - </systemProperty> - <systemProperty> - <key>server.port</key> - <value>${serverPort}</value> - </systemProperty> - </systemProperties> - - <!-- Command Line Arguments to add to the java command. Here, you - can specify the port as well as the Context you want your service to run - in. Use context=/ to run in an unnamed Context (Root Context). The default - configuration of the AJSC is to run under the / Context. Setting the port - here can aid during the development phase of your service. However, you can - leave this argument out entirely, and the AJSC will default to using an Ephemeral - port. --> - <arguments> - <argument>context=//</argument> - <argument>port=${serverPort}</argument> - <argument>sslport=${sslport}</argument> - </arguments> - </configuration> - </execution> - </executions> - <configuration> - <executable>java</executable> - </configuration> - <dependencies> - <dependency> - <groupId>com.att.ajsc</groupId> - <artifactId>ajsc-runner</artifactId> - <version>${ajscRuntimeVersion}</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </build> - </profile> - </profiles> + <repositories> + <repository> + <id>central</id> + <name>Maven 2 repository 2</name> + <url>http://repo2.maven.org/maven2/</url> + </repository> + <repository> + <id>ecomp-releases</id> + <name>ECOMP Release Repository</name> + <url>${nexusproxy}/content/repositories/releases/</url> + </repository> + <repository> + <id>ecomp-snapshots</id> + <name>ECOMP Snapshot Repository</name> + <url>${nexusproxy}/content/repositories/snapshots/</url> + </repository> + <repository> + <id>ecomp-staging</id> + <name>ECOMP Staging Repository</name> + <url>${nexusproxy}/content/repositories/staging/</url> + </repository> + </repositories> <build> + <finalName>model-loader</finalName> <plugins> <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>${spring-boot.version}</version> + <configuration> + <executable>true</executable> + </configuration> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> @@ -444,6 +261,30 @@ </execution> </executions> </plugin> + <plugin> + <groupId>com.mycila</groupId> + <artifactId>license-maven-plugin</artifactId> + <version>3.0</version> + <configuration> + <header>License.txt</header> + <includes> + <include>src/main/java/**</include> + <include>src/test/java/**</include> + <include>version/properties</include> + <include>pom.xml</include> + </includes> + <skipExistingHeaders>true</skipExistingHeaders> + </configuration> + <executions> + <execution> + <goals> + <!-- Set goal to "format" to auto update license headers --> + <goal>check</goal> + </goals> + <phase>process-sources</phase> + </execution> + </executions> + </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> @@ -461,108 +302,11 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.12.4</version><!--$NO-MVN-MAN-VER$ --> - <configuration> - <argLine>-noverify ${argLine}</argLine> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.1</version> - </plugin> - - <!-- Checkstyle plugin - used to report on compliance with --> - <!-- the Google style guide. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>3.3</version> - <configuration> - <reportPlugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.17</version> - <reportSets> - <reportSet> - <reports> - <report>checkstyle</report> - </reports> - </reportSet> - </reportSets> - </plugin> - </reportPlugins> - </configuration> - </plugin> - - <!-- license plugin --> - <plugin> - <groupId>com.mycila</groupId> - <artifactId>license-maven-plugin</artifactId> - <version>3.0</version> - <configuration> - <header>License.txt</header> - <includes> - <include>src/main/java/**</include> - <include>src/test/java/**</include> - </includes> - </configuration> - <executions> - <execution> - <goals> - <goal>format</goal> - </goals> - <phase>process-sources</phase> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>sonar-maven-plugin</artifactId> - <version>3.2</version> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${version.jacoco.maven.plugin}</version> - <executions> - <execution> - <id>jacoco-initialize-unit-tests</id> - <goals> - <goal>prepare-agent</goal> - </goals> - </execution> - <execution> - <id>report</id> - <phase>package</phase> - <goals> - <goal>report</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.sonatype.plugins</groupId> - <artifactId>nexus-staging-maven-plugin</artifactId> - <version>1.6.7</version> - <extensions>true</extensions> - <configuration> - <nexusUrl>${nexusproxy}</nexusUrl> - <stagingProfileId>176c31dfe190a</stagingProfileId> - <serverId>ecomp-staging</serverId> - </configuration> - </plugin> - </plugins> </build> </project> 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<String> artifactTypes = null; - - private List<String> 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<String> 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<String> 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<String> artifactTypes = null; + + private List<String> 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<String> 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<String> 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<Artifact> artifacts, String distributionId, List<Artifact> completedArtifacts,
- AaiRestClient restClient);
+ public abstract boolean pushArtifacts(List<Artifact> artifacts, String distributionId,
+ List<Artifact> completedArtifacts, AaiRestClient restClient);
- public abstract void rollback(List<Artifact> completedArtifacts, String distributionId,
- AaiRestClient aaiClient);
+ public abstract void rollback(List<Artifact> 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<Artifact> 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<Artifact> sort(List<Artifact> originalList) { - - if (originalList.size() <= 1) { + public List<Artifact> sort(List<Artifact> originalList) throws BabelArtifactParsingException { + if (originalList == null || originalList.size() <= 1) { return originalList; } - Collection<Node> nodes = createNodes(originalList); - Collection<Node> sortedNodes = sortNodes(nodes); + Collection<Node> sortedNodes = sortNodes(createNodes(originalList)); List<Artifact> 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<Node> sortNodes(Collection<Node> unsortedNodes) { + private Collection<Node> sortNodes(Collection<Node> unsortedNodes) throws BabelArtifactParsingException { // L <- Empty list that will contain the sorted elements List<Node> 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<Artifact> completedArtifacts) { + public boolean push(AaiRestClient aaiClient, ModelLoaderConfig config, String distId, + List<Artifact> 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<org.openecomp.sdc.api.notification.IArtifactInfo> getRelatedArtifacts() { + public List<IArtifactInfo> 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 index 68c805e..6b7c2c1 100644 --- a/ajsc-shared-config/etc/logback.xml +++ b/src/main/resources/logback.xml @@ -1,12 +1,5 @@ <configuration scan="true" scanPeriod="3 seconds" debug="false"> - <!--<jmxConfigurator /> --> - <!-- directory path for all other type logs --> - <property name="logDir" value="${AJSC_HOME}/logs" /> - - - <!-- specify the component name <ECOMP-component-name>::= "MSO" | "DCAE" - | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" --> <property name="componentName" value="AAI-ML"></property> <!-- default eelf log file names --> 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<String> 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<String> 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<String> 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<String> 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<Artifact> emptyList = Collections.emptyList(); - - ModelSorter sorter = new ModelSorter(); - sorter = new ModelSorter(); - - List<Artifact> 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<Artifact> modelList = new ArrayList<Artifact>(); - - 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<Artifact> 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<Artifact> modelList = new ArrayList<Artifact>(); - - 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<Artifact> 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<Artifact> modelList = new ArrayList<Artifact>(); - - 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<Artifact> 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<Artifact> 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<Artifact> 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<Artifact> modelList = new ArrayList<Artifact>(); + 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<Artifact> 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<Artifact> 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<Artifact> 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<Artifact> 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<Artifact> 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<BabelArtifact> setupTest(byte[] xml, INotificationData data) throws IOException { List<BabelArtifact> 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<BabelArtifact> setupTest(byte[] xml, INotificationData data) throws IOException { List<BabelArtifact> 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 <code>null</code>. + */ + 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<BabelArtifact> 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<BabelArtifact> 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 <code>null</code>. + */ + 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= |