Commit cadc107d authored by Christos Tranoris's avatar Christos Tranoris
Browse files

Merge branch...

Merge branch '115-check-consistency-of-characteristics-before-setting-them-in-service-create-update' into 109-integrate-flyway-in-tmf-api-for-db-migration-actions
parents 91cddc47 e5a2936c
Loading
Loading
Loading
Loading
Loading
+2 −2
Changes for Dockerfile: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
FROM ibm-semeru-runtimes:open-17.0.7_7-jdk
# RUN mkdir /opt/shareclasses
RUN mkdir -p /opt/openslice/lib/
COPY target/org.etsi.osl.tmf.api-1.4.0-SNAPSHOT-exec.jar /opt/openslice/lib/
CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.4.0-SNAPSHOT-exec.jar"]
COPY target/org.etsi.osl.tmf.api-2.0.0-SNAPSHOT-exec.jar /opt/openslice/lib/
CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-2.0.0-SNAPSHOT-exec.jar"]
EXPOSE 13082
 No newline at end of file
+1 −1
Changes for pom.xml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
	<parent>
		<groupId>org.etsi.osl</groupId>
		<artifactId>org.etsi.osl.main</artifactId>
		<version>2026Q2</version>
		<version>2026Q4-SNAPSHOT</version>
		<relativePath>../org.etsi.osl.main</relativePath>
	</parent>

+2
Changes for src/main/java/org/etsi/osl/tmf/rcm634/api/ResourceSpecificationApi.java: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ package org.etsi.osl.tmf.rcm634.api;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import com.fasterxml.jackson.databind.JsonNode;
@@ -158,6 +159,7 @@ public interface ResourceSpecificationApi {
    default ResponseEntity<List<ResourceSpecification>> listResourceSpecification(@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 = "Any other query parameter is an exact-match filter on the column of the same name (e.g. name, category, version)", hidden = true) @RequestParam Map<String, String> allParams
) {
        if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
            if (getAcceptHeader().get().contains("application/json")) {
+11 −13
Changes for src/main/java/org/etsi/osl/tmf/rcm634/api/ResourceSpecificationApiController.java: 11 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -24,7 +24,9 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import com.fasterxml.jackson.databind.JsonNode;
@@ -153,21 +155,17 @@ public class ResourceSpecificationApiController implements ResourceSpecification
	public ResponseEntity<List<ResourceSpecification>> listResourceSpecification(
			@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 = "Any other query parameter is an exact-match filter on the column of the same name (e.g. name, category, version)", hidden = true) @RequestParam Map<String, String> allParams) {

		try {
			if ((fields == null) ) {

				String myfields = "lastUpdate,lifecycleStatus";
				return new ResponseEntity<List<ResourceSpecification>>(resourceSpecificationRepoService.findAll(myfields),
						HttpStatus.OK);
			} else {

				return new ResponseEntity<List<ResourceSpecification>>(resourceSpecificationRepoService.findAll(fields),
						HttpStatus.OK);
			}
			

			String myfields = ( fields == null ) ? "lastUpdate,lifecycleStatus" : fields;
			Map<String, String> filters = new LinkedHashMap<>( allParams );
			filters.keySet().removeAll( List.of( "fields", "offset", "limit" ) );
			return new ResponseEntity<List<ResourceSpecification>>(
					resourceSpecificationRepoService.findAll(myfields, offset, limit, filters), HttpStatus.OK);
		} catch (IllegalArgumentException e) {
			return new ResponseEntity<List<ResourceSpecification>>(HttpStatus.BAD_REQUEST);
		} catch (Exception e) {
			log.error("Couldn't serialize response for content type application/json", e);
			return new ResponseEntity<List<ResourceSpecification>>(HttpStatus.INTERNAL_SERVER_ERROR);
+32 −1
Changes for src/main/java/org/etsi/osl/tmf/rcm634/api/ResourceSpecificationApiRouteBuilder.java: 32 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -32,10 +32,19 @@ public class ResourceSpecificationApiRouteBuilder extends RouteBuilder {
	@Value("${CATALOG_GET_RESOURCESPEC_BY_ID}")
	private String CATALOG_GET_RESOURCESPEC_BY_ID = "";


    @Value("${CATALOG_GET_RESOURCESPEC_BY_NAME_CATEGORY}")
    private String CATALOG_GET_RESOURCESPEC_BY_NAME_CATEGORY = "";

    @Value("${CATALOG_GET_RESOURCESPEC_BY_CATEGORY}")
    private String CATALOG_GET_RESOURCESPEC_BY_CATEGORY = "";

    @Value("${CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_CONTENT}")
    private String CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_CONTENT = "";

    @Value("${CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_VALUE}")
    private String CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_VALUE = "";
		
	
    @Autowired
    private ProducerTemplate template;

@@ -93,6 +102,28 @@ public class ResourceSpecificationApiRouteBuilder extends RouteBuilder {
		.marshal().json( JsonLibrary.Jackson)
		.convertBodyTo( String.class );
		


        from( CATALOG_GET_RESOURCESPEC_BY_CATEGORY )
        .log(LoggingLevel.INFO, log, CATALOG_GET_RESOURCESPEC_BY_CATEGORY + " message received!")
        .to("log:DEBUG?showBody=true&showHeaders=true")
        .bean( resourceSpecificationRepoService, "findByCategory(  ${header.acategory} )")
        .marshal().json( JsonLibrary.Jackson)
        .convertBodyTo( String.class );

		from( CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_CONTENT )
		.log(LoggingLevel.INFO, log, CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_CONTENT + " message received!")
		.to("log:DEBUG?showBody=true&showHeaders=true")
		.bean( resourceSpecificationRepoService, "searchByCharacteristicContent( ${header.searchString} )")
		.marshal().json( JsonLibrary.Jackson)
		.convertBodyTo( String.class );

		from( CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_VALUE )
		.log(LoggingLevel.INFO, log, CATALOG_SEARCH_RESOURCESPEC_BY_CHARACTERISTIC_VALUE + " message received!")
		.to("log:DEBUG?showBody=true&showHeaders=true")
		.bean( resourceSpecificationRepoService, "searchByCharacteristicValue( ${header.searchString} )")
		.marshal().json( JsonLibrary.Jackson)
		.convertBodyTo( String.class );
	}
	
}
Loading