Search in sources :

Example 31 with VplsData

use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.

the class VplsStoreTest method testRemoveVpls.

/**
 * Removes a VPLS from store; checks if config store is also updated.
 */
@Test
public void testRemoveVpls() {
    VplsData vplsData = VplsData.of(VPLS1, VLAN);
    vplsStore.addVpls(vplsData);
    vplsStore.removeVpls(vplsData);
    Collection<VplsData> vplsDataCollection = vplsStore.getAllVpls();
    assertEquals(0, vplsDataCollection.size());
    VplsAppConfig storedConfig = vplsStore.networkConfigService.getConfig(null, VplsAppConfig.class);
    assertNotEquals(-1L, storedConfig.updateTime());
    assertEquals(0, storedConfig.vplss().size());
}
Also used : VplsData(org.onosproject.vpls.api.VplsData) VplsAppConfig(org.onosproject.vpls.config.VplsAppConfig) VplsTest(org.onosproject.vpls.VplsTest) Test(org.junit.Test)

Example 32 with VplsData

use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.

the class VplsManager method removeInterface.

@Override
public Interface removeInterface(VplsData vplsData, Interface iface) {
    requireNonNull(vplsData);
    requireNonNull(iface);
    VplsData newData = VplsData.of(vplsData);
    newData.removeInterface(iface);
    updateVplsStatus(newData, VplsData.VplsState.UPDATING);
    return iface;
}
Also used : VplsData(org.onosproject.vpls.api.VplsData)

Example 33 with VplsData

use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.

the class VplsManager method removeVpls.

@Override
public VplsData removeVpls(VplsData vplsData) {
    requireNonNull(vplsData);
    VplsData newData = VplsData.of(vplsData);
    newData.state(VplsData.VplsState.REMOVING);
    vplsStore.removeVpls(vplsData);
    return vplsData;
}
Also used : VplsData(org.onosproject.vpls.api.VplsData)

Example 34 with VplsData

use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.

the class VplsManager method addInterface.

@Override
public void addInterface(VplsData vplsData, Interface iface) {
    requireNonNull(vplsData);
    requireNonNull(iface);
    VplsData newData = VplsData.of(vplsData);
    newData.addInterface(iface);
    updateVplsStatus(newData, VplsData.VplsState.UPDATING);
}
Also used : VplsData(org.onosproject.vpls.api.VplsData)

Example 35 with VplsData

use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.

the class VplsManager method createVpls.

@Override
public VplsData createVpls(String vplsName, EncapsulationType encapsulationType) {
    requireNonNull(vplsName);
    requireNonNull(encapsulationType);
    if (vplsStore.getVpls(vplsName) != null) {
        return null;
    }
    VplsData vplsData = VplsData.of(vplsName, encapsulationType);
    vplsStore.addVpls(vplsData);
    return vplsData;
}
Also used : VplsData(org.onosproject.vpls.api.VplsData)

Aggregations

VplsData (org.onosproject.vpls.api.VplsData)73 Test (org.junit.Test)44 VplsOperation (org.onosproject.vpls.api.VplsOperation)18 VplsTest (org.onosproject.vpls.VplsTest)11 ArrayDeque (java.util.ArrayDeque)10 Interface (org.onosproject.net.intf.Interface)10 Vpls (org.onosproject.vpls.api.Vpls)7 NetworkConfigEvent (org.onosproject.net.config.NetworkConfigEvent)6 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 Host (org.onosproject.net.Host)4 HostEvent (org.onosproject.net.host.HostEvent)4 Intent (org.onosproject.net.intent.Intent)4 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 Objects (java.util.Objects)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3 MacAddress (org.onlab.packet.MacAddress)3