- @Override
- public void addMapping(MappingOrigin origin, Eid key, SiteId siteId, Object data, boolean merge) {
- // SB registrations are first written to the MappingSystem and only afterwards are persisted to the datastore
- if (origin.equals(MappingOrigin.Southbound)) {
- // Store data first in MapCache and only afterwards persist to datastore. This should be used only for SB
- // registrations
- mappingSystem.addMapping(origin, key, data, merge);
- dsbe.addMapping(DSBEInputUtil.toMapping(origin, key, siteId, (MappingRecord) data));
- if (((MappingRecord) data).getXtrId() != null) {
- dsbe.addXtrIdMapping(DSBEInputUtil.toXtrIdMapping((MappingRecord) data));
- }
- } else {
- dsbe.addMapping(DSBEInputUtil.toMapping(origin, key, siteId, (MappingRecord) data));
- }
- }
-
- @Override
- public void updateMappingRegistration(MappingOrigin origin, Eid key, Long timestamp) {
- mappingSystem.updateMappingRegistration(origin, key, timestamp);
- }
-
- @Override
- public Object getMapping(MappingOrigin origin, Eid key) {
- return mappingSystem.getMapping(origin, key);
- }
-
- @Override
- public Object getMapping(Eid key) {
- return mappingSystem.getMapping(key);
- }
-
- @Override
- public Object getMapping(Eid srcKey, Eid dstKey) {
- return mappingSystem.getMapping(srcKey, dstKey);
- }
-