| /******************************************************************************** |
| * Copyright (c) 2015-2018 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| ********************************************************************************/ |
| |
| package org.eclipse.mdm.businessobjects.boundary; |
| |
| import static org.eclipse.mdm.businessobjects.boundary.ResourceConstants.REQUESTPARAM_ID; |
| import static org.eclipse.mdm.businessobjects.boundary.ResourceConstants.REQUESTPARAM_SOURCENAME; |
| import static org.eclipse.mdm.businessobjects.utils.Decomposer.decompose; |
| import static org.eclipse.mdm.businessobjects.utils.ServiceUtils.V; |
| |
| import javax.ejb.EJB; |
| import javax.ws.rs.Consumes; |
| import javax.ws.rs.DELETE; |
| import javax.ws.rs.GET; |
| import javax.ws.rs.POST; |
| import javax.ws.rs.Path; |
| import javax.ws.rs.PathParam; |
| import javax.ws.rs.Produces; |
| import javax.ws.rs.QueryParam; |
| import javax.ws.rs.core.MediaType; |
| import javax.ws.rs.core.Response; |
| import javax.ws.rs.core.Response.Status; |
| |
| import org.eclipse.mdm.api.base.model.ContextRoot; |
| import org.eclipse.mdm.api.base.model.ContextType; |
| import org.eclipse.mdm.api.base.model.Environment; |
| import org.eclipse.mdm.api.base.model.FileLink; |
| import org.eclipse.mdm.api.base.model.Measurement; |
| import org.eclipse.mdm.api.base.model.TestStep; |
| import org.eclipse.mdm.api.dflt.model.ValueList; |
| import org.eclipse.mdm.businessobjects.control.FileLinkActivity; |
| import org.eclipse.mdm.businessobjects.entity.ContextResponse; |
| import org.eclipse.mdm.businessobjects.entity.ContextSensorResponse; |
| import org.eclipse.mdm.businessobjects.entity.I18NResponse; |
| import org.eclipse.mdm.businessobjects.entity.MDMEntity; |
| import org.eclipse.mdm.businessobjects.entity.MDMEntityResponse; |
| import org.eclipse.mdm.businessobjects.entity.SearchAttributeResponse; |
| import org.eclipse.mdm.businessobjects.service.ContextService; |
| import org.eclipse.mdm.businessobjects.service.EntityFileLink; |
| import org.eclipse.mdm.businessobjects.service.EntityService; |
| import org.eclipse.mdm.businessobjects.utils.ServiceUtils; |
| |
| import io.swagger.v3.oas.annotations.Operation; |
| import io.swagger.v3.oas.annotations.Parameter; |
| 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.tags.Tag; |
| import io.vavr.collection.List; |
| import io.vavr.control.Try; |
| |
| /** |
| * {@link Measurement} resource |
| * |
| * @author Sebastian Dirsch, Gigatronik Ingolstadt GmbH |
| * |
| */ |
| @Tag(name = "Measurement") |
| @Path("/environments/{" + REQUESTPARAM_SOURCENAME + "}/measurements") |
| public class MeasurementResource { |
| |
| @EJB |
| private MeasurementService measurementService; |
| |
| @EJB |
| private EntityService entityService; |
| |
| @EJB |
| private ContextService contextService; |
| |
| @EJB |
| private FileLinkActivity fileLinkActivity; |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Operation(summary = "Get the search attributes", description = "Get a list of search attributes", responses = { |
| @ApiResponse(description = "The search attributes", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "400", description = "Error") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/searchattributes") |
| public Response getSearchAttributes( |
| @Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName) { |
| |
| return Try.of(() -> measurementService.getSearchAttributes(sourceName)) |
| .map(attrs -> ServiceUtils.toResponse(new SearchAttributeResponse(attrs), Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param filter filter string to filter the Measurement result |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Operation(summary = "Find Measurements by filter", description = "Get list of Measurements", responses = { |
| @ApiResponse(description = "The Measurements", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "400", description = "Error") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| public Response getMeasurements( |
| @Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @Parameter(description = "Filter expression", required = false) @QueryParam("filter") String filter) { |
| |
| return Try.of(() -> measurementService.getMeasurements(sourceName, filter)).map(List::ofAll) |
| .map(e -> ServiceUtils.buildEntityResponse(e, Status.OK, Measurement.class)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param MeasurementId id of the {@link Measurement} |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Operation(summary = "Find a Measurement by ID", description = "Returns Measurement based on ID", responses = { |
| @ApiResponse(description = "The Project", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "400", description = "Invalid ID supplied") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}") |
| public Response findMeasurement( |
| @Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @Parameter(description = "ID of the Measurement", required = true) @PathParam(REQUESTPARAM_ID) String id) { |
| return entityService.find(sourceName, Measurement.class, id) |
| .map(e -> ServiceUtils.buildEntityResponse(e, Status.OK)).recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER) |
| .getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param MeasurementId id of the {@link Measurement} |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts") |
| public Response findContext(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id) { |
| |
| return contextService.getMeasurementContext(sourceName, id).map(ServiceUtils::contextMapToJava) |
| .map(ContextResponse::new).map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Updates the context of {@link Measurement} with all parameters set in the |
| * given JSON body of the request. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id the identifier of the {@link MeasurementValue} to update. |
| * @param body the body of the request containing the attributes to update |
| * @return the context map of the updated {@link Measurement} |
| */ |
| @POST |
| @Produces(MediaType.APPLICATION_JSON) |
| @Consumes(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts") |
| public Response updateContext(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id, ContextResponse body) { |
| |
| return entityService.find(sourceName, Measurement.class, id) |
| .map(measurement -> contextService.updateContext(body, measurement)).map(ContextResponse::new) |
| .map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param MeasurementId id of the {@link Measurement} |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/unitundertest") |
| public Response findContextUUT(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id) { |
| |
| return contextService.getMeasurementContext(sourceName, id, ContextType.UNITUNDERTEST) |
| .map(ServiceUtils::contextMapToJava).map(ContextResponse::new) |
| .map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Updates the context of {@link ContextType} UNITUNDERTEST of |
| * {@link Measurement} with all parameters set in the given JSON body of the |
| * request. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id the identifier of the {@link MeasurementValue} to update. |
| * @param body the body of the request containing the attributes to update |
| * @return the context map of {@link ContextType} UNITUNDERTEST of the updated |
| * {@link TestStep} |
| */ |
| @POST |
| @Produces(MediaType.APPLICATION_JSON) |
| @Consumes(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/unitundertest") |
| public Response updateContextUUT(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id, ContextResponse body) { |
| |
| return entityService.find(sourceName, Measurement.class, id) |
| .map(measurement -> contextService.updateContext(body, measurement, ContextType.UNITUNDERTEST)) |
| .map(ContextResponse::new).map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param MeasurementId id of the {@link Measurement} |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/testsequence") |
| public Response findContextTSQ(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id) { |
| |
| return contextService.getMeasurementContext(sourceName, id, ContextType.TESTSEQUENCE) |
| .map(ServiceUtils::contextMapToJava).map(ContextResponse::new) |
| .map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Updates the context of {@link ContextType} TESTSEQUENCE of |
| * {@link Measurement} with all parameters set in the given JSON body of the |
| * request. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id the identifier of the {@link MeasurementValue} to update. |
| * @param body the body of the request containing the attributes to update |
| * @return the context map of {@link ContextType} TESTSEQUENCE of the updated |
| * {@link TestStep} |
| */ |
| @POST |
| @Produces(MediaType.APPLICATION_JSON) |
| @Consumes(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/testsequence") |
| public Response updateContextTSQ(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id, ContextResponse body) { |
| |
| return entityService.find(sourceName, Measurement.class, id) |
| .map(measurement -> contextService.updateContext(body, measurement, ContextType.TESTSEQUENCE)) |
| .map(ContextResponse::new).map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param MeasurementId id of the {@link Measurement} |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/testequipment") |
| public Response findContextTEQ(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id) { |
| |
| return contextService.getMeasurementContext(sourceName, id, ContextType.TESTEQUIPMENT) |
| .map(ServiceUtils::contextMapToJava).map(ContextResponse::new) |
| .map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Updates the context of {@link ContextType} TESTEQUIPMENT of |
| * {@link Measurement} with all parameters set in the given JSON body of the |
| * request. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id the identifier of the {@link MeasurementValue} to update. |
| * @param body the body of the request containing the attributes to update |
| * @return the context map of {@link ContextType} TESTEQUIPMENT of the updated |
| * {@link TestStep} |
| */ |
| @POST |
| @Produces(MediaType.APPLICATION_JSON) |
| @Consumes(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/testequipment") |
| public Response updateContextTEQ(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id, ContextResponse body) { |
| |
| return entityService.find(sourceName, Measurement.class, id) |
| .map(measurement -> contextService.updateContext(body, measurement, ContextType.TESTEQUIPMENT)) |
| .map(ContextResponse::new).map(contextResponse -> ServiceUtils.toResponse(contextResponse, Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param MeasurementId id of the {@link Measurement} |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}/contexts/testequipment/sensors") |
| public Response getContextTEQSensors(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @PathParam(REQUESTPARAM_ID) String id) { |
| |
| return Try.of(() -> measurementService.getSensors(sourceName, id)) |
| .map(sensorMap -> ServiceUtils.toResponse(new ContextSensorResponse(sensorMap), Status.OK)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * delegates the request to the {@link MeasurementService} |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @return the result of the delegated request as {@link Response} |
| */ |
| @GET |
| @Operation(summary = "Get the Measurement localizations", description = "Returns Measurement localizations", responses = { |
| @ApiResponse(description = "The Measurement localizations", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "500", description = "Error") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/localizations") |
| public Response localize( |
| @Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName) { |
| |
| return Try |
| .of(() -> new I18NResponse(measurementService.localizeType(sourceName), |
| measurementService.localizeAttributes(sourceName))) |
| .map(resp -> ServiceUtils.toResponse(resp, Status.OK)).recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER) |
| .getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Returns the created {@link Measurement}. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param body The {@link Measurement} to create. |
| * @return the created {@link Measurement} as {@link Response}. |
| */ |
| @POST |
| @Operation(summary = "Create a new Measurement", responses = { |
| @ApiResponse(description = "The created Measurement", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "500", description = "Error") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| @Consumes(MediaType.APPLICATION_JSON) |
| public Response create(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, MDMEntityResponse body) { |
| return entityService |
| .create(sourceName, Measurement.class, |
| entityService.extractArgumentsFromRequestBody(sourceName, body, List.of("Name"), |
| List.of(TestStep.class)).append(V(new ContextRoot[] {}))) |
| .map(e -> ServiceUtils.buildEntityResponse(e, Status.CREATED)) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Updates the {@link Measurement} with all parameters set in the given JSON |
| * body of the request. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id the identifier of the {@link MeasurementValue} to update. |
| * @param body the body of the request containing the attributes to update |
| * @return the updated {@link Measurement} |
| */ |
| @POST |
| @Operation(summary = "Update an existing Measurement", description = "Updates the Measurement with all parameters set in the body of the request.", responses = { |
| @ApiResponse(description = "The updated Measurement", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "400", description = "Invalid ID supplied") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| @Consumes(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}") |
| public Response patch(@PathParam(REQUESTPARAM_SOURCENAME) String sourceName, @PathParam(REQUESTPARAM_ID) String id, |
| MDMEntityResponse body) { |
| return entityService |
| .update(sourceName, entityService.find(sourceName, Measurement.class, id), |
| decompose(body::getData).<MDMEntity>getValueAt(0)) |
| .map(e -> ServiceUtils.buildEntityResponse(e, Status.OK)).recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER) |
| .getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Deletes and returns the deleted {@link Measurement}. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id The identifier of the {@link Measurement} to delete. |
| * @return the deleted {@link ValueList }s as {@link Response} |
| */ |
| @DELETE |
| @Operation(summary = "Delete an existing Measurement", responses = { |
| @ApiResponse(description = "The deleted Measurement", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "400", description = "Invalid ID supplied") }) |
| @Produces(MediaType.APPLICATION_JSON) |
| @Path("/{" + REQUESTPARAM_ID + "}") |
| public Response delete( |
| @Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @Parameter(description = "ID of the Measurement", required = true) @PathParam(REQUESTPARAM_ID) String id) { |
| return entityService.delete(sourceName, entityService.find(sourceName, Measurement.class, id)) |
| .map(e -> ServiceUtils.buildEntityResponse(e, Status.OK)).recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER) |
| .getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| |
| /** |
| * Stream the contents of a file link. |
| * |
| * @param sourceName name of the source (MDM {@link Environment} name) |
| * @param id The identifier of the {@link Measurement} which contains |
| * the {@link FileLink} |
| * @param remotePath The remote path of the {@link FileLink} to identify, which |
| * {@link FileLink}'s content is requests. |
| * @return The content of the file as {@link javax.ws.rs.core.StreamingOutput}. |
| * The response also has the MimeType set according to |
| * {@link FileLink#getMimeType()}. |
| */ |
| @GET |
| @Operation(summary = "Stream the contents of a file link", responses = { |
| @ApiResponse(description = "The content of the file link as a stream. MimeType is set to that of the file link.", content = @Content(schema = @Schema(implementation = MDMEntityResponse.class))), |
| @ApiResponse(responseCode = "400", description = "Invalid ID or remote path supplied") }) |
| @Path("/{" + REQUESTPARAM_ID + "}/files/{remotePath}") |
| public Response streamFileLink( |
| @Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName, |
| @Parameter(description = "ID of the Measurement containing the file link", required = true) @PathParam(REQUESTPARAM_ID) String id, |
| @Parameter(description = "The remote path of the file link whose content is to be retrieved", required = true) @PathParam("remotePath") String remotePath) { |
| |
| return entityService.find(sourceName, Measurement.class, id).map(fa -> new EntityFileLink(fa, remotePath)) |
| .map(efl -> Response.ok(efl.toStreamingOutput(fileLinkActivity, sourceName), |
| efl.getFileLink().getMimeType().toString()).build()) |
| .recover(ServiceUtils.ERROR_RESPONSE_SUPPLIER).getOrElse(ServiceUtils.SERVER_ERROR_RESPONSE); |
| } |
| } |