@Override public void groupOperationFailed(DeviceId deviceId, GroupOperation operation) { store.groupOperationFailed(deviceId, operation); }
@Override public void notifyOfFailovers(Collection<Group> failoverGroups) { store.notifyOfFailovers(failoverGroups); } }
private void processEventInternal(DeviceEvent event) { switch (event.type()) { case DEVICE_REMOVED: case DEVICE_AVAILABILITY_CHANGED: DeviceId deviceId = event.subject().id(); if (!deviceService.isAvailable(deviceId)) { log.debug("Device {} became unavailable for {}; clearing initial audit status", deviceId, event.type()); store.deviceInitialAuditCompleted(deviceId, false); if (purgeOnDisconnection) { store.purgeGroupEntry(deviceId); } } break; default: break; } } }
@Override public Iterable<Group> getGroups(DeviceId deviceId) { checkPermission(GROUP_READ); return store.getGroups(deviceId); }
@Override public void purgeGroupEntries(DeviceId deviceId) { checkPermission(GROUP_WRITE); store.purgeGroupEntry(deviceId); }
@Override public void purgeGroupEntries() { checkPermission(GROUP_WRITE); store.purgeGroupEntries(); }
@Override public void pushGroupMetrics(DeviceId deviceId, Collection<Group> groupEntries) { log.trace("Received group metrics from device {}", deviceId); checkValidity(); store.pushGroupMetrics(deviceId, groupEntries); }
/** * Delete a group associated to an application cookie. * GROUP_DELETED or GROUP_DELETE_FAILED notifications would be * provided along with cookie depending on the result of the * operation on the device. * * @param deviceId device identifier * @param appCookie application cookie to be used for lookup * @param appId Application Id */ @Override public void removeGroup(DeviceId deviceId, GroupKey appCookie, ApplicationId appId) { checkPermission(GROUP_WRITE); store.deleteGroupDescription(deviceId, appCookie); }
/** * Return a group object associated to an application cookie. * <p> * NOTE1: The presence of group object in the system does not * guarantee that the "group" is actually created in device. * GROUP_ADDED notification would confirm the creation of * this group in data plane. * * @param deviceId device identifier * @param appCookie application cookie to be used for lookup * @return group associated with the application cookie or * NULL if Group is not found for the provided cookie */ @Override public Group getGroup(DeviceId deviceId, GroupKey appCookie) { checkPermission(GROUP_READ); return store.getGroup(deviceId, appCookie); }
@Activate public void activate(ComponentContext context) { eventExecutor = Executors.newSingleThreadExecutor(groupedThreads("onos/group", "event")); store.setDelegate(delegate); eventDispatcher.addSink(GroupEvent.class, listenerRegistry); deviceService.addListener(deviceListener); cfgService.registerProperties(getClass()); modified(context); log.info("Started"); }
/** * Retrieve all groups created by an application in the specified device * as seen by current controller instance. * * @param deviceId device identifier * @param appId application id * @return collection of immutable group objects created by the application */ @Override public Iterable<Group> getGroups(DeviceId deviceId, ApplicationId appId) { checkPermission(GROUP_READ); return store.getGroups(deviceId); }