Loading src/main/java/org/etsi/osl/hypo/api/tmf/common/api/helpers/ServiceCatalogHelper.java +8 −8 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Strings; import org.etsi.osl.hypo.api.tmf.common.api.model.RelatedPartyDTO; import org.etsi.osl.hypo.api.tmf.common.api.services.RelatedPartyService; import org.etsi.osl.hypo.api.tmf.common.schema.RelatedPartyEntity; import org.etsi.osl.hypo.api.tmf.party.api.services.OrganizationService; import org.etsi.osl.hypo.api.tmf.party.organization.schema.Organization; Loading @@ -26,7 +27,6 @@ import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceCategoryEntity; import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceSpecificationEntity; import org.etsi.osl.hypo.api.tmf.services.common.model.ServiceRefOrValue; import org.etsi.osl.hypo.api.tmf.services.common.schema.ServiceSpecificationRef; import org.etsi.osl.hypo.api.tmf.services.common.service.RelatedPartyHelper; import org.etsi.osl.hypo.api.tmf.services.inventory.api.mappers.ServiceMapper; import org.etsi.osl.hypo.api.tmf.services.inventory.schema.Service; import org.etsi.osl.hypo.api.tmf.services.model.ServiceWithPeeredOrganization; Loading @@ -40,7 +40,7 @@ public class ServiceCatalogHelper { private final ServiceSpecificationService serviceSpecificationService; private final ServiceSpecificationRepository serviceSpecificationRepository; private final OrganizationService organizationService; private final RelatedPartyHelper relatedPartyHelper; private final RelatedPartyService relatedPartyService; private final ServiceMapper serviceMapper; @Inject Loading @@ -49,13 +49,13 @@ public class ServiceCatalogHelper { ServiceSpecificationService serviceInventoryService, ServiceSpecificationRepository serviceSpecificationRepository, OrganizationService organizationService, RelatedPartyHelper relatedPartyHelper, RelatedPartyService relatedPartyService, ServiceMapper serviceMapper) { this.serviceCategoryService = serviceCategoryService; this.serviceSpecificationService = serviceInventoryService; this.serviceSpecificationRepository = serviceSpecificationRepository; this.organizationService = organizationService; this.relatedPartyHelper = relatedPartyHelper; this.relatedPartyService = relatedPartyService; this.serviceMapper = serviceMapper; } Loading Loading @@ -303,11 +303,11 @@ public class ServiceCatalogHelper { : null; if (Objects.nonNull(relatedPartyId)) { relatedPartyHelper organizationService .getOptionalOrganizationById(relatedPartyId) .ifPresent( organization -> { if (relatedPartyHelper.isPeeredOrganization(organization)) { if (organizationService.isPeeredOrganization(organization)) { serviceWithPeeredOrganization.setOrganizationProvider(organization.getName()); } }); Loading Loading @@ -346,10 +346,10 @@ public class ServiceCatalogHelper { } public List<RelatedPartyEntity> findAllRelatedPartyListByIds(List<String> relatedPartyIds) { return relatedPartyHelper.getRelatedPartiesByIds(relatedPartyIds); return relatedPartyService.findAllRelatedPartiesByIds(relatedPartyIds); } public Set<RelatedPartyEntity> findAllRelatedPartySetByIds(Set<String> relatedPartyIds) { return relatedPartyHelper.getRelatedPartySetByIds(relatedPartyIds); return relatedPartyService.findAllRelatedPartiesByIds(relatedPartyIds); } } src/main/java/org/etsi/osl/hypo/api/tmf/common/api/services/UtilService.java +5 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import io.micrometer.common.util.StringUtils; import jakarta.ws.rs.core.MultivaluedMap; import jakarta.ws.rs.core.UriInfo; import java.net.URI; import java.util.Arrays; import java.util.HashMap; import java.util.List; Loading Loading @@ -264,4 +265,8 @@ public class UtilService { String whereClause = String.format(whereClauseFormat, queryQualifier); queryBuilder.append(whereClause); } public static URI getUri(String href, UriInfo uriInfo) { return StringUtils.isNotBlank(href) ? URI.create(href) : uriInfo.getAbsolutePath(); } } src/main/java/org/etsi/osl/hypo/api/tmf/services/activation/api/rest/ServiceActivationResource.java +2 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ public class ServiceActivationResource { schema = @Schema(implementation = Service.class, type = SchemaType.ARRAY))) public Response getAll(@RestQuery String fields, @Context UriInfo uriInfo) { Map<String, String> criteriaParams = UtilService.getRequestedCriteriaForFiltering(uriInfo); return Response.ok(serviceInventoryService.getByCriteria(fields, criteriaParams)).build(); return Response.ok(serviceInventoryService.getServicesByCriteria(fields, criteriaParams)) .build(); } @GET Loading src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/rest/ServiceSpecificationResource.java +2 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public class ServiceSpecificationResource { @Transactional public Response createServiceSpecification( @Valid ServiceSpecificationCreateRequest serviceSpecificationCreateRequest) { logger.info("Request : " + serviceSpecificationCreateRequest.toString()); logger.debug("Request : " + serviceSpecificationCreateRequest.toString()); ServiceSpecification serviceSpecification = serviceSpecificationService.getResponseFromCreateRequest(serviceSpecificationCreateRequest); return Response.ok(serviceSpecification).status(Response.Status.CREATED).build(); Loading Loading @@ -195,7 +195,7 @@ public class ServiceSpecificationResource { schema = @Schema(implementation = ErrorMessage.class))) public Response update(@Valid ServiceSpecificationUpdateRequest specs, @RestPath String id) { logger.info("Update service specification with id : " + id); logger.info("Request : " + specs.toString()); logger.debugf("Request : " + specs.toString()); ServiceSpecification serviceSpecification = serviceSpecificationService.getResponseFromUpdateRequest(specs, id); return Response.ok(serviceSpecification).build(); Loading src/main/java/org/etsi/osl/hypo/api/tmf/services/common/ServiceRepositories.java +37 −642 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
src/main/java/org/etsi/osl/hypo/api/tmf/common/api/helpers/ServiceCatalogHelper.java +8 −8 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Strings; import org.etsi.osl.hypo.api.tmf.common.api.model.RelatedPartyDTO; import org.etsi.osl.hypo.api.tmf.common.api.services.RelatedPartyService; import org.etsi.osl.hypo.api.tmf.common.schema.RelatedPartyEntity; import org.etsi.osl.hypo.api.tmf.party.api.services.OrganizationService; import org.etsi.osl.hypo.api.tmf.party.organization.schema.Organization; Loading @@ -26,7 +27,6 @@ import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceCategoryEntity; import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceSpecificationEntity; import org.etsi.osl.hypo.api.tmf.services.common.model.ServiceRefOrValue; import org.etsi.osl.hypo.api.tmf.services.common.schema.ServiceSpecificationRef; import org.etsi.osl.hypo.api.tmf.services.common.service.RelatedPartyHelper; import org.etsi.osl.hypo.api.tmf.services.inventory.api.mappers.ServiceMapper; import org.etsi.osl.hypo.api.tmf.services.inventory.schema.Service; import org.etsi.osl.hypo.api.tmf.services.model.ServiceWithPeeredOrganization; Loading @@ -40,7 +40,7 @@ public class ServiceCatalogHelper { private final ServiceSpecificationService serviceSpecificationService; private final ServiceSpecificationRepository serviceSpecificationRepository; private final OrganizationService organizationService; private final RelatedPartyHelper relatedPartyHelper; private final RelatedPartyService relatedPartyService; private final ServiceMapper serviceMapper; @Inject Loading @@ -49,13 +49,13 @@ public class ServiceCatalogHelper { ServiceSpecificationService serviceInventoryService, ServiceSpecificationRepository serviceSpecificationRepository, OrganizationService organizationService, RelatedPartyHelper relatedPartyHelper, RelatedPartyService relatedPartyService, ServiceMapper serviceMapper) { this.serviceCategoryService = serviceCategoryService; this.serviceSpecificationService = serviceInventoryService; this.serviceSpecificationRepository = serviceSpecificationRepository; this.organizationService = organizationService; this.relatedPartyHelper = relatedPartyHelper; this.relatedPartyService = relatedPartyService; this.serviceMapper = serviceMapper; } Loading Loading @@ -303,11 +303,11 @@ public class ServiceCatalogHelper { : null; if (Objects.nonNull(relatedPartyId)) { relatedPartyHelper organizationService .getOptionalOrganizationById(relatedPartyId) .ifPresent( organization -> { if (relatedPartyHelper.isPeeredOrganization(organization)) { if (organizationService.isPeeredOrganization(organization)) { serviceWithPeeredOrganization.setOrganizationProvider(organization.getName()); } }); Loading Loading @@ -346,10 +346,10 @@ public class ServiceCatalogHelper { } public List<RelatedPartyEntity> findAllRelatedPartyListByIds(List<String> relatedPartyIds) { return relatedPartyHelper.getRelatedPartiesByIds(relatedPartyIds); return relatedPartyService.findAllRelatedPartiesByIds(relatedPartyIds); } public Set<RelatedPartyEntity> findAllRelatedPartySetByIds(Set<String> relatedPartyIds) { return relatedPartyHelper.getRelatedPartySetByIds(relatedPartyIds); return relatedPartyService.findAllRelatedPartiesByIds(relatedPartyIds); } }
src/main/java/org/etsi/osl/hypo/api/tmf/common/api/services/UtilService.java +5 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import io.micrometer.common.util.StringUtils; import jakarta.ws.rs.core.MultivaluedMap; import jakarta.ws.rs.core.UriInfo; import java.net.URI; import java.util.Arrays; import java.util.HashMap; import java.util.List; Loading Loading @@ -264,4 +265,8 @@ public class UtilService { String whereClause = String.format(whereClauseFormat, queryQualifier); queryBuilder.append(whereClause); } public static URI getUri(String href, UriInfo uriInfo) { return StringUtils.isNotBlank(href) ? URI.create(href) : uriInfo.getAbsolutePath(); } }
src/main/java/org/etsi/osl/hypo/api/tmf/services/activation/api/rest/ServiceActivationResource.java +2 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ public class ServiceActivationResource { schema = @Schema(implementation = Service.class, type = SchemaType.ARRAY))) public Response getAll(@RestQuery String fields, @Context UriInfo uriInfo) { Map<String, String> criteriaParams = UtilService.getRequestedCriteriaForFiltering(uriInfo); return Response.ok(serviceInventoryService.getByCriteria(fields, criteriaParams)).build(); return Response.ok(serviceInventoryService.getServicesByCriteria(fields, criteriaParams)) .build(); } @GET Loading
src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/rest/ServiceSpecificationResource.java +2 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public class ServiceSpecificationResource { @Transactional public Response createServiceSpecification( @Valid ServiceSpecificationCreateRequest serviceSpecificationCreateRequest) { logger.info("Request : " + serviceSpecificationCreateRequest.toString()); logger.debug("Request : " + serviceSpecificationCreateRequest.toString()); ServiceSpecification serviceSpecification = serviceSpecificationService.getResponseFromCreateRequest(serviceSpecificationCreateRequest); return Response.ok(serviceSpecification).status(Response.Status.CREATED).build(); Loading Loading @@ -195,7 +195,7 @@ public class ServiceSpecificationResource { schema = @Schema(implementation = ErrorMessage.class))) public Response update(@Valid ServiceSpecificationUpdateRequest specs, @RestPath String id) { logger.info("Update service specification with id : " + id); logger.info("Request : " + specs.toString()); logger.debugf("Request : " + specs.toString()); ServiceSpecification serviceSpecification = serviceSpecificationService.getResponseFromUpdateRequest(specs, id); return Response.ok(serviceSpecification).build(); Loading
src/main/java/org/etsi/osl/hypo/api/tmf/services/common/ServiceRepositories.java +37 −642 File changed.Preview size limit exceeded, changes collapsed. Show changes