Search in sources :

Example 1 with Element

use of org.onosproject.net.Element 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;
}
Also used : Annotations(org.onosproject.net.Annotations) Device(org.onosproject.net.Device) Element(org.onosproject.net.Element)

Example 2 with Element

use of org.onosproject.net.Element in project onos by opennetworkinglab.

the class DefaultPortSerializer method read.

@Override
public DefaultPort read(Kryo kryo, Input input, Class<DefaultPort> aClass) {
    Element element = (Element) kryo.readClassAndObject(input);
    PortNumber number = kryo.readObject(input, PortNumber.class);
    boolean isEnabled = input.readBoolean();
    Port.Type type = kryo.readObject(input, Port.Type.class);
    long portSpeed = input.readLong();
    Annotations annotations = (Annotations) kryo.readClassAndObject(input);
    return new DefaultPort(element, number, isEnabled, type, portSpeed, annotations);
}
Also used : Annotations(org.onosproject.net.Annotations) Element(org.onosproject.net.Element) DefaultPort(org.onosproject.net.DefaultPort) Port(org.onosproject.net.Port) PortNumber(org.onosproject.net.PortNumber) DefaultPort(org.onosproject.net.DefaultPort)

Aggregations

Annotations (org.onosproject.net.Annotations)2 Element (org.onosproject.net.Element)2 DefaultPort (org.onosproject.net.DefaultPort)1 Device (org.onosproject.net.Device)1 Port (org.onosproject.net.Port)1 PortNumber (org.onosproject.net.PortNumber)1