import org.opendaylight.lispflowmapping.interfaces.lisp.ILispAuthentication;
-public class LispAuthenticationFactory {
+public final class LispAuthenticationFactory {
private static Map<LispKeyIDEnum, ILispAuthentication> keyIDToAuthenticationMap;
+ // Class should not be instantiated
+ private LispAuthenticationFactory() {
+ }
+
private static void initializeMap() {
keyIDToAuthenticationMap = new HashMap<LispKeyIDEnum, ILispAuthentication>();
keyIDToAuthenticationMap.put(LispKeyIDEnum.NONE, LispNoAuthentication.getInstance());
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
-public class LispAuthenticationUtil {
+public final class LispAuthenticationUtil {
+ // Utility class, should not be instantiated
+ private LispAuthenticationUtil() {
+ }
public static boolean validate(MapRegister mapRegister, String key) {
short keyId = 0;
* @author Florin Coras
*
*/
-public class DSBEInputUtil {
+public final class DSBEInputUtil {
+ // Utility class, should not be instantiated
+ private DSBEInputUtil() {
+ }
+
public static Mapping toMapping(MappingOrigin origin, Eid key, SiteId siteId, MappingRecord record) {
List<SiteId> siteIds = (siteId != null) ? Arrays.asList(siteId) : null;
return new MappingBuilder().setEidUri(new EidUri(LispAddressStringifier.getURIString(key)))
* @author Lorand Jakab
*
*/
-public class InstanceIdentifierUtil {
+public final class InstanceIdentifierUtil {
+ // Utility class, should not be instantiated
+ private InstanceIdentifierUtil() {
+ }
+
public static InstanceIdentifier<AuthenticationKey> createAuthenticationKeyIid(Eid eid) {
Preconditions.checkNotNull(eid, "Key needs and EID entry!");
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;
-public class LispNotificationHelper {
+public final class LispNotificationHelper {
+ // Utility class, should not be instantiated
+ private LispNotificationHelper() {
+ }
+
public static TransportAddress getTransportAddressFromRloc(Rloc rloc) {
TransportAddressBuilder tab = new TransportAddressBuilder();
Address address = rloc.getAddress();
* @author Florin Coras
*
*/
-public class MSNotificationInputUtil {
+public final class MSNotificationInputUtil {
+ // Utility class, should not be instantiated
+ private MSNotificationInputUtil() {
+ }
public static MappingChanged toMappingChanged(Mapping input, MappingChange change) {
return new MappingChangedBuilder().setMappingRecord(input.getMappingRecord())
* @author Lorand Jakab
*
*/
-public class RPCInputConvertorUtil {
+public final class RPCInputConvertorUtil {
+ // Utility class, should not be instantiated
+ private RPCInputConvertorUtil() {
+ }
+
public static AuthenticationKey toAuthenticationKey(AddKeyInput input) {
return toAuthenticationKey(input.getEid(), input.getMappingAuthkey());
}
* @author Lorand Jakab
*
*/
-public class LispAddressSerializerFactory {
+public final class LispAddressSerializerFactory {
private static Map<Class<? extends LispAddressFamily>, LispAddressSerializer> addressTypeToSerializerMap;
+ // Class should not be instantiated
+ private LispAddressSerializerFactory() {
+ }
+
private static void initializeMap() {
addressTypeToSerializerMap = new HashMap<Class<? extends LispAddressFamily>, LispAddressSerializer>();
addressTypeToSerializerMap.put(NoAddressAfi.class, NoAddressSerializer.getInstance());
private static Map<Short, Class<? extends LispAddressFamily>> afiToAddressTypeMap;
private static Map<Short, Class<? extends LispAddressFamily>> lcafToAddressTypeMap;
+ // Utility class, should not be instantiated
+ private AddressTypeMap() {
+ }
+
private static void initializeAfiMap() {
afiToAddressTypeMap = new HashMap<Short, Class<? extends LispAddressFamily>>();
afiToAddressTypeMap.put((short) 0, NoAddressAfi.class);
import java.nio.ByteBuffer;
-public class ByteUtil {
+public final class ByteUtil {
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
+ // Utility class, should not be instantiated
+ private ByteUtil() {
+ }
+
public static int getUnsignedByte(byte[] inBuffer, int pos) {
return inBuffer[pos] & 0xFF;
}
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;
-public class LispAddressUtil {
+public final class LispAddressUtil {
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])";
}
}
+ // Utility class, should not be instantiated
+ private LispAddressUtil() {
+ }
+
public static Class<? extends LispAddressFamily> addressTypeFromSimpleAddress(SimpleAddress address) {
if (address.getIpAddress() != null) {
return addressTypeFromIpAddress(address.getIpAddress());
* @author Lorand Jakab
*
*/
-public class LispSimpleAddressStringifier {
+public final class LispSimpleAddressStringifier {
+ // Utility class, should not be instantiated
+ private LispSimpleAddressStringifier() {
+ }
public static String getString(SimpleAddress addr) {
return getString(Destination.USER, addr);
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItem;
-public class MapNotifyBuilderHelper {
+public final class MapNotifyBuilderHelper {
+ // Utility class, should not be instantiated
+ private MapNotifyBuilderHelper() {
+ }
public static void setFromMapRegister(MapNotifyBuilder builder, MapRegister mapRegister) {
if (builder.getMappingRecordItem() == null) {
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;
-public class MapRequestUtil {
+public final class MapRequestUtil {
+ // Utility class, should not be instantiated
+ private MapRequestUtil() {
+ }
+
public static InetAddress selectItrRloc(MapRequest request) {
if (request.getItrRloc() == null) {
return null;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class MaskUtil {
+public final class MaskUtil {
private static final Logger LOG = LoggerFactory.getLogger(MaskUtil.class);
private static final short IPV4_MAX_MASK = 32;
private static final short IPV6_MAX_MASK = 128;
+ // Utility class, should not be instantiated
+ private MaskUtil() {
+ }
+
public static boolean isMaskable(Address address) {
if (address instanceof Ipv4Prefix || address instanceof Ipv6Prefix || address instanceof SourceDestKey) {
return true;
*/
package org.opendaylight.lispflowmapping.lisp.util;
-public class NumberUtil {
+public final class NumberUtil {
+ // Utility class, should not be instantiated
+ private NumberUtil() {
+ }
public static int asInt(Integer number) {
if (number != null) {
*
*/
-public class SourceDestKeyHelper {
+public final class SourceDestKeyHelper {
+ // Utility class, should not be instantiated
+ private SourceDestKeyHelper() {
+ }
+
private final static Logger LOG = LoggerFactory.getLogger(SourceDestKeyHelper.class);
public static Eid getSrc(Eid eid) {
Address addr = eid.getAddress();
*/
-public class LispUtil {
+public final class LispUtil {
+ // Utility class, should not be instantiated
+ private LispUtil() {
+ }
// private static final Logger LOG = LoggerFactory.getLogger(LispUtil.class);
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
-public class LispNotificationHelper {
+public final class LispNotificationHelper {
+ // Utility class, should not be instantiated
+ private LispNotificationHelper() {
+ }
+
public static MapRegister convertMapRegister(
org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister mapRegister) {
return new MapRegisterBuilder().setAuthenticationData(mapRegister.getAuthenticationData())