Catalog alignment
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / distribution / servlet / DistributionServlet.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.be.distribution.servlet;
22
23 import com.jcabi.aspects.Loggable;
24 import fj.data.Either;
25 import io.swagger.annotations.ApiImplicitParam;
26 import io.swagger.annotations.ApiImplicitParams;
27 import io.swagger.v3.oas.annotations.OpenAPIDefinition;
28 import io.swagger.v3.oas.annotations.Operation;
29 import io.swagger.v3.oas.annotations.Parameter;
30 import io.swagger.v3.oas.annotations.info.Info;
31 import io.swagger.v3.oas.annotations.media.ArraySchema;
32 import io.swagger.v3.oas.annotations.media.Content;
33 import io.swagger.v3.oas.annotations.media.Schema;
34 import io.swagger.v3.oas.annotations.responses.ApiResponse;
35 import io.swagger.v3.oas.annotations.responses.ApiResponses;
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.distribution.AuditHandler;
41 import org.openecomp.sdc.be.distribution.DistributionBusinessLogic;
42 import org.openecomp.sdc.be.distribution.api.client.RegistrationRequest;
43 import org.openecomp.sdc.be.distribution.api.client.ServerListResponse;
44 import org.openecomp.sdc.be.distribution.api.client.TopicRegistrationResponse;
45 import org.openecomp.sdc.be.distribution.api.client.TopicUnregistrationResponse;
46 import org.openecomp.sdc.be.impl.ComponentsUtils;
47 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
48 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
49 import org.openecomp.sdc.be.servlets.BeGenericServlet;
50 import org.openecomp.sdc.be.user.UserBusinessLogic;
51 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
52 import org.openecomp.sdc.common.api.Constants;
53 import org.openecomp.sdc.common.datastructure.Wrapper;
54 import org.openecomp.sdc.common.log.wrappers.Logger;
55 import org.openecomp.sdc.common.util.HttpUtil;
56 import org.openecomp.sdc.exception.ResponseFormat;
57 import org.springframework.stereotype.Controller;
58
59 import javax.inject.Inject;
60 import javax.servlet.http.HttpServletRequest;
61 import javax.ws.rs.Consumes;
62 import javax.ws.rs.GET;
63 import javax.ws.rs.HeaderParam;
64 import javax.ws.rs.POST;
65 import javax.ws.rs.Path;
66 import javax.ws.rs.Produces;
67 import javax.ws.rs.core.Context;
68 import javax.ws.rs.core.MediaType;
69 import javax.ws.rs.core.Response;
70
71 /**
72  * This Servlet serves external users for distribution purposes.
73  *
74  * @author tgitelman
75  *
76  */
77
78 @Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
79 @Path("/v1")
80 @OpenAPIDefinition(info =  @Info(title = "Distribution Servlet",description = "This Servlet serves external users for distribution purposes."))
81
82 @Controller
83 public class DistributionServlet extends BeGenericServlet {
84
85     private static final String START_HANDLE_REQUEST_OF = "Start handle request of {}";
86         private static final Logger log = Logger.getLogger(DistributionServlet.class);
87     private final DistributionBusinessLogic distributionLogic;
88     @Context
89     private HttpServletRequest request;
90
91     @Inject
92     public DistributionServlet(UserBusinessLogic userBusinessLogic,
93         ComponentsUtils componentsUtils, DistributionBusinessLogic distributionLogic) {
94         super(userBusinessLogic, componentsUtils);
95         this.distributionLogic = distributionLogic;
96     }
97
98     /**
99      *
100      * @param requestId
101      * @param instanceId
102      * @param accept
103      * @param authorization
104      * @return
105      */
106     @GET
107     @Path("/distributionUebCluster")
108     @Consumes(MediaType.APPLICATION_JSON)
109     @Produces(MediaType.APPLICATION_JSON)
110     @Operation(description = "UEB Server List", method = "GET", summary = "return the available UEB Server List")
111     //TODO Tal G fix response headers
112     /*responseHeaders = {
113             @ResponseHeader(name = Constants.CONTENT_TYPE_HEADER, description = "Determines the format of the response body", response = String.class),
114             @ResponseHeader(name = "Content-Length", description = "Length of  the response body", response = String.class)})*/
115     @ApiResponses(value = {
116             @ApiResponse(responseCode = "200", description = "ECOMP component is authenticated and list of Cambria API server’s FQDNs is returned",
117                     content = @Content(array = @ArraySchema(schema = @Schema(implementation = ServerListResponse.class)))),
118             @ApiResponse(responseCode = "400", description = "Missing  'X-ECOMP-InstanceID'  HTTP header - POL5001"),
119             @ApiResponse(responseCode = "401", description = "ECOMP component  should authenticate itself  and  to  re-send  again  HTTP  request  with its credentials  for  Basic Authentication - POL5002"),
120             @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
121             @ApiResponse(responseCode = "405", description = "Method  Not Allowed: Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) - POL4050"),
122             @ApiResponse(responseCode = "500", description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
123     @PermissionAllowed({AafPermission.PermNames.READ_VALUE})
124     public Response getUebServerList(
125             @Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
126             @Parameter(description = "X-ECOMP-InstanceID header", required = true)@HeaderParam(value = Constants.X_ECOMP_INSTANCE_ID_HEADER) String instanceId,
127             @Parameter(description = "Determines the format of the body of the response", required = false)@HeaderParam(value = Constants.ACCEPT_HEADER) String accept,
128             @Parameter(description = "The username and password", required = true)@HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization) {
129
130         String url = request.getMethod() + " " + request.getRequestURI();
131         log.debug(START_HANDLE_REQUEST_OF, url);
132         Response response = null;
133         ResponseFormat responseFormat = null;
134
135         if (instanceId == null) {
136             responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.MISSING_X_ECOMP_INSTANCE_ID);
137             response = buildErrorResponse(responseFormat);
138             getComponentsUtils().auditGetUebCluster(null, responseFormat.getStatus().toString(), responseFormat.getFormattedMessage());
139             return response;
140         }
141
142         try {
143             Either<ServerListResponse, ResponseFormat> actionResponse = distributionLogic.getUebServerList();
144
145             if (actionResponse.isRight()) {
146                 responseFormat = actionResponse.right().value();
147                 response = buildErrorResponse(responseFormat);
148             } else {
149                 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
150                 response = buildOkResponse(responseFormat, actionResponse.left().value());
151             }
152
153             getComponentsUtils().auditGetUebCluster(instanceId, responseFormat.getStatus().toString(), responseFormat.getFormattedMessage());
154             return response;
155
156         } catch (Exception e) {
157             BeEcompErrorManager.getInstance().logBeRestApiGeneralError("failed to get ueb serbver list from cofiguration");
158             log.debug("failed to get ueb serbver list from cofiguration", e);
159             responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
160             getComponentsUtils().auditGetUebCluster(instanceId, responseFormat.getStatus().toString(), responseFormat.getFormattedMessage());
161             response = buildErrorResponse(responseFormat);
162             return response;
163         }
164
165     }
166
167     /**
168      *
169      * @param requestId
170      * @param instanceId
171      * @param accept
172      * @param contentType
173      * @param contenLength
174      * @param authorization
175      * @param requestJson
176      * @return
177      */
178     @POST
179     @Path("/registerForDistribution")
180     @Consumes(MediaType.APPLICATION_JSON)
181     @Produces(MediaType.APPLICATION_JSON)
182     @Operation(parameters = @Parameter(name = "requestJson", required = true ), description = "Subscription status", method = "POST", summary = "Subscribes for distribution notifications")
183     @ApiResponses(value = {
184             @ApiResponse(responseCode = "200", description = "ECOMP component is successfully registered for distribution",content = @Content(array = @ArraySchema(schema = @Schema(implementation = TopicRegistrationResponse.class)))),
185             @ApiResponse(responseCode = "400", description = "Missing  'X-ECOMP-InstanceID'  HTTP header - POL5001"),
186             @ApiResponse(responseCode = "400", description = "Missing  Body - POL4500"),
187             @ApiResponse(responseCode = "400", description = "Invalid  Body  : missing mandatory parameter 'apiPublicKey' - POL4501"),
188             @ApiResponse(responseCode = "400", description = "Invalid  Body  : missing mandatory parameter 'distrEnvName' - POL4502"),
189             @ApiResponse(responseCode = "400", description = "Invalid Body :  Specified 'distrEnvName' doesn’t exist - POL4137"),
190             @ApiResponse(responseCode = "401", description = "ECOMP component  should authenticate itself  and  to  re-send  again  HTTP  request  with its Basic Authentication credentials - POL5002"),
191             @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
192             @ApiResponse(responseCode = "405", description = "Method  Not Allowed  :  Invalid HTTP method type used to  register for  distribution ( PUT,DELETE,GET  will be rejected) - POL4050"),
193             @ApiResponse(responseCode = "500", description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component  should  continue the attempts to  register for  distribution - POL5000")})
194
195     @ApiImplicitParams({@ApiImplicitParam(name = "requestJson", required = true, dataType = "org.openecomp.sdc.be.distribution.api.client.RegistrationRequest", paramType = "body", value = "json describe the artifact")})
196     @PermissionAllowed({AafPermission.PermNames.READ_VALUE})
197     public Response registerForDistribution(
198             @Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
199             @Parameter(description = "X-ECOMP-InstanceID header", required = true)@HeaderParam(value = Constants.X_ECOMP_INSTANCE_ID_HEADER) String instanceId,
200             @Parameter(description = "Determines the format of the body of the response", required = false)@HeaderParam(value = Constants.ACCEPT_HEADER) String accept,
201             @Parameter(description = "Determines the format of the body of the request", required = true)@HeaderParam(value = Constants.CONTENT_TYPE_HEADER) String contentType,
202             @Parameter(description = "Length  of  the request body", required = true)@HeaderParam(value = Constants.CONTENT_LENGTH_HEADER) String contenLength,
203             @Parameter(description = "The username and password", required = true)@HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization,
204             @Parameter( hidden = true) String requestJson) {
205         String url = request.getMethod() + " " + request.getRequestURI();
206         log.debug(START_HANDLE_REQUEST_OF, url);
207
208         Wrapper<Response> responseWrapper = new Wrapper<>();
209         Wrapper<RegistrationRequest> registrationRequestWrapper = new Wrapper<>();
210
211         validateHeaders(responseWrapper, request, AuditingActionEnum.ADD_KEY_TO_TOPIC_ACL);
212
213         if (responseWrapper.isEmpty()) {
214             validateJson(responseWrapper, registrationRequestWrapper, requestJson);
215         }
216         if (responseWrapper.isEmpty()) {
217             validateEnv(responseWrapper);
218         }
219
220         if (responseWrapper.isEmpty()) {
221             distributionLogic.handleRegistration(responseWrapper, registrationRequestWrapper.getInnerElement(), buildAuditHandler(request, registrationRequestWrapper.getInnerElement()));
222         } else {
223             BeEcompErrorManager.getInstance().logBeDistributionEngineSystemError(DistributionBusinessLogic.REGISTER_IN_DISTRIBUTION_ENGINE, "registration validation failed");
224         }
225
226         return responseWrapper.getInnerElement();
227     }
228
229     /**
230      * Returns list of valid artifact types for validation done in the distribution client.<br>
231      * The list is the representation of the values of the enum ArtifactTypeEnum.
232      */
233     @GET
234     @Path("/artifactTypes")
235     @Consumes(MediaType.APPLICATION_JSON)
236     @Produces(MediaType.APPLICATION_JSON)
237     @Operation(description = "Artifact types list", method = "GET", summary = "Fetches available artifact types list")
238     @ApiResponses(value = {
239             @ApiResponse(responseCode = "200", description = "Artifact types list fetched successfully", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
240             @ApiResponse(responseCode = "400", description = "Missing  'X-ECOMP-InstanceID'  HTTP header - POL5001"),
241             @ApiResponse(responseCode = "401", description = "ECOMP component  should authenticate itself  and  to  re-send  again  HTTP  request  with its Basic Authentication credentials - POL5002"),
242             @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
243             @ApiResponse(responseCode = "405", description = "Method  Not Allowed  :  Invalid HTTP method type used to  register for  distribution ( POST,PUT,DELETE  will be rejected) - POL4050"),
244             @ApiResponse(responseCode = "500", description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component  should  continue the attempts to  register for  distribution - POL5000")})
245     @PermissionAllowed({AafPermission.PermNames.READ_VALUE})
246     public Response getValidArtifactTypes(
247             @Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
248             @Parameter(description = "X-ECOMP-InstanceID header", required = true)@HeaderParam(value = Constants.X_ECOMP_INSTANCE_ID_HEADER) String instanceId,
249             @Parameter(description = "The username and password", required = true)@HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization,
250             @Parameter(description = "The username and password", required = true)@HeaderParam(value = Constants.ACCEPT_HEADER) String accept) {
251         String url = request.getMethod() + " " + request.getRequestURI();
252         log.debug(START_HANDLE_REQUEST_OF, url);
253         Response response = null;
254
255         Wrapper<Response> responseWrapper = new Wrapper<>();
256
257         //TODO check if in use
258         validateHeaders(responseWrapper, request, AuditingActionEnum.GET_VALID_ARTIFACT_TYPES);
259         if (responseWrapper.isEmpty()) {
260             response = buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), ArtifactTypeEnum.values());
261         } else {
262             response = responseWrapper.getInnerElement();
263         }
264         return response;
265     }
266
267     /**
268      * Removes from subscription for distribution notifications
269      *
270      * @param requestId
271      * @param instanceId
272      * @param accept
273      * @param contentType
274      * @param contenLength
275      * @param authorization
276      * @param requestJson
277      * @return
278      */
279     @POST
280     @Path("/unRegisterForDistribution")
281     @Consumes(MediaType.APPLICATION_JSON)
282     @Produces(MediaType.APPLICATION_JSON)
283     @Operation(parameters = @Parameter(name = "requestJson", required = true ),description = "Subscription status", method = "POST", summary = "Removes from subscription for distribution notifications")
284     //TODO Edit the responses
285     @ApiResponses(value = {
286             @ApiResponse(responseCode = "204", description = "ECOMP component is successfully unregistered",
287                     content = @Content(array = @ArraySchema(schema = @Schema(implementation = TopicUnregistrationResponse.class)))),
288             @ApiResponse(responseCode = "400", description = "Missing  'X-ECOMP-InstanceID'  HTTP header - POL5001"),
289             @ApiResponse(responseCode = "400", description = "Missing  Body - POL4500"),
290             @ApiResponse(responseCode = "400", description = "Invalid  Body  : missing mandatory parameter 'apiPublicKey' - POL4501"),
291             @ApiResponse(responseCode = "400", description = "Invalid  Body  : missing mandatory parameter 'distrEnvName' - SVC4506"),
292             @ApiResponse(responseCode = "400", description = "Invalid Body :  Specified 'distrEnvName' doesn’t exist - POL4137"),
293             @ApiResponse(responseCode = "401", description = "ECOMP component  should authenticate itself  and  to  re-send  again  HTTP  request  with its Basic Authentication credentials - POL5002"),
294             @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
295             @ApiResponse(responseCode = "405", description = "Method  Not Allowed  :  Invalid HTTP method type used to  register for  distribution ( PUT,DELETE,GET will be rejected) - POL4050"),
296             @ApiResponse(responseCode = "500", description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component  should  continue the attempts to  register for  distribution - POL5000")})
297     //@ApiImplicitParams({@ApiImplicitParam(name = "requestJson", required = true, dataType = "org.openecomp.sdc.be.distribution.api.client.RegistrationRequest", paramType = "body", value = "json describe the artifact")})
298     @ApiImplicitParams({@ApiImplicitParam(name = "requestJson", required = true, dataType = "org.openecomp.sdc.be.distribution.api.client.RegistrationRequest", paramType = "body", value = "json describe the artifact")})
299     @PermissionAllowed({AafPermission.PermNames.READ_VALUE})
300     public Response unRegisterForDistribution(
301             @Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
302             @Parameter(description = "X-ECOMP-InstanceID header", required = true)@HeaderParam(value = Constants.X_ECOMP_INSTANCE_ID_HEADER) String instanceId,
303             @Parameter(description = "Determines the format of the body of the response", required = false)@HeaderParam(value = Constants.ACCEPT_HEADER) String accept,
304             @Parameter(description = "Determines the format of the body of the request", required = true)@HeaderParam(value = Constants.CONTENT_TYPE_HEADER) String contentType,
305             @Parameter(description = "Length  of  the request body", required = true)@HeaderParam(value = Constants.CONTENT_LENGTH_HEADER) String contenLength,
306             @Parameter(description = "The username and password", required = true)@HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization,
307             @Parameter( hidden = true) String requestJson) {
308
309         String url = request.getMethod() + " " + request.getRequestURI();
310         log.debug(START_HANDLE_REQUEST_OF, url);
311
312         Wrapper<Response> responseWrapper = new Wrapper<>();
313         Wrapper<RegistrationRequest> unRegistrationRequestWrapper = new Wrapper<>();
314
315         validateHeaders(responseWrapper, request, AuditingActionEnum.REMOVE_KEY_FROM_TOPIC_ACL);
316
317         if (responseWrapper.isEmpty()) {
318             validateJson(responseWrapper, unRegistrationRequestWrapper, requestJson);
319         }
320         if (responseWrapper.isEmpty()) {
321             validateEnv(responseWrapper);
322         }
323         if (responseWrapper.isEmpty()) {
324             distributionLogic.handleUnRegistration(responseWrapper, unRegistrationRequestWrapper.getInnerElement(), buildAuditHandler(request, unRegistrationRequestWrapper.getInnerElement()));
325         } else {
326             BeEcompErrorManager.getInstance().logBeDistributionEngineSystemError(DistributionBusinessLogic.UN_REGISTER_IN_DISTRIBUTION_ENGINE, "unregistration validation failed");
327         }
328
329         return responseWrapper.getInnerElement();
330     }
331
332     private void validateEnv(Wrapper<Response> responseWrapper) {
333
334         // DE194021
335         StorageOperationStatus environmentStatus = distributionLogic.getDistributionEngine().isEnvironmentAvailable();
336         if (environmentStatus != StorageOperationStatus.OK) {
337             if (environmentStatus == StorageOperationStatus.DISTR_ENVIRONMENT_NOT_FOUND) {
338                 Response missingHeaderResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.DISTRIBUTION_ENV_DOES_NOT_EXIST));
339                 responseWrapper.setInnerElement(missingHeaderResponse);
340             } else {
341                 Response missingHeaderResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.GENERAL_ERROR));
342                 responseWrapper.setInnerElement(missingHeaderResponse);
343             }
344         }
345
346     }
347
348     private void validateHeaders(Wrapper<Response> responseWrapper, HttpServletRequest request, AuditingActionEnum auditingAction) {
349         if (request.getHeader(Constants.X_ECOMP_INSTANCE_ID_HEADER) == null) {
350             Response missingHeaderResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.MISSING_X_ECOMP_INSTANCE_ID));
351             responseWrapper.setInnerElement(missingHeaderResponse);
352             ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.MISSING_X_ECOMP_INSTANCE_ID);
353             getComponentsUtils().auditMissingInstanceIdAsDistributionEngineEvent(auditingAction, responseFormat.getStatus().toString());
354
355         }
356
357     }
358
359     private void validateJson(Wrapper<Response> responseWrapper, Wrapper<RegistrationRequest> registrationRequestWrapper, String requestJson) {
360         if (requestJson == null || requestJson.isEmpty()) {
361             Response missingBodyResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.MISSING_BODY));
362             responseWrapper.setInnerElement(missingBodyResponse);
363         } else {
364             Either<RegistrationRequest, Exception> eitherRegistration = HttpUtil.convertJsonStringToObject(requestJson, RegistrationRequest.class);
365             if (eitherRegistration.isLeft()) {
366                 RegistrationRequest registrationRequest = eitherRegistration.left().value();
367                 if (registrationRequest.getApiPublicKey() == null) {
368                     Response missingBodyResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.MISSING_PUBLIC_KEY));
369                     responseWrapper.setInnerElement(missingBodyResponse);
370
371                 } else if (registrationRequest.getDistrEnvName() == null) {
372                     Response missingBodyResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.MISSING_ENV_NAME));
373                     responseWrapper.setInnerElement(missingBodyResponse);
374                 } else {
375                     registrationRequestWrapper.setInnerElement(registrationRequest);
376                 }
377             } else {
378                 Response missingBodyResponse = buildErrorResponse(distributionLogic.getResponseFormatManager().getResponseFormat(ActionStatus.MISSING_BODY));
379                 responseWrapper.setInnerElement(missingBodyResponse);
380             }
381         }
382
383     }
384
385     private AuditHandler buildAuditHandler(HttpServletRequest request, RegistrationRequest registrationRequest) {
386         return new AuditHandler(getComponentsUtils(), request.getHeader(Constants.X_ECOMP_INSTANCE_ID_HEADER), registrationRequest);
387     }
388 }