package com.boundary.sdk;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Route builder that receives SNMP messages into {@link RawEvent}
 * and then sends to Boundary event route.
 * 
 * @author davidg
 *
 */
public class SNMPRoute extends UDPRouterBuilder {
	
	private static Logger LOG = LoggerFactory.getLogger(SNMPRoute.class);
	
	private final int DEFAULT_SNMP_PORT=162;
	
	private String mibRepositoryPath;

	public SNMPRoute() {
		this.port = DEFAULT_SNMP_PORT;
		this.mibRepositoryPath="";
	}
	
	/**
	 * Sets the path to the directory
	 * to the compiled MIBs.
	 * 
	 * @param path
	 */
	public void setMibRepository(String path) {
		this.mibRepositoryPath = path;
	}
	
	/**
	 * Returns the currently configured path
	 * to the compiled MIBs
	 * @return
	 */
	public String getMibRepository() {
		return this.mibRepositoryPath;
	}
	
	/**
	 * Configuration for the SNMP route 
	 */
	@Override
	public void configure() {
		// TBD, verify if I have to provide host property
		// TBD, Should the trap listener be bound to port 0.0.0.0??
		// TBD, Support of TCP??
		String uri = "snmp:127.0.0.1:" + this.port + "?protocol=udp&type=TRAP";
		from(uri)
		.routeId(this.routeId)
		.to("log:" + this.getClass().toString() + "?level=INFO&showBody=true&showHeaders=true")
		.process(new SNMPToEventProcessor())
		.marshal().serialization()
		.to(toUri)
		;
	}
}

@@ -425,16 +425,75 @@
 ryPath;%0A
+%09private String license;%0A%0A%09/**%0A%09 * Default constructor%0A%09 */
 %0A%09public
@@ -569,16 +569,37 @@
 ath=%22%22;%0A
+%09%09this.license = %22%22;%0A
 %09%7D%0A%09%0A%09/*
@@ -934,24 +934,311 @@
 ;%0A%09%7D%0A%09%0A%09/**%0A
+%09 * Sets the SNMP4J-SMI license key%0A%09 * %0A%09 * @param license%0A%09 */%0A%09public void setLicense(String license) %7B%0A%09%09this.license = license;%0A%09%7D%0A%09%0A%09/**%0A%09 * Returns the current value ofthe SNMP4J-SMI license key%0A%09 * %0A%09 * @return%0A%09 */%0A%09public String getLicense() %7B%0A%09%09return this.license;%0A%09%7D%0A%09%0A%09/**%0A
 %09 * Configur
@@ -1684,16 +1684,33 @@
 ocessor(
+mibRepositoryPath
 ))%0A%09%09.ma

Add properties to configure MIB lookup