try {
return clazz.getMethod(methodName, Invocation.class);
} catch (SecurityException e) {
+ LOG.debug("Catched SecurityException", e);
} catch (NoSuchMethodException e) {
+ LOG.debug("Catched NoSuchMethodException", e);
}
return findMethod(clazz.getSuperclass());
try {
return currentBuilder();
} catch (IllegalStateException e) {
+ LOG.debug("Catched IllegalStateException", e);
return null;
}
}
import org.jmock.api.Action;
import org.jmock.api.Invocation;
import org.junit.Assert;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public abstract class BaseTestCase extends BaseExpectations {
+ protected static final Logger LOG = LoggerFactory.getLogger(BaseTestCase.class);
+
protected InetAddress asInet(int intValue) {
try {
return InetAddress.getByAddress(ByteBuffer.allocate(4).putInt(intValue).array());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ByteBuffer.allocate(4).putInt(intValue).array(), e);
fail("");
}
return null;
field.set(testedObject, fieldData.value);
return fieldData.value;
} catch (Exception e) {
+ LOG.debug("Caught generic exception", e);
fail(e.getMessage());
}
}
authenticationLength = Mac.getInstance(algorithm).getMacLength();
tempAuthenticationData = new byte[authenticationLength];
} catch (NoSuchAlgorithmException e) {
- LOG.warn("No such MAC algorithm" + algorithm);
+ LOG.warn("No such MAC algorithm {}", algorithm, e);
}
}
return mac.doFinal(data);
} catch (InvalidKeyException e) {
- LOG.warn("Invalid password" + key);
+ LOG.warn("Invalid password {}", key, e);
} catch (NoSuchAlgorithmException e) {
- LOG.warn("No such MAC algorithm" + algorithm);
+ LOG.warn("No such MAC algorithm {}", algorithm, e);
}
return null;
}
}
}
} catch (SocketException se) {
+ LOG.debug("Caught socket exceptio", se);
}
return null;
}
submitFuture.checkedGet();
ret = true;
} catch (TransactionCommitFailedException e) {
- LOG.error("{} : {}", errMsg, e.getMessage());
+ LOG.error(errMsg, e);
ret = false;
}
return ret;
submitFuture.checkedGet();
ret = true;
} catch (TransactionCommitFailedException e) {
- LOG.error("{} : {}", errMsg, e.getMessage());
+ LOG.error(errMsg, e);
ret = false;
}
return ret;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class LispNotificationHelper {
+ protected static final Logger LOG = LoggerFactory.getLogger(LispNotificationHelper.class);
+
// Utility class, should not be instantiated
private LispNotificationHelper() {
}
InetAddress address = InetAddress.getByName(IPAddress);
return address;
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", IPAddress, e);
return null;
}
}
builder.setMapReply(new org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.MapReplyBuilder().setMappingRecord(
MappingRecordSerializer.getInstance().deserialize(requestBuffer)).build()).build();
} catch (RuntimeException re) {
- LOG.warn("couldn't deserialize map reply encapsulated in map request. {}", re.getMessage());
+ LOG.warn("Couldn't deserialize Map-Reply encapsulated in Map-Request", re);
}
}
return builder.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Lorand Jakab
*/
public final class Ipv4PrefixSerializer extends LispAddressSerializer {
+ protected static final Logger LOG = LoggerFactory.getLogger(Ipv4PrefixSerializer.class);
+
private static final Ipv4PrefixSerializer INSTANCE = new Ipv4PrefixSerializer();
// Private constructor prevents instantiation from other classes
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
- Ipv4Prefix address = (Ipv4Prefix) lispAddress.getAddress();
+ Ipv4Prefix prefix = (Ipv4Prefix) lispAddress.getAddress();
+ String address = MaskUtil.getAddressStringForIpv4Prefix(prefix);
try {
- buffer.put(Inet4Address.getByName(MaskUtil.getAddressStringForIpv4Prefix(address)).getAddress());
+ buffer.put(Inet4Address.getByName(address).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", address, e);
}
}
try {
address = InetAddress.getByAddress(ipBuffer);
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ipBuffer, e);
}
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix(
address.getHostAddress() + "/" + ctx.getMaskLen());
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Lorand Jakab
*/
public final class Ipv4Serializer extends LispAddressSerializer {
+ protected static final Logger LOG = LoggerFactory.getLogger(Ipv4Serializer.class);
+
private static final Ipv4Serializer INSTANCE = new Ipv4Serializer();
// Private constructor prevents instantiation from other classes
try {
buffer.put(Inet4Address.getByName(address.getIpv4().getValue()).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", address.getIpv4().getValue(), e);
}
}
try {
buffer.put(Inet4Address.getByName(address.getIpAddress().getIpv4Address().getValue()).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", address.getIpAddress().getIpv4Address().getValue(), e);
}
}
try {
address = InetAddress.getByAddress(ipBuffer);
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ipBuffer, e);
}
return new Ipv4Address(address.getHostAddress());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Lorand Jakab
*/
public final class Ipv6PrefixSerializer extends LispAddressSerializer {
+ protected static final Logger LOG = LoggerFactory.getLogger(Ipv6PrefixSerializer.class);
+
private static final Ipv6PrefixSerializer INSTANCE = new Ipv6PrefixSerializer();
// Private constructor prevents instantiation from other classes
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
- Ipv6Prefix address = (Ipv6Prefix) lispAddress.getAddress();
+ Ipv6Prefix prefix = (Ipv6Prefix) lispAddress.getAddress();
+ String address = MaskUtil.getAddressStringForIpv6Prefix(prefix);
try {
- buffer.put(Inet6Address.getByName(MaskUtil.getAddressStringForIpv6Prefix(address)).getAddress());
+ buffer.put(Inet6Address.getByName(address).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", address, e);
}
}
try {
buffer.put(Inet6Address.getByName(prefix.getIpv6Prefix().getValue()).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", prefix.getIpv6Prefix().getValue(), e);
}
}
try {
address = InetAddress.getByAddress(ipBuffer);
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ipBuffer, e);
}
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix(
address.getHostAddress() + "/" + ctx.getMaskLen());
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Lorand Jakab
*/
public final class Ipv6Serializer extends LispAddressSerializer {
+ protected static final Logger LOG = LoggerFactory.getLogger(Ipv6Serializer.class);
+
private static final Ipv6Serializer INSTANCE = new Ipv6Serializer();
// Private constructor prevents instantiation from other classes
try {
buffer.put(Inet6Address.getByName(address.getIpv6().getValue()).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", address.getIpv6().getValue(), e);
}
}
try {
buffer.put(Inet6Address.getByName(address.getIpAddress().getIpv6Address().getValue()).getAddress());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", address.getIpAddress().getIpv6Address().getValue(), e);
}
}
try {
address = InetAddress.getByAddress(ipBuffer);
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ipBuffer, e);
}
return new Ipv6Address(address.getHostAddress());
}
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop.LrsBits;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.HopBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class LispAddressUtil {
+ protected static final Logger LOG = LoggerFactory.getLogger(LispAddressUtil.class);
+
private static Pattern IP4_PATTERN = null;
private static Pattern IP6_PATTERN = null;
private static final String ip4Pattern = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])";
IP4_PATTERN = Pattern.compile(ip4Pattern, Pattern.CASE_INSENSITIVE);
IP6_PATTERN = Pattern.compile(ip6Pattern, Pattern.CASE_INSENSITIVE);
} catch (PatternSyntaxException e) {
+ LOG.debug("Caught pattern syntax exception", e);
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestnotification.MapRequestBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class MapRequestUtil {
+ protected static final Logger LOG = LoggerFactory.getLogger(MapRequestUtil.class);
+
// Utility class, should not be instantiated
private MapRequestUtil() {
}
try {
selectedItrRloc = InetAddress.getByName(((Ipv4) addr).getIpv4().getValue());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ((Ipv4) addr).getIpv4().getValue(), e);
}
break;
}
try {
selectedItrRloc = InetAddress.getByName(((Ipv6) addr).getIpv6().getValue());
} catch (UnknownHostException e) {
+ LOG.debug("Unknown host {}", ((Ipv6) addr).getIpv6().getValue(), e);
}
break;
}
threadSocket.receive(packet);
LOG.trace("Received a packet!");
} catch (SocketTimeoutException ste) {
+ LOG.trace("Timed out waiting on socket", ste);
continue;
} catch (IOException e) {
LOG.warn("IO Exception while trying to recieve packet", e);