2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.servlets;
23 import com.jcabi.aspects.Loggable;
24 import fj.data.Either;
25 import io.swagger.v3.oas.annotations.OpenAPIDefinition;
26 import io.swagger.v3.oas.annotations.Operation;
27 import io.swagger.v3.oas.annotations.Parameter;
28 import io.swagger.v3.oas.annotations.info.Info;
29 import io.swagger.v3.oas.annotations.media.ArraySchema;
30 import io.swagger.v3.oas.annotations.media.Content;
31 import io.swagger.v3.oas.annotations.media.Schema;
32 import io.swagger.v3.oas.annotations.responses.ApiResponse;
33 import io.swagger.v3.oas.annotations.responses.ApiResponses;
34 import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic;
35 import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
36 import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
37 import org.openecomp.sdc.be.config.BeEcompErrorManager;
38 import org.openecomp.sdc.be.dao.api.ActionStatus;
39 import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo;
40 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
41 import org.openecomp.sdc.be.impl.ComponentsUtils;
42 import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
43 import org.openecomp.sdc.be.user.UserBusinessLogic;
44 import org.openecomp.sdc.common.api.Constants;
45 import org.openecomp.sdc.common.log.wrappers.Logger;
46 import org.openecomp.sdc.exception.ResponseFormat;
47 import org.springframework.stereotype.Controller;
49 import javax.inject.Inject;
50 import javax.servlet.ServletContext;
51 import javax.servlet.http.HttpServletRequest;
52 import javax.ws.rs.Consumes;
53 import javax.ws.rs.DELETE;
54 import javax.ws.rs.GET;
55 import javax.ws.rs.HeaderParam;
56 import javax.ws.rs.POST;
57 import javax.ws.rs.PUT;
58 import javax.ws.rs.Path;
59 import javax.ws.rs.PathParam;
60 import javax.ws.rs.Produces;
61 import javax.ws.rs.core.Context;
62 import javax.ws.rs.core.MediaType;
63 import javax.ws.rs.core.Response;
66 @Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
68 @OpenAPIDefinition(info = @Info(title = "Additional Information Servlet", description = "Additional Information Servlet"))
70 public class AdditionalInformationServlet extends BeGenericServlet {
72 private static final Logger log = Logger.getLogger(AdditionalInformationServlet.class);
73 private static final String START_HANDLE_REQUEST_OF = "Start handle request of {}";
74 private static final String MODIFIER_ID_IS = "modifier id is {}";
75 private static final String FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY = "Failed to update additional information property. Reason - {}";
77 private final AdditionalInformationBusinessLogic businessLogic;
80 public AdditionalInformationServlet(UserBusinessLogic userBusinessLogic,
81 ComponentsUtils componentsUtils,
82 AdditionalInformationBusinessLogic businessLogic) {
83 super(userBusinessLogic, componentsUtils);
84 this.businessLogic = businessLogic;
96 @Path("/resources/{resourceId}/additionalinfo")
97 @Consumes(MediaType.APPLICATION_JSON)
98 @Produces(MediaType.APPLICATION_JSON)
99 @Operation(description = "Create Additional Information Label and Value", method = "POST",
100 summary = "Returns created Additional Inforamtion property", responses = @ApiResponse(
101 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
102 @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Additional information created"),
103 @ApiResponse(responseCode = "403", description = "Restricted operation"),
104 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
105 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
106 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
107 public Response createResourceAdditionalInformationLabel(
108 @Parameter(description = "resource id to update with new property",
109 required = true) @PathParam("resourceId") final String resourceId,
110 @Parameter(description = "Additional information key value to be created", required = true) String data,
111 @Context final HttpServletRequest request,
112 @HeaderParam(value = Constants.USER_ID_HEADER) String userUserId) {
114 return createAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, request, userUserId,
128 @Path("/services/{serviceId}/additionalinfo")
129 @Consumes(MediaType.APPLICATION_JSON)
130 @Produces(MediaType.APPLICATION_JSON)
131 @Operation(description = "Create Additional Information Label and Value", method = "POST",
132 summary = "Returns created Additional Inforamtion property",responses = @ApiResponse(
133 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
134 @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Additional information created"),
135 @ApiResponse(responseCode = "403", description = "Restricted operation"),
136 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
137 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
138 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
139 public Response createServiceAdditionalInformationLabel(
140 @Parameter(description = "service id to update with new property",
141 required = true) @PathParam("serviceId") final String serviceId,
142 @Parameter(description = "Additional information key value to be created", required = true) String data,
143 @Context final HttpServletRequest request,
144 @HeaderParam(value = Constants.USER_ID_HEADER) String userUserId) {
146 return createAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, request, userUserId, data);
160 @Path("/resources/{resourceId}/additionalinfo/{labelId}")
161 @Consumes(MediaType.APPLICATION_JSON)
162 @Produces(MediaType.APPLICATION_JSON)
163 @Operation(description = "Update Additional Information Label and Value", method = "PUT",
164 summary = "Returns updated Additional Inforamtion property", responses = @ApiResponse(
165 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
166 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information updated"),
167 @ApiResponse(responseCode = "403", description = "Restricted operation"),
168 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
169 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
170 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
171 public Response updateResourceAdditionalInformationLabel(
172 @Parameter(description = "resource id to update with new property",
173 required = true) @PathParam("resourceId") final String resourceId,
174 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
175 @Parameter(description = "Additional information key value to be created", required = true) String data,
176 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
178 return updateAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, labelId, request, userId,
193 @Path("/services/{serviceId}/additionalinfo/{labelId}")
194 @Consumes(MediaType.APPLICATION_JSON)
195 @Produces(MediaType.APPLICATION_JSON)
196 @Operation(description = "Update Additional Information Label and Value", method = "PUT",
197 summary = "Returns updated Additional Inforamtion property",responses = @ApiResponse(
198 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
199 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information updated"),
200 @ApiResponse(responseCode = "403", description = "Restricted operation"),
201 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
202 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
203 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
204 public Response updateServiceAdditionalInformationLabel(
205 @Parameter(description = "service id to update with new property",
206 required = true) @PathParam("serviceId") final String serviceId,
207 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
208 @Parameter(description = "Additional information key value to be created", required = true) String data,
209 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
211 return updateAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, labelId, request, userId,
225 @Path("/resources/{resourceId}/additionalinfo/{labelId}")
226 @Consumes(MediaType.APPLICATION_JSON)
227 @Produces(MediaType.APPLICATION_JSON)
228 @Operation(description = "Create Additional Information Label and Value", method = "DELETE",
229 summary = "Returns deleted Additional Inforamtion property", responses = @ApiResponse(
230 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
231 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information deleted"),
232 @ApiResponse(responseCode = "403", description = "Restricted operation"),
233 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
234 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
235 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
236 public Response updateResourceAdditionalInformationLabel(
237 @Parameter(description = "resource id to update with new property",
238 required = true) @PathParam("resourceId") final String resourceId,
239 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
240 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
242 return deleteAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, labelId, request,
256 @Path("/services/{serviceId}/additionalinfo/{labelId}")
257 @Consumes(MediaType.APPLICATION_JSON)
258 @Produces(MediaType.APPLICATION_JSON)
259 @Operation(description = "Create Additional Information Label and Value", method = "DELETE",
260 summary = "Returns deleted Additional Inforamtion property", responses = @ApiResponse(
261 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
262 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information deleted"),
263 @ApiResponse(responseCode = "403", description = "Restricted operation"),
264 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
265 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
266 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
267 public Response deleteServiceAdditionalInformationLabel(
268 @Parameter(description = "service id to update with new property",
269 required = true) @PathParam("serviceId") final String serviceId,
270 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
271 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
273 return deleteAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, labelId, request, userId);
286 @Path("/resources/{resourceId}/additionalinfo/{labelId}")
287 @Consumes(MediaType.APPLICATION_JSON)
288 @Produces(MediaType.APPLICATION_JSON)
289 @Operation(description = "Get Additional Information by id", method = "GET",
290 summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
291 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
292 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "fetched additional information"),
293 @ApiResponse(responseCode = "403", description = "Restricted operation"),
294 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
295 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
296 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
297 public Response getResourceAdditionalInformationLabel(
298 @Parameter(description = "resource id to update with new property",
299 required = true) @PathParam("resourceId") final String resourceId,
300 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
301 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
303 return getAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, labelId, request, userId);
316 @Path("/services/{serviceId}/additionalinfo/{labelId}")
317 @Consumes(MediaType.APPLICATION_JSON)
318 @Produces(MediaType.APPLICATION_JSON)
319 @Operation(description = "Get Additional Information by id", method = "GET",
320 summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
321 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
322 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "fetched additional information"),
323 @ApiResponse(responseCode = "403", description = "Restricted operation"),
324 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
325 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
326 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
327 public Response getServiceAdditionalInformationLabel(
328 @Parameter(description = "service id to update with new property",
329 required = true) @PathParam("serviceId") final String serviceId,
330 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
331 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
333 return getAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, labelId, request, userId);
345 @Path("/resources/{resourceId}/additionalinfo")
346 @Consumes(MediaType.APPLICATION_JSON)
347 @Produces(MediaType.APPLICATION_JSON)
348 @Operation(description = "Get all Additional Information under resource", method = "GET",
349 summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
350 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
351 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "list of additional information"),
352 @ApiResponse(responseCode = "403", description = "Restricted operation"),
353 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
354 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
355 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
356 public Response getAllResourceAdditionalInformationLabel(
357 @Parameter(description = "resource id to update with new property",
358 required = true) @PathParam("resourceId") final String resourceId,
359 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
361 return getAllAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, request, userId);
373 @Path("/services/{serviceId}/additionalinfo")
374 @Consumes(MediaType.APPLICATION_JSON)
375 @Produces(MediaType.APPLICATION_JSON)
376 @Operation(description = "Get all Additional Information under service", method = "GET",
377 summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
378 content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
379 @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "list of additional information"),
380 @ApiResponse(responseCode = "403", description = "Restricted operation"),
381 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
382 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
383 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
384 public Response getAllServiceAdditionalInformationLabel(
385 @Parameter(description = "service id to update with new property",
386 required = true) @PathParam("serviceId") final String serviceId,
387 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
389 return getAllAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, request, userId);
395 * Create additional information property under given resource/service
404 protected Response createAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, HttpServletRequest request, String userId, String data) {
406 ServletContext context = request.getSession().getServletContext();
408 String url = request.getMethod() + " " + request.getRequestURI();
409 log.debug(START_HANDLE_REQUEST_OF, url);
410 log.debug(MODIFIER_ID_IS, userId);
411 log.debug("data is {}", data);
414 // convert json to AdditionalInfoParameterInfo
415 AdditionalInfoParameterInfo additionalInfoParameterInfo = gson.fromJson(data, AdditionalInfoParameterInfo.class);
417 // create the new property
419 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.createAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
421 if (either.isRight()) {
422 ResponseFormat responseFormat = either.right().value();
423 log.info("Failed to create additional information {}. Reason - {}", additionalInfoParameterInfo, responseFormat);
424 return buildErrorResponse(responseFormat);
427 AdditionalInfoParameterInfo createdAI = either.left().value();
429 log.debug("Additional information {}={} created successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
431 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.CREATED);
432 return buildOkResponse(responseFormat, createdAI);
434 } catch (Exception e) {
435 log.debug("Create additional information failed with exception", e);
436 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
437 return buildErrorResponse(responseFormat);
443 * Update additional information property by id under given resource/service
453 protected Response updateAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, String labelId, HttpServletRequest request, String userId, String data) {
455 ServletContext context = request.getSession().getServletContext();
457 String url = request.getMethod() + " " + request.getRequestURI();
458 log.debug(START_HANDLE_REQUEST_OF, url);
459 log.debug(MODIFIER_ID_IS, userId);
460 log.debug("data is {}", data);
463 // convert json to AdditionalInfoParameterInfo
464 AdditionalInfoParameterInfo additionalInfoParameterInfo = gson.fromJson(data, AdditionalInfoParameterInfo.class);
466 // create the new property
468 additionalInfoParameterInfo.setUniqueId(labelId);
470 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.updateAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
472 if (either.isRight()) {
473 ResponseFormat responseFormat = either.right().value();
474 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
475 return buildErrorResponse(responseFormat);
478 AdditionalInfoParameterInfo createdAI = either.left().value();
480 log.debug("Additional information {}={} updated successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
482 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
483 return buildOkResponse(responseFormat, createdAI);
485 } catch (Exception e) {
486 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Update Additional Information");
487 log.debug("Update additional information failed with exception", e);
488 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
489 return buildErrorResponse(responseFormat);
496 * Delete an additional information property by id under given resource/service
505 protected Response deleteAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, String labelId, HttpServletRequest request, String userId) {
507 ServletContext context = request.getSession().getServletContext();
509 String url = request.getMethod() + " " + request.getRequestURI();
510 log.debug(START_HANDLE_REQUEST_OF, url);
511 log.debug(MODIFIER_ID_IS, userId);
515 AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo();
516 additionalInfoParameterInfo.setUniqueId(labelId);
518 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.deleteAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
520 if (either.isRight()) {
521 ResponseFormat responseFormat = either.right().value();
522 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
523 return buildErrorResponse(responseFormat);
526 AdditionalInfoParameterInfo createdAI = either.left().value();
528 log.debug("Additional information {}={} deleted successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
530 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
531 return buildOkResponse(responseFormat, createdAI);
533 } catch (Exception e) {
534 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Delete Additional Information");
535 log.debug("Delete additional information failed with exception", e);
536 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
537 return buildErrorResponse(responseFormat);
543 * Get a specific additional information property by a given id under given resource/service
552 protected Response getAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, String labelId, HttpServletRequest request, String userId) {
554 ServletContext context = request.getSession().getServletContext();
556 String url = request.getMethod() + " " + request.getRequestURI();
557 log.debug(START_HANDLE_REQUEST_OF, url);
558 log.debug(MODIFIER_ID_IS, userId);
562 // create the new property
565 AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo();
566 additionalInfoParameterInfo.setUniqueId(labelId);
568 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.getAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
570 if (either.isRight()) {
571 ResponseFormat responseFormat = either.right().value();
572 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
573 return buildErrorResponse(responseFormat);
576 AdditionalInfoParameterInfo createdAI = either.left().value();
578 log.debug("Additional information {}={} fetched successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
580 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
581 return buildOkResponse(responseFormat, createdAI);
583 } catch (Exception e) {
584 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get Additional Information");
586 log.debug("get additional information failed with exception", e);
587 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
588 return buildErrorResponse(responseFormat);
594 * Get all additional information properties under given resource/service
602 protected Response getAllAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, HttpServletRequest request, String userId) {
604 ServletContext context = request.getSession().getServletContext();
606 String url = request.getMethod() + " " + request.getRequestURI();
607 log.debug(START_HANDLE_REQUEST_OF, url);
608 log.debug(MODIFIER_ID_IS, userId);
614 Either<AdditionalInformationDefinition, ResponseFormat> either = businessLogic.getAllAdditionalInformation(nodeType, uniqueId, userId);
615 if (either.isRight()) {
616 ResponseFormat responseFormat = either.right().value();
617 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
618 return buildErrorResponse(responseFormat);
621 AdditionalInformationDefinition additionalInformationDefinition = either.left().value();
623 log.debug("All Additional information retrieved for component {} is {}", uniqueId, additionalInformationDefinition);
625 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
626 return buildOkResponse(responseFormat, additionalInformationDefinition);
628 } catch (Exception e) {
629 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get All Additional Information");
630 log.debug("Get all addiotanl information properties failed with exception", e);
631 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
632 return buildErrorResponse(responseFormat);