diff --git a/pom.xml b/pom.xml
index 05a3dd019ba2fa4ac10cfe4603e535ce5e28010f..56e5a62eca27c9d0cefd8be90e35d01ba0e79941 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,10 +9,10 @@
../org.etsi.osl.main
+ ${org.etsi.osl.tmf.api.version>}
org.etsi.osl.tmf.api
org.etsi.osl.tmf.api
- ${org.etsi.osl.tmf.api.version}
OpenSlice by ETSI
@@ -20,6 +20,7 @@
+
UTF-8
UTF-8
diff --git a/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java b/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java
index ac55f12d80bea74fa75b571c4fb1a0f4b261ff8b..b8e5b11ab5d362a73dc607ebe8a56453a7d04132 100644
--- a/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java
+++ b/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java
@@ -139,7 +139,7 @@ public class SwaggerDocumentationConfig {
@Bean
- public OpenApiCustomizer scm622OpenAPI() {
+ public OpenApiCustomizer po622OpenAPI() {
return openApi -> openApi
.specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth"))
.info(new Info().title("TMF 622 Product Ordering")
@@ -161,12 +161,48 @@ public class SwaggerDocumentationConfig {
SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
return GroupedOpenApi.builder()
.group("tmf-api-622-ProductOrderingManagement-v4.0.0")
- .addOpenApiCustomizer( this.scm622OpenAPI() )
+ .addOpenApiCustomizer( this.po622OpenAPI() )
.packagesToScan("org.etsi.osl.tmf.po622.api")
.build();
}
+
+ /**
+ * TMF 637 Product Inventory Management
+ * @return
+ */
+ @Bean
+ public OpenApiCustomizer pim637penAPI() {
+
+
+ return openApi -> openApi
+ .specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth"))
+ .info(new Info().title("TMF 637 Product Inventory Management")
+ .description("**TMF API Reference : TMF 637 - Product Inventory Management** Release : 19.0 - June 2019\n\nThe Product Inventory Management API provides standardized mechanism for product inventory management such as creation, update and retrieval of the representation of a product in the inventory. It also allows the notification of events related to product lifecycle **Product resource** A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s). Product Inventory API performs the following operations on product : - Retrieval of a product or a collection of products depending on filter criteria - Partial update of a product (including updating rules and for administration purpose) - Creation of a product (including default values and creation rules and for administration purpose) - Deletion of a product (for administration purposes) - Notification of events on product. Copyright © TM Forum 2019. All Rights Reserved ")
+
+ .version("4.0.0")
+ .license(new License().name("Apache 2.0").url("https://osl.etsi.org")))
+ .externalDocs(new ExternalDocumentation()
+ .description("TMF API Tables")
+ .url("https://www.tmforum.org/oda/open-apis/table"));
+
+ }
+
+
+@Bean
+public GroupedOpenApi pim637() {
+
+ SpringDocUtils.getConfig().replaceWithClass(java.time.LocalDate.class, java.sql.Date.class);
+ SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
+ return GroupedOpenApi.builder()
+ .group("tmf-api-637-ProductInventoryManagement-v4.0.0")
+ .addOpenApiCustomizer( this.pim637penAPI() )
+ .packagesToScan("org.etsi.osl.tmf.pim637.api")
+ .build();
+
+}
+
/**
* TMF 634 Resource Catalog Management
diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApi.java b/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApi.java
index 3b0eacf57af62f8a30f4838f1fd8dd1f82d73742..181bde0b3086d73d27d6b74e7445740589dbbc74 100644
--- a/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApi.java
+++ b/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApi.java
@@ -223,5 +223,25 @@ public interface ProductOfferingApi {
}
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
+
+ @Operation(summary = "Creates and Retrieves a ProductOffering by ID", operationId = "retrieveProductOffering", description = "This operation retrieves a ProductOffering entity. Attribute selection is enabled for all first level attributes." , tags = {
+ "productOffering", })
+ @ApiResponses(value = { @ApiResponse(responseCode ="200", description = "Success" ),
+ @ApiResponse(responseCode = "400", description = "Bad Request" ),
+ @ApiResponse(responseCode = "401", description = "Unauthorized" ),
+ @ApiResponse(responseCode = "403", description = "Forbidden" ),
+ @ApiResponse(responseCode = "404", description = "Not Found" ),
+ @ApiResponse(responseCode = "405", description = "Method Not allowed" ),
+ @ApiResponse(responseCode = "409", description = "Conflict" ),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error" ) })
+ @RequestMapping(value = "/productOffering/fromServiceSpecId/{id}", produces = {
+ "application/json;charset=utf-8" }, method = RequestMethod.POST)
+ default ResponseEntity createRetrieveProductOfferingBasedOnServiceSpec(
+ @Parameter(description = "Identifier of the ProductOffering", required = true) @PathVariable("id") String id) {
+
+
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
}
diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApiController.java b/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApiController.java
index c22b53ea188f9f749058ba2d145b53ed8582501c..b13182529d12bee5dceadefb1d9ea62ae43a2a92 100644
--- a/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApiController.java
+++ b/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductOfferingApiController.java
@@ -166,6 +166,22 @@ public class ProductOfferingApiController implements ProductOfferingApi {
return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_ADMIN')" )
+ public ResponseEntity createRetrieveProductOfferingBasedOnServiceSpec(
+ String id) {
+ try {
+
+
+ return new ResponseEntity(productOfferingRepoService.createRetrieveProductOfferingBasedOnServiceSpec(id),
+ HttpStatus.OK);
+ } catch (Exception e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+ }
}
diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductSpecificationApiRouteBuilder.java b/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductSpecificationApiRouteBuilder.java
new file mode 100644
index 0000000000000000000000000000000000000000..07fe723d0e242df176992fc1729001098dd3427e
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pcm620/api/ProductSpecificationApiRouteBuilder.java
@@ -0,0 +1,95 @@
+package org.etsi.osl.tmf.pcm620.api;
+
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.dataformat.JsonLibrary;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCreate;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationUpdate;
+import org.etsi.osl.tmf.pcm620.reposervices.ProductOfferingRepoService;
+import org.etsi.osl.tmf.pcm620.reposervices.ProductSpecificationRepoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
+
+@Configuration
+//@RefreshScope
+@Component
+public class ProductSpecificationApiRouteBuilder extends RouteBuilder {
+
+ private static final transient Log logger = LogFactory.getLog(ProductSpecificationApiRouteBuilder.class.getName());
+
+ @Value("${CATALOG_GET_PRODUCTSPEC_BY_ID}")
+ private String CATALOG_GET_PRODUCTSPEC_BY_ID = "";
+
+
+ @Value("${CATALOG_ADD_PRODUCTSPEC}")
+ private String CATALOG_ADD_PRODUCTSPEC = "";
+
+
+ @Value("${CATALOG_UPD_PRODUCTSPEC}")
+ private String CATALOG_UPD_PRODUCTSPEC = "";
+
+ @Value("${CATALOG_UPDADD_PRODUCTSPEC}")
+ private String CATALOG_UPDADD_PRODUCTSPEC = "";
+
+
+ @Value("${CATALOG_GET_PRODUCTOFFERING_BY_ID}")
+ private String CATALOG_GET_PRODUCTOFFERING_BY_ID = "";
+
+
+
+ @Autowired
+ ProductSpecificationRepoService productSpecificationRepoService;
+
+ @Autowired
+ ProductOfferingRepoService productOfferingRepoService;
+
+
+ @Override
+ public void configure() throws Exception {
+ from( CATALOG_GET_PRODUCTSPEC_BY_ID )
+ .log(LoggingLevel.INFO, log, CATALOG_GET_PRODUCTSPEC_BY_ID + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .bean( productSpecificationRepoService, "findByUuidEager")
+ .marshal().json( JsonLibrary.Jackson, String.class)
+ .convertBodyTo( String.class );
+
+
+ from( CATALOG_ADD_PRODUCTSPEC )
+ .log(LoggingLevel.INFO, log, CATALOG_ADD_PRODUCTSPEC + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .unmarshal().json( JsonLibrary.Jackson, ProductSpecificationCreate .class, true)
+ .bean( productSpecificationRepoService, "addProductSpecification(${body})")
+ .marshal().json( JsonLibrary.Jackson)
+ .convertBodyTo( String.class );
+
+ from( CATALOG_UPD_PRODUCTSPEC )
+ .log(LoggingLevel.INFO, log, CATALOG_UPD_PRODUCTSPEC + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .unmarshal().json( JsonLibrary.Jackson, ProductSpecificationUpdate.class, true)
+ .bean( productSpecificationRepoService, "updateProductSpecification(${header.serviceSpecId}, ${body} )")
+ .marshal().json( JsonLibrary.Jackson)
+ .convertBodyTo( String.class );
+
+ from( CATALOG_UPDADD_PRODUCTSPEC )
+ .log(LoggingLevel.INFO, log, CATALOG_UPD_PRODUCTSPEC + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .unmarshal().json( JsonLibrary.Jackson, ProductSpecificationUpdate.class, true)
+ .bean( productSpecificationRepoService, "updateOrAddProductSpecification(${header.serviceSpecId}, ${header.forceId}, ${body} )")
+ .marshal().json( JsonLibrary.Jackson)
+ .convertBodyTo( String.class );
+
+
+ from( CATALOG_GET_PRODUCTOFFERING_BY_ID )
+ .log(LoggingLevel.INFO, log, CATALOG_GET_PRODUCTOFFERING_BY_ID + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .bean( productOfferingRepoService, "findByUuidEager")
+ .marshal().json( JsonLibrary.Jackson, String.class)
+ .convertBodyTo( String.class );
+
+
+ }
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductOfferingRepoService.java b/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductOfferingRepoService.java
index b53dd5b0be6b91e419e748ff62d1583c3582dc58..40176d7b632d3795da8fa4b598a4fdfd4d25ea4c 100644
--- a/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductOfferingRepoService.java
+++ b/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductOfferingRepoService.java
@@ -26,21 +26,34 @@ import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import org.etsi.osl.tmf.JsonUtils;
import org.etsi.osl.tmf.am651.model.AgreementRef;
+import org.etsi.osl.tmf.common.model.Any;
import org.etsi.osl.tmf.common.model.AttachmentRefOrValue;
import org.etsi.osl.tmf.common.model.ELifecycle;
import org.etsi.osl.tmf.common.model.TimePeriod;
+import org.etsi.osl.tmf.common.model.service.ServiceSpecificationRef;
import org.etsi.osl.tmf.pcm620.model.BundledProductOffering;
import org.etsi.osl.tmf.pcm620.model.ProductOffering;
import org.etsi.osl.tmf.pcm620.model.ProductOfferingCreate;
import org.etsi.osl.tmf.pcm620.model.ProductOfferingPriceRef;
import org.etsi.osl.tmf.pcm620.model.ProductOfferingUpdate;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecification;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCharacteristic;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCharacteristicValue;
import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCharacteristicValueUse;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCreate;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef;
import org.etsi.osl.tmf.pcm620.repo.ProductOfferingRepository;
+import org.etsi.osl.tmf.pcm620.repo.ProductSpecificationRepository;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristicValue;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
+import org.etsi.osl.tmf.scm633.reposervices.ServiceSpecificationRepoService;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
@@ -58,8 +71,12 @@ public class ProductOfferingRepoService {
@Autowired
ProductOfferingRepository prodsOfferingRepo;
-
-
+
+ @Autowired
+ ProductSpecificationRepoService prodSpecRepoService;
+
+ @Autowired
+ ServiceSpecificationRepoService serviceSpecificationRepoService;
private SessionFactory sessionFactory;
@@ -205,6 +222,8 @@ public class ProductOfferingRepoService {
try {
dd = session.get(ProductOffering.class, id);
if (dd == null) {
+ tx.rollback();
+ session.close();
return this.findByUuid(id);// last resort
}
Hibernate.initialize(dd.getAttachment());
@@ -221,6 +240,7 @@ public class ProductOfferingRepoService {
Hibernate.initialize(dd.getProductOfferingTerm() );
Hibernate.initialize(dd.getServiceCandidate() );
Hibernate.initialize(dd.getResourceCandidate() );
+ Hibernate.initialize(dd.getChannel());
tx.commit();
} finally {
@@ -320,6 +340,7 @@ public class ProductOfferingRepoService {
if ( prodOfferingUpd.getProductSpecification() != null ) {
prodOffering.setProductSpecification( prodOfferingUpd.getProductSpecification() );
+ prodOffering = copyCharacteristicsFromProdSpec( prodOffering, prodOfferingUpd.getProductSpecification() );
}
@@ -542,5 +563,74 @@ public class ProductOfferingRepoService {
return prodOffering;
}
+
+ private ProductOffering copyCharacteristicsFromProdSpec(ProductOffering prodOffering,
+ @Valid ProductSpecificationRef productSpecRef) {
+
+ ProductSpecification prodSpec = prodSpecRepoService.findByUuid( productSpecRef.getId() );
+
+ if (prodSpec!= null ) {
+ for (ProductSpecificationCharacteristic prodSpecChar : prodSpec.getProductSpecCharacteristic()) {
+ if ( prodOffering.findCharacteristicByName( prodSpecChar.getName() ) == null ) {
+ ProductSpecificationCharacteristicValueUse pcitem = new ProductSpecificationCharacteristicValueUse();
+ pcitem.name( prodSpecChar.getName() );
+ pcitem.setDescription(prodSpecChar.getDescription());
+ pcitem
+ .maxCardinality(prodSpecChar.getMaxCardinality())
+ .minCardinality(prodSpecChar.getMinCardinality())
+ .valueType(prodSpecChar.getValueType());
+
+ for (ProductSpecificationCharacteristicValue r : prodSpecChar.getProductSpecCharacteristicValue()) {
+ ProductSpecificationCharacteristicValue pcval = new ProductSpecificationCharacteristicValue();
+ pcval.isDefault(r.isIsDefault())
+ .rangeInterval(r.getRangeInterval())
+ .regex(r.getRegex())
+ .unitOfMeasure(r.getUnitOfMeasure())
+ .valueFrom(r.getValueFrom()+"")
+ .valueTo(r.getValueTo()+"")
+ .valueType(r.getValueType())
+ .value( new Any( r.getValue() ) );
+ pcitem.addProductSpecCharacteristicValueItem( pcval );
+
+ }
+
+
+ prodOffering.addProdSpecCharValueUseItem(pcitem );
+ }
+ }
+ }
+
+ return prodOffering;
+ }
+
+ public ProductOffering createRetrieveProductOfferingBasedOnServiceSpec(String id) {
+
+ ServiceSpecification serviceSpec = serviceSpecificationRepoService.findByUuid(id);
+ ProductSpecificationCreate psc = new ProductSpecificationCreate();
+ psc.setName(serviceSpec.getName());
+ psc.setDescription(serviceSpec.getDescription());
+
+ ProductSpecification responseProdSpec = prodSpecRepoService.addProductSpecification(psc);
+
+ responseProdSpec = prodSpecRepoService.addServiceSpecToProductSpec( responseProdSpec, serviceSpec );
+
+ ProductOffering pOffer = this.prodOfferingFromPrdSpec( responseProdSpec );
+
+ return pOffer;
+ }
+
+ private ProductOffering prodOfferingFromPrdSpec(ProductSpecification responseProdSpec) {
+ ProductSpecificationRef prodSpecRef = new ProductSpecificationRef();
+ prodSpecRef.setId(responseProdSpec.getId());
+ prodSpecRef.setName(responseProdSpec.getName());
+
+ ProductOfferingCreate pefCre = new ProductOfferingCreate();
+ pefCre.setName( responseProdSpec.getName());
+ pefCre.productSpecification(prodSpecRef);
+
+ ProductOffering pOffer = this.addProductOffering(pefCre);
+
+ return pOffer;
+ }
}
diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductSpecificationRepoService.java b/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductSpecificationRepoService.java
index 2994b2aea69a05b52b4309ccf9da950156f8cdd2..deec0a663436f017e7d66f89389fb22bd6cd8ea6 100644
--- a/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductSpecificationRepoService.java
+++ b/src/main/java/org/etsi/osl/tmf/pcm620/reposervices/ProductSpecificationRepoService.java
@@ -30,6 +30,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import org.etsi.osl.tmf.common.model.Any;
import org.etsi.osl.tmf.common.model.AttachmentRefOrValue;
import org.etsi.osl.tmf.common.model.ELifecycle;
import org.etsi.osl.tmf.common.model.TimePeriod;
@@ -37,12 +38,17 @@ import org.etsi.osl.tmf.common.model.service.ServiceSpecificationRef;
import org.etsi.osl.tmf.pcm620.model.BundledProductSpecification;
import org.etsi.osl.tmf.pcm620.model.ProductSpecification;
import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCharacteristic;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCharacteristicValue;
import org.etsi.osl.tmf.pcm620.model.ProductSpecificationCreate;
import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRelationship;
import org.etsi.osl.tmf.pcm620.model.ProductSpecificationUpdate;
import org.etsi.osl.tmf.pcm620.repo.ProductSpecificationRepository;
import org.etsi.osl.tmf.prm669.model.RelatedParty;
import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristic;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristicValue;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
+import org.etsi.osl.tmf.scm633.reposervices.ServiceSpecificationRepoService;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
@@ -61,7 +67,9 @@ public class ProductSpecificationRepoService {
@Autowired
ProductSpecificationRepository prodsOfferingRepo;
-
+
+ @Autowired
+ ServiceSpecificationRepoService serviceSpecificationRepoService;
private SessionFactory sessionFactory;
@@ -200,6 +208,8 @@ public class ProductSpecificationRepoService {
return optionalCat.orElse(null);
}
+
+ @Transactional
public ProductSpecification findByUuidEager(String id) {
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction(); // instead of begin transaction, is it possible to continue?
@@ -207,16 +217,18 @@ public class ProductSpecificationRepoService {
try {
dd = session.get(ProductSpecification.class, id);
if (dd == null) {
+ session.close();
return this.findByUuid(id);// last resort
}
Hibernate.initialize(dd.getAttachment());
Hibernate.initialize(dd.getRelatedParty() );
Hibernate.initialize(dd.getBundledProductSpecification() );
Hibernate.initialize(dd.getResourceSpecification() );
- Hibernate.initialize(dd.getServiceSpecification() );
+ Hibernate.initialize(dd.getServiceSpecification() );
+ Hibernate.initialize(dd.getProductSpecificationRelationship() );
for (ProductSpecificationCharacteristic schar : dd.getProductSpecCharacteristic() ) {
Hibernate.initialize(schar.getProductSpecCharacteristicValue() );
-
+ Hibernate.initialize(schar.getProductSpecCharRelationship() );
}
@@ -428,7 +440,7 @@ public class ProductSpecificationRepoService {
}
-
+
/**
* Update ProductSpecificationRelationship list
@@ -548,7 +560,7 @@ public class ProductSpecificationRepoService {
}
/**
- * Update ResourceSpecificationRef list
+ * Update ServiceSpecificationRef list
*/
if (prodSpecUpd.getServiceSpecification() != null) {
@@ -569,6 +581,7 @@ public class ProductSpecificationRepoService {
if (!idexists) {
prodSpec.getServiceSpecification().add(ar);
+ prodSpec = copyConfigurableCharacteristics( prodSpec, ar );
idAddedUpdated.put(ar.getUuid(), true);
}
}
@@ -597,5 +610,74 @@ public class ProductSpecificationRepoService {
return prodSpec;
}
+
+ private ProductSpecification copyConfigurableCharacteristics(ProductSpecification prodSpec,
+ ServiceSpecificationRef ar) {
+
+ ServiceSpecification sourceSpec = serviceSpecificationRepoService.findByUuid(ar.getId());
+
+ if ( sourceSpec != null ) {
+ for (ServiceSpecCharacteristic ssc : sourceSpec.getServiceSpecCharacteristic()) {
+ if (ssc.isConfigurable()!= null && ssc.isConfigurable()) {
+ if ( prodSpec.findProdCharacteristicByName( ssc.getName() ) == null ) {
+
+ ProductSpecificationCharacteristic cnew = new ProductSpecificationCharacteristic();
+ cnew.setName( ssc.getName() );
+ cnew.setDescription( ssc.getDescription());
+ cnew.isUnique(ssc.isIsUnique())
+ .extensible(ssc.isExtensible())
+ .maxCardinality(ssc.getMaxCardinality())
+ .minCardinality(ssc.getMinCardinality())
+ .valueType(ssc.getValueType());
+ for (ServiceSpecCharacteristicValue r : ssc.getServiceSpecCharacteristicValue()) {
+ ProductSpecificationCharacteristicValue pcval = new ProductSpecificationCharacteristicValue();
+ pcval.isDefault(r.isIsDefault())
+ .rangeInterval(r.getRangeInterval())
+ .regex(r.getRegex())
+ .unitOfMeasure(r.getUnitOfMeasure())
+ .valueFrom(r.getValueFrom()+"")
+ .valueTo(r.getValueTo()+"")
+ .valueType(r.getValueType())
+ .value( new Any( r.getValue() ) );
+
+ cnew.addProductSpecCharacteristicValueItem( pcval );
+ }
+
+ prodSpec.getProductSpecCharacteristic().add( cnew );
+
+ }
+ }
+ }
+ }
+
+ return prodSpec;
+ }
+
+ public ProductSpecification addServiceSpecToProductSpec(ProductSpecification responseProdSpec, ServiceSpecification serviceSpec) {
+
+ ServiceSpecificationRef serviceSpecRef = new ServiceSpecificationRef();
+ serviceSpecRef.setId( serviceSpec.getId() );
+ serviceSpecRef.setName( serviceSpec.getName());
+ serviceSpecRef.setVersion(serviceSpec.getVersion());
+ serviceSpecRef.setReferredType(serviceSpec.getType());
+
+ ProductSpecificationUpdate pSpecUpd = new ProductSpecificationUpdate();
+ pSpecUpd.addServiceSpecificationItem(serviceSpecRef);
+ if (responseProdSpec.getServiceSpecification()!=null) {
+ pSpecUpd.getServiceSpecification().addAll( responseProdSpec.getServiceSpecification() );
+ }
+ responseProdSpec = updateProductSpecificationDataFromAPIcall(responseProdSpec, pSpecUpd);
+
+ return responseProdSpec;
+ }
+
+ public ProductSpecification updateOrAddProductSpecification(String id, ProductSpecificationCreate productSpecificatioCreate) {
+ ProductSpecification serviceSpec = updateProductSpecification(id, productSpecificatioCreate );
+ if ( serviceSpec == null ) {
+ serviceSpec = addProductSpecification( productSpecificatioCreate );
+ }
+
+ return serviceSpec;
+ }
}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ApiException.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ApiException.java
new file mode 100644
index 0000000000000000000000000000000000000000..dee19e45a7d626efd22887db321cb5555cd9171d
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ApiException.java
@@ -0,0 +1,10 @@
+package org.etsi.osl.tmf.pim637.api;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+public class ApiException extends Exception {
+ private int code;
+ public ApiException (int code, String msg) {
+ super(msg);
+ this.code = code;
+ }
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ApiOriginFilter.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ApiOriginFilter.java
new file mode 100644
index 0000000000000000000000000000000000000000..653abc4129136c306030c9b2be54c6034155496c
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ApiOriginFilter.java
@@ -0,0 +1,30 @@
+package org.etsi.osl.tmf.pim637.api;
+
+import java.io.IOException;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.FilterConfig;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+public class ApiOriginFilter implements jakarta.servlet.Filter {
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+ HttpServletResponse res = (HttpServletResponse) response;
+ res.addHeader("Access-Control-Allow-Origin", "*");
+ res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
+ res.addHeader("Access-Control-Allow-Headers", "Content-Type");
+ chain.doFilter(request, response);
+ }
+
+ @Override
+ public void destroy() {
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ApiResponseMessage.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ApiResponseMessage.java
new file mode 100644
index 0000000000000000000000000000000000000000..8bf7d4c83b4b574be35b1356da5e528e47354956
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ApiResponseMessage.java
@@ -0,0 +1,69 @@
+package org.etsi.osl.tmf.pim637.api;
+
+import jakarta.xml.bind.annotation.XmlTransient;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@jakarta.xml.bind.annotation.XmlRootElement
+public class ApiResponseMessage {
+ public static final int ERROR = 1;
+ public static final int WARNING = 2;
+ public static final int INFO = 3;
+ public static final int OK = 4;
+ public static final int TOO_BUSY = 5;
+
+ int code;
+ String type;
+ String message;
+
+ public ApiResponseMessage(){}
+
+ public ApiResponseMessage(int code, String message){
+ this.code = code;
+ switch(code){
+ case ERROR:
+ setType("error");
+ break;
+ case WARNING:
+ setType("warning");
+ break;
+ case INFO:
+ setType("info");
+ break;
+ case OK:
+ setType("ok");
+ break;
+ case TOO_BUSY:
+ setType("too busy");
+ break;
+ default:
+ setType("unknown");
+ break;
+ }
+ this.message = message;
+ }
+
+ @XmlTransient
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/HubApi.java b/src/main/java/org/etsi/osl/tmf/pim637/api/HubApi.java
new file mode 100644
index 0000000000000000000000000000000000000000..7dc3b86aea3df45469e25725451605e52133e6c8
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/HubApi.java
@@ -0,0 +1,77 @@
+/**
+ * NOTE: This class is auto generated by the swagger code generator program (3.0.60).
+ * https://github.com/swagger-api/swagger-codegen
+ * Do not edit the class manually.
+ */
+package org.etsi.osl.tmf.pim637.api;
+
+import org.etsi.osl.tmf.pim637.model.Error;
+import org.etsi.osl.tmf.pim637.model.EventSubscription;
+import org.etsi.osl.tmf.pim637.model.EventSubscriptionInput;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+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.RequestMethod;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@Validated
+public interface HubApi {
+
+ @Operation(summary = "Register a listener", description = "Sets the communication endpoint address the service instance must use to deliver information about its health state, execution state, failures and metrics.", tags={ "events subscription" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Subscribed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = EventSubscription.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/hub",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity registerListener(@Parameter(in = ParameterIn.DEFAULT, description = "Data containing the callback endpoint to deliver the information", required=true, schema=@Schema()) @Valid @RequestBody EventSubscriptionInput body
+);
+
+
+ @Operation(summary = "Unregister a listener", description = "Resets the communication endpoint address the service instance must use to deliver information about its health state, execution state, failures and metrics.", tags={ "events subscription" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "204", description = "Deleted"),
+
+ @ApiResponse(responseCode = "400", description = "Bad request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/hub/{id}",
+ produces = { "application/json;charset=utf-8" },
+ method = RequestMethod.DELETE)
+ ResponseEntity unregisterListener(@Parameter(in = ParameterIn.PATH, description = "The id of the registered listener", required=true, schema=@Schema()) @PathVariable("id") String id
+);
+
+}
+
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/HubApiController.java b/src/main/java/org/etsi/osl/tmf/pim637/api/HubApiController.java
new file mode 100644
index 0000000000000000000000000000000000000000..96129c8d13131e6c601ca1a826feaff0434177e2
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/HubApiController.java
@@ -0,0 +1,57 @@
+package org.etsi.osl.tmf.pim637.api;
+
+import java.io.IOException;
+import jakarta.servlet.http.HttpServletRequest;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.etsi.osl.tmf.pim637.model.EventSubscription;
+import org.etsi.osl.tmf.pim637.model.EventSubscriptionInput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@RestController("HubApiController637")
+public class HubApiController implements HubApi {
+
+ private static final Logger log = LoggerFactory.getLogger(HubApiController.class);
+
+ private final ObjectMapper objectMapper;
+
+ private final HttpServletRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public HubApiController(ObjectMapper objectMapper, HttpServletRequest request) {
+ this.objectMapper = objectMapper;
+ this.request = request;
+ }
+
+ public ResponseEntity registerListener(@Parameter(in = ParameterIn.DEFAULT, description = "Data containing the callback endpoint to deliver the information", required=true, schema=@Schema()) @Valid @RequestBody EventSubscriptionInput body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"query\" : \"query\",\r\n \"callback\" : \"callback\",\r\n \"id\" : \"id\"\r\n}", EventSubscription.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity unregisterListener(@Parameter(in = ParameterIn.PATH, description = "The id of the registered listener", required=true, schema=@Schema()) @PathVariable("id") String id
+) {
+ String accept = request.getHeader("Accept");
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ListenerApi.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ListenerApi.java
new file mode 100644
index 0000000000000000000000000000000000000000..8ea75df1e1c1685af62bef92deb90df4eee25ce9
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ListenerApi.java
@@ -0,0 +1,158 @@
+/**
+ * NOTE: This class is auto generated by the swagger code generator program (3.0.60).
+ * https://github.com/swagger-api/swagger-codegen
+ * Do not edit the class manually.
+ */
+package org.etsi.osl.tmf.pim637.api;
+
+import org.etsi.osl.tmf.pim637.model.Error;
+import org.etsi.osl.tmf.pim637.model.EventSubscription;
+import org.etsi.osl.tmf.pim637.model.ProductAttributeValueChangeEvent;
+import org.etsi.osl.tmf.pim637.model.ProductBatchEvent;
+import org.etsi.osl.tmf.pim637.model.ProductCreateEvent;
+import org.etsi.osl.tmf.pim637.model.ProductDeleteEvent;
+import org.etsi.osl.tmf.pim637.model.ProductStateChangeEvent;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@Validated
+public interface ListenerApi {
+
+ @Operation(summary = "Client listener for entity ProductAttributeValueChangeEvent", description = "Example of a client listener for receiving the notification ProductAttributeValueChangeEvent", tags={ "notification listeners (client side)" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Notified", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = EventSubscription.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/listener/productAttributeValueChangeEvent",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity listenToProductAttributeValueChangeEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductAttributeValueChangeEvent body
+);
+
+
+ @Operation(summary = "Client listener for entity ProductBatchEvent", description = "Example of a client listener for receiving the notification ProductBatchEvent", tags={ "notification listeners (client side)" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Notified", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = EventSubscription.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/listener/productBatchEvent",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity listenToProductBatchEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductBatchEvent body
+);
+
+
+ @Operation(summary = "Client listener for entity ProductCreateEvent", description = "Example of a client listener for receiving the notification ProductCreateEvent", tags={ "notification listeners (client side)" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Notified", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = EventSubscription.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/listener/productCreateEvent",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity listenToProductCreateEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductCreateEvent body
+);
+
+
+ @Operation(summary = "Client listener for entity ProductDeleteEvent", description = "Example of a client listener for receiving the notification ProductDeleteEvent", tags={ "notification listeners (client side)" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Notified", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = EventSubscription.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/listener/productDeleteEvent",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity listenToProductDeleteEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductDeleteEvent body
+);
+
+
+ @Operation(summary = "Client listener for entity ProductStateChangeEvent", description = "Example of a client listener for receiving the notification ProductStateChangeEvent", tags={ "notification listeners (client side)" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Notified", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = EventSubscription.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/listener/productStateChangeEvent",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity listenToProductStateChangeEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductStateChangeEvent body
+);
+
+}
+
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ListenerApiController.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ListenerApiController.java
new file mode 100644
index 0000000000000000000000000000000000000000..475d90f202574fa8d31ad7501d7cffd439007ba4
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ListenerApiController.java
@@ -0,0 +1,117 @@
+package org.etsi.osl.tmf.pim637.api;
+
+import java.io.IOException;
+import jakarta.servlet.http.HttpServletRequest;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.etsi.osl.tmf.pim637.model.EventSubscription;
+import org.etsi.osl.tmf.pim637.model.ProductAttributeValueChangeEvent;
+import org.etsi.osl.tmf.pim637.model.ProductBatchEvent;
+import org.etsi.osl.tmf.pim637.model.ProductCreateEvent;
+import org.etsi.osl.tmf.pim637.model.ProductDeleteEvent;
+import org.etsi.osl.tmf.pim637.model.ProductStateChangeEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@Controller("ListenerApiController637")
+@RequestMapping("/productInventoryManagement/v4/")
+public class ListenerApiController implements ListenerApi {
+
+ private static final Logger log = LoggerFactory.getLogger(ListenerApiController.class);
+
+ private final ObjectMapper objectMapper;
+
+ private final HttpServletRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public ListenerApiController(ObjectMapper objectMapper, HttpServletRequest request) {
+ this.objectMapper = objectMapper;
+ this.request = request;
+ }
+
+ public ResponseEntity listenToProductAttributeValueChangeEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductAttributeValueChangeEvent body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"query\" : \"query\",\r\n \"callback\" : \"callback\",\r\n \"id\" : \"id\"\r\n}", EventSubscription.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity listenToProductBatchEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductBatchEvent body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"query\" : \"query\",\r\n \"callback\" : \"callback\",\r\n \"id\" : \"id\"\r\n}", EventSubscription.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity listenToProductCreateEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductCreateEvent body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"query\" : \"query\",\r\n \"callback\" : \"callback\",\r\n \"id\" : \"id\"\r\n}", EventSubscription.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity listenToProductDeleteEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductDeleteEvent body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"query\" : \"query\",\r\n \"callback\" : \"callback\",\r\n \"id\" : \"id\"\r\n}", EventSubscription.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity listenToProductStateChangeEvent(@Parameter(in = ParameterIn.DEFAULT, description = "The event data", required=true, schema=@Schema()) @Valid @RequestBody ProductStateChangeEvent body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"query\" : \"query\",\r\n \"callback\" : \"callback\",\r\n \"id\" : \"id\"\r\n}", EventSubscription.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/NotFoundException.java b/src/main/java/org/etsi/osl/tmf/pim637/api/NotFoundException.java
new file mode 100644
index 0000000000000000000000000000000000000000..37767fee4433b2d43cb050541511b68b07971f28
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/NotFoundException.java
@@ -0,0 +1,10 @@
+package org.etsi.osl.tmf.pim637.api;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+public class NotFoundException extends ApiException {
+ private int code;
+ public NotFoundException (int code, String msg) {
+ super(code, msg);
+ this.code = code;
+ }
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ProductApi.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ProductApi.java
new file mode 100644
index 0000000000000000000000000000000000000000..c4f9f782563f7131a31f0a781f030f7310203880
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ProductApi.java
@@ -0,0 +1,158 @@
+/**
+ * NOTE: This class is auto generated by the swagger code generator program (3.0.60).
+ * https://github.com/swagger-api/swagger-codegen
+ * Do not edit the class manually.
+ */
+package org.etsi.osl.tmf.pim637.api;
+
+import java.util.List;
+import org.etsi.osl.tmf.pim637.model.Error;
+import org.etsi.osl.tmf.pim637.model.Product;
+import org.etsi.osl.tmf.pim637.model.ProductCreate;
+import org.etsi.osl.tmf.pim637.model.ProductUpdate;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+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.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@Validated
+public interface ProductApi {
+
+ @Operation(summary = "Creates a Product", description = "This operation creates a Product entity.", tags={ "product" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "201", description = "Created", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Product.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/product",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.POST)
+ ResponseEntity createProduct(@Parameter(in = ParameterIn.DEFAULT, description = "The Product to be created", required=true, schema=@Schema()) @Valid @RequestBody ProductCreate body
+);
+
+
+ @Operation(summary = "Deletes a Product", description = "This operation deletes a Product entity.", tags={ "product" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "204", description = "Deleted"),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/product/{id}",
+ produces = { "application/json;charset=utf-8" },
+ method = RequestMethod.DELETE)
+ ResponseEntity deleteProduct(@Parameter(in = ParameterIn.PATH, description = "Identifier of the Product", required=true, schema=@Schema()) @PathVariable("id") String id
+);
+
+
+ @Operation(summary = "List or find Product objects", description = "This operation list or find Product entities", tags={ "product" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "Success", content = @Content(mediaType = "application/json;charset=utf-8", array = @ArraySchema(schema = @Schema(implementation = Product.class)))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/product",
+ produces = { "application/json;charset=utf-8" },
+ method = RequestMethod.GET)
+ ResponseEntity> listProduct(@Parameter(in = ParameterIn.QUERY, description = "Comma-separated properties to be provided in response" ,schema=@Schema()) @Valid @RequestParam(value = "fields", required = false) String fields
+, @Parameter(in = ParameterIn.QUERY, description = "Requested index for start of resources to be provided in response" ,schema=@Schema()) @Valid @RequestParam(value = "offset", required = false) Integer offset
+, @Parameter(in = ParameterIn.QUERY, description = "Requested number of resources to be provided in response" ,schema=@Schema()) @Valid @RequestParam(value = "limit", required = false) Integer limit
+);
+
+
+ @Operation(summary = "Updates partially a Product", description = "This operation updates partially a Product entity.", tags={ "product" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "Updated", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Product.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/product/{id}",
+ produces = { "application/json;charset=utf-8" },
+ consumes = { "application/json;charset=utf-8" },
+ method = RequestMethod.PATCH)
+ ResponseEntity patchProduct(@Parameter(in = ParameterIn.PATH, description = "Identifier of the Product", required=true, schema=@Schema()) @PathVariable("id") String id
+, @Parameter(in = ParameterIn.DEFAULT, description = "The Product to be updated", required=true, schema=@Schema()) @Valid @RequestBody ProductUpdate body
+);
+
+
+ @Operation(summary = "Retrieves a Product by ID", description = "This operation retrieves a Product entity. Attribute selection is enabled for all first level attributes.", tags={ "product" })
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "Success", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Product.class))),
+
+ @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "405", description = "Method Not allowed", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))),
+
+ @ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(mediaType = "application/json;charset=utf-8", schema = @Schema(implementation = Error.class))) })
+ @RequestMapping(value = "/product/{id}",
+ produces = { "application/json;charset=utf-8" },
+ method = RequestMethod.GET)
+ ResponseEntity retrieveProduct(@Parameter(in = ParameterIn.PATH, description = "Identifier of the Product", required=true, schema=@Schema()) @PathVariable("id") String id
+, @Parameter(in = ParameterIn.QUERY, description = "Comma-separated properties to provide in response" ,schema=@Schema()) @Valid @RequestParam(value = "fields", required = false) String fields
+);
+
+}
+
diff --git a/src/main/java/org/etsi/osl/tmf/pim637/api/ProductApiController.java b/src/main/java/org/etsi/osl/tmf/pim637/api/ProductApiController.java
new file mode 100644
index 0000000000000000000000000000000000000000..f53ce22c4fc59e9cdaed8f3c80768cbf5be5f626
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/pim637/api/ProductApiController.java
@@ -0,0 +1,112 @@
+package org.etsi.osl.tmf.pim637.api;
+
+import java.io.IOException;
+import java.util.List;
+import jakarta.servlet.http.HttpServletRequest;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.etsi.osl.tmf.pim637.model.Product;
+import org.etsi.osl.tmf.pim637.model.ProductCreate;
+import org.etsi.osl.tmf.pim637.model.ProductUpdate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
+@Controller("productApiController637")
+@RequestMapping("/productInventoryManagement/v4/")
+public class ProductApiController implements ProductApi {
+
+ private static final Logger log = LoggerFactory.getLogger(ProductApiController.class);
+
+ private final ObjectMapper objectMapper;
+
+ private final HttpServletRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public ProductApiController(ObjectMapper objectMapper, HttpServletRequest request) {
+ this.objectMapper = objectMapper;
+ this.request = request;
+ }
+
+ public ResponseEntity createProduct(@Parameter(in = ParameterIn.DEFAULT, description = "The Product to be created", required=true, schema=@Schema()) @Valid @RequestBody ProductCreate body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"isBundle\" : true,\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ null, null ],\r\n \"description\" : \"description\",\r\n \"billingAccount\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productOrderItem\" : [ null, null ],\r\n \"realizingService\" : [ null, null ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ null, null ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n }, {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n } ],\r\n \"agreement\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n } ],\r\n \"productTerm\" : [ null, null ],\r\n \"relatedParty\" : [ null, null ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ null, null ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ null, null ]\r\n}", Product.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity deleteProduct(@Parameter(in = ParameterIn.PATH, description = "Identifier of the Product", required=true, schema=@Schema()) @PathVariable("id") String id
+) {
+ String accept = request.getHeader("Accept");
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity> listProduct(@Parameter(in = ParameterIn.QUERY, description = "Comma-separated properties to be provided in response" ,schema=@Schema()) @Valid @RequestParam(value = "fields", required = false) String fields
+,@Parameter(in = ParameterIn.QUERY, description = "Requested index for start of resources to be provided in response" ,schema=@Schema()) @Valid @RequestParam(value = "offset", required = false) Integer offset
+,@Parameter(in = ParameterIn.QUERY, description = "Requested number of resources to be provided in response" ,schema=@Schema()) @Valid @RequestParam(value = "limit", required = false) Integer limit
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity>(objectMapper.readValue("[ {\r\n \"isBundle\" : true,\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ null, null ],\r\n \"description\" : \"description\",\r\n \"billingAccount\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productOrderItem\" : [ null, null ],\r\n \"realizingService\" : [ null, null ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ null, null ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n }, {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n } ],\r\n \"agreement\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n } ],\r\n \"productTerm\" : [ null, null ],\r\n \"relatedParty\" : [ null, null ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ null, null ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ null, null ]\r\n}, {\r\n \"isBundle\" : true,\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ null, null ],\r\n \"description\" : \"description\",\r\n \"billingAccount\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productOrderItem\" : [ null, null ],\r\n \"realizingService\" : [ null, null ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ null, null ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n }, {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n } ],\r\n \"agreement\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n } ],\r\n \"productTerm\" : [ null, null ],\r\n \"relatedParty\" : [ null, null ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ null, null ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ null, null ]\r\n} ]", List.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity patchProduct(@Parameter(in = ParameterIn.PATH, description = "Identifier of the Product", required=true, schema=@Schema()) @PathVariable("id") String id
+,@Parameter(in = ParameterIn.DEFAULT, description = "The Product to be updated", required=true, schema=@Schema()) @Valid @RequestBody ProductUpdate body
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"isBundle\" : true,\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ null, null ],\r\n \"description\" : \"description\",\r\n \"billingAccount\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productOrderItem\" : [ null, null ],\r\n \"realizingService\" : [ null, null ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ null, null ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n }, {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n } ],\r\n \"agreement\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n } ],\r\n \"productTerm\" : [ null, null ],\r\n \"relatedParty\" : [ null, null ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ null, null ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ null, null ]\r\n}", Product.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ public ResponseEntity retrieveProduct(@Parameter(in = ParameterIn.PATH, description = "Identifier of the Product", required=true, schema=@Schema()) @PathVariable("id") String id
+,@Parameter(in = ParameterIn.QUERY, description = "Comma-separated properties to provide in response" ,schema=@Schema()) @Valid @RequestParam(value = "fields", required = false) String fields
+) {
+ String accept = request.getHeader("Accept");
+ if (accept != null && accept.contains("application/json")) {
+ try {
+ return new ResponseEntity(objectMapper.readValue("{\r\n \"isBundle\" : true,\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ null, null ],\r\n \"description\" : \"description\",\r\n \"billingAccount\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productOrderItem\" : [ null, null ],\r\n \"realizingService\" : [ null, null ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ null, null ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n }, {\r\n \"isBundle\" : true,\r\n \"productSpecification\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"targetProductSchema\" : {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"@schemaLocation\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"version\" : \"version\"\r\n },\r\n \"@referredType\" : \"@referredType\",\r\n \"@type\" : \"@type\",\r\n \"productCharacteristic\" : [ {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n }, {\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"valueType\" : \"valueType\",\r\n \"name\" : \"name\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : { }\r\n } ],\r\n \"description\" : \"description\",\r\n \"productOrderItem\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"productOrderHref\" : \"productOrderHref\",\r\n \"@baseType\" : \"@baseType\",\r\n \"orderItemId\" : \"orderItemId\",\r\n \"@type\" : \"@type\",\r\n \"productOrderId\" : \"productOrderId\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"orderItemAction\" : \"orderItemAction\"\r\n } ],\r\n \"realizingService\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"terminationDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"@baseType\" : \"@baseType\",\r\n \"realizingResource\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"value\" : \"value\"\r\n } ],\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"place\" : [ null, null ],\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"product\" : [ null, null ],\r\n \"agreement\" : [ null, null ],\r\n \"productOffering\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"productTerm\" : [ {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"duration\" : {\r\n \"amount\" : 2.302136,\r\n \"units\" : \"units\"\r\n },\r\n \"@baseType\" : \"@baseType\",\r\n \"validFor\" : {\r\n \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\"\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"description\" : \"description\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"relatedParty\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"role\" : \"role\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"relationshipType\" : \"relationshipType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n }, {\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"price\" : {\r\n \"taxRate\" : 6.0274563,\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"percentage\" : 0.8008282,\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"dutyFreeAmount\" : {\r\n \"unit\" : \"unit\",\r\n \"value\" : 1.4658129\r\n }\r\n },\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"productOfferingPrice\" : {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n },\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"productPriceAlteration\" : [ {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n }, {\r\n \"applicationDuration\" : 5,\r\n \"unitOfMeasure\" : \"unitOfMeasure\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"priceType\" : \"priceType\",\r\n \"description\" : \"description\",\r\n \"priority\" : 5,\r\n \"recurringChargePeriod\" : \"recurringChargePeriod\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\"\r\n } ]\r\n } ],\r\n \"status\" : \"created\"\r\n } ],\r\n \"agreement\" : [ {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n }, {\r\n \"@referredType\" : \"@referredType\",\r\n \"@baseType\" : \"@baseType\",\r\n \"@type\" : \"@type\",\r\n \"name\" : \"name\",\r\n \"id\" : \"id\",\r\n \"href\" : \"href\",\r\n \"@schemaLocation\" : \"http://example.com/aeiou\",\r\n \"agreementItemId\" : \"agreementItemId\"\r\n } ],\r\n \"productTerm\" : [ null, null ],\r\n \"relatedParty\" : [ null, null ],\r\n \"productSerialNumber\" : \"productSerialNumber\",\r\n \"name\" : \"name\",\r\n \"productRelationship\" : [ null, null ],\r\n \"isCustomerVisible\" : true,\r\n \"orderDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"startDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"productPrice\" : [ null, null ]\r\n}", Product.class), HttpStatus.NOT_IMPLEMENTED);
+ } catch (IOException e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+}
diff --git a/src/main/java/org/etsi/osl/tmf/pm628/api/HubApiController.java b/src/main/java/org/etsi/osl/tmf/pm628/api/HubApiController.java
index 77be4ef6598d3af3511264db92135868c0f80da1..c3bf28d4f446c20dbb3f7860792c146e14fae6d4 100644
--- a/src/main/java/org/etsi/osl/tmf/pm628/api/HubApiController.java
+++ b/src/main/java/org/etsi/osl/tmf/pm628/api/HubApiController.java
@@ -9,7 +9,7 @@ import javax.annotation.Generated;
import java.util.Optional;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-05-15T07:30:16.936523289Z[Etc/UTC]", comments = "Generator version: 7.6.0-SNAPSHOT")
-@Controller
+@Controller("HubApiController628")
@RequestMapping("/performance/v5")
public class HubApiController implements HubApi {
diff --git a/src/main/java/org/etsi/osl/tmf/po622/api/ListenerApiController.java b/src/main/java/org/etsi/osl/tmf/po622/api/ListenerApiController.java
index 540440c66b276040ec915d53f8e9f4c8c6d96198..0a183b76ef9e14ee1c8b2780a5eda15f69c4455f 100644
--- a/src/main/java/org/etsi/osl/tmf/po622/api/ListenerApiController.java
+++ b/src/main/java/org/etsi/osl/tmf/po622/api/ListenerApiController.java
@@ -30,7 +30,7 @@ import jakarta.servlet.http.HttpServletRequest;
@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]")
@Controller("ListenerApiController622")
-@RequestMapping("/productOrder/v4/")
+@RequestMapping("/productOrderingManagement/v4/")
public class ListenerApiController implements ListenerApi {
private final ObjectMapper objectMapper;
diff --git a/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApi.java b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApi.java
index b3851c5e55909c7ffb1388ce61e4d191ddbe455d..bd68031c98d66034047611612f2feb58cfb70ec1 100644
--- a/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApi.java
+++ b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApi.java
@@ -25,6 +25,8 @@
package org.etsi.osl.tmf.po622.api;
import java.io.IOException;
+import java.security.Principal;
+import java.util.Date;
import java.util.List;
import java.util.Optional;
@@ -35,6 +37,7 @@ import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
@@ -79,7 +82,7 @@ public interface ProductOrderApi {
produces = { "application/json;charset=utf-8" },
consumes = { "application/json;charset=utf-8" },
method = RequestMethod.POST)
- default ResponseEntity createProductOrder(@Parameter(description = "The ProductOrder to be created" ,required=true ) @Valid @RequestBody ProductOrderCreate body
+ default ResponseEntity createProductOrder(Principal principal, @Parameter(description = "The ProductOrder to be created" ,required=true ) @Valid @RequestBody ProductOrderCreate body
) {
if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
if (getAcceptHeader().get().contains("application/json")) {
@@ -110,7 +113,7 @@ public interface ProductOrderApi {
@RequestMapping(value = "/productOrder/{id}",
produces = { "application/json;charset=utf-8" },
method = RequestMethod.DELETE)
- default ResponseEntity deleteProductOrder(@Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id
+ default ResponseEntity deleteProductOrder(Principal principal,@Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id
) {
if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
} else {
@@ -133,9 +136,11 @@ public interface ProductOrderApi {
@RequestMapping(value = "/productOrder",
produces = { "application/json;charset=utf-8" },
method = RequestMethod.GET)
- default ResponseEntity> listProductOrder(@Parameter(description = "Comma-separated properties to be provided in response") @Valid @RequestParam(value = "fields", required = false) String fields
+ default ResponseEntity> listProductOrder(Principal principal,@Parameter(description = "Comma-separated properties to be provided in response") @Valid @RequestParam(value = "fields", required = false) String fields
,@Parameter(description = "Requested index for start of resources to be provided in response") @Valid @RequestParam(value = "offset", required = false) Integer offset
-,@Parameter(description = "Requested number of resources to be provided in response") @Valid @RequestParam(value = "limit", required = false) Integer limit
+,@Parameter(description = "Requested number of resources to be provided in response") @Valid @RequestParam(value = "limit", required = false) Integer limit,
+@Parameter(description = "Requested starttime for start of resources to be provided in response") @Valid @RequestParam(value = "starttime", required = false) Date starttime,
+@Parameter(description = "Requested endtime for start of resources to be provided in response") @Valid @RequestParam(value = "endtime", required = false) Date endtime
) {
if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
if (getAcceptHeader().get().contains("application/json")) {
@@ -167,7 +172,7 @@ public interface ProductOrderApi {
produces = { "application/json;charset=utf-8" },
consumes = { "application/json;charset=utf-8" },
method = RequestMethod.PATCH)
- default ResponseEntity patchProductOrder(@Parameter(description = "The ProductOrder to be updated" ,required=true ) @Valid @RequestBody ProductOrderUpdate body
+ default ResponseEntity patchProductOrder(Principal principal,@Parameter(description = "The ProductOrder to be updated" ,required=true ) @Valid @RequestBody ProductOrderUpdate body
,@Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id
) {
if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
@@ -199,7 +204,7 @@ public interface ProductOrderApi {
@RequestMapping(value = "/productOrder/{id}",
produces = { "application/json;charset=utf-8" },
method = RequestMethod.GET)
- default ResponseEntity retrieveProductOrder(@Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id
+ default ResponseEntity retrieveProductOrder(Principal principal, @Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id
,@Parameter(description = "Comma-separated properties to provide in response") @Valid @RequestParam(value = "fields", required = false) String fields
) {
if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
@@ -216,5 +221,46 @@ public interface ProductOrderApi {
}
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
+
+ @Operation(summary = "Get a SVG image with product order item services relationship graph", operationId = "getImageProductOrderItemRelationshipGraph",
+ description = "This operation returns a SVG image with Product order item services relationship graph", tags={ "productOrder", })
+@ApiResponses(value = {
+
+ @ApiResponse(responseCode = "302", description = "Success" ),
+ //@ApiResponse(responseCode ="200", description = "Success" ),
+ @ApiResponse(responseCode = "400", description = "Bad Request" ),
+ @ApiResponse(responseCode = "401", description = "Unauthorized" ),
+ @ApiResponse(responseCode = "403", description = "Forbidden" ),
+ @ApiResponse(responseCode = "404", description = "Not Found" ),
+ @ApiResponse(responseCode = "405", description = "Method Not allowed" ),
+ @ApiResponse(responseCode = "409", description = "Conflict" ),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error" ) })
+@RequestMapping(value ="/productOrder/{id}/item/{itemid}/relationship_graph",
+ produces = MediaType.ALL_VALUE ,
+ method = RequestMethod.GET)
+ResponseEntity getImageProductOrderItemRelationshipGraph(
+ @Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id,
+ @Parameter(description = "Identifier of the ProductOrderItem",required=true) @PathVariable("itemid") String itemid);
+
+
+@Operation(summary = "Get a SVG image with Product order notes activity graph", operationId = "getImageProductOrderNotesGraph",
+ description = "This operation returns a SVG image with Product order notes activity graph", tags={ "productOrder", })
+@ApiResponses(value = {
+
+ @ApiResponse(responseCode = "302", description = "Success" ),
+ //@ApiResponse(responseCode ="200", description = "Success" ),
+ @ApiResponse(responseCode = "400", description = "Bad Request" ),
+ @ApiResponse(responseCode = "401", description = "Unauthorized" ),
+ @ApiResponse(responseCode = "403", description = "Forbidden" ),
+ @ApiResponse(responseCode = "404", description = "Not Found" ),
+ @ApiResponse(responseCode = "405", description = "Method Not allowed" ),
+ @ApiResponse(responseCode = "409", description = "Conflict" ),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error" ) })
+@RequestMapping(value ="/productOrder/{id}/notes_graph",
+ produces = MediaType.ALL_VALUE ,
+ method = RequestMethod.GET)
+ResponseEntity getImageProductOrderNotesGraph(
+ @Parameter(description = "Identifier of the ProductOrder",required=true) @PathVariable("id") String id);
+
}
diff --git a/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiController.java b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiController.java
index bf80e2db4a7d9f04b08a42f44f00cd8854490ec4..ab307dda35bffd5b26b4632d250536437cc7dd72 100644
--- a/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiController.java
+++ b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiController.java
@@ -19,37 +19,212 @@
*/
package org.etsi.osl.tmf.po622.api;
+import java.net.URI;
+import java.security.Principal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
import java.util.Optional;
import com.fasterxml.jackson.databind.ObjectMapper;
-
+import org.etsi.osl.model.nfv.UserRoleType;
+import org.etsi.osl.tmf.common.model.UserPartRoleType;
+import org.etsi.osl.tmf.po622.model.ProductOrder;
+import org.etsi.osl.tmf.po622.model.ProductOrderCreate;
+import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
+import org.etsi.osl.tmf.po622.reposervices.ProductOrderRepoService;
+import org.etsi.osl.tmf.so641.api.NotFoundException;
+import org.etsi.osl.tmf.so641.model.ServiceOrder;
+import org.etsi.osl.tmf.util.AddUserAsOwnerToRelatedParties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.oauth2.jwt.Jwt;
+import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken;
import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-
+import io.swagger.v3.oas.annotations.Parameter;
import jakarta.servlet.http.HttpServletRequest;
-@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]")
-@Controller
+import jakarta.validation.Valid;
+
+@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen",
+ date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]")
+@Controller("ProductOrderApiController622")
@RequestMapping("/productOrderingManagement/v4/")
public class ProductOrderApiController implements ProductOrderApi {
- private final ObjectMapper objectMapper;
+ private final ObjectMapper objectMapper;
+
+ private final HttpServletRequest request;
+
+
+ @Value("${kroki.serverurl}")
+ private String KROKI_SERVERURL = "";
+
+ @Autowired
+ ProductOrderRepoService productOrderRepoService;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public ProductOrderApiController(ObjectMapper objectMapper, HttpServletRequest request) {
+ this.objectMapper = objectMapper;
+ this.request = request;
+ }
+
+
+ @PreAuthorize("hasAnyAuthority('ROLE_USER')")
+ @Override
+ public ResponseEntity createProductOrder(Principal principal,
+ @Parameter(description = "The ProductOrder to be created",
+ required = true) @Valid @RequestBody ProductOrderCreate productOrder) {
+
+ try {
+ // Object attr = request.getSession().getAttribute("SPRING_SECURITY_CONTEXT");
+ // SecurityContextHolder.setContext( (SecurityContext) attr );
+
+
+ log.info("authentication= " + principal.toString());
+ String extInfo = null;
+ try {
+
+
+ if (principal instanceof JwtAuthenticationToken) {
+
+ JwtAuthenticationToken pr = (JwtAuthenticationToken) principal;
+
+ Jwt lp = (Jwt) pr.getPrincipal();
+ extInfo = lp.getClaimAsString("email");
+ log.debug("extInfo= " + extInfo);
+
+ productOrder.setRelatedParty(AddUserAsOwnerToRelatedParties.addUser(principal.getName(),
+ // user.getId()+"",
+ principal.getName(), UserPartRoleType.REQUESTER, extInfo,
+ productOrder.getRelatedParty()));
+ } else if (principal instanceof UsernamePasswordAuthenticationToken) {
+ productOrder.setRelatedParty(AddUserAsOwnerToRelatedParties.addUser(principal.getName(),
+ // user.getId()+"",
+ principal.getName(), UserPartRoleType.REQUESTER, extInfo,
+ productOrder.getRelatedParty()));
+ }
+
+
+ } finally {
+
+ }
- private final HttpServletRequest request;
- @org.springframework.beans.factory.annotation.Autowired
- public ProductOrderApiController(ObjectMapper objectMapper, HttpServletRequest request) {
- this.objectMapper = objectMapper;
- this.request = request;
+
+ ProductOrder c = productOrderRepoService.addProductOrder(productOrder);
+
+ return new ResponseEntity(c, HttpStatus.OK);
+
+
+ } catch (NotFoundException e) {
+ log.error("Couldn't create Service Order. ", e);
+ return new ResponseEntity(HttpStatus.BAD_REQUEST);
+ } catch (Exception e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
}
+ }
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_ADMIN')")
+ public ResponseEntity deleteProductOrder(Principal principal, String id) {
- @Override
- public Optional getObjectMapper() {
- return Optional.ofNullable(objectMapper);
+ try {
+ return new ResponseEntity(productOrderRepoService.deleteByUuid(id), HttpStatus.OK);
+ } catch (Exception e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
}
+ }
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_ADMIN')")
+ public ResponseEntity> listProductOrder(Principal principal,
+ @Valid String fields, @Valid Integer offset, @Valid Integer limit, @Valid Date starttime,
+ @Valid Date endtime) {
+ try {
+
+ Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
+ log.debug("principal= " + principal.toString());
+
+ log.debug("principal ROLE_ADMIN = " + authentication.getAuthorities()
+ .contains(new SimpleGrantedAuthority(UserRoleType.ROLE_ADMIN.getValue())));
+ log.debug("principal ROLE_NFV_DEVELOPER = " + authentication.getAuthorities()
+ .contains(new SimpleGrantedAuthority(UserRoleType.ROLE_NFV_DEVELOPER.getValue())));
+ log.debug("principal ROLE_EXPERIMENTER = " + authentication.getAuthorities()
+ .contains(new SimpleGrantedAuthority(UserRoleType.ROLE_EXPERIMENTER.getValue())));
+
+ if (authentication.getAuthorities()
+ .contains(new SimpleGrantedAuthority(UserRoleType.ROLE_ADMIN.getValue()))) {
+
+ return new ResponseEntity>(
+ productOrderRepoService.findAll(fields, new HashMap<>(), starttime, endtime),
+ HttpStatus.OK);
+ } else {
+ return new ResponseEntity>(
+ productOrderRepoService.findAll(principal.getName(), UserPartRoleType.REQUESTER),
+ HttpStatus.OK);
+ }
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
+
+ } catch (Exception e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity>(HttpStatus.INTERNAL_SERVER_ERROR);
}
+ }
+
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_USER')")
+ public ResponseEntity patchProductOrder(Principal principal,
+ @Valid ProductOrderUpdate body, String id) {
+ ProductOrder c = productOrderRepoService.updateProductOrder(id, body);
+
+ return new ResponseEntity(c, HttpStatus.OK);
+ }
+
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_USER')")
+ public ResponseEntity retrieveProductOrder(Principal principal, String id,
+ @Valid String fields) {
+ try {
+
+ return new ResponseEntity( productOrderRepoService.findByUuid( id ), HttpStatus.OK);
+ } catch ( Exception e) {
+ log.error("Couldn't serialize response for content type application/json", e);
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_USER')")
+ public ResponseEntity getImageProductOrderItemRelationshipGraph(String id, String itemid) {
+ String encodedDiagram =
+ productOrderRepoService.getImageProductOrderItemRelationshipGraph(id, itemid);
+
+ // consider redirect to kroki..id
+ return ResponseEntity.status(HttpStatus.FOUND)
+ .location(URI.create(KROKI_SERVERURL + "/blockdiag/svg/" + encodedDiagram)).build();
+ // return null;
+ }
+
+ @Override
+ @PreAuthorize("hasAnyAuthority('ROLE_USER')")
+ public ResponseEntity getImageProductOrderNotesGraph(String id) {
+ String encodedDiagram = productOrderRepoService.getImageProductOrderNotesGraph(id);
+ // consider redirect to kroki..id
+ return ResponseEntity.status(HttpStatus.FOUND)
+ .location(URI.create(KROKI_SERVERURL + "/actdiag/svg/" + encodedDiagram)).build();
+ }
}
diff --git a/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiRouteBuilder.java b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiRouteBuilder.java
new file mode 100644
index 0000000000000000000000000000000000000000..23dbc57a33d948b7bc9ae6d01f0da12a7bbafb3c
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiRouteBuilder.java
@@ -0,0 +1,101 @@
+package org.etsi.osl.tmf.po622.api;
+
+import java.util.Map;
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.dataformat.JsonLibrary;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.centrallog.client.CentralLogger;
+import org.etsi.osl.tmf.po622.model.ProductOrderCreate;
+import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
+import org.etsi.osl.tmf.po622.reposervices.ProductOrderRepoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
+
+@Configuration
+//@RefreshScope
+@Component
+public class ProductOrderApiRouteBuilder extends RouteBuilder {
+
+ private static final transient Log logger = LogFactory.getLog(ProductOrderApiRouteBuilder.class.getName());
+
+ @Value("${CATALOG_GET_PRODUCTORDER_BY_ID}")
+ private String CATALOG_GET_PRODUCTORDER_BY_ID = "";
+
+ @Value("${CATALOG_GET_PRODUCTORDERS}")
+ private String CATALOG_GET_PRODUCTORDERS = "";
+
+ @Value("${CATALOG_GET_INITIAL_PRODUCTORDERS_IDS}")
+ private String CATALOG_GET_INITIAL_PRODUCTORDERS_IDS = "";
+
+ @Value("${CATALOG_GET_PRODUCTORDER_IDS_BY_STATE}")
+ private String CATALOG_GET_PRODUCTORDER_IDS_BY_STATE = "";
+
+ @Value("${CATALOG_UPD_PRODUCTORDER_BY_ID}")
+ private String CATALOG_UPD_PRODUCTORDER_BY_ID = "";
+
+ @Value("${CATALOG_ADD_PRODUCTORDER}")
+ private String CATALOG_ADD_PRODUCTORDER = "";
+
+
+ @Value("${GET_USER_BY_USERNAME}")
+ private String GET_USER_BY_USERNAME = "";
+
+ @Value("${spring.application.name}")
+ private String compname;
+
+ @Autowired
+ private ProducerTemplate template;
+
+ @Autowired
+ ProductOrderRepoService productOrderRepoService;
+
+ @Autowired
+ private CentralLogger centralLogger;
+
+
+ @Override
+ public void configure() throws Exception {
+ from(CATALOG_GET_PRODUCTORDERS).log(LoggingLevel.INFO, log, CATALOG_GET_PRODUCTORDERS + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .bean(productOrderRepoService, "findAllParamsJsonOrderIDs").convertBodyTo(String.class);
+
+
+from(CATALOG_GET_INITIAL_PRODUCTORDERS_IDS)
+ .log(LoggingLevel.INFO, log, CATALOG_GET_INITIAL_PRODUCTORDERS_IDS + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true").setBody(constant("{\"state\":\"INITIAL\"}")).unmarshal()
+ .json(JsonLibrary.Jackson, Map.class, true).bean(productOrderRepoService, "findAllParamsJsonOrderIDs")
+ .convertBodyTo(String.class);
+
+from(CATALOG_GET_PRODUCTORDER_IDS_BY_STATE)
+ .log(LoggingLevel.INFO, log, CATALOG_GET_PRODUCTORDER_IDS_BY_STATE + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true").setBody(simple("{\"state\":\"${header.orderstate}\"}"))
+ .unmarshal().json(JsonLibrary.Jackson, Map.class, true)
+ .bean(productOrderRepoService, "findAllParamsJsonOrderIDs").convertBodyTo(String.class);
+
+from(CATALOG_GET_PRODUCTORDER_BY_ID)
+ .log(LoggingLevel.INFO, log, CATALOG_GET_PRODUCTORDER_BY_ID + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true")
+ .bean(productOrderRepoService, "getProductOrderEagerAsString").convertBodyTo(String.class);
+
+from(CATALOG_UPD_PRODUCTORDER_BY_ID)
+ .log(LoggingLevel.INFO, log, CATALOG_UPD_PRODUCTORDER_BY_ID + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true").unmarshal()
+ .json(JsonLibrary.Jackson, ProductOrderUpdate.class, true)
+ .bean(productOrderRepoService, "updateProductOrder(${header.orderid}, ${body})");
+
+
+from(CATALOG_ADD_PRODUCTORDER)
+ .log(LoggingLevel.INFO, log, CATALOG_ADD_PRODUCTORDER + " message received!")
+ .to("log:DEBUG?showBody=true&showHeaders=true").unmarshal()
+ .json(JsonLibrary.Jackson, ProductOrderCreate.class, true)
+ .bean(productOrderRepoService, "addProductOrderReturnEager(${body})")
+ .convertBodyTo(String.class); //creates back a response
+ }
+
+
+}
diff --git a/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiRouteBuilderEvents.java b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiRouteBuilderEvents.java
new file mode 100644
index 0000000000000000000000000000000000000000..8343d3da1c62d37fbc0cd518416aeadc38e2fc83
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/po622/api/ProductOrderApiRouteBuilderEvents.java
@@ -0,0 +1,108 @@
+package org.etsi.osl.tmf.po622.api;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.centrallog.client.CLevel;
+import org.etsi.osl.centrallog.client.CentralLogger;
+import org.etsi.osl.tmf.common.model.Notification;
+import org.etsi.osl.tmf.po622.model.ProductOrderAttributeValueChangeNotification;
+import org.etsi.osl.tmf.po622.model.ProductOrderCreateNotification;
+import org.etsi.osl.tmf.po622.model.ProductOrderDeleteNotification;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateChangeNotification;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Configuration
+// @RefreshScope
+@Component
+public class ProductOrderApiRouteBuilderEvents extends RouteBuilder {
+
+ private static final transient Log logger =
+ LogFactory.getLog(ProductOrderApiRouteBuilderEvents.class.getName());
+
+
+
+ @Value("${EVENT_PRODUCT_ORDER_CREATE}")
+ private String EVENT_PRODUCT_ORDER_CREATE = "";
+
+ @Value("${EVENT_PRODUCT_ORDER_STATE_CHANGED}")
+ private String EVENT_PRODUCT_ORDER_STATE_CHANGED = "";
+
+ @Value("${EVENT_PRODUCT_ORDER_DELETE}")
+ private String EVENT_PRODUCT_ORDER_DELETE = "";
+
+ @Value("${EVENT_PRODUCT_ORDER_ATTRIBUTE_VALUE_CHANGED}")
+ private String EVENT_PRODUCT_ORDER_ATTRIBUTE_VALUE_CHANGED = "";
+
+
+
+ @Value("${spring.application.name}")
+ private String compname;
+
+ @Autowired
+ private ProducerTemplate template;
+
+
+ @Autowired
+ private CentralLogger centralLogger;
+
+ @Override
+ public void configure() throws Exception {
+
+
+
+ }
+
+ /**
+ * @param n
+ */
+ @Transactional
+ public void publishEvent(final Notification n, final String objId) {
+ n.setEventType(n.getClass().getName());
+ logger.info("will send Event for type " + n.getEventType());
+ try {
+ String msgtopic = "";
+
+ if (n instanceof ProductOrderCreateNotification) {
+ msgtopic = EVENT_PRODUCT_ORDER_CREATE;
+ } else if (n instanceof ProductOrderStateChangeNotification) {
+ msgtopic = EVENT_PRODUCT_ORDER_STATE_CHANGED;
+ } else if (n instanceof ProductOrderDeleteNotification) {
+ msgtopic = EVENT_PRODUCT_ORDER_DELETE;
+ } else if (n instanceof ProductOrderAttributeValueChangeNotification) {
+ msgtopic = EVENT_PRODUCT_ORDER_ATTRIBUTE_VALUE_CHANGED;
+ }
+ Map map = new HashMap<>();
+ map.put("eventid", n.getEventId());
+ map.put("objId", objId);
+
+ String apayload = toJsonString(n);
+ template.sendBodyAndHeaders(msgtopic, apayload, map);
+
+
+ centralLogger.log(CLevel.INFO, apayload, compname);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ logger.error("Cannot send Event . " + e.getMessage());
+ }
+ }
+
+
+ static String toJsonString(Object object) throws IOException {
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ return mapper.writeValueAsString(object);
+ }
+
+}
diff --git a/src/main/java/org/etsi/osl/tmf/po622/repo/ProductOrderRepository.java b/src/main/java/org/etsi/osl/tmf/po622/repo/ProductOrderRepository.java
new file mode 100644
index 0000000000000000000000000000000000000000..ae19cea2051edbc0248c9e6b581789e43c765714
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/po622/repo/ProductOrderRepository.java
@@ -0,0 +1,56 @@
+/*-
+ * ========================LICENSE_START=================================
+ * org.etsi.osl.tmf.api
+ * %%
+ * Copyright (C) 2019 openslice.io
+ * %%
+ * 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.etsi.osl.tmf.po622.repo;
+
+import java.util.List;
+import java.util.Optional;
+import org.etsi.osl.tmf.common.model.UserPartRoleType;
+import org.etsi.osl.tmf.po622.model.ProductOrder;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateType;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.stereotype.Repository;
+
+
+@Repository
+public interface ProductOrderRepository extends CrudRepository, PagingAndSortingRepository {
+
+
+ Optional findByUuid(String id);
+
+ Iterable findByState( ProductOrderStateType state);
+ @Query("SELECT por FROM ProductOrder por JOIN FETCH por.relatedParty rp WHERE rp.name = ?1 AND rp.role = ?2 ORDER BY por.orderDate DESC")
+ Iterable findByRolenameAndRoleType(String rolename, UserPartRoleType requester);
+ @Query("SELECT por FROM ProductOrder por JOIN FETCH por.relatedParty rp WHERE rp.name = ?1")
+ Iterable findByRolename(String rolename);
+
+ List findByOrderByOrderDateDesc();
+
+ @Query("SELECT por FROM ProductOrder por JOIN FETCH por.relatedParty rp ORDER BY por.orderDate DESC")
+ List findAllOptimized();
+
+
+
+ @Query("SELECT por FROM ProductOrder por JOIN FETCH por.note an "
+ + "WHERE por.uuid = ?1 "
+ + "ORDER BY an.date ASC")
+ Optional findNotesOfProdOrder(String id);
+}
diff --git a/src/main/java/org/etsi/osl/tmf/po622/reposervices/ProductOrderRepoService.java b/src/main/java/org/etsi/osl/tmf/po622/reposervices/ProductOrderRepoService.java
new file mode 100644
index 0000000000000000000000000000000000000000..2ae7aa07aac5b7440c131f256216f9fddbb52666
--- /dev/null
+++ b/src/main/java/org/etsi/osl/tmf/po622/reposervices/ProductOrderRepoService.java
@@ -0,0 +1,707 @@
+/*-
+ * ========================LICENSE_START=================================
+ * org.etsi.osl.tmf.api
+ * %%
+ * Copyright (C) 2019 openslice.io
+ * %%
+ * 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.etsi.osl.tmf.po622.reposervices;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.hibernate5.jakarta.Hibernate5JakartaModule;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.common.model.UserPartRoleType;
+import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ResourceRef;
+import org.etsi.osl.tmf.common.model.service.ServiceRef;
+import org.etsi.osl.tmf.pcm620.model.ProductOffering;
+import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecification;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef;
+import org.etsi.osl.tmf.pcm620.reposervices.ProductOfferingRepoService;
+import org.etsi.osl.tmf.pcm620.reposervices.ProductSpecificationRepoService;
+import org.etsi.osl.tmf.po622.api.ProductOrderApiRouteBuilderEvents;
+import org.etsi.osl.tmf.po622.model.OrderItemActionType;
+import org.etsi.osl.tmf.po622.model.ProductOrder;
+import org.etsi.osl.tmf.po622.model.ProductOrderAttributeValueChangeEvent;
+import org.etsi.osl.tmf.po622.model.ProductOrderAttributeValueChangeNotification;
+import org.etsi.osl.tmf.po622.model.ProductOrderCreate;
+import org.etsi.osl.tmf.po622.model.ProductOrderCreateEvent;
+import org.etsi.osl.tmf.po622.model.ProductOrderCreateNotification;
+import org.etsi.osl.tmf.po622.model.ProductOrderItem;
+import org.etsi.osl.tmf.po622.model.ProductOrderItemStateType;
+import org.etsi.osl.tmf.po622.model.ProductOrderMapper;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateChangeEvent;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateChangeNotification;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateType;
+import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
+import org.etsi.osl.tmf.po622.repo.ProductOrderRepository;
+import org.etsi.osl.tmf.prm669.model.RelatedParty;
+import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
+import org.etsi.osl.tmf.sim638.service.ServiceRepoService;
+import org.etsi.osl.tmf.so641.api.NotFoundException;
+import org.etsi.osl.tmf.so641.reposervices.ServiceOrderRepoService;
+import org.etsi.osl.tmf.util.KrokiClient;
+import org.hibernate.Hibernate;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.query.Query;
+import org.hibernate.transform.ResultTransformer;
+import org.mapstruct.factory.Mappers;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.PersistenceContext;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Service
+public class ProductOrderRepoService {
+
+ private static final transient Log logger =
+ LogFactory.getLog(ProductOrderRepoService.class.getName());
+
+ @Autowired
+ ObjectMapper objectMapper;
+
+ @Autowired
+ ProductOrderRepository productOrderRepo;
+
+
+ @Autowired
+ ProductSpecificationRepoService productSpecificationRepoService;
+
+ @Autowired
+ ProductOfferingRepoService productOfferingRepoService;
+
+
+ @Autowired
+ ProductOrderApiRouteBuilderEvents productOrderApiRouteBuilder;
+
+
+ @Autowired
+ ServiceRepoService serviceRepoService;
+
+ @Autowired
+ ServiceOrderRepoService serviceOrderRepoService;
+
+ private SessionFactory sessionFactory;
+
+ @PersistenceContext EntityManager entityManager;
+
+ @Autowired
+ public ProductOrderRepoService(EntityManagerFactory factory) {
+ if (factory.unwrap(SessionFactory.class) == null) {
+ throw new NullPointerException("factory is not a hibernate factory");
+ }
+ this.sessionFactory = factory.unwrap(SessionFactory.class);
+ }
+
+
+ @Transactional
+ public List findAll() {
+
+ // return (List) this.productOrderRepo.findAll();
+ // return (List) this.productOrderRepo.findByOrderByOrderDateDesc();
+ return (List) this.productOrderRepo.findAllOptimized();
+ }
+
+ public Void deleteByUuid(String id) {
+
+ Optional optso = this.productOrderRepo.findByUuid(id);
+ ProductOrder so = optso.get();
+ if ( so == null ) {
+ return null;
+ }
+
+ this.productOrderRepo.delete(so);
+ return null;
+}
+
+
+ public List findAllParams(Map allParams) {
+ logger.info("findAll with params:" + allParams.toString());
+ if ( ( allParams !=null) && allParams.get("state") !=null) {
+ ProductOrderStateType state = ProductOrderStateType.fromValue( allParams.get("state") );
+ logger.info("find by state:" + state );
+ return (List) this.productOrderRepo.findByState(state);
+ }else {
+ return findAll();
+ }
+ }
+
+
+ public String findAllParamsJsonOrderIDs(Map allParams) throws JsonProcessingException {
+
+ List lso = findAllParams(allParams);
+ ArrayList oids = new ArrayList<>();
+ for (ProductOrder object : lso) {
+ oids.add(object.getId());
+ }
+ ObjectMapper mapper = new ObjectMapper();
+ // Registering Hibernate4Module to support lazy objects
+ // this will fetch all lazy objects before marshaling
+ mapper.registerModule(new Hibernate5JakartaModule());
+ String res = mapper.writeValueAsString( oids );
+
+ return res;
+ }
+
+ public String addProductOrderReturnEager(@Valid ProductOrderCreate pOrderCreate) {
+ try {
+ ProductOrder so = this.addProductOrder(pOrderCreate);
+ return this.getProductOrderEagerAsString( so.getUuid());
+ } catch (JsonProcessingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+}
+
+ /**
+ *
+ * This findAll is optimized on fields.
+ * @param fields
+ * @param allParams
+ * @return
+ * @throws UnsupportedEncodingException
+ */
+ @Transactional
+ public List findAll(@Valid String fields, Map allParams, @Valid Date starttime, @Valid Date endtime)
+ throws UnsupportedEncodingException {
+
+ Session session = sessionFactory.openSession();
+ Transaction tx = session.beginTransaction();
+ List alist = null;
+ try {
+ String sql = "SELECT "
+ + "por.uuid as uuid,"
+ + "por.orderDate as orderDate,"
+ + "por.requestedStartDate as requestedStartDate,"
+ + "por.requestedCompletionDate as requestedCompletionDate,"
+ + "por.expectedCompletionDate as expectedCompletionDate,"
+ + "por.state as state,"
+ + "por.type as type,"
+ + "rp.uuid as relatedParty_uuid,"
+ + "rp.name as relatedParty_name";
+
+ if (fields != null && fields.length()>0 ) {
+ String[] field = fields.split(",");
+ for (String f : field) {
+ sql += ", sor." + f + " as " + f ;
+ }
+
+ }
+ sql += " FROM ProductOrder por "
+ + "JOIN por.relatedParty rp ";
+
+ if (allParams.size() > 0) {
+ sql += " WHERE rp.role = 'REQUESTER' AND ";
+ for (String pname : allParams.keySet()) {
+ sql += " " + pname + " LIKE ";
+ String pval = URLDecoder.decode(allParams.get(pname), StandardCharsets.UTF_8.toString());
+ sql += "'" + pval + "'";
+ }
+ } else {
+ sql += " WHERE rp.role = 'REQUESTER' ";
+ }
+
+ if ( starttime != null ) {
+ sql += " AND por.orderDate >= :param1";
+
+ }
+ if ( endtime != null ) {
+ sql += " AND por.expectedCompletionDate <= :param2";
+ }
+
+ sql += " ORDER BY por.orderDate DESC";
+
+ Query query = session.createQuery( sql );
+ if ( starttime != null ) {
+ query.setParameter("param1", starttime.toInstant().atOffset(ZoneOffset.UTC) );
+ }
+ if ( endtime != null ) {
+ query.setParameter("param2", endtime.toInstant().atOffset(ZoneOffset.UTC) );
+ }
+
+ List