Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUSETOOLS-3330 - provide a camel catalog cache bundle for Camel 2.21.… #1608

Merged
merged 2 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/features/org.fusesource.ide.core.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="org.jboss.tools.common.jaxb"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="libs/camel-blueprint-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/camel-catalog-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/camel-catalog-maven-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/camel-catalog-provider-karaf-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/camel-catalog-provider-springboot-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/camel-core-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/camel-spring-2.21.0.fuse-760027-redhat-00001.jar"/>
<classpathentry exported="true" kind="lib" path="libs/log4j-over-slf4j-1.7.22.redhat-2.jar"/>
<classpathentry exported="true" kind="lib" path="libs/slf4j-api-1.7.22.redhat-2.jar"/>
<classpathentry exported="true" kind="lib" path="libs/slf4j-simple-1.7.22.redhat-2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.fusesource.ide.project.RiderProjectBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.fusesource.ide.project.RiderProjectNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001;singleton:=true
Bundle-Version: 11.6.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.11.0",
org.eclipse.core.resources;bundle-version="3.10.0",
org.eclipse.ui;bundle-version="3.107.0",
org.fusesource.ide.camel.model.service.core,
org.fusesource.ide.camel.model.service.impl
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
libs/camel-blueprint-2.21.0.fuse-760027-redhat-00001.jar,
libs/camel-catalog-2.21.0.fuse-760027-redhat-00001.jar,
libs/camel-catalog-maven-2.21.0.fuse-760027-redhat-00001.jar,
libs/camel-catalog-provider-karaf-2.21.0.fuse-760027-redhat-00001.jar,
libs/camel-catalog-provider-springboot-2.21.0.fuse-760027-redhat-00001.jar,
libs/camel-core-2.21.0.fuse-760027-redhat-00001.jar,
libs/camel-spring-2.21.0.fuse-760027-redhat-00001.jar,
libs/log4j-over-slf4j-1.7.22.redhat-2.jar,
libs/slf4j-api-1.7.22.redhat-2.jar,
libs/slf4j-simple-1.7.22.redhat-2.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bundle-Vendor = Red Hat
Bundle-Name = Fuse Camel Service Plugin for 2.21.0.fuse-760027-redhat-00001

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source.. = src/
bin.includes = META-INF/,\
.,\
plugin.xml,\
OSGI-INF/,\
libs/camel-blueprint-2.21.0.fuse-760027-redhat-00001.jar,\
libs/camel-catalog-2.21.0.fuse-760027-redhat-00001.jar,\
libs/camel-catalog-maven-2.21.0.fuse-760027-redhat-00001.jar,\
libs/camel-catalog-provider-karaf-2.21.0.fuse-760027-redhat-00001.jar,\
libs/camel-catalog-provider-springboot-2.21.0.fuse-760027-redhat-00001.jar,\
libs/camel-core-2.21.0.fuse-760027-redhat-00001.jar,\
libs/camel-spring-2.21.0.fuse-760027-redhat-00001.jar,\
libs/log4j-over-slf4j-1.7.22.redhat-2.jar,\
libs/slf4j-api-1.7.22.redhat-2.jar,\
libs/slf4j-simple-1.7.22.redhat-2.jar

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.fusesource.ide.camel.model.service.impl.camelcatalogprovider">
<class class="org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001.CamelCatalogWrapper">
</class>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.fusesource.ide.core</groupId>
<artifactId>plugins</artifactId>
<version>11.6.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001</artifactId>
<packaging>eclipse-plugin</packaging>
<name>Red Hat Fuse Tooling :: Core :: Plugins :: Camel Dynamic Service Implementation for 2.21.0.fuse-760027-redhat-00001</name>

