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.onap.so.apihandlerinfra;
23 import javax.annotation.PostConstruct;
24 import javax.ws.rs.ApplicationPath;
25 import org.glassfish.jersey.server.ResourceConfig;
26 import org.glassfish.jersey.servlet.ServletProperties;
27 import org.onap.so.apihandler.filters.RequestIdFilter;
28 import org.onap.so.apihandlerinfra.exceptions.ApiExceptionMapper;
29 import org.onap.so.apihandlerinfra.infra.rest.Network;
30 import org.onap.so.apihandlerinfra.infra.rest.ServiceInstance;
31 import org.onap.so.apihandlerinfra.infra.rest.VfModules;
32 import org.onap.so.apihandlerinfra.infra.rest.Vnf;
33 import org.onap.so.apihandlerinfra.infra.rest.Volumes;
34 import org.onap.so.apihandlerinfra.infra.rest.exception.mapper.AAIEntityNotFoundMapper;
35 import org.onap.so.apihandlerinfra.infra.rest.exception.mapper.CloudConfigurationNotFoundMapper;
36 import org.onap.so.apihandlerinfra.infra.rest.exception.mapper.NoRecipeExceptionMapper;
37 import org.onap.so.apihandlerinfra.infra.rest.exception.mapper.RequestConflictMapper;
38 import org.onap.so.apihandlerinfra.infra.rest.exception.mapper.WorkflowEngineConnectionMapper;
39 import org.onap.so.apihandlerinfra.tenantisolation.CloudOrchestration;
40 import org.onap.so.apihandlerinfra.tenantisolation.CloudResourcesOrchestration;
41 import org.onap.so.apihandlerinfra.tenantisolation.ModelDistributionRequest;
42 import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
43 import org.onap.so.web.exceptions.RuntimeExceptionMapper;
44 import org.springframework.context.annotation.Configuration;
45 import io.swagger.jaxrs.config.BeanConfig;
46 import io.swagger.jaxrs.listing.ApiListingResource;
47 import io.swagger.jaxrs.listing.SwaggerSerializers;
51 public class JerseyConfiguration extends ResourceConfig {
55 register(GlobalHealthcheckHandler.class);
56 register(NodeHealthcheckHandler.class);
57 register(ServiceInstances.class);
58 register(TasksHandler.class);
59 register(CloudOrchestration.class);
60 register(CloudResourcesOrchestration.class);
61 register(OrchestrationRequests.class);
62 register(VfModules.class);
64 register(Network.class);
65 register(Volumes.class);
66 register(ServiceInstance.class);
67 register(JaxRsFilterLogging.class);
68 register(ManualTasks.class);
69 register(TasksHandler.class);
70 register(ApiListingResource.class);
71 register(SwaggerSerializers.class);
72 register(ApiExceptionMapper.class);
73 register(RuntimeExceptionMapper.class);
74 register(RequestIdFilter.class);
75 register(E2EServiceInstances.class);
76 register(WorkflowSpecificationsHandler.class);
77 register(InstanceManagement.class);
78 register(ResumeOrchestrationRequest.class);
79 register(AAIEntityNotFoundMapper.class);
80 register(CloudConfigurationNotFoundMapper.class);
81 register(NoRecipeExceptionMapper.class);
82 register(RequestConflictMapper.class);
83 register(WorkflowEngineConnectionMapper.class);
84 // this registration seems to be needed to get predictable
85 // execution behavior for the above JSON Exception Mappers
86 register(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.class);
87 register(ModelDistributionRequest.class);
88 property(ServletProperties.FILTER_FORWARD_ON_404, true);
89 BeanConfig beanConfig = new BeanConfig();
90 beanConfig.setVersion("1.0.2");
91 beanConfig.setSchemes(new String[] {"https"});
92 beanConfig.setResourcePackage("org.onap.so.apihandlerinfra");
93 beanConfig.setPrettyPrint(true);
94 beanConfig.setScan(true);