use of org.onosproject.net.group.StoredGroupEntry in project onos by opennetworkinglab.
the class SimpleVirtualGroupStore method deleteGroupDescription.
@Override
public void deleteGroupDescription(NetworkId networkId, DeviceId deviceId, GroupKey appCookie) {
// Check if a group is existing with the provided key
StoredGroupEntry existing = null;
if (groupEntriesByKey.get(networkId) != null && groupEntriesByKey.get(networkId).get(deviceId) != null) {
existing = groupEntriesByKey.get(networkId).get(deviceId).get(appCookie);
}
if (existing == null) {
return;
}
synchronized (existing) {
existing.setState(Group.GroupState.PENDING_DELETE);
}
notifyDelegate(networkId, new GroupEvent(GroupEvent.Type.GROUP_REMOVE_REQUESTED, existing));
}
use of org.onosproject.net.group.StoredGroupEntry in project onos by opennetworkinglab.
the class SimpleGroupStore method removeGroupEntry.
/**
* Removes the group entry from store.
*
* @param group group entry
*/
@Override
public void removeGroupEntry(Group group) {
StoredGroupEntry existing = (groupEntriesById.get(group.deviceId()) != null) ? groupEntriesById.get(group.deviceId()).get(group.id()) : null;
if (existing != null) {
ConcurrentMap<GroupKey, StoredGroupEntry> keyTable = getGroupKeyTable(existing.deviceId());
ConcurrentMap<GroupId, StoredGroupEntry> idTable = getGroupIdTable(existing.deviceId());
idTable.remove(existing.id());
keyTable.remove(existing.appCookie());
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing));
}
}
use of org.onosproject.net.group.StoredGroupEntry in project onos by opennetworkinglab.
the class SimpleGroupStore method deleteGroupDescription.
/**
* Triggers deleting the existing group entry.
*
* @param deviceId the device ID
* @param appCookie the group key
*/
@Override
public void deleteGroupDescription(DeviceId deviceId, GroupKey appCookie) {
// Check if a group is existing with the provided key
StoredGroupEntry existing = (groupEntriesByKey.get(deviceId) != null) ? groupEntriesByKey.get(deviceId).get(appCookie) : null;
if (existing == null) {
return;
}
synchronized (existing) {
existing.setState(GroupState.PENDING_DELETE);
}
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, existing));
}
Aggregations