<properties>
<bundle.camel.version>2.21.0.fuse-760027-redhat-00001</bundle.camel.version>
<bundle.slf4j.version>1.7.22.redhat-2</bundle.slf4j.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-deps</id>
<goals>
<goal>copy</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog-maven</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog-provider-karaf</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog-provider-springboot</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
<version>${bundle.camel.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${bundle.slf4j.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>${bundle.slf4j.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${bundle.slf4j.version}</version>
</artifactItem>
</artifactItems>
<useBaseVersion>true</useBaseVersion>
<skip>false</skip>
<outputDirectory>${basedir}/libs/</outputDirectory>
</configuration>
</plugin>

<plugin>
<!-- make sure lib dir is removed after clean to avoid "dirty" build -->
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/libs</directory>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*******************************************************************************
* Copyright (c) 2020 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001;

import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;

import org.apache.camel.catalog.CamelCatalog;
import org.apache.camel.catalog.DefaultCamelCatalog;
import org.apache.camel.catalog.karaf.KarafRuntimeProvider;
import org.apache.camel.catalog.springboot.SpringBootRuntimeProvider;
import org.fusesource.ide.camel.model.service.core.util.CamelCatalogUtils;
import org.fusesource.ide.camel.model.service.impl.ICamelCatalogWrapper;

public class CamelCatalogWrapper implements ICamelCatalogWrapper {

private CamelCatalog camelCatalog;

public CamelCatalogWrapper() {
camelCatalog = new DefaultCamelCatalog(true);
}

public CamelCatalog getCamelCatalog() {
return camelCatalog;
}

@Override
public String getLoadedVersion() {
return camelCatalog.getLoadedVersion();
}

@Override
public Map<String, String> endpointProperties(String uri) throws URISyntaxException {
return camelCatalog.endpointProperties(uri);
}

@Override
public List<String> findModelNames() {
return camelCatalog.findModelNames();
}

@Override
public String modelJSonSchema(String name) {
return camelCatalog.modelJSonSchema(name);
}

@Override
public List<String> findLanguageNames() {
return camelCatalog.findLanguageNames();
}

@Override
public String languageJSonSchema(String name) {
return camelCatalog.languageJSonSchema(name);
}

@Override
public List<String> findDataFormatNames() {
return camelCatalog.findDataFormatNames();
}

@Override
public String dataFormatJSonSchema(String name) {
return camelCatalog.dataFormatJSonSchema(name);
}

@Override
public List<String> findComponentNames() {
return camelCatalog.findComponentNames();
}

@Override
public String componentJSonSchema(String name) {
return camelCatalog.componentJSonSchema(name);
}

@Override
public String blueprintSchemaAsXml() {
return camelCatalog.blueprintSchemaAsXml();
}

@Override
public String springSchemaAsXml() {
return camelCatalog.springSchemaAsXml();
}

@Override
public void setRuntimeProvider(String runtimeProvider) {
if (CamelCatalogUtils.RUNTIME_PROVIDER_KARAF.equals(runtimeProvider)) {
camelCatalog.setRuntimeProvider(new KarafRuntimeProvider());
} else {
camelCatalog.setRuntimeProvider(new SpringBootRuntimeProvider());
}
}

@Override
public String getRuntimeprovider() {
if (camelCatalog.getRuntimeProvider() instanceof KarafRuntimeProvider) {
return CamelCatalogUtils.RUNTIME_PROVIDER_KARAF;
} else {
return CamelCatalogUtils.RUNTIME_PROVIDER_SPRINGBOOT;
}
}

@Override
public void addMavenRepositoryToVersionManager(String id, String url) {
//Do nothing
}

}
1 change: 1 addition & 0 deletions core/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<module>org.fusesource.ide.camel.model.service.impl.v2210fuse731003redhat00003</module>
<module>org.fusesource.ide.camel.model.service.impl.v2210fuse740039redhat00001</module>
<module>org.fusesource.ide.camel.model.service.impl.v2210fuse750033redhat00001</module>
<module>org.fusesource.ide.camel.model.service.impl.v2210fuse760027redhat00001</module>
<module>org.fusesource.ide.camel.validation</module>
<module>org.fusesource.ide.cheatsheets</module>
<module>org.fusesource.ide.graph</module>
Expand Down