This commit makes Sonar happier.
Change-Id: I9be49fca7eaabe0f6ca876d0bb25773e7daedb20
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
protected Mockery context;
protected boolean showAllExpectations;
private final Synchroniser synchroniser = new Synchroniser();
- protected static final Logger logger = LoggerFactory.getLogger(BaseExpectations.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(BaseExpectations.class);
@Before
public void before() throws Exception {
values.add(lastValue);
boolean match = match(lastValue);
if (match && (logMatch != null)) {
- logger.trace("Match: " + logMatch + " " + value);
+ LOG.trace("Match: " + logMatch + " " + value);
}
return match;
}
public Object invoke(Invocation invocation) throws Throwable {
if (logInvocation) {
- logger.trace("Invoke: returning " + lastValue);
+ LOG.trace("Invoke: returning " + lastValue);
}
return lastValue;
}
return ret;
}
-}
\ No newline at end of file
+}
protected static void assertHexEquals(byte expected, byte actual) {
assertEquals(String.format("0x%02X", expected), String.format("0x%02X", actual));
}
-}
\ No newline at end of file
+}
public String toString() {
return "MappingEntry: " + value.toString();
}
-}
\ No newline at end of file
+}
return false;
return true;
}
-}
\ No newline at end of file
+}
public class ClusterDAOService implements ILispDAO {
- protected static final Logger logger = LoggerFactory.getLogger(ClusterDAOService.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(ClusterDAOService.class);
private IClusterContainerServices clusterContainerService = null;
private ConcurrentMap<Object, ConcurrentMap<String, Object>> data;
private final String CACHE_NAME = "mappingServiceCache";
}
void unsetClusterContainerService(IClusterContainerServices s) {
- logger.trace("Cluster Service unset");
+ LOG.trace("Cluster Service unset");
if (this.clusterContainerService == s) {
this.clusterContainerService = null;
}
private void allocateCache() {
if (this.clusterContainerService == null) {
- logger.warn("un-initialized clusterContainerService, can't create cache");
+ LOG.warn("un-initialized clusterContainerService, can't create cache");
return;
}
- logger.trace("Creating Cache for ClusterDAOService");
+ LOG.trace("Creating Cache for ClusterDAOService");
try {
this.clusterContainerService.createCache(CACHE_NAME, EnumSet.of(IClusterServices.cacheMode.NON_TRANSACTIONAL));
} catch (CacheConfigException cce) {
- logger.warn("Cache couldn't be created for ClusterDAOService - check cache mode");
+ LOG.warn("Cache couldn't be created for ClusterDAOService - check cache mode");
} catch (CacheExistException cce) {
- logger.warn("Cache for ClusterDAOService already exists, destroy and recreate");
+ LOG.warn("Cache for ClusterDAOService already exists, destroy and recreate");
}
- logger.trace("Cache successfully created for ClusterDAOService");
+ LOG.trace("Cache successfully created for ClusterDAOService");
}
@SuppressWarnings({ "unchecked" })
private void retrieveCache() {
if (this.clusterContainerService == null) {
- logger.warn("un-initialized clusterContainerService, can't retrieve cache");
+ LOG.warn("un-initialized clusterContainerService, can't retrieve cache");
return;
}
- logger.trace("Retrieving cache for ClusterDAOService");
+ LOG.trace("Retrieving cache for ClusterDAOService");
data = (ConcurrentMap<Object, ConcurrentMap<String, Object>>) this.clusterContainerService.getCache(CACHE_NAME);
if (data == null) {
- logger.warn("Cache couldn't be retrieved for ClusterDAOService");
+ LOG.warn("Cache couldn't be retrieved for ClusterDAOService");
}
- logger.trace("Cache was successfully retrieved for ClusterDAOService");
+ LOG.trace("Cache was successfully retrieved for ClusterDAOService");
}
public void getAll(IRowVisitor visitor) {
public class LispMappingService implements CommandProvider, IFlowMapping, BindingAwareConsumer, //
IMapRequestResultHandler, IMapNotifyHandler {
- protected static final Logger logger = LoggerFactory.getLogger(LispMappingService.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispMappingService.class);
private static final ConfigIni configIni = new ConfigIni();
private ILispDAO lispDao = null;
}
void setBindingAwareBroker(BindingAwareBroker bindingAwareBroker) {
- logger.trace("BindingAwareBroker set!");
+ LOG.trace("BindingAwareBroker set!");
BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
bindingAwareBroker.registerConsumer(this, bundleContext);
}
void unsetBindingAwareBroker(BindingAwareBroker bindingAwareBroker) {
- logger.debug("BindingAwareBroker was unset in LispMappingService");
+ LOG.debug("BindingAwareBroker was unset in LispMappingService");
}
public void basicInit(ILispDAO dao) {
}
void setLispDao(ILispDAO dao) {
- logger.trace("LispDAO set in LispMappingService");
+ LOG.trace("LispDAO set in LispMappingService");
basicInit(dao);
}
void unsetLispDao(ILispDAO dao) {
- logger.trace("LispDAO was unset in LispMappingService");
+ LOG.trace("LispDAO was unset in LispMappingService");
mapServer = null;
mapResolver = null;
lispDao = null;
public void init() {
try {
registerWithOSGIConsole();
- logger.info("LISP (RFC6830) Mapping Service init finished");
+ LOG.info("LISP (RFC6830) Mapping Service init finished");
} catch (Exception e) {
- logger.error(e.getStackTrace().toString());
+ LOG.error(e.getStackTrace().toString());
}
}
}
public void destroy() {
- logger.info("LISP (RFC6830) Mapping Service is destroyed!");
+ LOG.info("LISP (RFC6830) Mapping Service is destroyed!");
mapResolver = null;
mapServer = null;
}
}
public void onSessionInitialized(ConsumerContext session) {
- logger.info("Lisp Consumer session initialized!");
+ LOG.info("Lisp Consumer session initialized!");
notificationService = session.getSALService(NotificationService.class);
registerNotificationListener(AddMapping.class, new MapRegisterNotificationHandler());
registerNotificationListener(RequestMapping.class, new MapRequestNotificationHandler());
smnib.setTransportAddress(tab.build());
getLispSB().sendMapNotify(smnib.build());
} else {
- logger.warn("got null map notify");
+ LOG.warn("got null map notify");
}
}
smrib.setTransportAddress(mapRequestNotification.getTransportAddress());
getLispSB().sendMapReply(smrib.build());
} else {
- logger.warn("got null map reply");
+ LOG.warn("got null map reply");
}
}
}
}
public void handleSMR(MapRequest smr, LispAddressContainer subscriber) {
- logger.debug("Sending SMR to " + subscriber.toString());
+ LOG.debug("Sending SMR to " + subscriber.toString());
SendMapRequestInputBuilder smrib = new SendMapRequestInputBuilder();
smrib.setMapRequest(new MapRequestBuilder(smr).build());
smrib.setTransportAddress(LispNotificationHelper.getTransportAddressFromContainer(subscriber));
public static final int MAP_REGISTER_AND_NOTIFY_AUTHENTICATION_POSITION = 16;
-}
\ No newline at end of file
+}
public class LispMACAuthentication implements ILispAuthentication {
- protected static final Logger logger = LoggerFactory.getLogger(LispMACAuthentication.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispMACAuthentication.class);
protected String algorithm;
private byte[] tempAuthenticationData;
authenticationLength = Mac.getInstance(algorithm).getMacLength();
tempAuthenticationData = new byte[authenticationLength];
} catch (NoSuchAlgorithmException e) {
- logger.warn("No such MAC algorithm" + algorithm);
+ LOG.warn("No such MAC algorithm" + algorithm);
}
}
return mac.doFinal(data);
} catch (InvalidKeyException e) {
- logger.warn("Invalid password" + key);
+ LOG.warn("Invalid password" + key);
} catch (NoSuchAlgorithmException e) {
- logger.warn("No such MAC algorithm" + algorithm);
+ LOG.warn("No such MAC algorithm" + algorithm);
}
return null;
}
import org.slf4j.LoggerFactory;
public class ConfigIni {
- protected static final Logger logger = LoggerFactory.getLogger(ConfigIni.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(ConfigIni.class);
private boolean mappingOverwrite;
private boolean smr;
private String elpPolicy;
if (str == null) {
str = System.getProperty(LISP_MAPPING_OVERWRITE);
if (str == null) {
- logger.debug("Configuration variable '{}' is unset. Setting to default value: 'true'", LISP_MAPPING_OVERWRITE);
+ LOG.debug("Configuration variable '{}' is unset. Setting to default value: 'true'", LISP_MAPPING_OVERWRITE);
return;
}
}
if (str.trim().equalsIgnoreCase("false")) {
this.mappingOverwrite = false;
- logger.debug("Setting configuration variable '{}' to 'false'", LISP_MAPPING_OVERWRITE);
+ LOG.debug("Setting configuration variable '{}' to 'false'", LISP_MAPPING_OVERWRITE);
} else {
- logger.debug("Setting configuration variable '{}' to 'true'", LISP_MAPPING_OVERWRITE);
+ LOG.debug("Setting configuration variable '{}' to 'true'", LISP_MAPPING_OVERWRITE);
}
}
if (str == null) {
str = System.getProperty(LISP_SMR);
if (str == null) {
- logger.debug("Configuration variable '{}' is unset. Setting to default value: 'true'", LISP_SMR);
+ LOG.debug("Configuration variable '{}' is unset. Setting to default value: 'true'", LISP_SMR);
return;
}
}
if (str.trim().equalsIgnoreCase("false")) {
this.smr = false;
- logger.debug("Setting configuration variable '{}' to 'false'", LISP_SMR);
+ LOG.debug("Setting configuration variable '{}' to 'false'", LISP_SMR);
} else {
- logger.debug("Setting configuration variable '{}' to 'true'", LISP_SMR);
+ LOG.debug("Setting configuration variable '{}' to 'true'", LISP_SMR);
}
}
if (str == null) {
str = System.getProperty(LISP_ELP_POLICY);
if (str == null) {
- logger.debug("Configuration variable '{}' is unset. Setting to default value: 'default' (ELP only)",
+ LOG.debug("Configuration variable '{}' is unset. Setting to default value: 'default' (ELP only)",
LISP_ELP_POLICY);
return;
}
if (str.trim().equalsIgnoreCase("both")) {
this.elpPolicy = "both";
- logger.debug("Setting configuration variable '{}' to 'both' (keep ELP, add next hop)", LISP_ELP_POLICY);
+ LOG.debug("Setting configuration variable '{}' to 'both' (keep ELP, add next hop)", LISP_ELP_POLICY);
} else if (str.trim().equalsIgnoreCase("replace")) {
this.elpPolicy = "replace";
- logger.debug("Setting configuration variable '{}' to 'replace' (next hop only)", LISP_ELP_POLICY);
+ LOG.debug("Setting configuration variable '{}' to 'replace' (next hop only)", LISP_ELP_POLICY);
} else {
- logger.debug("Setting configuration variable '{}' to 'default' (ELP only)", LISP_ELP_POLICY);
+ LOG.debug("Setting configuration variable '{}' to 'default' (ELP only)", LISP_ELP_POLICY);
}
}
private static final int TTL_RLOC_TIMED_OUT = 1;
private static final int TTL_NO_RLOC_KNOWN = 15;
- protected static final Logger logger = LoggerFactory.getLogger(MapResolver.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(MapResolver.class);
private static final ConfigIni configIni = new ConfigIni();
private static final String elpPolicy = configIni.getElpPolicy();
public void handleMapRequest(MapRequest request, boolean smr, IMapRequestResultHandler callback) {
if (dao == null) {
- logger.warn("handleMapRequest called while dao is uninitialized");
+ LOG.warn("handleMapRequest called while dao is uninitialized");
return;
}
if (request.isPitr()) {
if (smr) {
IMappingServiceKey key = MappingServiceKeyUtil.generateMappingServiceKey(mapping.getKey().getEID(),
mapping.getKey().getMask());
- logger.trace("Adding new subscriber: " + subscriberRloc.toString());
+ LOG.trace("Adding new subscriber: " + subscriberRloc.toString());
subscribers.add(subscriberRloc);
dao.put(key, new MappingEntry<HashSet<MappingServiceSubscriberRLOC>>(SUBSCRIBERS_SUBKEY, subscribers));
}
public class MapServer extends AbstractLispComponent implements IMapServerAsync {
- protected static final Logger logger = LoggerFactory.getLogger(MapServer.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(MapServer.class);
private static final ConfigIni configIni = new ConfigIni();
private static final boolean overwriteConfig = configIni.mappingOverwriteIsSet();
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface current = interfaces.nextElement();
- logger.debug("Interface " + current.toString());
+ LOG.debug("Interface " + current.toString());
if (!current.isUp() || current.isLoopback() || current.isVirtual())
continue;
Enumeration<InetAddress> addresses = current.getInetAddresses();
// Skip loopback and link local addresses
if (current_addr.isLoopbackAddress() || current_addr.isLinkLocalAddress())
continue;
- logger.debug(current_addr.getHostAddress());
+ LOG.debug(current_addr.getHostAddress());
return current_addr;
}
}
public void handleMapRegister(MapRegister mapRegister, boolean smr, IMapNotifyHandler callback) {
if (dao == null) {
- logger.warn("handleMapRegister called while dao is uninitialized");
+ LOG.warn("handleMapRegister called while dao is uninitialized");
} else {
boolean failed = false;
String password = null;
if (shouldAuthenticate()) {
password = getPassword(eidRecord.getLispAddressContainer(), eidRecord.getMaskLength());
if (!LispAuthenticationUtil.validate(mapRegister, password)) {
- logger.warn("Authentication failed");
+ LOG.warn("Authentication failed");
failed = true;
break;
}
HashSet<MappingServiceSubscriberRLOC> subscribers = getSubscribers(eidRecord.getLispAddressContainer(), eidRecord.getMaskLength());
if (subscribers != null) {
MapRequest mapRequest = buildSMR(eidRecord);
- logger.trace("Built SMR packet: " + mapRequest.toString());
+ LOG.trace("Built SMR packet: " + mapRequest.toString());
for (MappingServiceSubscriberRLOC rloc : subscribers) {
if (rloc.timedOut()) {
- logger.trace("Lazy removing expired subscriber entry " + rloc.toString());
+ LOG.trace("Lazy removing expired subscriber entry " + rloc.toString());
subscribers.remove(rloc);
} else {
callback.handleSMR(mapRequest, rloc.getSrcRloc());
if (!failed) {
MapNotifyBuilder builder = new MapNotifyBuilder();
if (BooleanUtils.isTrue(mapRegister.isWantMapNotify())) {
- logger.trace("MapRegister wants MapNotify");
+ LOG.trace("MapRegister wants MapNotify");
MapNotifyBuilderHelper.setFromMapRegister(builder, mapRegister);
if (shouldAuthenticate()) {
builder.setAuthenticationData(LispAuthenticationUtil.createAuthenticationData(builder.build(), password));
public class MapRequestSerializer {
private static final MapRequestSerializer INSTANCE = new MapRequestSerializer();
- protected static final Logger logger = LoggerFactory.getLogger(MapRequestSerializer.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(MapRequestSerializer.class);
// Private constructor prevents instantiation from other classes
private MapRequestSerializer() {
builder.setMapReply(new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.MapReplyBuilder(
new EidToLocatorRecordBuilder(EidToLocatorRecordSerializer.getInstance().deserialize(requestBuffer)).build()).build());
} catch (RuntimeException re) {
- logger.warn("couldn't deserialize map reply encapsulated in map request. {}", re.getMessage());
+ LOG.warn("couldn't deserialize map reply encapsulated in map request. {}", re.getMessage());
}
}
return builder.build();
mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
- // List logger bundles
+ // List LOG bundles
mavenBundle("org.slf4j", "jcl-over-slf4j").versionAsInProject(),
mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
private IFlowMapping lms;
private ClusterDAOService clusterService;
- protected static final Logger logger = LoggerFactory.getLogger(MappingServiceIntegrationTest.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(MappingServiceIntegrationTest.class);
private byte[] mapRequestPacket;
private byte[] mapRegisterPacketWithNotify;
private byte[] mapRegisterPacketWithoutNotify;
Integer httpResponseCode = connection.getResponseCode();
if (httpResponseCode > 299) {
- logger.trace("HTTP Address: " + url);
- logger.trace("HTTP Response Code: " + httpResponseCode);
+ LOG.trace("HTTP Address: " + url);
+ LOG.trace("HTTP Response Code: " + httpResponseCode);
fail();
}
String jsonAuthData = createAuthKeyJSON(pass, address, mask);
- logger.trace("Sending this JSON to LISP server: \n" + jsonAuthData);
- logger.trace("Address: " + address);
+ LOG.trace("Sending this JSON to LISP server: \n" + jsonAuthData);
+ LOG.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 };
assertEquals(((LispIpv4Address) mapRequest.getEidRecord().get(0).getLispAddressContainer().getAddress()).getIpv4Address().getValue(),
eid);
notificationCalled = true;
- logger.warn("notification arrived");
+ LOG.warn("notification arrived");
}
});
sendMapRequest(mapRequest, port);
if (notificationCalled) {
return;
} else {
- logger.warn("notification hasn't arrived, sleeping...");
+ LOG.warn("notification hasn't arrived, sleeping...");
Thread.sleep(500);
}
}
try {
DatagramPacket packet = new DatagramPacket(bytesToSend, bytesToSend.length);
initPacketAddress(packet, port);
- logger.trace("Sending packet to LispPlugin on socket, port {}", port);
+ LOG.trace("Sending packet to LispPlugin on socket, port {}", port);
socket.send(packet);
} catch (Throwable t) {
fail();
try {
byte[] buffer = new byte[4096];
DatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length);
- logger.trace("Waiting for packet from socket...");
+ LOG.trace("Waiting for packet from socket...");
receivedSocket.setSoTimeout(timeout);
receivedSocket.receive(receivePacket);
- logger.trace("Recieved packet from socket!");
+ LOG.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.trace("Bundle[" + element.getBundleId() + "]:" + element.getSymbolicName() + ",v" + element.getVersion() + ", state:"
+ LOG.trace("Bundle[" + element.getBundleId() + "]:" + element.getSymbolicName() + ",v" + element.getVersion() + ", state:"
+ stateToString(state));
if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
- logger.trace("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
+ LOG.trace("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
// try {
// String host = element.getHeaders().get("FRAGMENT-HOST");
// if (host != null) {
- // logger.warn("Bundle " + element.getSymbolicName() +
+ // LOG.warn("Bundle " + element.getSymbolicName() +
// " is a fragment which is part of: " + host);
- // logger.warn("Required imports are: " +
+ // LOG.warn("Required imports are: " +
// element.getHeaders().get("IMPORT-PACKAGE"));
// } else {
// element.start();
// }
// } catch (BundleException e) {
- // logger.error("BundleException:", e);
+ // LOG.error("BundleException:", e);
// fail();
// }
}
}
if (debugit) {
- logger.warn(("Do some debugging because some bundle is unresolved"));
+ LOG.warn(("Do some debugging because some bundle is unresolved"));
}
// assertNotNull(broker);
// BundleContext
/*
* for (ServiceReference sr : bc.getAllServiceReferences(null, null)) {
- * logger.trace(sr.getBundle().getSymbolicName());
- * logger.trace(sr.toString()); }
+ * LOG.trace(sr.getBundle().getSymbolicName());
+ * LOG.trace(sr.toString()); }
*/
try {
Thread.sleep(1000);
}
-}
\ No newline at end of file
+}
public class LispDeviceNetconfConnector implements AutoCloseable, LfmNetconfConnectorService {
- private static final Logger logger = LoggerFactory.getLogger(LispDeviceNetconfConnector.class);
+ private static final Logger LOG = LoggerFactory.getLogger(LispDeviceNetconfConnector.class);
private final ExecutorService executor;
private LispNetconfConnector nconfConnector;
public LispDeviceNetconfConnector(ExecutorService executor, LispNetconfConnector nconfConnector) {
this.executor = executor;
this.nconfConnector = nconfConnector;
- logger.info( "LispDeviceNetconfConnector constructed" );
+ LOG.info( "LispDeviceNetconfConnector constructed" );
}
/**
public Future<RpcResult<Void>> buildConnector(final BuildConnectorInput input) {
SettableFuture<RpcResult<Void>> futureResult = SettableFuture.create();
- logger.trace("Received RPC to buildConnector: " + input);
+ LOG.trace("Received RPC to buildConnector: " + input);
if (verifyBuildInput(input, futureResult) != true) {
return futureResult;
private boolean verifyBuildInput(final BuildConnectorInput req, SettableFuture<RpcResult<Void>> futureResult ) {
if (req.getInstance() == null) {
- logger.error("Instance name not initialized");
+ LOG.error("Instance name not initialized");
futureResult.set(RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "Instance name not initialized")
.build());
}
if (req.getAddress() == null) {
- logger.error("IP address not initialized");
+ LOG.error("IP address not initialized");
futureResult.set(RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "IP address not initialized")
.build());
}
if (req.getPort() == null) {
- logger.error("Port not initialized");
+ LOG.error("Port not initialized");
futureResult.set(RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "Port not initialized")
.build());
}
if (req.getUsername() == null) {
- logger.error("Username not initialized");
+ LOG.error("Username not initialized");
futureResult.set(RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "Username not initialized")
.build());
}
if (req.getPassword() == null) {
- logger.error("Password not initialized");
+ LOG.error("Password not initialized");
futureResult.set(RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "Password not initialized")
.build());
private boolean verifyRemoveInput(final RemoveConnectorInput conn, SettableFuture<RpcResult<Void>> futureResult) {
if (conn.getInstance() == null) {
- logger.error("Instance name not initialized");
+ LOG.error("Instance name not initialized");
futureResult.set(RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "Instance name not initialized")
.build());
try {
nconfConnector.createNetconfConnector(buildConnectorInput.getInstance(), buildConnectorInput.getAddress(),
buildConnectorInput.getPort().getValue(), buildConnectorInput.getUsername(), buildConnectorInput.getPassword());
- logger.info("LispNetconfConnector {} built", buildConnectorInput.getInstance());
+ LOG.info("LispNetconfConnector {} built", buildConnectorInput.getInstance());
return RpcResultBuilder.<Void>success().build();
} catch( InstanceAlreadyExistsException e ) {
- logger.error("LispNetconfConnector {} already exists!", buildConnectorInput.getInstance());
+ LOG.error("LispNetconfConnector {} already exists!", buildConnectorInput.getInstance());
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exists", "LispNetconfConnector exists")
.build();
} catch (ConflictingVersionException ex) {
- logger.error("LispNetconfConnector {} version exception", buildConnectorInput.getInstance());
+ LOG.error("LispNetconfConnector {} version exception", buildConnectorInput.getInstance());
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "LispNetconfConnector version exception")
.build();
} catch ( ValidationException ex) {
- logger.error("LispNetconfConnector {} validation exception", buildConnectorInput.getInstance());
+ LOG.error("LispNetconfConnector {} validation exception", buildConnectorInput.getInstance());
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "exception", "LispNetconfConnector validation exception")
.build();
public RpcResult<Void> call() {
try {
nconfConnector.removeNetconfConnector(removeConnectorInput.getInstance());
- logger.info("LispNetconfConnector {} removed!", removeConnectorInput.getInstance());
+ LOG.info("LispNetconfConnector {} removed!", removeConnectorInput.getInstance());
return RpcResultBuilder.<Void> success().build();
} catch( InstanceNotFoundException e ) {
- logger.info("LispNetconfConnector {} doesn't exists!", removeConnectorInput.getInstance());
+ LOG.info("LispNetconfConnector {} doesn't exists!", removeConnectorInput.getInstance());
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "no-exist", "LispNetconfConnector doesn't exist")
.build();
} catch( ValidationException e ) {
- logger.info("LispNetconfConnector {}: Could not validate remove transactions!", removeConnectorInput.getInstance());
+ LOG.info("LispNetconfConnector {}: Could not validate remove transactions!", removeConnectorInput.getInstance());
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "fail", "LispNetconfConnector doesn't exist")
.build();
} catch (ConflictingVersionException e) {
- logger.error("LispNetconfConnector {}: Cannot remove due to conflicting version", removeConnectorInput.getInstance() );
+ LOG.error("LispNetconfConnector {}: Cannot remove due to conflicting version", removeConnectorInput.getInstance() );
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "fail", "Conflicting version exception")
.build();
} catch (Exception e) {
- logger.error("LispNetconfConnector {} exception while removing: {}", removeConnectorInput.getInstance(), e.getClass());
+ LOG.error("LispNetconfConnector {} exception while removing: {}", removeConnectorInput.getInstance(), e.getClass());
return RpcResultBuilder.<Void> failed()
.withError(ErrorType.APPLICATION, "fail", "Cannot remove LispNetconfConnector: " + removeConnectorInput.getInstance())
.build();
public class LispNetconfConnector {
private ConfigRegistryJMXClient configRegistryClient;
- private static final Logger logger = LoggerFactory.getLogger(LispNetconfConnector.class);
+ private static final Logger LOG = LoggerFactory.getLogger(LispNetconfConnector.class);
private MBeanServer platformMBeanServer;
ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
if (transaction == null) {
- logger.error("Could not create transaction with ConfigRegistry! Cannot build NETCONF connector!");
+ LOG.error("Could not create transaction with ConfigRegistry! Cannot build NETCONF connector!");
return;
}
mxBean.setTcpOnly(false);
if (solveDependencies(transaction, mxBean) != true) {
- logger.error("Failed to solve dependencies! Aborting!");
+ LOG.error("Failed to solve dependencies! Aborting!");
return;
}
if (bindingBrokerRegistry != null ) {
mxBean.setBindingRegistry(bindingBrokerRegistry);
} else {
- logger.debug("No BindingBroker instance found");
+ LOG.debug("No BindingBroker instance found");
return false;
}
if (domRegistry != null) {
mxBean.setDomRegistry(domRegistry);
} else {
- logger.debug("No DomRegistryBroker instance found");
+ LOG.debug("No DomRegistryBroker instance found");
return false;
}
if (eventExecutor != null) {
mxBean.setEventExecutor(eventExecutor);
} else {
- logger.debug("No EventExecutor instance found");
+ LOG.debug("No EventExecutor instance found");
return false;
}
if (threadpool != null) {
mxBean.setProcessingExecutor(threadpool);
} else {
- logger.debug("No ThreadPool instance found");
+ LOG.debug("No ThreadPool instance found");
return false;
}
if (clientDispatcher != null) {
mxBean.setClientDispatcher(clientDispatcher);
} else {
- logger.debug("No ClientDispatcher instance found");
+ LOG.debug("No ClientDispatcher instance found");
return false;
}
public class Activator extends DependencyActivatorBase {
- protected static final Logger logger = LoggerFactory.getLogger(Activator.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(Activator.class);
@Override
public void init(BundleContext context, DependencyManager manager) throws Exception {
.setInterface(new String[] { ILispNeutronService.class.getName(), INeutronPortAware.class.getName()}, props)
.setImplementation(LispNeutronPortHandler.class));
- logger.debug("LISP Neutron Service is initialized!");
+ LOG.debug("LISP Neutron Service is initialized!");
}
@Override
public void destroy(BundleContext context, DependencyManager manager) throws Exception {
- logger.debug("LISP Neutron Service is destroyed!");
+ LOG.debug("LISP Neutron Service is destroyed!");
}
}
@Override
public int canCreateNetwork(NeutronNetwork network) {
- logger.info("Neutron canCreateNetwork : Network name: " + network.getNetworkName());
- logger.debug("Lisp Neutron Network: " + network.toString());
+ LOG.info("Neutron canCreateNetwork : Network name: " + network.getNetworkName());
+ LOG.debug("Lisp Neutron Network: " + network.toString());
return HttpURLConnection.HTTP_OK;
}
@Override
public void neutronNetworkCreated(NeutronNetwork network) {
- logger.info("Neutron Network Created : Network name: " + network.getNetworkName());
- logger.debug("Lisp Neutron Network: " + network.toString());
+ LOG.info("Neutron Network Created : Network name: " + network.getNetworkName());
+ LOG.debug("Lisp Neutron Network: " + network.toString());
}
@Override
public int canUpdateNetwork(NeutronNetwork delta, NeutronNetwork original) {
- logger.info("Neutron canUpdateNetwork : Network name: " + original.getNetworkName());
- logger.debug("Lisp Neutron Network: " + original.toString());
+ LOG.info("Neutron canUpdateNetwork : Network name: " + original.getNetworkName());
+ LOG.debug("Lisp Neutron Network: " + original.toString());
return HttpURLConnection.HTTP_OK;
}
@Override
public void neutronNetworkUpdated(NeutronNetwork network) {
- logger.info("Neutron Network Updated : Network name: " + network.getNetworkName());
- logger.debug("Lisp Neutron Network: " + network.toString());
+ LOG.info("Neutron Network Updated : Network name: " + network.getNetworkName());
+ LOG.debug("Lisp Neutron Network: " + network.toString());
}
@Override
public int canDeleteNetwork(NeutronNetwork network) {
- logger.info("Neutron canDeleteNetwork : Network name: " + network.getNetworkName());
- logger.debug("Lisp Neutron Network: " + network.toString());
+ LOG.info("Neutron canDeleteNetwork : Network name: " + network.getNetworkName());
+ LOG.debug("Lisp Neutron Network: " + network.toString());
return HttpURLConnection.HTTP_OK;
}
@Override
public void neutronNetworkDeleted(NeutronNetwork network) {
- logger.info("Neutron Network Deleted : Network name: " + network.getNetworkName());
- logger.debug("Lisp Neutron Network: " + network.toString());
+ LOG.info("Neutron Network Deleted : Network name: " + network.getNetworkName());
+ LOG.debug("Lisp Neutron Network: " + network.toString());
return;
}
@Override
public int canCreatePort(NeutronPort port) {
- logger.info("Neutron canCreatePort : Port name: " + port.getName());
+ LOG.info("Neutron canCreatePort : Port name: " + port.getName());
return HttpURLConnection.HTTP_OK;
}
// TODO Consider adding Port MAC -> Port fixed IP in MS
// TODO Add Port fixed ip -> host ip mapping in MS - Requires extension of Port object
- logger.info("Neutron Port Created: Port name: " + port.getName() + " Port Fixed IP: " +
+ LOG.info("Neutron Port Created: Port name: " + port.getName() + " Port Fixed IP: " +
( port.getFixedIPs() != null ? port.getFixedIPs().get(0) : "No Fixed IP assigned" ));
- logger.debug("Neutron Port Created : " + port.toString());
+ LOG.debug("Neutron Port Created : " + port.toString());
}
public int canUpdatePort(NeutronPort delta, NeutronPort original) {
// TODO Port IP and port's host ip is stored by Lisp Neutron Service. If there is change to these fields, the update needs to be processed.
- logger.info("Neutron canUpdatePort : Port name: " + original.getName() + " Port Fixed IP: " +
+ LOG.info("Neutron canUpdatePort : Port name: " + original.getName() + " Port Fixed IP: " +
( original.getFixedIPs() != null ? original.getFixedIPs().get(0) : "No Fixed IP assigned" ));
- logger.debug("Neutron canUpdatePort : original" + original.toString() + " delta : " + delta.toString());
+ LOG.debug("Neutron canUpdatePort : original" + original.toString() + " delta : " + delta.toString());
return HttpURLConnection.HTTP_OK;
}
public void neutronPortUpdated(NeutronPort port) {
// TODO Port IP and port's host ip is stored by Lisp Neutron Service. If there is change to these fields, the update needs to be processed.
- logger.info("Neutron Port updated: Port name: " + port.getName() + " Port Fixed IP: " +
+ LOG.info("Neutron Port updated: Port name: " + port.getName() + " Port Fixed IP: " +
( port.getFixedIPs() != null ? port.getFixedIPs().get(0) : "No Fixed IP assigned" ));
- logger.debug("Neutron Port Updated : " + port.toString());
+ LOG.debug("Neutron Port Updated : " + port.toString());
}
public int canDeletePort(NeutronPort port) {
// TODO Check if Port IPs are stored by Lisp Neutron Service. if not return error code.
- logger.info("Neutron canDeletePort : Port name: " + port.getName() + " Port Fixed IP: " +
+ LOG.info("Neutron canDeletePort : Port name: " + port.getName() + " Port Fixed IP: " +
( port.getFixedIPs() != null ? port.getFixedIPs().get(0) : "No Fixed IP assigned" ));
- logger.debug("Neutron canDeltePort: " + port.toString());
+ LOG.debug("Neutron canDeltePort: " + port.toString());
return HttpURLConnection.HTTP_OK;
}
public void neutronPortDeleted(NeutronPort port) {
// TODO if port ips existed in MapServer, delete them. Else, log error.
- logger.info("Neutron Port Deleted: Port name: " + port.getName() + " Port Fixed IP: " +
+ LOG.info("Neutron Port Deleted: Port name: " + port.getName() + " Port Fixed IP: " +
( port.getFixedIPs() != null ? port.getFixedIPs().get(0) : "No Fixed IP assigned" ));
- logger.debug("Neutron Port Deleted : " + port.toString());
+ LOG.debug("Neutron Port Deleted : " + port.toString());
}
}
public class LispNeutronService implements ILispNeutronService {
- protected static final Logger logger = LoggerFactory.getLogger(LispNeutronService.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispNeutronService.class);
protected IFlowMapping mappingService;
public IFlowMapping getMappingService() {
}
public void setMappingService(IFlowMapping mappingService) {
- logger.debug("MappingService set in Lisp Neutron");
+ LOG.debug("MappingService set in Lisp Neutron");
this.mappingService = mappingService;
}
public void unsetMappingService(IFlowMapping mappingService) {
- logger.debug("MappingService was unset in LISP Neutron");
+ LOG.debug("MappingService was unset in LISP Neutron");
this.mappingService = null;
}
}
*/
public void stop() {
- logger.info("LISP Neutron Service is down!");
+ LOG.info("LISP Neutron Service is down!");
}
public void destroy() {
- logger.debug("LISP Neutron Service is destroyed!");
+ LOG.debug("LISP Neutron Service is destroyed!");
mappingService = null;
}
@Override
public int canCreateSubnet(NeutronSubnet subnet) {
- logger.info("Neutron canCreateSubnet : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
+ LOG.info("Neutron canCreateSubnet : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
subnet.getCidr());
- logger.debug("Lisp Neutron Subnet: " + subnet.toString());
+ LOG.debug("Lisp Neutron Subnet: " + subnet.toString());
return HttpURLConnection.HTTP_OK;
}
public void neutronSubnetCreated(NeutronSubnet subnet) {
//TODO update for multi-tenancy
- logger.info("Neutron Subnet Created request : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
+ LOG.info("Neutron Subnet Created request : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
subnet.getCidr());
- logger.debug("Lisp Neutron Subnet: " + subnet.toString());
+ LOG.debug("Lisp Neutron Subnet: " + subnet.toString());
int masklen = Integer.parseInt(subnet.getCidr().split("/")[1]);
SubnetUtils util = new SubnetUtils(subnet.getCidr());
try{
lispNeutronService.getMappingService().addAuthenticationKey(addressContainer, masklen, subnet.getNetworkUUID());
- logger.debug("Neutron Subnet Added to MapServer : Subnet name: " + subnet.getName() + " EID Prefix: " +
+ LOG.debug("Neutron Subnet Added to MapServer : Subnet name: " + subnet.getName() + " EID Prefix: " +
addressContainer.toString() + " Key: " + subnet.getNetworkUUID());
}
catch (Exception e){
- logger.error("Adding new subnet to lisp service mapping service failed. Subnet : " + subnet.toString());
+ LOG.error("Adding new subnet to lisp service mapping service failed. Subnet : " + subnet.toString());
}
}
@Override
public int canUpdateSubnet(NeutronSubnet delta, NeutronSubnet original) {
if (delta == null || original == null){
- logger.error("Neutron canUpdateSubnet rejected: subnet objects were null");
+ LOG.error("Neutron canUpdateSubnet rejected: subnet objects were null");
return HttpURLConnection.HTTP_BAD_REQUEST;
}
- logger.info("Neutron canUpdateSubnet : Subnet name: " + original.getName() + " Subnet Cidr: " +
+ LOG.info("Neutron canUpdateSubnet : Subnet name: " + original.getName() + " Subnet Cidr: " +
original.getCidr());
- logger.debug("Lisp Neutron Subnet update: original : " + original.toString() + " delta : " + delta.toString());
+ LOG.debug("Lisp Neutron Subnet update: original : " + original.toString() + " delta : " + delta.toString());
// We do not accept a Subnet update that changes the cidr. If cider or network UUID is changed, return error.
if ( !(original.getCidr().equals(delta.getCidr())) ){
- logger.error("Neutron canUpdateSubnet rejected: Subnet name: " + original.getName() + " Subnet Cidr: " +
+ LOG.error("Neutron canUpdateSubnet rejected: Subnet name: " + original.getName() + " Subnet Cidr: " +
original.getCidr());
return HttpURLConnection.HTTP_CONFLICT;
}
*/
@Override
public int canDeleteSubnet(NeutronSubnet subnet) {
- logger.info("Neutron canDeleteSubnet : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
+ LOG.info("Neutron canDeleteSubnet : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
subnet.getCidr() + "Key: " + subnet.getNetworkUUID());
- logger.debug("Lisp Neutron Subnet: " + subnet.toString());
+ LOG.debug("Lisp Neutron Subnet: " + subnet.toString());
int result;
int masklen = Integer.parseInt(subnet.getCidr().split("/")[1]);
try{
if (lispNeutronService.getMappingService().getAuthenticationKey(addressContainer, masklen) == null){
- logger.error("Neutron canDeleteSubnet rejected : Subnet does not exist: Subnet name: " +
+ LOG.error("Neutron canDeleteSubnet rejected : Subnet does not exist: Subnet name: " +
subnet.getName() +
" Eid Prefix: " + addressContainer.toString() +
" Key: " + subnet.getNetworkUUID());
result = HttpURLConnection.HTTP_OK;
}
catch (Exception e){
- logger.error("canDeleteSubnet request rejected. Subnet : " + subnet.toString());
+ LOG.error("canDeleteSubnet request rejected. Subnet : " + subnet.toString());
result = HttpURLConnection.HTTP_BAD_REQUEST;
}
return result;
*/
@Override
public void neutronSubnetDeleted(NeutronSubnet subnet) {
- logger.info("Neutron Subnet Deleted Request : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
+ LOG.info("Neutron Subnet Deleted Request : Subnet name: " + subnet.getName() + " Subnet Cidr: " +
subnet.getCidr() + "Key: " + subnet.getNetworkUUID());
- logger.debug("Lisp Neutron Subnet: " + subnet.toString());
+ LOG.debug("Lisp Neutron Subnet: " + subnet.toString());
int masklen = Integer.parseInt(subnet.getCidr().split("/")[1]);
SubnetUtils util = new SubnetUtils(subnet.getCidr());
try{
// if subnet does not exist in MapServer, return error
if (lispNeutronService.getMappingService().getAuthenticationKey(addressContainer,masklen) == null){
- logger.error("Neutron Delete Subnet Failed: Subnet does not exist: Subnet name: " + subnet.getName() +
+ LOG.error("Neutron Delete Subnet Failed: Subnet does not exist: Subnet name: " + subnet.getName() +
" Eid Prefix: " + addressContainer.toString() +
"Key: " + subnet.getNetworkUUID());
return;
}
lispNeutronService.getMappingService().removeAuthenticationKey(addressContainer, masklen);
- logger.debug("Neutron Subnet Deleted from MapServer : Subnet name: " + subnet.getName() +
+ LOG.debug("Neutron Subnet Deleted from MapServer : Subnet name: " + subnet.getName() +
" Eid Prefix: " + addressContainer.toString() +
" Key: " + subnet.getNetworkUUID());
}
catch (Exception e){
- logger.error("Deleting subnet's EID prefix from mapping service failed + Subnet: " + subnet.toString());
+ LOG.error("Deleting subnet's EID prefix from mapping service failed + Subnet: " + subnet.toString());
}
}
-}
\ No newline at end of file
+}
public class LispAddressConvertorNB {
- protected static final Logger logger = LoggerFactory.getLogger(LispAddressConvertorNB.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispAddressConvertorNB.class);
public static LispAddress convertToLispAddress(LispAddressGeneric generic){
if (generic == null){
- logger.warn("Couldn't convert address, generic address is null");
+ LOG.warn("Couldn't convert address, generic address is null");
return null;
}
LispAddressGeneric RLOCGeneric;
if (mapRegister == null){
- logger.warn("Couldn't convert addresses, mapRegister is null");
+ LOG.warn("Couldn't convert addresses, mapRegister is null");
return;
}
LispAddress RLOC;
if (record == null){
- logger.warn("Couldn't convert addresses, record is null");
+ LOG.warn("Couldn't convert addresses, record is null");
return;
}
@Path("/")
public class LispMappingNorthbound implements ILispmappingNorthbound {
- protected static final Logger logger = LoggerFactory.getLogger(LispMappingNorthbound.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispMappingNorthbound.class);
private IFlowMapping mappingService;
private String userName;
}
void setFlowMappingService(IFlowMapping mappingService) {
- logger.trace("FlowMapping set in LispNorthbound");
+ LOG.trace("FlowMapping set in LispNorthbound");
this.mappingService = mappingService;
}
void unsetFlowMappingService(IFlowMapping mappingService) {
- logger.trace("LispDAO was unset in LISP Northbound");
+ LOG.trace("LispDAO was unset in LISP Northbound");
this.mappingService = null;
}
public void init() {
- logger.trace("LISP Northbound Service is initialized!");
+ LOG.trace("LISP Northbound Service is initialized!");
}
public void start() {
- logger.info("LISP Northbound Service is up!");
+ LOG.info("LISP Northbound Service is up!");
}
public void stop() {
- logger.info("LISP Northbound Service is down!");
+ LOG.info("LISP Northbound Service is down!");
}
public void destroy() {
- logger.trace("LISP Northbound Service is destroyed!");
+ LOG.trace("LISP Northbound Service is destroyed!");
mappingService = null;
}
-}
\ No newline at end of file
+}
}
-}
\ No newline at end of file
+}
import com.google.common.net.InetAddresses;
public class LispSouthboundPlugin extends AbstractBindingAwareProvider implements IConfigLispSouthboundPlugin, CommandProvider, LispflowmappingService {
- protected static final Logger logger = LoggerFactory.getLogger(LispSouthboundPlugin.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispSouthboundPlugin.class);
private static Object startLock = new Object();
private LispIoThread lispThread;
lispXtrSouthboundService = null;
lispThread = null;
xtrThread = null;
- logger.info("LISP (RFC6830) Mapping Service is down!");
+ LOG.info("LISP (RFC6830) Mapping Service is down!");
try {
Thread.sleep(1100);
} catch (InterruptedException e) {
int lispReceiveTimeout = 1000;
- logger.info("LISP (RFC6830) Mapping Service is running and listening on address: " + bindingAddress + " port: "
+ LOG.info("LISP (RFC6830) Mapping Service is running and listening on address: " + bindingAddress + " port: "
+ threadSocket.getLocalPort());
try {
threadSocket.setSoTimeout(lispReceiveTimeout);
} catch (SocketException e) {
- logger.error("Cannot open socket on UDP port " + threadSocket.getLocalPort(), e);
+ LOG.error("Cannot open socket on UDP port " + threadSocket.getLocalPort(), e);
return;
}
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
try {
threadSocket.receive(packet);
- logger.trace("Received a packet!");
+ LOG.trace("Received a packet!");
} catch (SocketTimeoutException ste) {
continue;
} catch (IOException e) {
- logger.warn("IO Exception while trying to recieve packet", e);
+ LOG.warn("IO Exception while trying to recieve packet", e);
}
- logger.trace(String.format("Handling packet from {%s}:{%d} (len={%d})", packet.getAddress().getHostAddress(), packet.getPort(),
+ LOG.trace(String.format("Handling packet from {%s}:{%d} (len={%d})", packet.getAddress().getHostAddress(), packet.getPort(),
packet.getLength()));
try {
this.service.handlePacket(packet);
} catch (Exception e) {
- logger.warn("Error while handling packet", e);
+ LOG.warn("Error while handling packet", e);
}
}
threadSocket.close();
- logger.trace("Socket closed");
+ LOG.trace("Socket closed");
running = false;
}
socket = new DatagramSocket(new InetSocketAddress(bindingAddress, LispMessage.PORT_NUM));
lispThread = new LispIoThread(socket, lispSouthboundService);
lispThread.start();
- logger.info("LISP (RFC6830) Mapping Service Southbound Plugin is up!");
+ LOG.info("LISP (RFC6830) Mapping Service Southbound Plugin is up!");
if (listenOnXtrPort) {
restartXtrThread();
}
} catch (SocketException e) {
- logger.error("couldn't start socket {}", e.getMessage());
+ LOG.error("couldn't start socket {}", e.getMessage());
}
}
xtrSocket = new DatagramSocket(new InetSocketAddress(bindingAddress, xtrPort));
xtrThread = new LispIoThread(xtrSocket, lispXtrSouthboundService);
xtrThread.start();
- logger.info("xTR Southbound Plugin is up!");
+ LOG.info("xTR Southbound Plugin is up!");
} catch (SocketException e) {
- logger.warn("failed to start xtr thread: {}", e.getMessage());
+ LOG.warn("failed to start xtr thread: {}", e.getMessage());
}
}
public void onSessionInitiated(ProviderContext session) {
- logger.info("LISP (RFC6830) Mapping Service is up!");
+ LOG.info("LISP (RFC6830) Mapping Service is up!");
synchronized (startLock) {
if (!alreadyInit) {
alreadyInit = true;
lispXtrSouthboundService = new LispXtrSouthboundService();
registerWithOSGIConsole();
registerRPCs(session);
- logger.trace("Provider Session initialized");
+ LOG.trace("Provider Session initialized");
if (bindingAddress == null) {
setLispAddress("0.0.0.0");
}
lispXtrSouthboundService.setNotificationProvider(session.getSALService(NotificationProviderService.class));
session.addRpcImplementation(LispflowmappingService.class, this);
} catch (Exception e) {
- logger.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
InetAddress ip = InetAddresses.forString(address.getIpAddress().getIpv4Address().getValue());
packet.setAddress(ip);
try {
- if (logger.isDebugEnabled()) {
- logger.trace("Sending " + packetType + " on port " + address.getPort().getValue() + " to address: " + ip);
+ if (LOG.isDebugEnabled()) {
+ LOG.trace("Sending " + packetType + " on port " + address.getPort().getValue() + " to address: " + ip);
}
socket.send(packet);
} catch (IOException e) {
- logger.warn("Failed to send " + packetType, e);
+ LOG.warn("Failed to send " + packetType, e);
}
}
public void setLispAddress(String address) {
synchronized (startLock) {
if (bindingAddress != null && bindingAddress.equals(address)) {
- logger.trace("configured lisp binding address didn't change.");
+ LOG.trace("configured lisp binding address didn't change.");
} else {
String action = (bindingAddress == null ? "Setting" : "Resetting");
- logger.trace(action + " lisp binding address to: " + address);
+ LOG.trace(action + " lisp binding address to: " + address);
bindingAddress = address;
if (lispThread != null) {
lispThread.stopRunning();
@Override
public Future<RpcResult<Void>> sendMapNotify(SendMapNotifyInput mapNotifyInput) {
- logger.trace("sendMapNotify called!!");
+ LOG.trace("sendMapNotify called!!");
if (mapNotifyInput != null) {
ByteBuffer outBuffer = MapNotifySerializer.getInstance().serialize(mapNotifyInput.getMapNotify());
handleSerializedLispBuffer(mapNotifyInput.getTransportAddress(), outBuffer, MAP_NOTIFY);
} else {
- logger.warn("MapNotify was null");
+ LOG.warn("MapNotify was null");
}
return null;
}
@Override
public Future<RpcResult<Void>> sendMapReply(SendMapReplyInput mapReplyInput) {
- logger.trace("sendMapReply called!!");
+ LOG.trace("sendMapReply called!!");
if (mapReplyInput != null) {
ByteBuffer outBuffer = MapReplySerializer.getInstance().serialize(mapReplyInput.getMapReply());
handleSerializedLispBuffer(mapReplyInput.getTransportAddress(), outBuffer, MAP_REPlY);
} else {
- logger.warn("MapReply was null");
+ LOG.warn("MapReply was null");
}
return null;
}
@Override
public Future<RpcResult<Void>> sendMapRequest(SendMapRequestInput mapRequestInput) {
- logger.trace("sendMapRequest called!!");
+ LOG.trace("sendMapRequest called!!");
if (mapRequestInput != null) {
ByteBuffer outBuffer = MapRequestSerializer.getInstance().serialize(mapRequestInput.getMapRequest());
handleSerializedLispBuffer(mapRequestInput.getTransportAddress(), outBuffer, MAP_REQUEST);
} else {
- logger.debug("MapRequest was null");
+ LOG.debug("MapRequest was null");
}
return null;
}
public void shouldListenOnXtrPort(boolean shouldListenOnXtrPort) {
listenOnXtrPort = shouldListenOnXtrPort;
if (listenOnXtrPort) {
- logger.debug("restarting xtr thread");
+ LOG.debug("restarting xtr thread");
restartXtrThread();
} else {
- logger.debug("terminating thread");
+ LOG.debug("terminating thread");
stopXtrThread();
}
}
public class LispSouthboundService implements ILispSouthboundService {
private NotificationProviderService notificationProvider;
- protected static final Logger logger = LoggerFactory.getLogger(LispSouthboundService.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispSouthboundService.class);
public void setNotificationProvider(NotificationProviderService nps) {
this.notificationProvider = nps;
int type = ByteUtil.getUnsignedByte(inBuffer, LispMessage.Pos.TYPE) >> 4;
Object lispType = LispMessageEnum.valueOf((byte) (type));
if (lispType == LispMessageEnum.EncapsulatedControlMessage) {
- logger.trace("Received packet of type EncapsulatedControlMessage");
+ LOG.trace("Received packet of type EncapsulatedControlMessage");
handleEncapsulatedControlMessage(inBuffer, packet.getAddress());
} else if (lispType == LispMessageEnum.MapRequest) {
- logger.trace("Received packet of type MapRequest");
+ LOG.trace("Received packet of type MapRequest");
handleMapRequest(inBuffer, packet.getPort());
} else if (lispType == LispMessageEnum.MapRegister) {
- logger.trace("Received packet of type MapRegister");
+ LOG.trace("Received packet of type MapRegister");
handleMapRegister(inBuffer, packet.getAddress(), packet.getPort());
} else {
- logger.warn("Received unknown LISP control packet (type " + ((lispType != null) ? lispType : type) + ")");
- logger.trace("Buffer: " + ByteUtil.bytesToHex(packet.getData(), packet.getLength()));
+ LOG.warn("Received unknown LISP control packet (type " + ((lispType != null) ? lispType : type) + ")");
+ LOG.trace("Buffer: " + ByteUtil.bytesToHex(packet.getData(), packet.getLength()));
}
}
requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
if (notificationProvider != null) {
notificationProvider.publish(requestMappingBuilder.build());
- logger.trace("MapRequest was published!");
+ LOG.trace("MapRequest was published!");
} else {
- logger.warn("Notification Provider is null!");
+ LOG.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.trace("MapRegister was published!");
+ LOG.trace("MapRegister was published!");
} else {
- logger.warn("Notification Provider is null!");
+ LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Register (len=" + inBuffer.capacity() + ")", re);
public class LispXtrSouthboundService implements ILispSouthboundService {
private NotificationProviderService notificationProvider;
- protected static final Logger logger = LoggerFactory.getLogger(LispXtrSouthboundService.class);
+ protected static final Logger LOG = LoggerFactory.getLogger(LispXtrSouthboundService.class);
public void setNotificationProvider(NotificationProviderService nps) {
this.notificationProvider = nps;
ByteBuffer inBuffer = ByteBuffer.wrap(packet.getData(), 0, packet.getLength());
Object lispType = LispMessageEnum.valueOf((byte) (ByteUtil.getUnsignedByte(inBuffer, LispMessage.Pos.TYPE) >> 4));
if (lispType == LispMessageEnum.MapRequest) {
- logger.trace("Received packet of type MapRequest for xTR");
+ LOG.trace("Received packet of type MapRequest for xTR");
handleMapRequest(inBuffer);
} else if (lispType == LispMessageEnum.MapReply){
- logger.trace("Received packet of type MapReply for xTR");
+ LOG.trace("Received packet of type MapReply for xTR");
handleMapReply(inBuffer);
} else {
- logger.warn("Received unknown packet type");
+ LOG.warn("Received unknown packet type");
}
}
requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
if (notificationProvider != null) {
notificationProvider.publish(requestMappingBuilder.build());
- logger.trace("MapRequest was published!");
+ LOG.trace("MapRequest was published!");
} else {
- logger.warn("Notification Provider is null!");
+ LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Request (len=" + inBuffer.capacity() + ")", re);
if (notificationProvider != null) {
notificationProvider.publish(replyMappingBuilder.build());
- logger.trace("MapReply was published!");
+ LOG.trace("MapReply was published!");
} else {
- logger.warn("Notification Provider is null!");
+ LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Reply (len=" + buffer.capacity() + ")", re);