当前位置: 首页>>代码示例>>Java>>正文


Java VirtualNetworkService.get方法代码示例

本文整理汇总了Java中org.onosproject.incubator.net.virtual.VirtualNetworkService.get方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualNetworkService.get方法的具体用法?Java VirtualNetworkService.get怎么用?Java VirtualNetworkService.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.incubator.net.virtual.VirtualNetworkService的用法示例。


在下文中一共展示了VirtualNetworkService.get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VirtualNetworkGroupManager

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
public VirtualNetworkGroupManager(VirtualNetworkService manager, NetworkId networkId) {
    super(manager, networkId, GroupEvent.class);

    store = serviceDirectory.get(VirtualNetworkGroupStore.class);
    deviceService = manager.get(networkId, DeviceService.class);

    providerRegistryService =
            serviceDirectory.get(VirtualProviderRegistryService.class);
    innerProviderService = new InternalGroupProviderService();
    providerRegistryService.registerProviderService(networkId(), innerProviderService);

    this.storeDelegate = new InternalStoreDelegate();
    store.setDelegate(networkId, this.storeDelegate);

    log.info("Started");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:17,代码来源:VirtualNetworkGroupManager.java

示例2: execute

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
@Override
protected void execute() {
    CoreService coreService = get(CoreService.class);

    VirtualNetworkService vnetservice = get(VirtualNetworkService.class);
    DeviceService deviceService = vnetservice.get(NetworkId.networkId(networkId),
                                                  DeviceService.class);
    FlowRuleService service = vnetservice.get(NetworkId.networkId(networkId),
                                              FlowRuleService.class);
    contentFilter = new StringFilter(filter, StringFilter.Strategy.AND);

    compilePredicate();

    SortedMap<Device, List<FlowEntry>> flows = getSortedFlows(deviceService, service);

    if (outputJson()) {
        print("%s", json(flows.keySet(), flows));
    } else {
        flows.forEach((device, flow) -> printFlows(device, flow, coreService));
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:22,代码来源:VirtualFlowsListCommand.java

示例3: DefaultOFSwitch

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
private DefaultOFSwitch(DatapathId dpid, OFSwitchCapabilities capabilities,
                        NetworkId networkId, DeviceId deviceId,
                        ServiceDirectory serviceDirectory) {
    this.dpId = dpid;
    this.capabilities = capabilities;
    this.networkId = networkId;
    this.deviceId = deviceId;
    this.ofSwitchService = serviceDirectory.get(OFSwitchService.class);
    this.driverService = serviceDirectory.get(DriverService.class);
    this.virtualNetworkAdminService = serviceDirectory.get(VirtualNetworkAdminService.class);
    VirtualNetworkService virtualNetworkService = serviceDirectory.get(VirtualNetworkService.class);
    this.flowRuleService = virtualNetworkService.get(networkId, FlowRuleService.class);
    this.groupService = virtualNetworkService.get(networkId, GroupService.class);
    this.meterService = virtualNetworkService.get(networkId, MeterService.class);

    log = LoggerFactory.getLogger(OFAgent.TRACER_LOG_TENANT_ID_PREFIX + virtualNetworkService.getTenantId(networkId)
                                          + " " + getClass().getSimpleName() + " : " + dpid);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:19,代码来源:DefaultOFSwitch.java

示例4: VirtualNetworkPathManager

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
/**
 * Creates a new virtual network path service object.
 *
 * @param virtualNetworkManager virtual network manager service
 * @param networkId a virtual network identifier
 */

public VirtualNetworkPathManager(VirtualNetworkService virtualNetworkManager,
                                 NetworkId networkId) {
    this.networkId = networkId;

    topologyService = virtualNetworkManager.get(networkId(), TopologyService.class);
    hostService = virtualNetworkManager.get(networkId(), HostService.class);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:15,代码来源:VirtualNetworkPathManager.java

示例5: VirtualNetworkFlowObjectiveManager

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
public VirtualNetworkFlowObjectiveManager(VirtualNetworkService manager,
                                          NetworkId networkId) {
    super(manager, networkId);

    deviceService = manager.get(networkId(), DeviceService.class);
    flowRuleService = manager.get(networkId(), FlowRuleService.class);

    executorService = newFixedThreadPool(4, groupedThreads("onos/virtual/objective-installer", "%d", log));

    virtualFlowObjectiveStore =
            serviceDirectory.get(VirtualNetworkFlowObjectiveStore.class);
    delegate = new InternalStoreDelegate();
    virtualFlowObjectiveStore.setDelegate(networkId(), delegate);
    flowObjectiveStore = new StoreConvertor();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:16,代码来源:VirtualNetworkFlowObjectiveManager.java

示例6: execute

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
@Override
protected void execute() {
    VirtualNetworkService service = get(VirtualNetworkService.class);
    IntentService virtualNetworkIntentService = service.get(NetworkId.networkId(networkId), IntentService.class);

    ConnectPoint ingress = ConnectPoint.deviceConnectPoint(ingressDeviceString);
    ConnectPoint egress = ConnectPoint.deviceConnectPoint(egressDeviceString);

    TrafficSelector selector = buildTrafficSelector();
    TrafficTreatment treatment = buildTrafficTreatment();

    List<Constraint> constraints = buildConstraints();

    Intent intent = VirtualNetworkIntent.builder()
            .networkId(NetworkId.networkId(networkId))
            .appId(appId())
            .key(key())
            .selector(selector)
            .treatment(treatment)
            .ingressPoint(ingress)
            .egressPoint(egress)
            .constraints(constraints)
            .priority(priority())
            .build();
    virtualNetworkIntentService.submit(intent);
    print("Virtual intent submitted:\n%s", intent.toString());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:28,代码来源:VirtualNetworkIntentCreateCommand.java

示例7: execute

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
@Override
protected void execute() {
    VirtualNetworkService vnetService = get(VirtualNetworkService.class);
    MastershipAdminService mastershipAdminService = vnetService
            .get(NetworkId.networkId(networkId), MastershipAdminService.class);
    mastershipAdminService.balanceRoles();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:8,代码来源:VirtualNetworkBalanceMastersCommand.java

示例8: execute

import org.onosproject.incubator.net.virtual.VirtualNetworkService; //导入方法依赖的package包/类
@Override
protected void execute() {
    VirtualNetworkService service = get(VirtualNetworkService.class);
    PacketService virtualPacketService = service.get(NetworkId.networkId(networkId), PacketService.class);

    if (command == null) {
        print("Command is not defined");
        return;
    }

    if (command.equals("getRequests")) {
        getRequests(virtualPacketService);
        return;
    }

    TrafficSelector selector = buildTrafficSelector();
    PacketPriority packetPriority = PacketPriority.CONTROL; //TODO allow user to specify
    Optional<DeviceId> optionalDeviceId = null;
    if (!isNullOrEmpty(deviceIdString)) {
        optionalDeviceId = Optional.of(DeviceId.deviceId(deviceIdString));
    }

    if (command.equals("requestPackets")) {
        if (optionalDeviceId != null) {
            virtualPacketService.requestPackets(selector, packetPriority, appId(), optionalDeviceId);
        } else {
            virtualPacketService.requestPackets(selector, packetPriority, appId());
        }
        print("Virtual packet requested:\n%s", selector);
        return;
    }

   if (command.equals("cancelPackets")) {
        if (optionalDeviceId != null) {
            virtualPacketService.cancelPackets(selector, packetPriority, appId(), optionalDeviceId);
        } else {
            virtualPacketService.cancelPackets(selector, packetPriority, appId());
        }
        print("Virtual packet cancelled:\n%s", selector);
        return;
    }

    print("Unsupported command %s", command);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:45,代码来源:VirtualNetworkPacketRequestCommand.java


注:本文中的org.onosproject.incubator.net.virtual.VirtualNetworkService.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。