values.add(lastValue);
boolean match = match(lastValue);
if (match && (logMatch != null)) {
- logger.debug("Match: " + logMatch + " " + value);
+ logger.trace("Match: " + logMatch + " " + value);
}
return match;
}
public Object invoke(Invocation invocation) throws Throwable {
if (logInvocation) {
- logger.debug("Invoke: returning " + lastValue);
+ logger.trace("Invoke: returning " + lastValue);
}
return lastValue;
}
import org.opendaylight.lispflowmapping.implementation.dao.ClusterDAOService;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Main application activator class for registering the dependencies and
public class Activator extends ComponentActivatorAbstractBase {
- /*
- * Logger instance
- */
- protected static final Logger logger = LoggerFactory.getLogger(Activator.class);
-
/**
* Function called when the activator starts just after some initializations
* are done by the ComponentActivatorAbstractBase.
}
void setBindingAwareBroker(BindingAwareBroker bindingAwareBroker) {
- logger.debug("BindingAwareBroker set!");
+ logger.trace("BindingAwareBroker set!");
BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
bindingAwareBroker.registerConsumer(this, bundleContext);
}
}
void setLispDao(ILispDAO dao) {
- logger.debug("LispDAO set in LispMappingService");
+ logger.trace("LispDAO set in LispMappingService");
basicInit(dao);
- logger.debug("Registering LispIpv4Address");
+ logger.trace("Registering LispIpv4Address");
lispDao.register(LispIpv4AddressInMemoryConverter.class);
- logger.debug("Registering LispIpv6Address");
+ logger.trace("Registering LispIpv6Address");
lispDao.register(LispIpv6AddressInMemoryConverter.class);
- logger.debug("Registering MappingServiceKey");
+ logger.trace("Registering MappingServiceKey");
lispDao.register(MappingServiceKeyConvertor.class);
- logger.debug("Registering MappingServiceNoMaskKey");
+ logger.trace("Registering MappingServiceNoMaskKey");
lispDao.register(MappingServiceNoMaskKeyConvertor.class);
}
void unsetLispDao(ILispDAO dao) {
- logger.debug("LispDAO was unset in LispMappingService");
+ logger.trace("LispDAO was unset in LispMappingService");
mapServer = null;
mapResolver = null;
lispDao = null;
}
public void destroy() {
- logger.debug("LISP (RFC6830) Mapping Service is destroyed!");
+ logger.info("LISP (RFC6830) Mapping Service is destroyed!");
mapResolver = null;
mapServer = null;
}
}
public void onSessionInitialized(ConsumerContext session) {
- logger.debug("Lisp Consumer session initialized!");
+ logger.info("Lisp Consumer session initialized!");
NotificationService notificationService = session.getSALService(NotificationService.class);
// notificationService.registerNotificationListener(LispNotification.class,
// this);
authenticationLength = Mac.getInstance(algorithm).getMacLength();
tempAuthenticationData = new byte[authenticationLength];
} catch (NoSuchAlgorithmException e) {
- logger.error("No such MAC algorithm" + algorithm);
+ logger.warn("No such MAC algorithm" + algorithm);
}
}
return mac.doFinal(data);
} catch (InvalidKeyException e) {
- logger.error("Invalid password" + key);
+ logger.warn("Invalid password" + key);
} catch (NoSuchAlgorithmException e) {
- logger.error("No such MAC algorithm" + algorithm);
+ logger.warn("No such MAC algorithm" + algorithm);
}
return null;
}
}
void unsetClusterContainerService(IClusterContainerServices s) {
- logger.debug("Cluster Service unset");
+ logger.trace("Cluster Service unset");
if (this.clusterContainerService == s) {
this.clusterContainerService = null;
}
@SuppressWarnings("deprecation")
private void allocateCache() {
if (this.clusterContainerService == null) {
- logger.error("un-initialized clusterContainerService, can't create cache");
+ logger.warn("un-initialized clusterContainerService, can't create cache");
return;
}
- logger.debug("Creating Cache for ClusterDAOService");
+ logger.trace("Creating Cache for ClusterDAOService");
try {
this.clusterContainerService.createCache(CACHE_NAME, EnumSet.of(IClusterServices.cacheMode.NON_TRANSACTIONAL));
} catch (CacheConfigException cce) {
- logger.error("Cache couldn't be created for ClusterDAOService - check cache mode");
+ logger.warn("Cache couldn't be created for ClusterDAOService - check cache mode");
} catch (CacheExistException cce) {
- logger.error("Cache for ClusterDAOService already exists, destroy and recreate");
+ logger.warn("Cache for ClusterDAOService already exists, destroy and recreate");
}
- logger.debug("Cache successfully created for ClusterDAOService");
+ logger.trace("Cache successfully created for ClusterDAOService");
}
@SuppressWarnings({ "unchecked", "deprecation" })
private void retrieveCache() {
if (this.clusterContainerService == null) {
- logger.error("un-initialized clusterContainerService, can't retrieve cache");
+ logger.warn("un-initialized clusterContainerService, can't retrieve cache");
return;
}
- logger.debug("Retrieving cache for ClusterDAOService");
+ logger.trace("Retrieving cache for ClusterDAOService");
typeToKeysToValues = (ConcurrentMap<Class<?>, Map<Object, Map<String, Object>>>) this.clusterContainerService.getCache(CACHE_NAME);
if (typeToKeysToValues == null) {
- logger.error("Cache couldn't be retrieved for ClusterDAOService");
+ logger.warn("Cache couldn't be retrieved for ClusterDAOService");
}
- logger.debug("Cache was successfully retrieved for ClusterDAOService");
+ logger.trace("Cache was successfully retrieved for ClusterDAOService");
}
public void getAll(IRowVisitor visitor) {
import org.opendaylight.lispflowmapping.interfaces.dao.IMappingServiceKey;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class MappingServiceKeyUtil {
- protected static final Logger logger = LoggerFactory.getLogger(MappingServiceKeyUtil.class);
-
public static IMappingServiceKey generateMappingServiceKey(LispAddressContainer lispAddressContainer, int mask) {
if (MaskUtil.isMaskable(lispAddressContainer.getAddress())) {
LispAddressContainerBuilder normalizedBuilder = new LispAddressContainerBuilder();
if (shouldAuthenticate) {
password = getPassword(eidRecord.getLispAddressContainer(), eidRecord.getMaskLength());
if (!LispAuthenticationUtil.validate(mapRegister, password)) {
- logger.debug("Authentication failed");
+ logger.warn("Authentication failed");
failed = true;
break;
}
String jsonAuthData = createAuthKeyJSON(pass, address, mask);
- logger.info("Sending this JSON to LISP server: \n" + jsonAuthData);
- logger.info("Address: " + address);
+ logger.trace("Sending this JSON to LISP server: \n" + jsonAuthData);
+ logger.trace("Address: " + address);
byte[] expectedSha = new byte[] { (byte) 146, (byte) 234, (byte) 52, (byte) 247, (byte) 186, (byte) 232, (byte) 31, (byte) 249, (byte) 87,
(byte) 73, (byte) 234, (byte) 54, (byte) 225, (byte) 160, (byte) 129, (byte) 251, (byte) 73, (byte) 53, (byte) 196, (byte) 62 };
Integer httpResponseCode = connection.getResponseCode();
if (httpResponseCode > 299) {
- logger.info("HTTP Address: " + url);
- logger.info("HTTP Response Code: " + httpResponseCode);
+ logger.trace("HTTP Address: " + url);
+ logger.trace("HTTP Response Code: " + httpResponseCode);
fail();
}
try {
DatagramPacket packet = new DatagramPacket(bytesToSend, bytesToSend.length);
initPacketAddress(packet);
- logger.info("Sending MapRegister to LispPlugin on socket");
+ logger.trace("Sending MapRegister to LispPlugin on socket");
socket.send(packet);
} catch (Throwable t) {
fail();
try {
byte[] buffer = new byte[4096];
DatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length);
- logger.info("Waiting for packet from socket...");
+ logger.trace("Waiting for packet from socket...");
socket.setSoTimeout(timeout);
socket.receive(receivePacket);
- logger.info("Recieved packet from socket!");
+ logger.trace("Recieved packet from socket!");
return receivePacket;
} catch (SocketTimeoutException ste) {
throw ste;
Bundle b[] = bc.getBundles();
for (Bundle element : b) {
int state = element.getState();
- logger.debug("Bundle[" + element.getBundleId() + "]:" + element.getSymbolicName() + ",v" + element.getVersion() + ", state:"
+ logger.trace("Bundle[" + element.getBundleId() + "]:" + element.getSymbolicName() + ",v" + element.getVersion() + ", state:"
+ stateToString(state));
if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
- logger.debug("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
+ logger.trace("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
try {
String host = element.getHeaders().get(Constants.FRAGMENT_HOST);
// BundleContext
/*
* for (ServiceReference sr : bc.getAllServiceReferences(null, null)) {
- * logger.info(sr.getBundle().getSymbolicName());
- * logger.info(sr.toString()); }
+ * logger.trace(sr.getBundle().getSymbolicName());
+ * logger.trace(sr.toString()); }
*/
}
import org.apache.felix.dm.Component;
import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Main application activator class for registering the dependencies and
public class Activator extends ComponentActivatorAbstractBase {
- /*
- * Logger instance
- */
- protected static final Logger logger = LoggerFactory.getLogger(Activator.class);
-
/**
* Function called when the activator starts just after some initializations
* are done by the ComponentActivatorAbstractBase.
}
void setFlowMappingService(IFlowMapping mappingService) {
- logger.debug("FlowMapping set in LispNorthbound");
+ logger.trace("FlowMapping set in LispNorthbound");
this.mappingService = mappingService;
}
void unsetFlowMappingService(IFlowMapping mappingService) {
- logger.debug("LispDAO was unset in LISP Northbound");
+ logger.trace("LispDAO was unset in LISP Northbound");
this.mappingService = null;
}
public void init() {
- logger.debug("LISP Northbound Service is initialized!");
+ logger.trace("LISP Northbound Service is initialized!");
}
public void start() {
}
public void destroy() {
- logger.debug("LISP Northbound Service is destroyed!");
+ logger.trace("LISP Northbound Service is destroyed!");
mappingService = null;
}
socket = new DatagramSocket(new InetSocketAddress(bindingAddress, lispPortNumber));
socket.setSoTimeout(lispReceiveTimeout);
} catch (SocketException e) {
- logger.warn("Cannot open socket on UDP port " + lispPortNumber, e);
+ logger.error("Cannot open socket on UDP port " + lispPortNumber, e);
return;
}
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
try {
socket.receive(packet);
- logger.debug("Received a packet!");
+ logger.trace("Received a packet!");
} catch (SocketTimeoutException ste) {
continue;
} catch (IOException e) {
- logger.error("IO Exception while trying to recieve packet", e);
+ logger.warn("IO Exception while trying to recieve packet", e);
}
- logger.debug(String.format("Handling packet from {%s}:{%d} (len={%d})", packet.getAddress().getHostAddress(), packet.getPort(),
+ logger.trace(String.format("Handling packet from {%s}:{%d} (len={%d})", packet.getAddress().getHostAddress(), packet.getPort(),
packet.getLength()));
try {
lispSouthboundService.handlePacket(packet);
} catch (Throwable t) {
- logger.error("Error while handling packet", t);
+ logger.warn("Error while handling packet", t);
}
}
socket.close();
- logger.info("Socket closed");
+ logger.trace("Socket closed");
stillRunning = false;
}
lispSouthboundService = new LispSouthboundService();
registerWithOSGIConsole();
registerRPCs(session);
- logger.debug("Provider Session initialized");
+ logger.trace("Provider Session initialized");
if (bindingAddress == null) {
setLispAddress("0.0.0.0");
}
ByteBuffer outBuffer = MapNotifySerializer.getInstance().serialize(mapNotify);
handleSerializedLispBuffer(address, outBuffer, MAP_NOTIFY);
} else {
- logger.debug("MapNotify was null");
+ logger.warn("MapNotify was null");
}
return null;
}
packet.setAddress(address);
try {
if (logger.isDebugEnabled()) {
- logger.debug("Sending " + packetType + " on port " + LispMessage.PORT_NUM + " to address: " + address);
+ logger.trace("Sending " + packetType + " on port " + LispMessage.PORT_NUM + " to address: " + address);
}
socket.send(packet);
} catch (IOException e) {
- logger.error("Failed to send " + packetType, e);
+ logger.warn("Failed to send " + packetType, e);
}
}
ByteBuffer outBuffer = MapReplySerializer.getInstance().serialize(mapReply);
handleSerializedLispBuffer(address, outBuffer, MAP_REPlY);
} else {
- logger.debug("MapReply was null");
+ logger.warn("MapReply was null");
}
return null;
}
public void setLispAddress(String address) {
synchronized (startLock) {
if (bindingAddress != null && bindingAddress.equals(address)) {
- logger.debug("configured lisp binding address didn't change.");
+ logger.trace("configured lisp binding address didn't change.");
} else {
String action = (bindingAddress == null ? "Setting" : "Resetting");
- logger.info(action + " lisp binding address to: " + address);
+ logger.trace(action + " lisp binding address to: " + address);
bindingAddress = address;
if (thread != null) {
thread.stopRunning();
ByteBuffer inBuffer = ByteBuffer.wrap(packet.getData(), 0, packet.getLength());
Object lispType = LispMessageEnum.valueOf((byte) (ByteUtil.getUnsignedByte(inBuffer, LispMessage.Pos.TYPE) >> 4));
if (lispType == LispMessageEnum.EncapsulatedControlMessage) {
- logger.debug("Recieved packet of type EncapsulatedControlMessage");
+ logger.trace("Recieved packet of type EncapsulatedControlMessage");
handleEncapsulatedControlMessage(inBuffer, packet.getAddress());
} else if (lispType == LispMessageEnum.MapRequest) {
- logger.debug("Recieved packet of type MapRequest");
+ logger.trace("Recieved packet of type MapRequest");
handleMapRequest(inBuffer);
} else if (lispType == LispMessageEnum.MapRegister) {
- logger.debug("Recieved packet of type MapRegister");
+ logger.trace("Recieved packet of type MapRegister");
handleMapRegister(inBuffer, packet.getAddress());
}
- logger.debug("Recieved unknown packet type");
+ logger.warn("Recieved unknown packet type");
}
private void handleEncapsulatedControlMessage(ByteBuffer inBuffer, InetAddress sourceAddress) {
requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
if (notificationProvider != null) {
notificationProvider.publish(requestMappingBuilder.build());
- logger.debug("MapRequest was published!");
+ logger.trace("MapRequest was published!");
} else {
- logger.error("Notification Provider is null!");
+ logger.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Request (len=" + inBuffer.capacity() + ")", re);
addMappingBuilder.setTransportAddress(transportAddressBuilder.build());
if (notificationProvider != null) {
notificationProvider.publish(addMappingBuilder.build());
- logger.debug("MapRegister was published!");
+ logger.trace("MapRegister was published!");
} else {
- logger.error("Notification Provider is null!");
+ logger.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Register (len=" + inBuffer.capacity() + ")", re);