You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by jb...@apache.org on 2009/08/10 15:16:21 UTC
svn commit: r802782 - in
/servicemix/components/bindings/servicemix-snmp/trunk/src:
main/java/org/apache/servicemix/snmp/ test/java/org/apache/servicemix/snmp/
test/resources/
Author: jbonofre
Date: Mon Aug 10 13:16:20 2009
New Revision: 802782
URL: http://svn.apache.org/viewvc?rev=802782&view=rev
Log:
Change the listenAddress attribute to address.
Modified:
servicemix/components/bindings/servicemix-snmp/trunk/src/main/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpoint.java
servicemix/components/bindings/servicemix-snmp/trunk/src/test/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpointTest.java
servicemix/components/bindings/servicemix-snmp/trunk/src/test/resources/spring-trap-consumer.xml
Modified: servicemix/components/bindings/servicemix-snmp/trunk/src/main/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-snmp/trunk/src/main/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpoint.java?rev=802782&r1=802781&r2=802782&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-snmp/trunk/src/main/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpoint.java (original)
+++ servicemix/components/bindings/servicemix-snmp/trunk/src/main/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpoint.java Mon Aug 10 13:16:20 2009
@@ -54,7 +54,7 @@
private Snmp snmp;
private TransportMapping transport;
- private String listenAddress;
+ private String address;
private boolean enabled = DEFAULT_ENABLED_VALUE;
private SnmpMarshalerSupport marshaler = new DefaultSnmpMarshaler();
@@ -69,7 +69,7 @@
// load connection data only if the endpoint is enabled
if (isEnabled()) {
logger.debug("Activating endpoint");
- this.listenGenericAddress = GenericAddress.parse(this.listenAddress);
+ this.listenGenericAddress = GenericAddress.parse(this.address);
this.transport = new DefaultUdpTransportMapping((UdpAddress) this.listenGenericAddress);
this.snmp = new Snmp(transport);
snmp.addCommandResponder(this);
@@ -117,17 +117,17 @@
super.validate();
// check listen address not null
- if (this.listenAddress == null) {
+ if (this.address == null) {
throw new DeploymentException("The listen address attribute has to be specified!");
}
// check if address is valid
try {
- if (GenericAddress.parse(this.listenAddress) == null) {
- throw new DeploymentException("The specified address " + listenAddress + " is not valid!");
+ if (GenericAddress.parse(this.address) == null) {
+ throw new DeploymentException("The specified address " + address + " is not valid!");
}
} catch (IllegalArgumentException ex) {
- throw new DeploymentException("The specified address " + listenAddress + " is not valid!");
+ throw new DeploymentException("The specified address " + address + " is not valid!");
}
}
@@ -191,8 +191,8 @@
return this.snmp;
}
- public String getListenAddress() {
- return this.listenAddress;
+ public String getAddress() {
+ return this.address;
}
/**
@@ -228,8 +228,8 @@
* @param listenAddress
* a <code>String</code> value containing the connection details
*/
- public void setListenAddress(String listenAddress) {
- this.listenAddress = listenAddress;
+ public void setAddress(String address) {
+ this.address = address;
}
public SnmpMarshalerSupport getMarshaler() {
Modified: servicemix/components/bindings/servicemix-snmp/trunk/src/test/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-snmp/trunk/src/test/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpointTest.java?rev=802782&r1=802781&r2=802782&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-snmp/trunk/src/test/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpointTest.java (original)
+++ servicemix/components/bindings/servicemix-snmp/trunk/src/test/java/org/apache/servicemix/snmp/SnmpTrapConsumerEndpointTest.java Mon Aug 10 13:16:20 2009
@@ -47,7 +47,7 @@
private static final String VAR_BIND_UDP_LOCAL = "1.3.6.1.2.1.7.5.1";
private static final String VAR_BIND_UDP_LOCAL_ADDRESS = ".1";
private static final String VAR_BIND_UDP_LOCAL_PORT = ".2";
- private static final String listenAddress = "udp:127.0.0.1/1662";
+ private static final String address = "udp:127.0.0.1/1662";
/**
* Sets up a {@link SnmpTrapConsumerEndpoint}, sends a v1 trap
@@ -99,7 +99,7 @@
private void sendV1Trap() {
// Setting up snmp and listening address
Snmp snmp = null;
- Address listenGenericAddress = GenericAddress.parse(listenAddress);
+ Address listenGenericAddress = GenericAddress.parse(address);
try {
TransportMapping transport = new DefaultUdpTransportMapping();
snmp = new Snmp(transport);
Modified: servicemix/components/bindings/servicemix-snmp/trunk/src/test/resources/spring-trap-consumer.xml
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-snmp/trunk/src/test/resources/spring-trap-consumer.xml?rev=802782&r1=802781&r2=802782&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-snmp/trunk/src/test/resources/spring-trap-consumer.xml (original)
+++ servicemix/components/bindings/servicemix-snmp/trunk/src/test/resources/spring-trap-consumer.xml Mon Aug 10 13:16:20 2009
@@ -32,7 +32,7 @@
<snmp:trap-consumer service="test:snmp-service"
endpoint="trap-consumer"
targetService="test:receiver"
- listenAddress="udp:127.0.0.1/1662">
+ address="udp:127.0.0.1/1662">
</snmp:trap-consumer>
</snmp:endpoints>
</snmp:component>