public class LispMappingService implements IFlowMapping, IMapRequestResultHandler,
IMapNotifyHandler, OdlLispProtoListener, AutoCloseable, ClusterSingletonService {
- public static final String LISPFLOWMAPPING_ENTITY_NAME = "lispflowmapping";
- public static final ServiceGroupIdentifier SERVICE_GROUP_IDENTIFIER = ServiceGroupIdentifier.create(
+ private static final String LISPFLOWMAPPING_ENTITY_NAME = "lispflowmapping";
+ private static final ServiceGroupIdentifier SERVICE_GROUP_IDENTIFIER = ServiceGroupIdentifier.create(
LISPFLOWMAPPING_ENTITY_NAME);
- protected static final Logger LOG = LoggerFactory.getLogger(LispMappingService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(LispMappingService.class);
private final ClusterSingletonServiceProvider clusterSingletonService;
private volatile boolean smr = ConfigIni.getInstance().smrIsSet();
tlsMapRequest.set(new MutablePair<MapRequest, TransportAddress>(mapRequest, transportAddress));
}
- public void destroy() {
+ private void destroy() {
LOG.info("LISP (RFC6830) Mapping Service is destroyed!");
mapResolver = null;
mapServer = null;
*
*/
public class MappingService implements OdlMappingserviceService, IMappingService, AutoCloseable {
- protected static final Logger LOG = LoggerFactory.getLogger(MappingService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MappingService.class);
private static final String NOT_FOUND_TAG = "data-missing";
private static final String DATA_EXISTS_TAG = "data-exists";
import org.slf4j.LoggerFactory;
public class MapResolver implements IMapResolverAsync {
- protected static final Logger LOG = LoggerFactory.getLogger(MapResolver.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MapResolver.class);
private IMappingService mapService;
private boolean subscriptionService;
public class MapServer implements IMapServerAsync, OdlMappingserviceListener, ISmrNotificationListener {
- protected static final Logger LOG = LoggerFactory.getLogger(MapServer.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MapServer.class);
private static final byte[] ALL_ZEROES_XTR_ID = new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0};
private IMappingService mapService;
private boolean subscriptionService;
private ListenerRegistration<ClusteredDataTreeChangeListener<T>> configRegistration;
private ListenerRegistration<ClusteredDataTreeChangeListener<T>> operRegistration;
- public void registerDataChangeListener() {
+ void registerDataChangeListener() {
final DataTreeIdentifier<T> configDataTreeIdentifier = new DataTreeIdentifier<>(
LogicalDatastoreType.CONFIGURATION, path);
final DataTreeIdentifier<T> operDataTreeIdentifier = new DataTreeIdentifier<>(
operRegistration.close();
}
- public void setBroker(DataBroker broker) {
+ void setBroker(DataBroker broker) {
this.broker = broker;
}
public class TimeBucket {
private static final Logger LOG = LoggerFactory.getLogger(TimeBucket.class);
- private ConcurrentHashMap<Eid, MappingData> bucketElements;
+ private final ConcurrentHashMap<Eid, MappingData> bucketElements;
- private MappingSystem mappingSystem;
+ private final MappingSystem mappingSystem;
public TimeBucket(MappingSystem mappingSystem) {
bucketElements = new ConcurrentHashMap<>();
public class TimeBucketMappingTimeoutService implements ISouthBoundMappingTimeoutService {
private static final Logger LOG = LoggerFactory.getLogger(TimeBucketWheel.class);
- TimeBucketWheel timeBucketWheel;
+ private final TimeBucketWheel timeBucketWheel;
public TimeBucketMappingTimeoutService(int numberOfBucket, long mappingRecordValidityInMillis,
MappingSystem mappingSystem) {
import org.slf4j.LoggerFactory;
public final class LispNotificationHelper {
- protected static final Logger LOG = LoggerFactory.getLogger(LispNotificationHelper.class);
+ private static final Logger LOG = LoggerFactory.getLogger(LispNotificationHelper.class);
private static final Splitter COLON_SPLITTER = Splitter.on(':');
// Utility class, should not be instantiated
public static InetAddress getAddressByName(String ipAddress) {
try {
- InetAddress address = InetAddress.getByName(ipAddress);
- return address;
+ return InetAddress.getByName(ipAddress);
} catch (UnknownHostException e) {
LOG.debug("Unknown host {}", ipAddress, e);
return null;
* @author Lorand Jakab
*
*/
-public class LoggingUtil {
+public final class LoggingUtil {
// Utility class, should not be instantiated
private LoggingUtil() {
}
*
*/
public final class MappingMergeUtil {
- protected static final Logger LOG = LoggerFactory.getLogger(MappingMergeUtil.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MappingMergeUtil.class);
// Utility class, should not be instantiated
private MappingMergeUtil() {
Rloc newRloc = newLocator.getRloc();
if (locatorMap.containsKey(newRloc)) {
// overlapping locator
- if (locatorMap.get(newRloc).equals(newLocator)) {
- continue;
- } else {
+ if (!locatorMap.get(newRloc).equals(newLocator)) {
LocatorRecord mergedLocator = mergeLocators(locatorMap.get(newRloc), newLocator);
newLocatorList.add(mergedLocator);
}
}
// Build new merged and sorted locator set if need be
- if (newLocatorList.size() != 0) {
+ if (!newLocatorList.isEmpty()) {
List<LocatorRecord> mergedLocators = new ArrayList<LocatorRecord>();
int mlocIt = 0;
return timestampIsExpired(timestamp.getTime());
}
- public static boolean timestampIsExpired(Long timestamp) {
+ private static boolean timestampIsExpired(Long timestamp) {
Preconditions.checkNotNull(timestamp, "timestamp should not be null!");
if ((System.currentTimeMillis() - timestamp) > ConfigIni.getInstance().getRegistrationValiditySb()) {
return true;