public static final BigInteger METADA_MASK_TUNNEL_ID = new BigInteger("00000000FFFFFF00", 16);
public static final BigInteger METADATA_MASK_SERVICE_SH_FLAG = new BigInteger("000000FFFF000001", 16);
public static final BigInteger METADATA_MASK_LPORT_TAG_SH_FLAG = new BigInteger("1FFFFF0000000001", 16);
+ public static final BigInteger METADATA_MASK_ELAN_SUBNET_ROUTE = new BigInteger("0000FFFF00000000", 16);
public static final BigInteger METADATA_MASK_SUBNET_ROUTE = new BigInteger("0000FFFFFFFFFFFF", 16);
public static BigInteger getMetaDataForLPortDispatcher(int lportTag, short serviceIndex) {
return (metadata.and(METADATA_MASK_VRFID)).longValue();
}
+ public static long getVpnIdFromMetadata(BigInteger metadata) {
+ return (metadata.and(METADATA_MASK_VRFID)).longValue();
+ }
public static BigInteger getWriteMetaDataMaskForDispatcherTable() {
return new BigInteger("FFFFFFFFFFFFFFFF", 16);
}
public static final int DEFAULT_ARP_FLOW_PRIORITY = 100;
+ public static final int SCF_SERVICE_INDEX = 1;
+ public static final int L3VPN_SERVICE_INDEX = 2;
+ public static final int ELAN_SERVICE_INDEX = 3;
//Table IDs
public static final short L3_FIB_TABLE = 21;
public static final short L3_LFIB_TABLE = 20;
public class EntityOwnerUtils {
public static final String ENTITY_OWNER_CACHE = "entity.owner.cache";
private static final Logger LOG = LoggerFactory.getLogger(EntityOwnerUtils.class);
+ static final ArrayList<EntityEvent> eventsHistory = new ArrayList<>();
+ public static class EntityEvent {
+ long time;
+ String entityName;
+ boolean isOwner;
+ boolean hasOwner;
+ public EntityEvent(long time, String entityName, boolean hasOwner, boolean isOwner) {
+ this.time = time;
+ this.entityName = entityName;
+ this.hasOwner = hasOwner;
+ this.isOwner = isOwner;
+ }
+ public long getTime() {
+ return time;
+ }
+ public String getEntityName() {
+ return entityName;
+ }
+ public boolean isOwner() {
+ return isOwner;
+ }
+ public boolean hasOwner() {
+ return hasOwner;
+ }
+ }
+ public static ArrayList<EntityEvent> getEventsHistory() {
+ return eventsHistory;
+ }
static {
createEntityOwnerCache();
String entityType = ownershipChange.getEntity().getType();
String entityName = ownershipChange.getEntity().getId().toString();
LOG.info("entity ownership changed for "+entityType);
+ eventsHistory.add(new EntityEvent(System.currentTimeMillis(), entityName, ownershipChange.hasOwner() ,
+ ownershipChange.isOwner()));
if (ownershipChange.hasOwner() && ownershipChange.isOwner()) {
LOG.info("entity ownership change became owner for type "+entityType);
updateEntityOwner(entityType, entityName, Boolean.TRUE);