diff options
author | Rich Tabedzki <richard.tabedzki@att.com> | 2019-02-01 13:45:04 -0500 |
---|---|---|
committer | Rich Tabedzki <richard.tabedzki@att.com> | 2019-02-01 13:49:27 -0500 |
commit | 489343746ccbb0d1864911b53c7ab354ea32bec1 (patch) | |
tree | 81aea3dde701ee10cdebda5e228ad5942a03354f /aai-service/provider/src | |
parent | 159f3d829424fad2519fddfd88b8b9b0c45a2da9 (diff) |
improved handling of indexed data
Changes made:
* improve handling of indexed data in sli-adaptors:aai-service update request
* added code to convert index based data to daat array based to better fit AAI UPDATE processing
Change-Id: Ic5b457f546a70c82278c4f2c6b126b77e8d27eae
Issue-ID: CCSDK-1013
Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com>
Diffstat (limited to 'aai-service/provider/src')
23 files changed, 190 insertions, 461 deletions
diff --git a/aai-service/provider/src/main/java/META-INF/sun-jaxb.episode b/aai-service/provider/src/main/java/META-INF/sun-jaxb.episode deleted file mode 100755 index f14c7d47c..000000000 --- a/aai-service/provider/src/main/java/META-INF/sun-jaxb.episode +++ /dev/null @@ -1,376 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<bindings xmlns="http://java.sun.com/xml/ns/jaxb" if-exists="true" version="2.1"> - <!-- - -This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 -See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -Any modifications to this file will be lost upon recompilation of the source schema. -Generated on: 2017.02.21 at 07:59:51 PM EST - - --> - <bindings xmlns:tns="http://org.openecomp.aai.inventory/v8" if-exists="true" scd="x-schema::tns"> - <schemaBindings map="false"> - <package name="org.openecomp.aai.inventory.v8"/> - </schemaBindings> - <bindings if-exists="true" scd="tns:model-element"> - <class ref="org.openecomp.aai.inventory.v8.ModelElement"/> - </bindings> - <bindings if-exists="true" scd="tns:named-query"> - <class ref="org.openecomp.aai.inventory.v8.NamedQuery"/> - </bindings> - <bindings if-exists="true" scd="tns:result-data"> - <class ref="org.openecomp.aai.inventory.v8.ResultData"/> - </bindings> - <bindings if-exists="true" scd="tns:search-results"> - <class ref="org.openecomp.aai.inventory.v8.SearchResults"/> - </bindings> - <bindings if-exists="true" scd="tns:search"> - <class ref="org.openecomp.aai.inventory.v8.Search"/> - </bindings> - <bindings if-exists="true" scd="tns:update-node-key"> - <class ref="org.openecomp.aai.inventory.v8.UpdateNodeKey"/> - </bindings> - <bindings if-exists="true" scd="tns:action-data"> - <class ref="org.openecomp.aai.inventory.v8.ActionData"/> - </bindings> - <bindings if-exists="true" scd="tns:action"> - <class ref="org.openecomp.aai.inventory.v8.Action"/> - </bindings> - <bindings if-exists="true" scd="tns:update"> - <class ref="org.openecomp.aai.inventory.v8.Update"/> - </bindings> - <bindings if-exists="true" scd="tns:key-data"> - <class ref="org.openecomp.aai.inventory.v8.KeyData"/> - </bindings> - <bindings if-exists="true" scd="tns:notify"> - <class ref="org.openecomp.aai.inventory.v8.Notify"/> - </bindings> - <bindings if-exists="true" scd="tns:actions"> - <class ref="org.openecomp.aai.inventory.v8.Actions"/> - </bindings> - <bindings if-exists="true" scd="tns:relationship-data"> - <class ref="org.openecomp.aai.inventory.v8.RelationshipData"/> - </bindings> - <bindings if-exists="true" scd="tns:related-to-property"> - <class ref="org.openecomp.aai.inventory.v8.RelatedToProperty"/> - </bindings> - <bindings if-exists="true" scd="tns:relationship"> - <class ref="org.openecomp.aai.inventory.v8.Relationship"/> - </bindings> - <bindings if-exists="true" scd="tns:relationship-list"> - <class ref="org.openecomp.aai.inventory.v8.RelationshipList"/> - </bindings> - <bindings if-exists="true" scd="tns:volume-group"> - <class ref="org.openecomp.aai.inventory.v8.VolumeGroup"/> - </bindings> - <bindings if-exists="true" scd="tns:volume-groups"> - <class ref="org.openecomp.aai.inventory.v8.VolumeGroups"/> - </bindings> - <bindings if-exists="true" scd="tns:volume"> - <class ref="org.openecomp.aai.inventory.v8.Volume"/> - </bindings> - <bindings if-exists="true" scd="tns:volumes"> - <class ref="org.openecomp.aai.inventory.v8.Volumes"/> - </bindings> - <bindings if-exists="true" scd="tns:l3-interface-ipv4-address-list"> - <class ref="org.openecomp.aai.inventory.v8.L3InterfaceIpv4AddressList"/> - </bindings> - <bindings if-exists="true" scd="tns:l3-interface-ipv6-address-list"> - <class ref="org.openecomp.aai.inventory.v8.L3InterfaceIpv6AddressList"/> - </bindings> - <bindings if-exists="true" scd="tns:vlan"> - <class ref="org.openecomp.aai.inventory.v8.Vlan"/> - </bindings> - <bindings if-exists="true" scd="tns:vlans"> - <class ref="org.openecomp.aai.inventory.v8.Vlans"/> - </bindings> - <bindings if-exists="true" scd="tns:l-interface"> - <class ref="org.openecomp.aai.inventory.v8.LInterface"/> - </bindings> - <bindings if-exists="true" scd="tns:l-interfaces"> - <class ref="org.openecomp.aai.inventory.v8.LInterfaces"/> - </bindings> - <bindings if-exists="true" scd="tns:vserver"> - <class ref="org.openecomp.aai.inventory.v8.Vserver"/> - </bindings> - <bindings if-exists="true" scd="tns:vservers"> - <class ref="org.openecomp.aai.inventory.v8.Vservers"/> - </bindings> - <bindings if-exists="true" scd="tns:tenant"> - <class ref="org.openecomp.aai.inventory.v8.Tenant"/> - </bindings> - <bindings if-exists="true" scd="tns:tenants"> - <class ref="org.openecomp.aai.inventory.v8.Tenants"/> - </bindings> - <bindings if-exists="true" scd="tns:flavor"> - <class ref="org.openecomp.aai.inventory.v8.Flavor"/> - </bindings> - <bindings if-exists="true" scd="tns:flavors"> - <class ref="org.openecomp.aai.inventory.v8.Flavors"/> - </bindings> - <bindings if-exists="true" scd="tns:group-assignment"> - <class ref="org.openecomp.aai.inventory.v8.GroupAssignment"/> - </bindings> - <bindings if-exists="true" scd="tns:group-assignments"> - <class ref="org.openecomp.aai.inventory.v8.GroupAssignments"/> - </bindings> - <bindings if-exists="true" scd="tns:snapshot"> - <class ref="org.openecomp.aai.inventory.v8.Snapshot"/> - </bindings> - <bindings if-exists="true" scd="tns:snapshots"> - <class ref="org.openecomp.aai.inventory.v8.Snapshots"/> - </bindings> - <bindings if-exists="true" scd="tns:metadatum"> - <class ref="org.openecomp.aai.inventory.v8.Metadatum"/> - </bindings> - <bindings if-exists="true" scd="tns:metadata"> - <class ref="org.openecomp.aai.inventory.v8.Metadata"/> - </bindings> - <bindings if-exists="true" scd="tns:image"> - <class ref="org.openecomp.aai.inventory.v8.Image"/> - </bindings> - <bindings if-exists="true" scd="tns:images"> - <class ref="org.openecomp.aai.inventory.v8.Images"/> - </bindings> - <bindings if-exists="true" scd="tns:availability-zone"> - <class ref="org.openecomp.aai.inventory.v8.AvailabilityZone"/> - </bindings> - <bindings if-exists="true" scd="tns:availability-zones"> - <class ref="org.openecomp.aai.inventory.v8.AvailabilityZones"/> - </bindings> - <bindings if-exists="true" scd="tns:cloud-region"> - <class ref="org.openecomp.aai.inventory.v8.CloudRegion"/> - </bindings> - <bindings if-exists="true" scd="tns:cloud-regions"> - <class ref="org.openecomp.aai.inventory.v8.CloudRegions"/> - </bindings> - <bindings if-exists="true" scd="tns:p-interface"> - <class ref="org.openecomp.aai.inventory.v8.PInterface"/> - </bindings> - <bindings if-exists="true" scd="tns:p-interfaces"> - <class ref="org.openecomp.aai.inventory.v8.PInterfaces"/> - </bindings> - <bindings if-exists="true" scd="tns:lag-interface"> - <class ref="org.openecomp.aai.inventory.v8.LagInterface"/> - </bindings> - <bindings if-exists="true" scd="tns:lag-interfaces"> - <class ref="org.openecomp.aai.inventory.v8.LagInterfaces"/> - </bindings> - <bindings if-exists="true" scd="tns:pserver"> - <class ref="org.openecomp.aai.inventory.v8.Pserver"/> - </bindings> - <bindings if-exists="true" scd="tns:pservers"> - <class ref="org.openecomp.aai.inventory.v8.Pservers"/> - </bindings> - <bindings if-exists="true" scd="tns:cloud-infrastructure"> - <class ref="org.openecomp.aai.inventory.v8.CloudInfrastructure"/> - </bindings> - <bindings if-exists="true" scd="tns:service-instance"> - <class ref="org.openecomp.aai.inventory.v8.ServiceInstance"/> - </bindings> - <bindings if-exists="true" scd="tns:service-instances"> - <class ref="org.openecomp.aai.inventory.v8.ServiceInstances"/> - </bindings> - <bindings if-exists="true" scd="tns:service-subscription"> - <class ref="org.openecomp.aai.inventory.v8.ServiceSubscription"/> - </bindings> - <bindings if-exists="true" scd="tns:service-subscriptions"> - <class ref="org.openecomp.aai.inventory.v8.ServiceSubscriptions"/> - </bindings> - <bindings if-exists="true" scd="tns:customer"> - <class ref="org.openecomp.aai.inventory.v8.Customer"/> - </bindings> - <bindings if-exists="true" scd="tns:customers"> - <class ref="org.openecomp.aai.inventory.v8.Customers"/> - </bindings> - <bindings if-exists="true" scd="tns:business"> - <class ref="org.openecomp.aai.inventory.v8.Business"/> - </bindings> - <bindings if-exists="true" scd="tns:service"> - <class ref="org.openecomp.aai.inventory.v8.Service"/> - </bindings> - <bindings if-exists="true" scd="tns:services"> - <class ref="org.openecomp.aai.inventory.v8.Services"/> - </bindings> - <bindings if-exists="true" scd="tns:element-choice-set"> - <class ref="org.openecomp.aai.inventory.v8.ElementChoiceSet"/> - </bindings> - <bindings if-exists="true" scd="tns:model-elements"> - <class ref="org.openecomp.aai.inventory.v8.ModelElements"/> - </bindings> - <bindings if-exists="true" scd="tns:model-constraints"> - <class ref="org.openecomp.aai.inventory.v8.ModelConstraints"/> - </bindings> - <bindings if-exists="true" scd="tns:model-constraint"> - <class ref="org.openecomp.aai.inventory.v8.ModelConstraint"/> - </bindings> - <bindings if-exists="true" scd="tns:constrained-element-sets"> - <class ref="org.openecomp.aai.inventory.v8.ConstrainedElementSets"/> - </bindings> - <bindings if-exists="true" scd="tns:constrained-element-set"> - <class ref="org.openecomp.aai.inventory.v8.ConstrainedElementSet"/> - </bindings> - <bindings if-exists="true" scd="tns:element-choice-sets"> - <class ref="org.openecomp.aai.inventory.v8.ElementChoiceSets"/> - </bindings> - <bindings if-exists="true" scd="tns:model"> - <class ref="org.openecomp.aai.inventory.v8.Model"/> - </bindings> - <bindings if-exists="true" scd="tns:models"> - <class ref="org.openecomp.aai.inventory.v8.Models"/> - </bindings> - <bindings if-exists="true" scd="tns:related-lookup"> - <class ref="org.openecomp.aai.inventory.v8.RelatedLookup"/> - </bindings> - <bindings if-exists="true" scd="tns:related-lookups"> - <class ref="org.openecomp.aai.inventory.v8.RelatedLookups"/> - </bindings> - <bindings if-exists="true" scd="tns:property-constraint"> - <class ref="org.openecomp.aai.inventory.v8.PropertyConstraint"/> - </bindings> - <bindings if-exists="true" scd="tns:property-constraints"> - <class ref="org.openecomp.aai.inventory.v8.PropertyConstraints"/> - </bindings> - <bindings if-exists="true" scd="tns:named-query-element"> - <class ref="org.openecomp.aai.inventory.v8.NamedQueryElement"/> - </bindings> - <bindings if-exists="true" scd="tns:named-query-elements"> - <class ref="org.openecomp.aai.inventory.v8.NamedQueryElements"/> - </bindings> - <bindings if-exists="true" scd="tns:named-queries"> - <class ref="org.openecomp.aai.inventory.v8.NamedQueries"/> - </bindings> - <bindings if-exists="true" scd="tns:service-design-and-creation"> - <class ref="org.openecomp.aai.inventory.v8.ServiceDesignAndCreation"/> - </bindings> - <bindings if-exists="true" scd="tns:logical-link"> - <class ref="org.openecomp.aai.inventory.v8.LogicalLink"/> - </bindings> - <bindings if-exists="true" scd="tns:logical-links"> - <class ref="org.openecomp.aai.inventory.v8.LogicalLinks"/> - </bindings> - <bindings if-exists="true" scd="tns:vnfc"> - <class ref="org.openecomp.aai.inventory.v8.Vnfc"/> - </bindings> - <bindings if-exists="true" scd="tns:vnfcs"> - <class ref="org.openecomp.aai.inventory.v8.Vnfcs"/> - </bindings> - <bindings if-exists="true" scd="tns:subnet"> - <class ref="org.openecomp.aai.inventory.v8.Subnet"/> - </bindings> - <bindings if-exists="true" scd="tns:subnets"> - <class ref="org.openecomp.aai.inventory.v8.Subnets"/> - </bindings> - <bindings if-exists="true" scd="tns:ctag-assignment"> - <class ref="org.openecomp.aai.inventory.v8.CtagAssignment"/> - </bindings> - <bindings if-exists="true" scd="tns:ctag-assignments"> - <class ref="org.openecomp.aai.inventory.v8.CtagAssignments"/> - </bindings> - <bindings if-exists="true" scd="tns:segmentation-assignment"> - <class ref="org.openecomp.aai.inventory.v8.SegmentationAssignment"/> - </bindings> - <bindings if-exists="true" scd="tns:segmentation-assignments"> - <class ref="org.openecomp.aai.inventory.v8.SegmentationAssignments"/> - </bindings> - <bindings if-exists="true" scd="tns:l3-network"> - <class ref="org.openecomp.aai.inventory.v8.L3Network"/> - </bindings> - <bindings if-exists="true" scd="tns:l3-networks"> - <class ref="org.openecomp.aai.inventory.v8.L3Networks"/> - </bindings> - <bindings if-exists="true" scd="tns:vf-module"> - <class ref="org.openecomp.aai.inventory.v8.VfModule"/> - </bindings> - <bindings if-exists="true" scd="tns:vf-modules"> - <class ref="org.openecomp.aai.inventory.v8.VfModules"/> - </bindings> - <bindings if-exists="true" scd="tns:generic-vnf"> - <class ref="org.openecomp.aai.inventory.v8.GenericVnf"/> - </bindings> - <bindings if-exists="true" scd="tns:generic-vnfs"> - <class ref="org.openecomp.aai.inventory.v8.GenericVnfs"/> - </bindings> - <bindings if-exists="true" scd="tns:pnf"> - <class ref="org.openecomp.aai.inventory.v8.Pnf"/> - </bindings> - <bindings if-exists="true" scd="tns:pnfs"> - <class ref="org.openecomp.aai.inventory.v8.Pnfs"/> - </bindings> - <bindings if-exists="true" scd="tns:physical-link"> - <class ref="org.openecomp.aai.inventory.v8.PhysicalLink"/> - </bindings> - <bindings if-exists="true" scd="tns:physical-links"> - <class ref="org.openecomp.aai.inventory.v8.PhysicalLinks"/> - </bindings> - <bindings if-exists="true" scd="tns:network"> - <class ref="org.openecomp.aai.inventory.v8.Network"/> - </bindings> - <bindings if-exists="true" scd="tns:reserved-prop-names"> - <class ref="org.openecomp.aai.inventory.v8.ReservedPropNames"/> - </bindings> - <bindings if-exists="true" scd="tns:edge-prop-names"> - <class ref="org.openecomp.aai.inventory.v8.EdgePropNames"/> - </bindings> - <bindings if-exists="true" scd="tns:aai-internal"> - <class ref="org.openecomp.aai.inventory.v8.AaiInternal"/> - </bindings> - <bindings if-exists="true" scd="tns:inventory"> - <class ref="org.openecomp.aai.inventory.v8.Inventory"/> - </bindings> - <bindings if-exists="true" scd="tns:inventory-item-data"> - <class ref="org.openecomp.aai.inventory.v8.InventoryItemData"/> - </bindings> - <bindings if-exists="true" scd="tns:inventory-item"> - <class ref="org.openecomp.aai.inventory.v8.InventoryItem"/> - </bindings> - <bindings if-exists="true" scd="tns:tagged-inventory-item-list"> - <class ref="org.openecomp.aai.inventory.v8.TaggedInventoryItemList"/> - </bindings> - <bindings if-exists="true" scd="tns:start-node-filter"> - <class ref="org.openecomp.aai.inventory.v8.StartNodeFilter"/> - </bindings> - <bindings if-exists="true" scd="tns:include-node-filter"> - <class ref="org.openecomp.aai.inventory.v8.IncludeNodeFilter"/> - </bindings> - <bindings if-exists="true" scd="tns:secondary-filter"> - <class ref="org.openecomp.aai.inventory.v8.SecondaryFilter"/> - </bindings> - <bindings if-exists="true" scd="tns:notification-event-header"> - <class ref="org.openecomp.aai.inventory.v8.NotificationEventHeader"/> - </bindings> - <bindings if-exists="true" scd="tns:notification-event"> - <class ref="org.openecomp.aai.inventory.v8.NotificationEvent"/> - </bindings> - <bindings if-exists="true" scd="tns:query-parameters"> - <class ref="org.openecomp.aai.inventory.v8.QueryParameters"/> - </bindings> - <bindings if-exists="true" scd="tns:instance-filter"> - <class ref="org.openecomp.aai.inventory.v8.InstanceFilter"/> - </bindings> - <bindings if-exists="true" scd="tns:instance-filters"> - <class ref="org.openecomp.aai.inventory.v8.InstanceFilters"/> - </bindings> - <bindings if-exists="true" scd="tns:model-and-named-query-search"> - <class ref="org.openecomp.aai.inventory.v8.ModelAndNamedQuerySearch"/> - </bindings> - <bindings if-exists="true" scd="tns:properties"> - <class ref="org.openecomp.aai.inventory.v8.Properties"/> - </bindings> - <bindings if-exists="true" scd="tns:extra-properties"> - <class ref="org.openecomp.aai.inventory.v8.ExtraProperties"/> - </bindings> - <bindings if-exists="true" scd="tns:inventory-response-item"> - <class ref="org.openecomp.aai.inventory.v8.InventoryResponseItem"/> - </bindings> - <bindings if-exists="true" scd="tns:inventory-response-items"> - <class ref="org.openecomp.aai.inventory.v8.InventoryResponseItems"/> - </bindings> - <bindings if-exists="true" scd="tns:response-list"> - <class ref="org.openecomp.aai.inventory.v8.ResponseList"/> - </bindings> - <bindings if-exists="true" scd="tns:extra-property"> - <class ref="org.openecomp.aai.inventory.v8.ExtraProperty"/> - </bindings> - </bindings> -</bindings> diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java index 6af6ad6ac..752bd9f3b 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java @@ -19,7 +19,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.IOException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java index a3aecda14..c4f9464e3 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java @@ -67,7 +67,7 @@ import org.apache.http.impl.EnglishReasonPhraseCatalog; /** * The AAIClientRESTExecutor class provides CRUD API for AAI Client service. - * @author richtabedzki + * @author Rich Tabedzki */ public class AAIClientRESTExecutor implements AAIExecutorInterface { diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java index 20f926569..3fa954951 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java @@ -21,6 +21,10 @@ * ============LICENSE_END========================================================= */ +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.IOException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIExecutorInterface.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIExecutorInterface.java index 9203daa1b..d02f14a95 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIExecutorInterface.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIExecutorInterface.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; public interface AAIExecutorInterface { diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java index c66ae06f4..04312fd7c 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.IOException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java index 430389473..2411d292e 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.BufferedReader; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java index 9fac977d3..2f774e407 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import org.onap.ccsdk.sli.adaptors.aai.data.ErrorResponse; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java index 36c34e291..9888c838b 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.File; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java index 6c48c63dd..3bd6ac496 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.lang.annotation.Annotation; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAITrinityService.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAITrinityService.java index 6c627ff6a..d1abda13d 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAITrinityService.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAITrinityService.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import org.slf4j.Logger; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java index aaae11a98..892288652 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java @@ -19,7 +19,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.IOException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java index 6011858d0..8e6af0100 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java @@ -19,7 +19,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java index 35f190e52..07bb69d83 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java index 458248462..59aba1b8f 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - + /** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/HttpMethod.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/HttpMethod.java index 28d79cfc8..8f7abe601 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/HttpMethod.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/HttpMethod.java @@ -1,5 +1,8 @@ package org.onap.ccsdk.sli.adaptors.aai; - +/** + * @author Rich Tabedzki + * + */ public interface HttpMethod { public static final String GET = "GET"; public static final String HEAD = "HEAD"; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java index d1995f04f..d6df6286a 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java index dafc4a70c..6b050b5ac 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java @@ -20,7 +20,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java index cab601ac8..68aff1f95 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipListRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipListRequest.java index 847bdea0a..8cd7a44e0 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipListRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipListRequest.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java index bc97e1a59..e26421aaa 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java @@ -19,7 +19,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java index 1e9915a0d..0094b45fd 100644..100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java @@ -18,7 +18,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - +/** + * @author Rich Tabedzki + * + */ package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java index 8ecc0b3ea..8046ca5e3 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java @@ -3,15 +3,15 @@ * openECOMP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * reserved. * Modifications Copyright (C) 2018 IBM. * ================================================================================ * 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. @@ -19,6 +19,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ +/** + * The UpdateRequest class provides processing related to update transaction. + * @author richtabedzki + */ package org.onap.ccsdk.sli.adaptors.aai; @@ -26,8 +30,12 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; +import java.util.stream.Collectors; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; @@ -35,74 +43,110 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class UpdateRequest extends AAIRequest { - - private AAIRequest request; - private Map<String, String> params; + + private AAIRequest request; + private Map<String, String> params; + + public UpdateRequest(AAIRequest request, Map<String, String> parms) { + this.request = request; + this.params = parms; + } - public UpdateRequest(AAIRequest request, Map<String, String> parms) { - this.request = request; - this.params = parms; - } + @Override + public URL getRequestUrl(String method, String resourceVersion) + throws UnsupportedEncodingException, MalformedURLException, URISyntaxException { + return request.getRequestUrl(method, resourceVersion); + } - @Override - public URL getRequestUrl(String method, String resourceVersion) - throws UnsupportedEncodingException, MalformedURLException, URISyntaxException { - return request.getRequestUrl(method, resourceVersion); - } + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException, URISyntaxException { + return request.getRequestQueryUrl(method); + } - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException, URISyntaxException { - return request.getRequestQueryUrl(method); - } + @Override + public String toJSONString() { + updateArrayEntries(params); + ObjectMapper mapper = AAIService.getObjectMapper(); + String json = null; + + try { + json = mapper.writeValueAsString(params); + } catch (JsonProcessingException e) { + LOG.error("Could not convert parameters of " + request.getRequestObject().getClass().getName(), e); + } + + return json; + } - @Override - public String toJSONString() { - ObjectMapper mapper = AAIService.getObjectMapper(); - String json = null; - - try { - json = mapper.writeValueAsString(params); - } catch (JsonProcessingException e) { - LOG.error("Could not convert parameters of " + request.getRequestObject().getClass().getName(), e); - } - - return json; - } + /** + * + * Update array entries. + * The method converts indexed data entries to an array of values + * + * @param data Map containing String:String values representing input data + */ + private void updateArrayEntries( Map<String, String> data) { + Set<String> set = data.keySet() + .stream() + .filter(s -> s.endsWith("_length")) + .collect(Collectors.toSet()); + + for(String lenghtKey : set) { + String key = lenghtKey.replace("_length", ""); +// String index = data.get(lenghtKey); + List<String> array = new ArrayList<>(); + + Set<String> subset = data.keySet() + .stream() + .filter(s -> s.startsWith(String.format("%s[",key))) + .collect(Collectors.toSet()); + for(String subKey : subset) { + String subValue = data.get(subKey); + array.add(subValue); + LOG.trace("{} : {} ", subKey, subValue); + } + data.put(key, array.toString()); + data.remove(lenghtKey); + for(String subKey : subset) { + data.remove(subKey); + } + } + } - @Override - public String[] getArgsList() { - return request.getArgsList(); - } + @Override + public String[] getArgsList() { + return request.getArgsList(); + } - @Override - public Class<? extends AAIDatum> getModelClass() { - return request.getModelClass(); - } - - @Override - public void addRequestProperty(String key, String value) { - request.requestProperties.put(key, value); - } + @Override + public Class<? extends AAIDatum> getModelClass() { + return request.getModelClass(); + } + + @Override + public void addRequestProperty(String key, String value) { + request.requestProperties.put(key, value); + } - public static String processPathData(String requestUrl, Properties requestProperties) { - -// if(request != null) { -// Class<?> clazz = request.getClass(); -// Method function = null; -// try { -// function = clazz.getMethod("processPathData", request_url.getClass(), requestProperties.getClass()); -// request_url = (String) function.invoke(null, request_url, requestProperties); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } - -// request.processPathData(request_url, requestProperties); - return requestUrl; - } - - public void processRequestPathValues(Map<String, String> nameValues) { - request.processRequestPathValues(nameValues); - } + public static String processPathData(String requestUrl, Properties requestProperties) { + +// if(request != null) { +// Class<?> clazz = request.getClass(); +// Method function = null; +// try { +// function = clazz.getMethod("processPathData", request_url.getClass(), requestProperties.getClass()); +// request_url = (String) function.invoke(null, request_url, requestProperties); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + +// request.processPathData(request_url, requestProperties); + return requestUrl; + } + + public void processRequestPathValues(Map<String, String> nameValues) { + request.processRequestPathValues(nameValues); + } } |