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;
}
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;
}
Aggregations