Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2021 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.dirigible.services.spring.boot;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import org.apache.catalina.filters.CorsFilter;
import org.apache.cxf.Bus;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
import org.apache.cxf.jaxrs.swagger.ui.SwaggerUiConfig;
import org.apache.olingo.odata2.core.servlet.ODataServlet;
import org.eclipse.dirigible.runtime.core.embed.EmbeddedDirigible;
import org.eclipse.dirigible.runtime.core.filter.HealthCheckFilter;
import org.eclipse.dirigible.runtime.core.filter.HttpContextFilter;
import org.eclipse.dirigible.runtime.core.initializer.DirigibleInitializer;
import org.eclipse.dirigible.runtime.core.services.HomeRedirectServlet;
import org.eclipse.dirigible.runtime.core.services.LogoutServlet;
import org.eclipse.dirigible.runtime.core.version.Version;
import org.eclipse.dirigible.runtime.core.version.VersionProcessor;
//import org.eclipse.dirigible.runtime.security.filter.SecurityFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@SpringBootApplication
public class DirigibleRestServiceApplication {
private static final Logger logger = LoggerFactory.getLogger(DirigibleRestServiceApplication.class);
@Autowired
private Bus bus;
public static void main(String[] args) {
SpringApplication.run(DirigibleRestServiceApplication.class, args);
}
@Bean
public Server rsServer() {
EmbeddedDirigible dirigible = new EmbeddedDirigible();
DirigibleInitializer initializer = dirigible.initialize();
JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
endpoint.setBus(bus);
endpoint.setServiceBeans(new ArrayList