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.Operation;
26 import io.swagger.v3.oas.annotations.Parameter;
27 import io.swagger.v3.oas.annotations.media.ArraySchema;
28 import io.swagger.v3.oas.annotations.media.Content;
29 import io.swagger.v3.oas.annotations.media.Schema;
30 import io.swagger.v3.oas.annotations.responses.ApiResponse;
31 import io.swagger.v3.oas.annotations.servers.Server;
32 import io.swagger.v3.oas.annotations.servers.Servers;
33 import io.swagger.v3.oas.annotations.tags.Tag;
34 import io.swagger.v3.oas.annotations.tags.Tags;
35 import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic;
36 import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
37 import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
38 import org.openecomp.sdc.be.config.BeEcompErrorManager;
39 import org.openecomp.sdc.be.dao.api.ActionStatus;
40 import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo;
41 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
42 import org.openecomp.sdc.be.impl.ComponentsUtils;
43 import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
44 import org.openecomp.sdc.be.user.UserBusinessLogic;
45 import org.openecomp.sdc.common.api.Constants;
46 import org.openecomp.sdc.common.log.wrappers.Logger;
47 import org.openecomp.sdc.exception.ResponseFormat;
48 import org.springframework.stereotype.Controller;
50 import javax.inject.Inject;
51 import javax.servlet.ServletContext;
52 import javax.servlet.http.HttpServletRequest;
53 import javax.ws.rs.Consumes;
54 import javax.ws.rs.DELETE;
55 import javax.ws.rs.GET;
56 import javax.ws.rs.HeaderParam;
57 import javax.ws.rs.POST;
58 import javax.ws.rs.PUT;
59 import javax.ws.rs.Path;
60 import javax.ws.rs.PathParam;
61 import javax.ws.rs.Produces;
62 import javax.ws.rs.core.Context;
63 import javax.ws.rs.core.MediaType;
64 import javax.ws.rs.core.Response;
67 @Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
69 @Tags({@Tag(name = "SDC Internal APIs")})
70 @Servers({@Server(url = "/sdc2/rest")})
72 public class AdditionalInformationServlet extends BeGenericServlet {
74 private static final Logger log = Logger.getLogger(AdditionalInformationServlet.class);
75 private static final String START_HANDLE_REQUEST_OF = "Start handle request of {}";
76 private static final String MODIFIER_ID_IS = "modifier id is {}";
77 private static final String FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY = "Failed to update additional information property. Reason - {}";
79 private final AdditionalInformationBusinessLogic businessLogic;
82 public AdditionalInformationServlet(UserBusinessLogic userBusinessLogic,
83 ComponentsUtils componentsUtils,
84 AdditionalInformationBusinessLogic businessLogic) {
85 super(userBusinessLogic, componentsUtils);
86 this.businessLogic = businessLogic;
98 @Path("/resources/{resourceId}/additionalinfo")
99 @Consumes(MediaType.APPLICATION_JSON)
100 @Produces(MediaType.APPLICATION_JSON)
101 @Operation(description = "Create Additional Information Label and Value", method = "POST",
102 summary = "Returns created Additional Inforamtion property", responses = {
103 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
104 @ApiResponse(responseCode = "201", description = "Additional information created"),
105 @ApiResponse(responseCode = "403", description = "Restricted operation"),
106 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
107 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
108 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
109 public Response createResourceAdditionalInformationLabel(
110 @Parameter(description = "resource id to update with new property",
111 required = true) @PathParam("resourceId") final String resourceId,
112 @Parameter(description = "Additional information key value to be created", required = true) String data,
113 @Context final HttpServletRequest request,
114 @HeaderParam(value = Constants.USER_ID_HEADER) String userUserId) {
116 return createAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, request, userUserId,
130 @Path("/services/{serviceId}/additionalinfo")
131 @Consumes(MediaType.APPLICATION_JSON)
132 @Produces(MediaType.APPLICATION_JSON)
133 @Operation(description = "Create Additional Information Label and Value", method = "POST",
134 summary = "Returns created Additional Inforamtion property", responses = {
135 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
136 @ApiResponse(responseCode = "201", description = "Additional information created"),
137 @ApiResponse(responseCode = "403", description = "Restricted operation"),
138 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
139 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
140 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
141 public Response createServiceAdditionalInformationLabel(
142 @Parameter(description = "service id to update with new property",
143 required = true) @PathParam("serviceId") final String serviceId,
144 @Parameter(description = "Additional information key value to be created", required = true) String data,
145 @Context final HttpServletRequest request,
146 @HeaderParam(value = Constants.USER_ID_HEADER) String userUserId) {
148 return createAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, request, userUserId, data);
162 @Path("/resources/{resourceId}/additionalinfo/{labelId}")
163 @Consumes(MediaType.APPLICATION_JSON)
164 @Produces(MediaType.APPLICATION_JSON)
165 @Operation(description = "Update Additional Information Label and Value", method = "PUT",
166 summary = "Returns updated Additional Inforamtion property", responses = {
167 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
168 @ApiResponse(responseCode = "200", description = "Additional information updated"),
169 @ApiResponse(responseCode = "403", description = "Restricted operation"),
170 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
171 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
172 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
173 public Response updateResourceAdditionalInformationLabel(
174 @Parameter(description = "resource id to update with new property",
175 required = true) @PathParam("resourceId") final String resourceId,
176 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
177 @Parameter(description = "Additional information key value to be created", required = true) String data,
178 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
180 return updateAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, labelId, request, userId,
195 @Path("/services/{serviceId}/additionalinfo/{labelId}")
196 @Consumes(MediaType.APPLICATION_JSON)
197 @Produces(MediaType.APPLICATION_JSON)
198 @Operation(description = "Update Additional Information Label and Value", method = "PUT",
199 summary = "Returns updated Additional Inforamtion property", responses = {
200 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
201 @ApiResponse(responseCode = "200", description = "Additional information updated"),
202 @ApiResponse(responseCode = "403", description = "Restricted operation"),
203 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
204 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
205 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
206 public Response updateServiceAdditionalInformationLabel(
207 @Parameter(description = "service id to update with new property",
208 required = true) @PathParam("serviceId") final String serviceId,
209 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
210 @Parameter(description = "Additional information key value to be created", required = true) String data,
211 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
213 return updateAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, labelId, request, userId,
227 @Path("/resources/{resourceId}/additionalinfo/{labelId}")
228 @Consumes(MediaType.APPLICATION_JSON)
229 @Produces(MediaType.APPLICATION_JSON)
230 @Operation(description = "Create Additional Information Label and Value", method = "DELETE",
231 summary = "Returns deleted Additional Inforamtion property", responses = {
232 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
233 @ApiResponse(responseCode = "200", description = "Additional information deleted"),
234 @ApiResponse(responseCode = "403", description = "Restricted operation"),
235 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
236 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
237 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
238 public Response updateResourceAdditionalInformationLabel(
239 @Parameter(description = "resource id to update with new property",
240 required = true) @PathParam("resourceId") final String resourceId,
241 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
242 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
244 return deleteAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, labelId, request,
258 @Path("/services/{serviceId}/additionalinfo/{labelId}")
259 @Consumes(MediaType.APPLICATION_JSON)
260 @Produces(MediaType.APPLICATION_JSON)
261 @Operation(description = "Create Additional Information Label and Value", method = "DELETE",
262 summary = "Returns deleted Additional Inforamtion property", responses = {
263 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
264 @ApiResponse(responseCode = "200", description = "Additional information deleted"),
265 @ApiResponse(responseCode = "403", description = "Restricted operation"),
266 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
267 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
268 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
269 public Response deleteServiceAdditionalInformationLabel(
270 @Parameter(description = "service id to update with new property",
271 required = true) @PathParam("serviceId") final String serviceId,
272 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
273 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
275 return deleteAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, labelId, request, userId);
288 @Path("/resources/{resourceId}/additionalinfo/{labelId}")
289 @Consumes(MediaType.APPLICATION_JSON)
290 @Produces(MediaType.APPLICATION_JSON)
291 @Operation(description = "Get Additional Information by id", method = "GET",
292 summary = "Returns Additional Inforamtion property", responses = {
293 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
294 @ApiResponse(responseCode = "200", description = "fetched additional information"),
295 @ApiResponse(responseCode = "403", description = "Restricted operation"),
296 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
297 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
298 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
299 public Response getResourceAdditionalInformationLabel(
300 @Parameter(description = "resource id to update with new property",
301 required = true) @PathParam("resourceId") final String resourceId,
302 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
303 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
305 return getAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, labelId, request, userId);
318 @Path("/services/{serviceId}/additionalinfo/{labelId}")
319 @Consumes(MediaType.APPLICATION_JSON)
320 @Produces(MediaType.APPLICATION_JSON)
321 @Operation(description = "Get Additional Information by id", method = "GET",
322 summary = "Returns Additional Inforamtion property", responses = {
323 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
324 @ApiResponse(responseCode = "200", description = "fetched additional information"),
325 @ApiResponse(responseCode = "403", description = "Restricted operation"),
326 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
327 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
328 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
329 public Response getServiceAdditionalInformationLabel(
330 @Parameter(description = "service id to update with new property",
331 required = true) @PathParam("serviceId") final String serviceId,
332 @Parameter(description = "label id", required = true) @PathParam("labelId") final String labelId,
333 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
335 return getAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, labelId, request, userId);
347 @Path("/resources/{resourceId}/additionalinfo")
348 @Consumes(MediaType.APPLICATION_JSON)
349 @Produces(MediaType.APPLICATION_JSON)
350 @Operation(description = "Get all Additional Information under resource", method = "GET",
351 summary = "Returns Additional Inforamtion property", responses = {
352 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
353 @ApiResponse(responseCode = "200", description = "list of additional information"),
354 @ApiResponse(responseCode = "403", description = "Restricted operation"),
355 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
356 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
357 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
358 public Response getAllResourceAdditionalInformationLabel(
359 @Parameter(description = "resource id to update with new property",
360 required = true) @PathParam("resourceId") final String resourceId,
361 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
363 return getAllAdditionalInformationLabelForComponent(NodeTypeEnum.Resource, resourceId, request, userId);
375 @Path("/services/{serviceId}/additionalinfo")
376 @Consumes(MediaType.APPLICATION_JSON)
377 @Produces(MediaType.APPLICATION_JSON)
378 @Operation(description = "Get all Additional Information under service", method = "GET",
379 summary = "Returns Additional Inforamtion property", responses = {
380 @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
381 @ApiResponse(responseCode = "200", description = "list of additional information"),
382 @ApiResponse(responseCode = "403", description = "Restricted operation"),
383 @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
384 @ApiResponse(responseCode = "409", description = "Additional information key already exist")})
385 @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
386 public Response getAllServiceAdditionalInformationLabel(
387 @Parameter(description = "service id to update with new property",
388 required = true) @PathParam("serviceId") final String serviceId,
389 @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
391 return getAllAdditionalInformationLabelForComponent(NodeTypeEnum.Service, serviceId, request, userId);
397 * Create additional information property under given resource/service
406 protected Response createAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, HttpServletRequest request, String userId, String data) {
408 ServletContext context = request.getSession().getServletContext();
410 String url = request.getMethod() + " " + request.getRequestURI();
411 log.debug(START_HANDLE_REQUEST_OF, url);
412 log.debug(MODIFIER_ID_IS, userId);
413 log.debug("data is {}", data);
416 // convert json to AdditionalInfoParameterInfo
417 AdditionalInfoParameterInfo additionalInfoParameterInfo = gson.fromJson(data, AdditionalInfoParameterInfo.class);
419 // create the new property
421 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.createAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
423 if (either.isRight()) {
424 ResponseFormat responseFormat = either.right().value();
425 log.info("Failed to create additional information {}. Reason - {}", additionalInfoParameterInfo, responseFormat);
426 return buildErrorResponse(responseFormat);
429 AdditionalInfoParameterInfo createdAI = either.left().value();
431 log.debug("Additional information {}={} created successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
433 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.CREATED);
434 return buildOkResponse(responseFormat, createdAI);
436 } catch (Exception e) {
437 log.debug("Create additional information failed with exception", e);
438 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
439 return buildErrorResponse(responseFormat);
445 * Update additional information property by id under given resource/service
455 protected Response updateAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, String labelId, HttpServletRequest request, String userId, String data) {
457 ServletContext context = request.getSession().getServletContext();
459 String url = request.getMethod() + " " + request.getRequestURI();
460 log.debug(START_HANDLE_REQUEST_OF, url);
461 log.debug(MODIFIER_ID_IS, userId);
462 log.debug("data is {}", data);
465 // convert json to AdditionalInfoParameterInfo
466 AdditionalInfoParameterInfo additionalInfoParameterInfo = gson.fromJson(data, AdditionalInfoParameterInfo.class);
468 // create the new property
470 additionalInfoParameterInfo.setUniqueId(labelId);
472 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.updateAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
474 if (either.isRight()) {
475 ResponseFormat responseFormat = either.right().value();
476 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
477 return buildErrorResponse(responseFormat);
480 AdditionalInfoParameterInfo createdAI = either.left().value();
482 log.debug("Additional information {}={} updated successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
484 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
485 return buildOkResponse(responseFormat, createdAI);
487 } catch (Exception e) {
488 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Update Additional Information");
489 log.debug("Update additional information failed with exception", e);
490 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
491 return buildErrorResponse(responseFormat);
498 * Delete an additional information property by id under given resource/service
507 protected Response deleteAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, String labelId, HttpServletRequest request, String userId) {
509 ServletContext context = request.getSession().getServletContext();
511 String url = request.getMethod() + " " + request.getRequestURI();
512 log.debug(START_HANDLE_REQUEST_OF, url);
513 log.debug(MODIFIER_ID_IS, userId);
517 AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo();
518 additionalInfoParameterInfo.setUniqueId(labelId);
520 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.deleteAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
522 if (either.isRight()) {
523 ResponseFormat responseFormat = either.right().value();
524 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
525 return buildErrorResponse(responseFormat);
528 AdditionalInfoParameterInfo createdAI = either.left().value();
530 log.debug("Additional information {}={} deleted successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
532 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
533 return buildOkResponse(responseFormat, createdAI);
535 } catch (Exception e) {
536 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Delete Additional Information");
537 log.debug("Delete additional information failed with exception", e);
538 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
539 return buildErrorResponse(responseFormat);
545 * Get a specific additional information property by a given id under given resource/service
554 protected Response getAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, String labelId, HttpServletRequest request, String userId) {
556 ServletContext context = request.getSession().getServletContext();
558 String url = request.getMethod() + " " + request.getRequestURI();
559 log.debug(START_HANDLE_REQUEST_OF, url);
560 log.debug(MODIFIER_ID_IS, userId);
564 // create the new property
567 AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo();
568 additionalInfoParameterInfo.setUniqueId(labelId);
570 Either<AdditionalInfoParameterInfo, ResponseFormat> either = businessLogic.getAdditionalInformation(nodeType, uniqueId, additionalInfoParameterInfo, userId);
572 if (either.isRight()) {
573 ResponseFormat responseFormat = either.right().value();
574 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
575 return buildErrorResponse(responseFormat);
578 AdditionalInfoParameterInfo createdAI = either.left().value();
580 log.debug("Additional information {}={} fetched successfully with id {}", createdAI.getKey(), createdAI.getValue(), createdAI.getUniqueId());
582 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
583 return buildOkResponse(responseFormat, createdAI);
585 } catch (Exception e) {
586 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get Additional Information");
588 log.debug("get additional information failed with exception", e);
589 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
590 return buildErrorResponse(responseFormat);
596 * Get all additional information properties under given resource/service
604 protected Response getAllAdditionalInformationLabelForComponent(NodeTypeEnum nodeType, String uniqueId, HttpServletRequest request, String userId) {
606 ServletContext context = request.getSession().getServletContext();
608 String url = request.getMethod() + " " + request.getRequestURI();
609 log.debug(START_HANDLE_REQUEST_OF, url);
610 log.debug(MODIFIER_ID_IS, userId);
616 Either<AdditionalInformationDefinition, ResponseFormat> either = businessLogic.getAllAdditionalInformation(nodeType, uniqueId, userId);
617 if (either.isRight()) {
618 ResponseFormat responseFormat = either.right().value();
619 log.info(FAILED_TO_UPDATE_ADDITIONAL_INFO_PROPERTY, responseFormat);
620 return buildErrorResponse(responseFormat);
623 AdditionalInformationDefinition additionalInformationDefinition = either.left().value();
625 log.debug("All Additional information retrieved for component {} is {}", uniqueId, additionalInformationDefinition);
627 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
628 return buildOkResponse(responseFormat, additionalInformationDefinition);
630 } catch (Exception e) {
631 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get All Additional Information");
632 log.debug("Get all addiotanl information properties failed with exception", e);
633 ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
634 return buildErrorResponse(responseFormat);