use of org.onosproject.net.intent.ObjectiveTrackerService in project onos by opennetworkinglab.
the class IntentsDiagnosisCommand method buildServiceRefs.
private ServiceRefs buildServiceRefs() {
IntentService intentsService = get(IntentService.class);
if (intentsService == null) {
return null;
}
DeviceService deviceService = get(DeviceService.class);
if (deviceService == null) {
return null;
}
FlowStatisticService flowStatsService = get(FlowStatisticService.class);
if (flowStatsService == null) {
return null;
}
FlowRuleService flowService = get(FlowRuleService.class);
if (flowService == null) {
return null;
}
WorkPartitionService workPartitionService = get(WorkPartitionService.class);
if (workPartitionService == null) {
return null;
}
ObjectiveTrackerService objectiveTrackerService = get(ObjectiveTrackerService.class);
if (objectiveTrackerService == null) {
return null;
}
return new ServiceRefs(intentsService, deviceService, flowService, workPartitionService, objectiveTrackerService);
}
use of org.onosproject.net.intent.ObjectiveTrackerService in project onos by opennetworkinglab.
the class IntentsDiagnosisCommand method getIntentsByLinkSet.
private Set<Map.Entry<LinkKey, Key>> getIntentsByLinkSet(ServiceRefs svcRefs) {
try {
ObjectiveTrackerService objTracker = svcRefs.getObjectiveTrackerService();
// Utilizing reflection instead of adding new interface for getting intentsByLink
Field f = objTracker.getClass().getDeclaredField(FIELD_INTENTS_BY_LINK);
f.setAccessible(true);
SetMultimap<LinkKey, Key> intentsByLink = (SetMultimap<LinkKey, Key>) f.get(objTracker);
return ImmutableSet.copyOf(intentsByLink.entries());
} catch (NoSuchFieldException | IllegalAccessException ex) {
error("error: " + ex);
return ImmutableSet.of();
}
}
Aggregations