You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/09/23 11:43:47 UTC
svn commit: r818024 - in /camel/trunk: apache-camel/
apache-camel/src/main/descriptors/ components/ components/camel-snmp/
components/camel-snmp/src/ components/camel-snmp/src/main/
components/camel-snmp/src/main/java/ components/camel-snmp/src/main/ja...
Author: davsclaus
Date: Wed Sep 23 09:43:45 2009
New Revision: 818024
URL: http://svn.apache.org/viewvc?rev=818024&view=rev
Log:
CAMEL-2035: Added new component camel-snmp. Thanks to Lars Heinemann for the contribution.
Added:
camel/trunk/components/camel-snmp/
camel/trunk/components/camel-snmp/pom.xml (with props)
camel/trunk/components/camel-snmp/src/
camel/trunk/components/camel-snmp/src/main/
camel/trunk/components/camel-snmp/src/main/java/
camel/trunk/components/camel-snmp/src/main/java/org/
camel/trunk/components/camel-snmp/src/main/java/org/apache/
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java (with props)
camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java (with props)
camel/trunk/components/camel-snmp/src/main/resources/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt (with props)
camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt (with props)
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/component/
camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/component/snmp
camel/trunk/components/camel-snmp/src/test/
camel/trunk/components/camel-snmp/src/test/java/
camel/trunk/components/camel-snmp/src/test/java/org/
camel/trunk/components/camel-snmp/src/test/java/org/apache/
camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/
camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/
camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/
camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java (with props)
camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java (with props)
camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java (with props)
camel/trunk/components/camel-snmp/src/test/resources/
camel/trunk/components/camel-snmp/src/test/resources/log4j.properties (with props)
Modified:
camel/trunk/apache-camel/pom.xml
camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
camel/trunk/components/pom.xml
camel/trunk/parent/pom.xml
camel/trunk/platforms/karaf/features/pom.xml
camel/trunk/platforms/karaf/features/src/main/resources/bundles.properties
camel/trunk/platforms/karaf/features/src/main/resources/features.xml
Modified: camel/trunk/apache-camel/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/pom.xml?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/apache-camel/pom.xml (original)
+++ camel/trunk/apache-camel/pom.xml Wed Sep 23 09:43:45 2009
@@ -216,6 +216,10 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-snmp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
</dependency>
<dependency>
Modified: camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/src/main/descriptors/common-bin.xml?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/apache-camel/src/main/descriptors/common-bin.xml (original)
+++ camel/trunk/apache-camel/src/main/descriptors/common-bin.xml Wed Sep 23 09:43:45 2009
@@ -76,6 +76,7 @@
<include>org.apache.camel:camel-scala</include>
<include>org.apache.camel:camel-script</include>
<include>org.apache.camel:camel-servlet</include>
+ <include>org.apache.camel:camel-snmp</include>
<include>org.apache.camel:camel-spring</include>
<include>org.apache.camel:camel-spring-integration</include>
<include>org.apache.camel:camel-sql</include>
Added: camel/trunk/components/camel-snmp/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/pom.xml?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/pom.xml (added)
+++ camel/trunk/components/camel-snmp/pom.xml Wed Sep 23 09:43:45 2009
@@ -0,0 +1,72 @@
+<?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>camel-parent</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-snmp</artifactId>
+ <packaging>bundle</packaging>
+ <name>Camel :: SNMP</name>
+ <description>Camel SNMP support</description>
+
+ <properties>
+ <camel.osgi.export.pkg>org.apache.camel.component.snmp.*</camel.osgi.export.pkg>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.snmp4j</artifactId>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test</artifactId>
+ <optional>true</optional>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Propchange: camel/trunk/components/camel-snmp/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-snmp/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,25 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import java.util.LinkedList;
+
+import org.snmp4j.smi.OID;
+
+public class OIDList extends LinkedList<OID> {
+ private static final long serialVersionUID = -4944963695232274481L;
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDList.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,46 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import java.beans.PropertyEditorSupport;
+import java.util.StringTokenizer;
+
+import org.snmp4j.smi.OID;
+
+public class OIDListEditor extends PropertyEditorSupport {
+
+ @Override
+ public void setAsText(String text) throws IllegalArgumentException {
+ OIDList list = new OIDList();
+ if (text.indexOf(",") != -1) {
+ // seems to be a comma separated oid list
+ StringTokenizer strTok = new StringTokenizer(text, ",");
+ while (strTok.hasMoreTokens()) {
+ String tok = strTok.nextToken();
+ if (tok != null && tok.trim().length() > 0) {
+ list.add(new OID(tok.trim()));
+ } else {
+ // empty token - skip
+ }
+ }
+ } else {
+ // maybe a single oid
+ list.add(new OID(text.trim()));
+ }
+ setValue(list);
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/OIDListEditor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,21 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+public enum SnmpActionType {
+ TRAP, POLL
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpActionType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,38 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+
+/**
+ * Represents the component that manages {@link SnmpEndpoint}. It holds the list
+ * of named direct endpoints.
+ */
+public class SnmpComponent extends DefaultComponent {
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+ SnmpEndpoint endpoint = new SnmpEndpoint(uri, this);
+ setProperties(endpoint, parameters);
+ endpoint.initiate();
+ return endpoint;
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,76 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import org.apache.camel.Converter;
+import org.snmp4j.PDU;
+import org.snmp4j.smi.VariableBinding;
+
+@Converter
+public final class SnmpConverters {
+ public static final String SNMP_TAG = "snmp";
+ public static final String ENTRY_TAG = "entry";
+ public static final String OID_TAG = "oid";
+ public static final String VALUE_TAG = "value";
+
+ private static final String SNMP_TAG_OPEN = '<' + SNMP_TAG + '>';
+ private static final String SNMP_TAG_CLOSE = "</" + SNMP_TAG + '>';
+ private static final String ENTRY_TAG_OPEN = '<' + ENTRY_TAG + '>';
+ private static final String ENTRY_TAG_CLOSE = "</" + ENTRY_TAG + '>';
+ private static final String OID_TAG_OPEN = '<' + OID_TAG + '>';
+ private static final String OID_TAG_CLOSE = "</" + OID_TAG + '>';
+ private static final String VALUE_TAG_OPEN = '<' + VALUE_TAG + '>';
+ private static final String VALUE_TAG_CLOSE = "</" + VALUE_TAG + '>';
+
+ private SnmpConverters() {
+ //Utility Class
+ }
+
+ /**
+ * Converts the given snmp pdu to a String body.
+ *
+ * @param pdu the snmp pdu
+ * @return the text content
+ */
+ @Converter
+ public static String toString(PDU pdu) {
+ // the output buffer
+ StringBuffer sb = new StringBuffer();
+
+ // prepare the header
+ sb.append(SNMP_TAG_OPEN);
+
+ // now loop all variables of the response
+ for (Object o : pdu.getVariableBindings()) {
+ VariableBinding b = (VariableBinding)o;
+
+ sb.append(ENTRY_TAG_OPEN);
+ sb.append(OID_TAG_OPEN);
+ sb.append(b.getOid().toString());
+ sb.append(OID_TAG_CLOSE);
+ sb.append(VALUE_TAG_OPEN);
+ sb.append(b.getVariable().toString());
+ sb.append(VALUE_TAG_CLOSE);
+ sb.append(ENTRY_TAG_CLOSE);
+ }
+
+ // prepare the footer
+ sb.append(SNMP_TAG_CLOSE);
+
+ return sb.toString();
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpConverters.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,210 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import java.net.URI;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.impl.DefaultExchange;
+import org.apache.camel.impl.DefaultPollingEndpoint;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.snmp4j.PDU;
+import org.snmp4j.mp.SnmpConstants;
+
+public class SnmpEndpoint extends DefaultPollingEndpoint {
+
+ public static final String DEFAULT_COMMUNITY = "public";
+ public static final int DEFAULT_SNMP_VERSION = SnmpConstants.version1;
+ public static final int DEFAULT_SNMP_RETRIES = 2;
+ public static final int DEFAULT_SNMP_TIMEOUT = 1500;
+
+ private static final Log LOG = LogFactory.getLog(SnmpEndpoint.class);
+
+ private OIDList oids = new OIDList();
+ private String address;
+ private String protocol;
+ private int retries = DEFAULT_SNMP_RETRIES;
+ private int timeout = DEFAULT_SNMP_TIMEOUT;
+ private int snmpVersion = DEFAULT_SNMP_VERSION;
+ private String snmpCommunity = DEFAULT_COMMUNITY;
+ private SnmpActionType type;
+ private int delay = 60;
+
+ /**
+ * creates a snmp endpoint
+ *
+ * @param uri the endpoint uri
+ * @param component the component
+ */
+ public SnmpEndpoint(String uri, SnmpComponent component) {
+ super(uri, component);
+ }
+
+ public Consumer createConsumer(Processor processor) throws Exception {
+ if (this.type == SnmpActionType.TRAP) {
+ return new SnmpTrapConsumer(this, processor);
+ } else if (this.type == SnmpActionType.POLL) {
+ return new SnmpOIDPoller(this, processor);
+ } else {
+ throw new IllegalArgumentException("The type '" + this.type + "' is not valid!");
+ }
+ }
+
+ public Producer createProducer() throws Exception {
+ throw new UnsupportedOperationException("SnmpProducer is not implemented");
+ }
+
+ public boolean isSingleton() {
+ return true;
+ }
+
+ /**
+ * creates an exchange for the given message
+ *
+ * @param pdu the pdu
+ * @return an exchange
+ */
+ public Exchange createExchange(PDU pdu) {
+ return createExchange(getExchangePattern(), pdu);
+ }
+
+ /**
+ * creates an exchange for the given pattern and message
+ *
+ * @param pattern the message exchange pattern
+ * @param pdu the pdu
+ * @return the exchange
+ */
+ private Exchange createExchange(ExchangePattern pattern, PDU pdu) {
+ Exchange exchange = new DefaultExchange(this, pattern);
+ exchange.setIn(new SnmpMessage(pdu));
+ return exchange;
+ }
+
+ /**
+ * creates and configures the endpoint
+ *
+ * @throws Exception if unable to setup connection
+ */
+ public void initiate() throws Exception {
+ URI uri = URI.create(getEndpointUri());
+ String host = uri.getHost();
+ int port = uri.getPort();
+ if (host == null || host.trim().length() < 1) {
+ host = "127.0.0.1";
+ }
+ if (port == -1) {
+ if (getType() == SnmpActionType.POLL) {
+ port = 161; // default snmp poll port
+ } else {
+ port = 162; // default trap port
+ }
+ }
+
+
+ // set the address
+ String address = String.format("%s:%s/%d", getProtocol(), host, port);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Using snmp address " + address);
+ }
+ setAddress(address);
+ }
+
+ public int getDelay() {
+ return delay;
+ }
+
+ /**
+ * Sets update rate in seconds
+ *
+ * @param updateEvery the update rate in seconds
+ */
+ public void setDelay(int updateEvery) {
+ this.delay = updateEvery;
+ }
+
+ public SnmpActionType getType() {
+ return this.type;
+ }
+
+ public void setType(SnmpActionType type) {
+ this.type = type;
+ }
+
+ public OIDList getOids() {
+ return this.oids;
+ }
+
+ public void setOids(OIDList oids) {
+ this.oids = oids;
+ }
+
+ public String getAddress() {
+ return this.address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public int getRetries() {
+ return this.retries;
+ }
+
+ public void setRetries(int retries) {
+ this.retries = retries;
+ }
+
+ public int getTimeout() {
+ return this.timeout;
+ }
+
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+
+ public int getSnmpVersion() {
+ return this.snmpVersion;
+ }
+
+ public void setSnmpVersion(int snmpVersion) {
+ this.snmpVersion = snmpVersion;
+ }
+
+ public String getSnmpCommunity() {
+ return this.snmpCommunity;
+ }
+
+ public void setSnmpCommunity(String snmpCommunity) {
+ this.snmpCommunity = snmpCommunity;
+ }
+
+ public String getProtocol() {
+ return this.protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,61 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import org.apache.camel.impl.DefaultMessage;
+import org.snmp4j.PDU;
+
+public class SnmpMessage extends DefaultMessage {
+ private PDU pdu;
+
+ public SnmpMessage() {
+ this(new PDU());
+ }
+
+ public SnmpMessage(PDU pdu) {
+ this.pdu = pdu;
+ }
+
+ @Override
+ public String toString() {
+ if (pdu != null) {
+ return "SnmpMessage: " + SnmpConverters.toString(pdu);
+ } else {
+ return "SnmpMessage: " + getBody();
+ }
+ }
+
+ /**
+ * Returns the underlying SNMP message
+ */
+ public PDU getSnmpMessage() {
+ return this.pdu;
+ }
+
+ @Override
+ public SnmpMessage newInstance() {
+ return new SnmpMessage();
+ }
+
+ @Override
+ protected Object createBody() {
+ if (this.pdu != null) {
+ return SnmpConverters.toString(this.pdu);
+ }
+ return null;
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpMessage.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,156 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.snmp4j.CommunityTarget;
+import org.snmp4j.PDU;
+import org.snmp4j.Snmp;
+import org.snmp4j.TransportMapping;
+import org.snmp4j.event.ResponseEvent;
+import org.snmp4j.event.ResponseListener;
+import org.snmp4j.mp.MPv3;
+import org.snmp4j.security.SecurityModels;
+import org.snmp4j.security.SecurityProtocols;
+import org.snmp4j.security.USM;
+import org.snmp4j.smi.Address;
+import org.snmp4j.smi.GenericAddress;
+import org.snmp4j.smi.OID;
+import org.snmp4j.smi.OctetString;
+import org.snmp4j.smi.VariableBinding;
+import org.snmp4j.transport.DefaultUdpTransportMapping;
+
+public class SnmpOIDPoller extends ScheduledPollConsumer implements ResponseListener {
+
+ private static final transient Log LOG = LogFactory.getLog(SnmpOIDPoller.class);
+
+ private Address targetAddress;
+ private TransportMapping transport;
+ private Snmp snmp;
+ private USM usm;
+ private CommunityTarget target;
+ private PDU pdu;
+ private SnmpEndpoint endpoint;
+
+ public SnmpOIDPoller(SnmpEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ this.endpoint = endpoint;
+ // convert delay from seconds to millis
+ setDelay(endpoint.getDelay() * 1000);
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ LOG.debug("Activating oid poller");
+ this.targetAddress = GenericAddress.parse(this.endpoint.getAddress());
+ this.transport = new DefaultUdpTransportMapping();
+ this.snmp = new Snmp(this.transport);
+ this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
+ SecurityModels.getInstance().addSecurityModel(usm);
+
+ // setting up target
+ target = new CommunityTarget();
+ target.setCommunity(new OctetString(this.endpoint.getSnmpCommunity()));
+ target.setAddress(targetAddress);
+ target.setRetries(this.endpoint.getRetries());
+ target.setTimeout(this.endpoint.getTimeout());
+ target.setVersion(this.endpoint.getSnmpVersion());
+
+ // creating PDU
+ this.pdu = new PDU();
+ // listen to the transport
+ this.transport.listen();
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ // stop listening to the transport
+ if (this.transport.isListening()) {
+ this.transport.close();
+ }
+
+ super.doStop();
+ }
+
+ @Override
+ protected void poll() throws Exception {
+ this.pdu.clear();
+ this.pdu.setType(PDU.GET);
+
+ // prepare the request items
+ for (OID oid : this.endpoint.getOids()) {
+ this.pdu.add(new VariableBinding(oid));
+ }
+
+ // send the request
+ snmp.send(pdu, target, null, this);
+ }
+
+ public void onResponse(ResponseEvent event) {
+ // Always cancel async request when response has been received
+ // otherwise a memory leak is created! Not canceling a request
+ // immediately can be useful when sending a request to a broadcast
+ // address.
+ ((Snmp)event.getSource()).cancel(event.getRequest(), this);
+
+ // check for valid response
+ if (event.getRequest() == null || event.getResponse() == null) {
+ // ignore null requests/responses
+ LOG.debug("Received invalid snmp event. Request: " + event.getRequest() + " / Response: " + event.getResponse());
+ return;
+ }
+
+ PDU pdu = event.getResponse();
+ processPDU(pdu);
+ }
+
+ /**
+ * processes the pdu message
+ *
+ * @param pdu the pdu
+ */
+ public void processPDU(PDU pdu) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Received response event for " + this.endpoint.getAddress() + " : " + pdu);
+ }
+ Exchange exchange = endpoint.createExchange(pdu);
+ try {
+ getProcessor().process(exchange);
+ } catch (Exception ex) {
+ exchange.setException(ex);
+ }
+ }
+
+ /** * @return Returns the target.
+ */
+ public CommunityTarget getTarget() {
+ return this.target;
+ }
+
+ /**
+ * @param target The target to set.
+ */
+ public void setTarget(CommunityTarget target) {
+ this.target = target;
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java (added)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,99 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.snmp4j.CommandResponder;
+import org.snmp4j.CommandResponderEvent;
+import org.snmp4j.PDU;
+import org.snmp4j.Snmp;
+import org.snmp4j.TransportMapping;
+import org.snmp4j.smi.Address;
+import org.snmp4j.smi.GenericAddress;
+import org.snmp4j.smi.UdpAddress;
+import org.snmp4j.transport.DefaultUdpTransportMapping;
+
+public class SnmpTrapConsumer extends DefaultConsumer implements CommandResponder {
+
+ private static final Log LOG = LogFactory.getLog(SnmpTrapConsumer.class);
+
+ private SnmpEndpoint endpoint;
+ private Address listenGenericAddress;
+ private Snmp snmp;
+ private TransportMapping transport;
+
+ public SnmpTrapConsumer(SnmpEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ this.endpoint = endpoint;
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ // load connection data only if the endpoint is enabled
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Starting trap consumer on " + this.endpoint.getAddress());
+ }
+ this.listenGenericAddress = GenericAddress.parse(this.endpoint.getAddress());
+ this.transport = new DefaultUdpTransportMapping((UdpAddress)this.listenGenericAddress);
+ this.snmp = new Snmp(transport);
+ this.snmp.addCommandResponder(this);
+
+ // listen to the transport
+ this.transport.listen();
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ // stop listening to the transport
+ if (this.transport != null && this.transport.isListening()) {
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Stopping trap consumer on " + this.endpoint.getAddress());
+ }
+ this.transport.close();
+ }
+
+ super.doStop();
+ }
+
+ public void processPdu(CommandResponderEvent event) {
+ PDU pdu = event.getPDU();
+ // check PDU not null
+ if (pdu != null) {
+ processPDU(pdu);
+ } else {
+ LOG.debug("Received invalid trap PDU: " + pdu);
+ }
+ }
+
+ public void processPDU(PDU pdu) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Received trap event for " + this.endpoint.getAddress() + " : " + pdu);
+ }
+ Exchange exchange = endpoint.createExchange(pdu);
+ try {
+ getProcessor().process(exchange);
+ } catch (Exception ex) {
+ exchange.setException(ex);
+ }
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt (added)
+++ camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt Wed Sep 23 09:43:45 2009
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
Propchange: camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt (added)
+++ camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt Wed Sep 23 09:43:45 2009
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
Propchange: camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/main/resources/META-INF/NOTICE.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/TypeConverter?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/TypeConverter (added)
+++ camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/TypeConverter Wed Sep 23 09:43:45 2009
@@ -0,0 +1 @@
+org.apache.camel.component.snmp
Added: camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/component/snmp
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/component/snmp?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/component/snmp (added)
+++ camel/trunk/components/camel-snmp/src/main/resources/META-INF/services/org/apache/camel/component/snmp Wed Sep 23 09:43:45 2009
@@ -0,0 +1,17 @@
+#
+# 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.apache.camel.component.snmp.SnmpComponent
Added: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java (added)
+++ camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,58 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import java.util.List;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class PollOIDTest extends CamelTestSupport {
+ private static final transient Log LOG = LogFactory.getLog(PollOIDTest.class);
+
+ // a disabled test... before enabling you must fill in a working IP, Port
+ // and maybe oids in the route below
+ @Ignore
+ @Test
+ public void testOIDPolling() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMinimumMessageCount(1);
+ mock.assertIsSatisfied();
+ List<Exchange> oids = mock.getExchanges();
+ if (LOG.isInfoEnabled()) {
+ for (Exchange e : oids) {
+ LOG.info("OID: " + e.getIn().getBody(String.class));
+ }
+ }
+ }
+
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ public void configure() {
+ // START SNIPPET: e1
+ from("snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0").transform(body().convertToString()).to("mock:result");
+ // END SNIPPET: e1
+ }
+ };
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java (added)
+++ camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,58 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import java.util.List;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class TrapReceiveTest extends CamelTestSupport {
+ private static final transient Log LOG = LogFactory.getLog(TrapReceiveTest.class);
+
+ // a disabled test... before enabling you must fill in a working IP, Port
+ // and maybe oids in the route below
+ @Ignore
+ @Test
+ public void testReceiveTraps() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMinimumMessageCount(1);
+ mock.assertIsSatisfied();
+ List<Exchange> oids = mock.getExchanges();
+ if (LOG.isInfoEnabled()) {
+ for (Exchange e : oids) {
+ LOG.info("TRAP: " + e.getIn().getBody(String.class));
+ }
+ }
+ }
+
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ public void configure() {
+ // START SNIPPET: e1
+ from("snmp:0.0.0.0:1662?protocol=udp&type=TRAP").transform(body().convertToString()).to("mock:result");
+ // END SNIPPET: e1
+ }
+ };
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java (added)
+++ camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java Wed Sep 23 09:43:45 2009
@@ -0,0 +1,60 @@
+/**
+ * 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.apache.camel.component.snmp;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class UriConfigurationTest extends Assert {
+ protected CamelContext context = new DefaultCamelContext();
+
+ @Test
+ public void testTrapReceiverConfiguration() throws Exception {
+ Endpoint endpoint = context.getEndpoint("snmp:0.0.0.0:1662?protocol=udp&type=TRAP&oids=1.3.6.1.2.1.7.5.1");
+ assertTrue("Endpoint not an SnmpEndpoint: " + endpoint, endpoint instanceof SnmpEndpoint);
+ SnmpEndpoint snmpEndpoint = (SnmpEndpoint) endpoint;
+
+ Assert.assertEquals(SnmpActionType.TRAP, snmpEndpoint.getType());
+ Assert.assertEquals("1.3.6.1.2.1.7.5.1", snmpEndpoint.getOids().get(0).toString());
+ Assert.assertEquals("udp:0.0.0.0/1662", snmpEndpoint.getAddress());
+ }
+
+ @Test
+ public void testTrapReceiverWithoutPortConfiguration() throws Exception {
+ Endpoint endpoint = context.getEndpoint("snmp:0.0.0.0?protocol=udp&type=TRAP&oids=1.3.6.1.2.1.7.5.1");
+ assertTrue("Endpoint not an SnmpEndpoint: " + endpoint, endpoint instanceof SnmpEndpoint);
+ SnmpEndpoint snmpEndpoint = (SnmpEndpoint) endpoint;
+
+ Assert.assertEquals(SnmpActionType.TRAP, snmpEndpoint.getType());
+ Assert.assertEquals("1.3.6.1.2.1.7.5.1", snmpEndpoint.getOids().get(0).toString());
+ Assert.assertEquals("udp:0.0.0.0/162", snmpEndpoint.getAddress());
+ }
+
+ @Test
+ public void testOidPollerConfiguration() throws Exception {
+ Endpoint endpoint = context.getEndpoint("snmp:127.0.0.1:1662?protocol=udp&type=POLL&oids=1.3.6.1.2.1.7.5.1");
+ assertTrue("Endpoint not an SnmpEndpoint: " + endpoint, endpoint instanceof SnmpEndpoint);
+ SnmpEndpoint snmpEndpoint = (SnmpEndpoint) endpoint;
+
+ Assert.assertEquals(SnmpActionType.POLL, snmpEndpoint.getType());
+ Assert.assertEquals("1.3.6.1.2.1.7.5.1", snmpEndpoint.getOids().get(0).toString());
+ Assert.assertEquals("udp:127.0.0.1/1662", snmpEndpoint.getAddress());
+ }
+}
Propchange: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/UriConfigurationTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-snmp/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/test/resources/log4j.properties?rev=818024&view=auto
==============================================================================
--- camel/trunk/components/camel-snmp/src/test/resources/log4j.properties (added)
+++ camel/trunk/components/camel-snmp/src/test/resources/log4j.properties Wed Sep 23 09:43:45 2009
@@ -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.
+## ---------------------------------------------------------------------------
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=INFO, file
+
+log4j.logger.org.apache.camel.component.snmp=DEBUG
+log4j.logger.org.snmp4j=DEBUG
+#log4j.logger.org.apache.camel=DEBUG
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.file.file=target/camel-snmp-test.log
+log4j.appender.file.append=true
Propchange: camel/trunk/components/camel-snmp/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-snmp/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-snmp/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: camel/trunk/components/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/pom.xml?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/components/pom.xml (original)
+++ camel/trunk/components/pom.xml Wed Sep 23 09:43:45 2009
@@ -77,6 +77,8 @@
<module>camel-saxon</module>
<module>camel-scala</module>
<module>camel-script</module>
+ <module>camel-servlet</module>
+ <module>camel-snmp</module>
<module>camel-spring</module>
<module>camel-spring-integration</module>
<module>camel-spring-javaconfig</module>
@@ -92,6 +94,5 @@
<module>camel-xstream</module>
<module>camel-web</module>
<module>camel-web-standalone</module>
- <module>camel-servlet</module>
</modules>
</project>
Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Wed Sep 23 09:43:45 2009
@@ -98,6 +98,7 @@
<xerces-version>2.8.0</xerces-version>
<xalan-version>2.7.1</xalan-version>
<xmlbeans-version>2.4.0</xmlbeans-version>
+ <snmp4j-version>1.8.1_1</snmp4j-version>
<!-- OSGi bundles properties -->
<camel.osgi.import.camel.version>version="[$(version;==;${camel.osgi.version.clean}),$(version;=+;${camel.osgi.version.clean}))"</camel.osgi.import.camel.version>
@@ -382,6 +383,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-snmp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${project.version}</version>
</dependency>
@@ -966,6 +972,13 @@
<artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
<version>${javax-mail-version}</version>
</dependency>
+
+ <!-- optional SNMP4J -->
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.snmp4j</artifactId>
+ <version>${snmp4j-version}</version>
+ </dependency>
<!-- optional XStream -->
<dependency>
Modified: camel/trunk/platforms/karaf/features/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/pom.xml?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/features/pom.xml (original)
+++ camel/trunk/platforms/karaf/features/pom.xml Wed Sep 23 09:43:45 2009
@@ -89,6 +89,7 @@
<saxon-bundle-version>9.1.0.1_1</saxon-bundle-version>
<servicemix-specs-version>1.4-SNAPSHOT</servicemix-specs-version>
<servlet-api-2.5-version>2.5-20081211</servlet-api-2.5-version>
+ <snmp4j-bundle-version>1.8.1_1</snmp4j-bundle-version>
<smack-bundle-version>3.0.4_1</smack-bundle-version>
<spring-commons-collections-version>3.2.1</spring-commons-collections-version>
<spring-version>2.5.6.SEC01</spring-version>
Modified: camel/trunk/platforms/karaf/features/src/main/resources/bundles.properties
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/bundles.properties?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/features/src/main/resources/bundles.properties (original)
+++ camel/trunk/platforms/karaf/features/src/main/resources/bundles.properties Wed Sep 23 09:43:45 2009
@@ -69,6 +69,7 @@
org.apache.servicemix.bundles/org.apache.servicemix.bundles.qpid/${qpid-bundle-version}/jar
org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/${saxon-bundle-version}/jar
org.apache.servicemix.bundles/org.apache.servicemix.bundles.smack/${smack-bundle-version}/jar
+org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j/${snmp4j-bundle-version}/jar
org.apache.servicemix.bundles/org.apache.servicemix.bundles.stringtemplate/${stringtemplate-bundle-version}/jar
org.apache.servicemix.bundles/org.apache.servicemix.bundles.tagsoup/${tagsoup-bundle-version}/jar
org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity/${velocity-bundle-version}/jar
Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=818024&r1=818023&r2=818024&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/features/src/main/resources/features.xml (original)
+++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Wed Sep 23 09:43:45 2009
@@ -371,6 +371,11 @@
<bundle>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${servicemix-specs-version}</bundle>
<bundle>mvn:org.apache.camel/camel-script/${pom.version}</bundle>
</feature>
+ <feature name='camel-snmp' version='${pom.version}'>
+ <feature version='${pom.version}'>camel-core</feature>
+ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j/${snmp4j-bundle-version}</bundle>
+ <bundle>mvn:org.apache.camel/camel-snmp/${pom.version}</bundle>
+ </feature>
<feature name='camel-spring-integration' version='${pom.version}'>
<bundle>mvn:org.springframework.integration/org.springframework.integration/1.0.1.RELEASE</bundle>
<feature version='${pom.version}'>camel-spring</feature>