use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class AuthKeyDb method removeAuthenticationKey.
@Override
public void removeAuthenticationKey(Eid eid) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getVniTable(key);
if (table == null) {
return;
}
table.removeSpecific(key, SubKeys.AUTH_KEY);
if (table.isEmpty()) {
removeVniTable(eid);
}
}
use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class AuthKeyDb method addAuthenticationKey.
@Override
public void addAuthenticationKey(Eid eid, MappingAuthkey authKey) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getOrInstantiateVniTable(key);
table.put(key, new MappingEntry<>(SubKeys.AUTH_KEY, authKey));
}
use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class AuthKeyDb method getAuthenticationKey.
/*
* Retrieves authentication key from the database. As opposed to the mapping cache, Source/Dest keys are treated as
* exact match keys here, and a two level longest prefix match is NOT performed.
*/
@Override
public MappingAuthkey getAuthenticationKey(Eid eid) {
ILispDAO table = getVniTable(eid);
if (table == null) {
return null;
}
if (MaskUtil.isMaskable(eid.getAddress()) && !(eid.getAddress() instanceof SourceDestKey)) {
return getAuthKeyLpm(eid, table);
} else {
Eid key = MaskUtil.normalize(eid);
Object password = table.getSpecific(key, SubKeys.AUTH_KEY);
if (password != null && password instanceof MappingAuthkey) {
return (MappingAuthkey) password;
} else {
LOG.warn("Failed to find password!");
return null;
}
}
}
use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class MultiTableMapCache method removeData.
@Override
public void removeData(Eid eid, String subKey) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getVniTable(key);
if (table == null) {
return;
}
if (key.getAddress() instanceof SourceDestKey) {
ILispDAO db = getSDInnerDao(key, table);
if (db != null) {
db.removeSpecific(SourceDestKeyHelper.getSrcBinary(key), subKey);
if (db.isEmpty()) {
removeSDInnerDao(key, table);
}
}
} else {
table.removeSpecific(key, subKey);
}
if (table.isEmpty()) {
removeVniTable(eid);
}
}
use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class MultiTableMapCache method removeMapping.
public void removeMapping(Eid eid) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getVniTable(key);
if (table == null) {
return;
}
if (key.getAddress() instanceof SourceDestKey) {
ILispDAO db = getSDInnerDao(key, table);
if (db != null) {
db.remove(SourceDestKeyHelper.getSrcBinary(key));
if (db.isEmpty()) {
removeSDInnerDao(key, table);
}
}
} else {
table.remove(key);
}
if (table.isEmpty()) {
removeVniTable(eid);
}
}
Aggregations