Search in sources :

Example 1 with ResourcePostBulkFetchRequest

use of org.folio.rest.jaxrs.model.ResourcePostBulkFetchRequest in project mod-kb-ebsco-java by folio-org.

the class EholdingsResourcesImpl method postEholdingsResourcesBulkFetch.

@Override
@HandleValidationErrors
public void postEholdingsResourcesBulkFetch(String contentType, ResourcePostBulkFetchRequest entity, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
    final RMAPITemplate template = templateFactory.createTemplate(okapiHeaders, asyncResultHandler);
    template.requestAction(context -> context.getResourcesService().retrieveResourcesBulk(entity.getResources())).executeWithResult(ResourceBulkFetchCollection.class);
}
Also used : RMAPITemplateFactory(org.folio.rest.util.template.RMAPITemplateFactory) ResourcePostBulkFetchRequest(org.folio.rest.jaxrs.model.ResourcePostBulkFetchRequest) TagRepository(org.folio.repository.tag.TagRepository) ExceptionMappers.error400NotFoundMapper(org.folio.rest.util.ExceptionMappers.error400NotFoundMapper) Autowired(org.springframework.beans.factory.annotation.Autowired) ResourcePutRequest(org.folio.rest.jaxrs.model.ResourcePutRequest) AccessTypeMappingsService(org.folio.service.accesstypes.AccessTypeMappingsService) Context(io.vertx.core.Context) PackageId(org.folio.holdingsiq.model.PackageId) AccessType(org.folio.rest.jaxrs.model.AccessType) JSONAPI(org.folio.rest.util.RestConstants.JSONAPI) RowSetUtils(org.folio.db.RowSetUtils) AccessTypesService(org.folio.service.accesstypes.AccessTypesService) HandleValidationErrors(org.folio.rest.aspect.HandleValidationErrors) ResourcePostValidator(org.folio.rest.validator.ResourcePostValidator) ListUtils.parseByComma(org.folio.common.ListUtils.parseByComma) Map(java.util.Map) TitlesHoldingsIQService(org.folio.holdingsiq.service.TitlesHoldingsIQService) PackagesHoldingsIQService(org.folio.holdingsiq.service.PackagesHoldingsIQService) EholdingsResources(org.folio.rest.jaxrs.resource.EholdingsResources) OkapiData(org.folio.holdingsiq.model.OkapiData) ResourceTagsPutBodyValidator(org.folio.rest.validator.ResourceTagsPutBodyValidator) DbResource(org.folio.repository.resources.DbResource) IdParser.parseTitleId(org.folio.rest.util.IdParser.parseTitleId) UUID(java.util.UUID) Future(io.vertx.core.Future) FilterQuery(org.folio.holdingsiq.model.FilterQuery) NotFoundException(javax.ws.rs.NotFoundException) Objects(java.util.Objects) List(java.util.List) CollectionUtils.isNotEmpty(org.apache.commons.collections4.CollectionUtils.isNotEmpty) CompletionStage(java.util.concurrent.CompletionStage) Response(javax.ws.rs.core.Response) ResourceBulkFetchCollection(org.folio.rest.jaxrs.model.ResourceBulkFetchCollection) RMAPITemplateContext(org.folio.rest.util.template.RMAPITemplateContext) CONTENT_TYPE(org.apache.http.protocol.HTTP.CONTENT_TYPE) SC_NOT_FOUND(org.apache.http.HttpStatus.SC_NOT_FOUND) UserKbCredentialsService(org.folio.service.kbcredentials.UserKbCredentialsService) RecordKey(org.folio.repository.RecordKey) RecordType(org.folio.repository.RecordType) IdParser.parsePackageId(org.folio.rest.util.IdParser.parsePackageId) IdParser.parseResourceId(org.folio.rest.util.IdParser.parseResourceId) ResourceTagsPutRequest(org.folio.rest.jaxrs.model.ResourceTagsPutRequest) ResourceRequestConverter(org.folio.rest.converter.resources.ResourceRequestConverter) Sort(org.folio.holdingsiq.model.Sort) CompletableFuture(java.util.concurrent.CompletableFuture) BooleanUtils(org.apache.commons.lang3.BooleanUtils) Function(java.util.function.Function) InputValidationException(org.folio.rest.exception.InputValidationException) SpringContextUtil(org.folio.spring.SpringContextUtil) ErrorUtil.createError(org.folio.rest.util.ErrorUtil.createError) ResourceSelectedPayload(org.folio.holdingsiq.model.ResourceSelectedPayload) ResourcePostRequest(org.folio.rest.jaxrs.model.ResourcePostRequest) ResourceTags(org.folio.rest.jaxrs.model.ResourceTags) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ResourceRepository(org.folio.repository.resources.ResourceRepository) RelatedEntitiesLoader(org.folio.service.loader.RelatedEntitiesLoader) AsyncResult(io.vertx.core.AsyncResult) SearchProperties(org.folio.properties.common.SearchProperties) RMAPITemplate(org.folio.rest.util.template.RMAPITemplate) ResourceId(org.folio.holdingsiq.model.ResourceId) Title(org.folio.holdingsiq.model.Title) IdParser.resourceIdToString(org.folio.rest.util.IdParser.resourceIdToString) JSON_API_TYPE(org.folio.rest.util.RestConstants.JSON_API_TYPE) Resource(org.folio.rest.jaxrs.model.Resource) ResourceTagsItem(org.folio.rest.jaxrs.model.ResourceTagsItem) IdParser(org.folio.rest.util.IdParser) ResourcePostDataAttributes(org.folio.rest.jaxrs.model.ResourcePostDataAttributes) ExceptionMappers.error422InputValidationMapper(org.folio.rest.util.ExceptionMappers.error422InputValidationMapper) Vertx(io.vertx.core.Vertx) ResourceNotFoundException(org.folio.holdingsiq.service.exception.ResourceNotFoundException) ErrorHandler(org.folio.rest.util.ErrorHandler) ObjectsForPostResourceResult(org.folio.rmapi.result.ObjectsForPostResourceResult) CustomerResources(org.folio.holdingsiq.model.CustomerResources) IdParser.getResourceId(org.folio.rest.util.IdParser.getResourceId) TAGS_TYPE(org.folio.rest.util.RestConstants.TAGS_TYPE) ResourcePut(org.folio.holdingsiq.model.ResourcePut) Handler(io.vertx.core.Handler) ResourceTagsDataAttributes(org.folio.rest.jaxrs.model.ResourceTagsDataAttributes) ResourcePutBodyValidator(org.folio.rest.validator.ResourcePutBodyValidator) ResourceResult(org.folio.rmapi.result.ResourceResult) PackageByIdData(org.folio.holdingsiq.model.PackageByIdData) RMAPITemplate(org.folio.rest.util.template.RMAPITemplate) HandleValidationErrors(org.folio.rest.aspect.HandleValidationErrors)

Aggregations

AsyncResult (io.vertx.core.AsyncResult)1 Context (io.vertx.core.Context)1 Future (io.vertx.core.Future)1 Handler (io.vertx.core.Handler)1 Vertx (io.vertx.core.Vertx)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 UUID (java.util.UUID)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 CompletionStage (java.util.concurrent.CompletionStage)1 Function (java.util.function.Function)1 NotFoundException (javax.ws.rs.NotFoundException)1 Response (javax.ws.rs.core.Response)1 CollectionUtils.isNotEmpty (org.apache.commons.collections4.CollectionUtils.isNotEmpty)1 BooleanUtils (org.apache.commons.lang3.BooleanUtils)1 SC_NOT_FOUND (org.apache.http.HttpStatus.SC_NOT_FOUND)1 CONTENT_TYPE (org.apache.http.protocol.HTTP.CONTENT_TYPE)1 ListUtils.parseByComma (org.folio.common.ListUtils.parseByComma)1 RowSetUtils (org.folio.db.RowSetUtils)1