camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/4] camel git commit: CAMEL-10828: camel-catalog-nexus - more work
Date Mon, 20 Feb 2017 13:24:18 GMT
CAMEL-10828: camel-catalog-nexus - more work


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8d4a41f8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8d4a41f8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8d4a41f8

Branch: refs/heads/master
Commit: 8d4a41f88503d004bf4fb8ff6d13fc8afe05221c
Parents: d492153
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Feb 20 14:19:10 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Feb 20 14:19:10 2017 +0100

----------------------------------------------------------------------
 platforms/catalog-nexus/pom.xml                 |   6 +
 .../catalog/nexus/BaseNexusRepository.java      |  13 --
 .../nexus/ComponentCatalogNexusRepository.java  |  19 +++
 .../camel/catalog/nexus/ConnectorDataStore.java |   5 +
 .../ConnectorDataStoreNexusRepository.java      |  13 ++
 .../catalog/nexus/MemoryConnectorDataStore.java |   6 +-
 ...ocalFileComponentCatalogNexusRepository.java |   2 +-
 .../LocalFileConnectorNexusRepository.java      |  55 ++++++++
 .../LocalNexusConnectorRepositoryTest.java      |  53 +++++++
 .../resources/nexus-sample-component-result.xml |  37 +++++
 .../resources/nexus-sample-connector-result.xml |  37 +++++
 .../src/test/resources/nexus-sample-result.xml  |  37 -----
 platforms/myfoo-connector/pom.xml               | 138 +++++++++++++++++++
 .../org/myfoo/connector/MyFooComponent.java     |  27 ++++
 .../services/org/apache/camel/component/my-foo  |  18 +++
 .../main/resources/camel-connector-schema.json  |  26 ++++
 .../src/main/resources/camel-connector.json     |  21 +++
 platforms/pom.xml                               |   3 +-
 18 files changed, 463 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/pom.xml b/platforms/catalog-nexus/pom.xml
index a3653bf..bb0d970 100644
--- a/platforms/catalog-nexus/pom.xml
+++ b/platforms/catalog-nexus/pom.xml
@@ -111,6 +111,12 @@
                     <include>*.jar</include>
                   </includes>
                 </resource>
