Search in sources :

Example 1 with VnetService

use of org.onosproject.incubator.net.virtual.VnetService in project onos by opennetworkinglab.

the class VirtualNetworkManager method create.

/**
 * Create a new vnet service instance.
 *
 * @param serviceKey service key
 * @return vnet service
 */
private VnetService create(ServiceKey serviceKey) {
    VirtualNetwork network = getVirtualNetwork(serviceKey.networkId());
    checkNotNull(network, NETWORK_NULL);
    VnetService service;
    if (serviceKey.serviceClass.equals(DeviceService.class)) {
        service = new VirtualNetworkDeviceManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(LinkService.class)) {
        service = new VirtualNetworkLinkManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(TopologyService.class)) {
        service = new VirtualNetworkTopologyManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(IntentService.class)) {
        service = new VirtualNetworkIntentManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(HostService.class)) {
        service = new VirtualNetworkHostManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(PathService.class)) {
        service = new VirtualNetworkPathManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(FlowRuleService.class)) {
        service = new VirtualNetworkFlowRuleManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(PacketService.class)) {
        service = new VirtualNetworkPacketManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(GroupService.class)) {
        service = new VirtualNetworkGroupManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(MeterService.class)) {
        service = new VirtualNetworkMeterManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(FlowObjectiveService.class)) {
        service = new VirtualNetworkFlowObjectiveManager(this, network.id());
    } else if (serviceKey.serviceClass.equals(MastershipService.class) || serviceKey.serviceClass.equals(MastershipAdminService.class) || serviceKey.serviceClass.equals(MastershipTermService.class)) {
        service = new VirtualNetworkMastershipManager(this, network.id());
    } else {
        return null;
    }
    networkServices.put(serviceKey, service);
    return service;
}
Also used : IntentService(org.onosproject.net.intent.IntentService) PacketService(org.onosproject.net.packet.PacketService) MastershipAdminService(org.onosproject.mastership.MastershipAdminService) VnetService(org.onosproject.incubator.net.virtual.VnetService) MastershipService(org.onosproject.mastership.MastershipService) VirtualNetwork(org.onosproject.incubator.net.virtual.VirtualNetwork) PathService(org.onosproject.net.topology.PathService) LinkService(org.onosproject.net.link.LinkService) MeterService(org.onosproject.net.meter.MeterService)

Example 2 with VnetService

use of org.onosproject.incubator.net.virtual.VnetService in project onos by opennetworkinglab.

the class VirtualNetworkManager method get.

@Override
@SuppressWarnings("unchecked")
public <T> T get(NetworkId networkId, Class<T> serviceClass) {
    checkNotNull(networkId, NETWORK_NULL);
    ServiceKey serviceKey = networkServiceKey(networkId, serviceClass);
    VnetService service = lookup(serviceKey);
    if (service == null) {
        service = create(serviceKey);
    }
    return (T) service;
}
Also used : VnetService(org.onosproject.incubator.net.virtual.VnetService)

Aggregations

VnetService (org.onosproject.incubator.net.virtual.VnetService)2 VirtualNetwork (org.onosproject.incubator.net.virtual.VirtualNetwork)1 MastershipAdminService (org.onosproject.mastership.MastershipAdminService)1 MastershipService (org.onosproject.mastership.MastershipService)1 IntentService (org.onosproject.net.intent.IntentService)1 LinkService (org.onosproject.net.link.LinkService)1 MeterService (org.onosproject.net.meter.MeterService)1 PacketService (org.onosproject.net.packet.PacketService)1 PathService (org.onosproject.net.topology.PathService)1