use of org.onosproject.net.Annotations in project onos by opennetworkinglab.
the class SuppressionRules method isSuppressed.
public boolean isSuppressed(Port port) {
Element parent = port.element();
if (parent instanceof Device) {
if (isSuppressed((Device) parent)) {
return true;
}
}
final Annotations annotations = port.annotations();
if (containsSuppressionAnnotation(annotations)) {
return true;
}
return false;
}
use of org.onosproject.net.Annotations in project onos by opennetworkinglab.
the class MeteredConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
Annotations annotations1 = DefaultAnnotations.builder().set(METERED, METERED1).build();
Annotations annotations2 = DefaultAnnotations.builder().set(METERED, METERED2).build();
meteredLink = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN1)).dst(cp(DID2, PN2)).type(DIRECT).annotations(annotations1).build();
nonMeteredLink = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN3)).dst(cp(DID3, PN4)).type(DIRECT).annotations(annotations2).build();
unAnnotatedLink = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN5)).dst(cp(DID3, PN6)).type(DIRECT).build();
meteredPath = new DefaultPath(PROVIDER_ID, Arrays.asList(meteredLink, nonMeteredLink), ScalarWeight.toWeight(10));
nonMeteredPath = new DefaultPath(PROVIDER_ID, Arrays.asList(nonMeteredLink, unAnnotatedLink), ScalarWeight.toWeight(10));
}
use of org.onosproject.net.Annotations in project onos by opennetworkinglab.
the class TierConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
Annotations annotations1 = DefaultAnnotations.builder().set(TIER, TIER1).build();
Annotations annotations2 = DefaultAnnotations.builder().set(TIER, TIER2).build();
Annotations annotations3 = DefaultAnnotations.builder().set(TIER, TIER3).build();
link1 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN1)).dst(cp(DID2, PN2)).type(DIRECT).annotations(annotations1).build();
link2 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN3)).dst(cp(DID3, PN4)).type(DIRECT).annotations(annotations2).build();
link3 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN5)).dst(cp(DID4, PN6)).type(DIRECT).annotations(annotations3).build();
path12 = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
path13 = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link3), ScalarWeight.toWeight(10));
path23 = new DefaultPath(PROVIDER_ID, Arrays.asList(link2, link3), ScalarWeight.toWeight(10));
}
use of org.onosproject.net.Annotations in project onos by opennetworkinglab.
the class HostServiceAdapter method getHost.
@Override
public Host getHost(HostId hostId) {
ProviderId providerId = ProviderId.NONE;
MacAddress mac = MacAddress.valueOf("fa:12:3e:56:ee:a2");
VlanId vlan = VlanId.NONE;
HostLocation location = HostLocation.NONE;
Set<IpAddress> ips = Sets.newHashSet();
Annotations annotations = null;
return new DefaultHost(providerId, hostId, mac, vlan, location, ips, annotations);
}
use of org.onosproject.net.Annotations in project onos by opennetworkinglab.
the class TopologyViewMessageHandlerBase method deviceDetails.
// Generates a property panel model for device details response
protected PropertyPanel deviceDetails(DeviceId deviceId) {
log.debug("generate prop panel data for device {}", deviceId);
Device device = services.device().getDevice(deviceId);
Annotations annot = device.annotations();
String proto = annot.value(AnnotationKeys.PROTOCOL);
String title = friendlyDevice(deviceId);
LionBundle lion = getLionBundle(LION_TOPO);
PropertyPanel pp = new PropertyPanel(title, lookupGlyph(device)).navPath(DEVICE_NAV_PATH).id(deviceId.toString());
addDeviceBasicProps(pp, deviceId, device, proto, lion);
addLocationProps(pp, annot, lion);
addDeviceCountStats(pp, deviceId, lion);
addDeviceCoreButtons(pp);
return pp;
}
Aggregations