+                <resource>
+                  <directory>../myfoo-connector/target</directory>
+                  <includes>
+                    <include>*.jar</include>
+                  </includes>
+                </resource>
               </resources>
             </configuration>
           </execution>

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
index 02cd8c7..8e7653e 100644
--- a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
+++ b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
@@ -49,7 +49,6 @@ public abstract class BaseNexusRepository {
     private volatile ScheduledExecutorService executorService;
     private AtomicBoolean started = new AtomicBoolean();
 
-    private CamelCatalog camelCatalog;
     private int initialDelay = 10;
     private int delay = 60;
     private String nexusUrl = "http://nexus/service/local/data_index";
@@ -59,14 +58,6 @@ public abstract class BaseNexusRepository {
         this.classifier = classifier;
     }
 
-    public CamelCatalog getCamelCatalog() {
-        return camelCatalog;
-    }
-
-    public void setCamelCatalog(CamelCatalog camelCatalog) {
-        this.camelCatalog = camelCatalog;
-    }
-
     public String getNexusUrl() {
         return nexusUrl;
     }
@@ -116,10 +107,6 @@ public abstract class BaseNexusRepository {
      * Starts the Nexus indexer.
      */
     public void start() {
-        if (camelCatalog == null) {
-            throw new IllegalArgumentException("CamelCatalog must be configured");
-        }
-
         if (nexusUrl == null || nexusUrl.isEmpty()) {
             log.warn("Nexus service not found. Indexing Nexus is not enabled!");
             return;

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
index 2e606f9..03844b1 100644
--- a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
+++ b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
@@ -32,10 +32,29 @@ import static org.apache.camel.catalog.CatalogHelper.loadText;
  */
 public class ComponentCatalogNexusRepository extends BaseNexusRepository {
 
+    private CamelCatalog camelCatalog;
+
     public ComponentCatalogNexusRepository() {
         super("component");
     }
 
+    public CamelCatalog getCamelCatalog() {
+        return camelCatalog;
+    }
+
+    public void setCamelCatalog(CamelCatalog camelCatalog) {
+        this.camelCatalog = camelCatalog;
+    }
+
+    @Override
+    public void start() {
+        if (camelCatalog == null) {
+            throw new IllegalArgumentException("CamelCatalog must be configured");
+        }
+
+        super.start();
+    }
+
     @Override
     public void onNewArtifacts(Set<NexusArtifactDto> newArtifacts) {
         // now download the new artifact JARs and look inside to find more details

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStore.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStore.java
b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStore.java
index 68c9858..b1daa7a 100644
--- a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStore.java
+++ b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStore.java
@@ -34,4 +34,9 @@ public interface ConnectorDataStore {
      */
     List<ConnectorDto> searchArtifacts(String filter, boolean latestVersionOnly);
 
+    /**
+     * Number of connectors in the data store.
+     */
+    int size();
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStoreNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStoreNexusRepository.java
b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStoreNexusRepository.java
index 50e0190..3e7426a 100644
--- a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStoreNexusRepository.java
+++ b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorDataStoreNexusRepository.java
@@ -46,6 +46,15 @@ public class ConnectorDataStoreNexusRepository extends BaseNexusRepository
{
     }
 
     @Override
+    public void start() {
+        if (connectorDataStore == null) {
+            throw new IllegalArgumentException("ConnectorDataStore must be configured");
+        }
+
+        super.start();
+    }
+
+    @Override
     public void onNewArtifacts(Set<NexusArtifactDto> newArtifacts) {
         // now download the new artifact JARs and look inside to find more details
         for (NexusArtifactDto dto : newArtifacts) {
@@ -130,6 +139,10 @@ public class ConnectorDataStoreNexusRepository extends BaseNexusRepository
{
                 String name = CatalogHelper.after(line, ":");
                 if (name != null) {
                     name = name.trim();
+                    if (name.endsWith(",")) {
+                        // skip last comma
+                        name = name.substring(0, name.length() - 1);
+                    }
                     return CatalogHelper.removeLeadingAndEndingQuotes(name);
                 }
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/MemoryConnectorDataStore.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/MemoryConnectorDataStore.java
b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/MemoryConnectorDataStore.java
index b78e96a..e3d5995 100644
--- a/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/MemoryConnectorDataStore.java
+++ b/platforms/catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/MemoryConnectorDataStore.java
@@ -34,7 +34,11 @@ public class MemoryConnectorDataStore implements ConnectorDataStore {
 
     @Override
     public List<ConnectorDto> searchArtifacts(String filter, boolean latestVersionOnly)
{
-
         return null;
     }
+
+    @Override
+    public int size() {
+        return connectors.size();
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileComponentCatalogNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileComponentCatalogNexusRepository.java
b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileComponentCatalogNexusRepository.java
index 6d18289..4327166 100644
--- a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileComponentCatalogNexusRepository.java
+++ b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileComponentCatalogNexusRepository.java
@@ -36,7 +36,7 @@ public class LocalFileComponentCatalogNexusRepository extends ComponentCatalogNe
 
     @Override
     protected URL createNexusUrl() throws MalformedURLException {
-        File file = new File("target/test-classes/nexus-sample-result.xml");
+        File file = new File("target/test-classes/nexus-sample-component-result.xml");
         return new URL("file:" + file.getAbsolutePath());
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileConnectorNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileConnectorNexusRepository.java
b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileConnectorNexusRepository.java
new file mode 100644
index 0000000..00d1c6a
--- /dev/null
+++ b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileConnectorNexusRepository.java
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.catalog.nexus;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public class LocalFileConnectorNexusRepository extends ConnectorDataStoreNexusRepository
{
+
+    private Runnable onAddConnector;
+
+    public Runnable getOnAddConnector() {
+        return onAddConnector;
+    }
+
+    public void setOnAddConnector(Runnable onAddConnector) {
+        this.onAddConnector = onAddConnector;
+    }
+
+    @Override
+    protected URL createNexusUrl() throws MalformedURLException {
+        File file = new File("target/test-classes/nexus-sample-connector-result.xml");
+        return new URL("file:" + file.getAbsolutePath());
+    }
+
+    @Override
+    protected String createArtifactURL(NexusArtifactDto dto) {
+        // load from local file instead
+        return "file:target/localrepo/" + dto.getArtifactId() + "-" + dto.getVersion() +
".jar";
+    }
+
+    @Override
+    protected void addConnector(NexusArtifactDto dto, String name, String connectorJson,
String connectorSchemaJson) {
+        super.addConnector(dto, name, connectorJson, connectorSchemaJson);
+
+        if (onAddConnector != null) {
+            onAddConnector.run();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusConnectorRepositoryTest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusConnectorRepositoryTest.java
b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusConnectorRepositoryTest.java
new file mode 100644
index 0000000..b415cfd
--- /dev/null
+++ b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusConnectorRepositoryTest.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.catalog.nexus;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import junit.framework.TestCase;
+import org.junit.Test;
+
+public class LocalNexusConnectorRepositoryTest extends TestCase {
+
+    private MemoryConnectorDataStore dataStore = new MemoryConnectorDataStore();
+
+    @Test
+    public void testLocalNexus() throws Exception {
+        LocalFileConnectorNexusRepository repo = new LocalFileConnectorNexusRepository();
+        repo.setInitialDelay(2);
+        repo.setDelay(3);
+        repo.setNexusUrl("dummy");
+        repo.setConnectorDataStore(dataStore);
+
+        final CountDownLatch latch = new CountDownLatch(1);
+        repo.setOnAddConnector(latch::countDown);
+
+        int before = dataStore.size();
+
+        repo.start();
+
+        assertTrue("Should have found connector", latch.await(10, TimeUnit.SECONDS));
+
+        repo.stop();
+
+        int after = dataStore.size();
+
+        assertTrue("There should be 1 connector found", after - before == 1);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/test/resources/nexus-sample-component-result.xml
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/resources/nexus-sample-component-result.xml
b/platforms/catalog-nexus/src/test/resources/nexus-sample-component-result.xml
new file mode 100644
index 0000000..aae70b6
--- /dev/null
+++ b/platforms/catalog-nexus/src/test/resources/nexus-sample-component-result.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<search-results>
+  <totalCount>1</totalCount>
+  <from>-1</from>
+  <count>-1</count>
+  <tooManyResults>false</tooManyResults>
+  <data>
+    <artifact>
+      <resourceURI>http://nexus.dummy/service/local/repositories/staging/content/org/apache/camel/dummy-component/${project.version}/dummy-component-${project.version}.jar</resourceURI>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>dummy-component</artifactId>
+      <version>${project.version}</version>
+      <packaging>jar</packaging>
+      <extension>jar</extension>
+      <repoId>staging</repoId>
+      <contextId>Staging</contextId>
+      <pomLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=dummy-component&amp;v=${project.version}&amp;e=pom</pomLink>
+      <artifactLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=dummy-component&amp;v=${project.version}&amp;e=jar</artifactLink>
+      <highlightedFragment>&lt;blockquote&gt;Artifact ID&lt;UL&gt;&lt;LI&gt;dummy-&lt;B&gt;component&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/blockquote&gt;</highlightedFragment>
+    </artifact>
+  </data>
+</search-results>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/test/resources/nexus-sample-connector-result.xml
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/resources/nexus-sample-connector-result.xml
b/platforms/catalog-nexus/src/test/resources/nexus-sample-connector-result.xml
new file mode 100644
index 0000000..05173b5
--- /dev/null
+++ b/platforms/catalog-nexus/src/test/resources/nexus-sample-connector-result.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<search-results>
+  <totalCount>1</totalCount>
+  <from>-1</from>
+  <count>-1</count>
+  <tooManyResults>false</tooManyResults>
+  <data>
+    <artifact>
+      <resourceURI>http://nexus.dummy/service/local/repositories/staging/content/org/apache/camel/myfoo-connector/${project.version}/myfoo-connector-${project.version}.jar</resourceURI>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>myfoo-connector</artifactId>
+      <version>${project.version}</version>
+      <packaging>jar</packaging>
+      <extension>jar</extension>
+      <repoId>staging</repoId>
+      <contextId>Staging</contextId>
+      <pomLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=myfoo-connector&amp;v=${project.version}&amp;e=pom</pomLink>
+      <artifactLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=myfoo-connector&amp;v=${project.version}&amp;e=jar</artifactLink>
+      <highlightedFragment>&lt;blockquote&gt;Artifact ID&lt;UL&gt;&lt;LI&gt;myfoo-&lt;B&gt;connector&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/blockquote&gt;</highlightedFragment>
+    </artifact>
+  </data>
+</search-results>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml b/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
deleted file mode 100644
index aae70b6..0000000
--- a/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<search-results>
-  <totalCount>1</totalCount>
-  <from>-1</from>
-  <count>-1</count>
-  <tooManyResults>false</tooManyResults>
-  <data>
-    <artifact>
-      <resourceURI>http://nexus.dummy/service/local/repositories/staging/content/org/apache/camel/dummy-component/${project.version}/dummy-component-${project.version}.jar</resourceURI>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>dummy-component</artifactId>
-      <version>${project.version}</version>
-      <packaging>jar</packaging>
-      <extension>jar</extension>
-      <repoId>staging</repoId>
-      <contextId>Staging</contextId>
-      <pomLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=dummy-component&amp;v=${project.version}&amp;e=pom</pomLink>
-      <artifactLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=dummy-component&amp;v=${project.version}&amp;e=jar</artifactLink>
-      <highlightedFragment>&lt;blockquote&gt;Artifact ID&lt;UL&gt;&lt;LI&gt;dummy-&lt;B&gt;component&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/blockquote&gt;</highlightedFragment>
-    </artifact>
-  </data>
-</search-results>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/myfoo-connector/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/myfoo-connector/pom.xml b/platforms/myfoo-connector/pom.xml
new file mode 100644
index 0000000..a63e079
--- /dev/null
+++ b/platforms/myfoo-connector/pom.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>platforms</artifactId>
+    <version>2.19.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <artifactId>myfoo-connector</artifactId>
+  <name>Camel :: Platforms :: My Foo Connector</name>
+  <description>Camel My Foo Connector</description>
+  <packaging>jar</packaging>
+
+  <dependencies>
+
+    <!-- base component to use for this connector -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- camel-connector -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-connector</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- support camel documentation -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>apt</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    
+  </dependencies>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+
+    <plugins>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>${maven-compiler-plugin-version}</version>
+        <configuration>
+          <source>1.8</source>
+          <target>1.8</target>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>${maven-resources-plugin-version}</version>
+        <configuration>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+
+      <!-- generate components meta-data and validate component includes documentation
etc -->
+      <plugin>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-package-maven-plugin</artifactId>
+        <version>${project.version}</version>
+        <executions>
+          <execution>
+            <id>prepare</id>
+            <goals>
+              <goal>prepare-components</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+          <execution>
+            <id>validate</id>
+            <goals>
+              <goal>validate-components</goal>
+            </goals>
+            <phase>prepare-package</phase>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!-- turn off jar plugin as we use connector plugin to jar instead -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>${maven-jar-plugin-version}</version>
+        <executions>
+          <execution>
+            <id>default-jar</id>
+            <phase/>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!-- connector plugin will build the jar -->
+      <plugin>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-connector-maven-plugin</artifactId>
+        <version>${project.version}</version>
+        <executions>
+          <execution>
+            <id>connector</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+    </plugins>
+  </build>
+  
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/myfoo-connector/src/main/java/org/myfoo/connector/MyFooComponent.java
----------------------------------------------------------------------
diff --git a/platforms/myfoo-connector/src/main/java/org/myfoo/connector/MyFooComponent.java
b/platforms/myfoo-connector/src/main/java/org/myfoo/connector/MyFooComponent.java
new file mode 100644
index 0000000..1817f9f
--- /dev/null
+++ b/platforms/myfoo-connector/src/main/java/org/myfoo/connector/MyFooComponent.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.myfoo.connector;
+
+import org.apache.camel.component.connector.DefaultConnectorComponent;
+
+public class MyFooComponent extends DefaultConnectorComponent {
+
+    public MyFooComponent() {
+        super("myfoo", "org.myfoo.connector.MyFooComponent");
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/myfoo-connector/src/main/resources/META-INF/services/org/apache/camel/component/my-foo
----------------------------------------------------------------------
diff --git a/platforms/myfoo-connector/src/main/resources/META-INF/services/org/apache/camel/component/my-foo
b/platforms/myfoo-connector/src/main/resources/META-INF/services/org/apache/camel/component/my-foo
new file mode 100644
index 0000000..6a0b504
--- /dev/null
+++ b/platforms/myfoo-connector/src/main/resources/META-INF/services/org/apache/camel/component/my-foo
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class=org.myfoo.connector.MyFooComponent
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json
----------------------------------------------------------------------
diff --git a/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json b/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json
new file mode 100644
index 0000000..7bdf1c9
--- /dev/null
+++ b/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json
@@ -0,0 +1,26 @@
+{
+  "component": {
+    "kind": "component",
+    "baseScheme": "timer",
+    "scheme": "my-foo",
+    "syntax": "my-foo:timerName",
+    "title": "MyFoo",
+    "description": "Something cool",
+    "label": "foo,timer",
+    "deprecated": false,
+    "async": false,
+    "consumerOnly": true,
+    "lenientProperties": false,
+    "javaType": "org.myfoo.connector.MyFooComponent",
+    "groupId": "org.apache.camel",
+    "artifactId": "myfoo-connector",
+    "version": "2.19.0-SNAPSHOT"
+  },
+  "componentProperties": {
+  },
+  "properties": {
+    "timerName": { "kind": "path", "displayName": "Timer Name", "group": "consumer", "required":
true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false,
"description": "The name of the timer" },
+    "period": { "kind": "parameter", "displayName": "Period", "group": "consumer", "required":
false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue":
5000, "description": "If greater than 0 generate periodic events every period milliseconds.
The default value is 1000. You can also specify time values using units such as 60s (60 seconds)
5m30s (5 minutes and 30 seconds) and 1h (1 hour)." },
+    "repeatCount": { "kind": "parameter", "displayName": "Repeat Count", "group": "consumer",
"required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false,
"defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you
set it to 1 the timer will only fire once. If you set it to 5 it will only fire five times.
A value of zero or negative means fire forever." }
+  }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/myfoo-connector/src/main/resources/camel-connector.json
----------------------------------------------------------------------
diff --git a/platforms/myfoo-connector/src/main/resources/camel-connector.json b/platforms/myfoo-connector/src/main/resources/camel-connector.json
new file mode 100644
index 0000000..116f48e
--- /dev/null
+++ b/platforms/myfoo-connector/src/main/resources/camel-connector.json
@@ -0,0 +1,21 @@
+{
+  "baseScheme": "timer",
+  "baseGroupId": "org.apache.camel",
+  "baseArtifactId": "camel-core",
+  "baseVersion": "2.19.0-SNAPSHOT",
+  "baseJavaType": "org.apache.camel.component.timer.TimerComponent",
+  "name": "MyFoo",
+  "scheme": "my-foo",
+  "javaType": "org.myfoo.connector.MyFooComponent",
+  "groupId": "org.myfoo",
+  "artifactId": "myfoo-connector",
+  "version": "2.19.0-SNAPSHOT",
+  "description": "Something cool",
+  "labels": [ "foo", "timer" ],
+  "pattern": "From",
+  "endpointOptions": [ "timerName", "period", "repeatCount" ],
+  "endpointValues": {
+    "fixedRate": true,
+    "period": 5000
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8d4a41f8/platforms/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/pom.xml b/platforms/pom.xml
index 7aa34b9..245768c 100644
--- a/platforms/pom.xml
+++ b/platforms/pom.xml
@@ -35,8 +35,9 @@
     <module>commands</module>
     <module>karaf</module>
     <module>spring-boot</module>
-    <!-- dummy used for testing catalog -->
+    <!-- dummy/myfoo used for testing catalog -->
     <module>dummy-component</module>
+    <module>myfoo-connector</module>
     <!-- run catalog last -->
     <module>catalog</module>
     <module>catalog-provider-karaf</module>


Mime
View raw message