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


Java RegionAdminService类代码示例

本文整理汇总了Java中org.onosproject.net.region.RegionAdminService的典型用法代码示例。如果您正苦于以下问题:Java RegionAdminService类的具体用法?Java RegionAdminService怎么用?Java RegionAdminService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionAdminService service = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    List<Set<NodeId>> masters = Lists.newArrayList();
    Set<NodeId> nodeIds = Sets.newHashSet();
    for (String masterArg : masterArgs) {
        if (masterArg.equals("/")) {
            masters.add(nodeIds);
            nodeIds = Sets.newHashSet();
        } else {
            nodeIds.add(NodeId.nodeId(masterArg));
        }
    }
    masters.add(nodeIds);

    service.createRegion(regionId, name, REGION_TYPE_MAP.get(type), masters);
    print("Region successfully added.");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:RegionAddCommand.java

示例2: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionService regionService = get(RegionService.class);
    RegionAdminService regionAdminService = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    if (regionService.getRegion(regionId) == null) {
        print("The region with id %s does not exist.", regionId);
        return;
    }

    List<Set<NodeId>> masters = Lists.newArrayList();
    Set<NodeId> nodeIds = Sets.newHashSet();
    for (String masterArg : masterArgs) {
        if (masterArg.equals("/")) {
            masters.add(nodeIds);
            nodeIds = Sets.newHashSet();
        } else {
            nodeIds.add(NodeId.nodeId(masterArg));
        }
    }
    masters.add(nodeIds);

    regionAdminService.updateRegion(regionId, name, REGION_TYPE_MAP.get(type), masters);
    print("Region with id %s is successfully updated.", regionId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:RegionUpdateCommand.java

示例3: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionService regionService = get(RegionService.class);
    RegionAdminService regionAdminService = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    if (regionService.getRegion(regionId) == null) {
        print("The region with id %s does not exist.", regionId);
        return;
    }

    List<Set<NodeId>> masters = Lists.newArrayList();
    Set<NodeId> nodeIds = Sets.newHashSet();
    for (String masterArg : masterArgs) {
        if ("/".equals(masterArg)) {
            masters.add(nodeIds);
            nodeIds = Sets.newHashSet();
        } else {
            nodeIds.add(NodeId.nodeId(masterArg));
        }
    }
    masters.add(nodeIds);

    regionAdminService.updateRegion(regionId, name, REGION_TYPE_MAP.get(type), masters);
    print("Region with id %s is successfully updated.", regionId);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:27,代码来源:RegionUpdateCommand.java

示例4: setupTest

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
/**
 * Sets up the global values for all the tests.
 */
@Before
public void setupTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    ServiceDirectory testDirectory =
            new TestServiceDirectory()
            .add(RegionService.class, mockRegionService)
            .add(RegionAdminService.class, mockRegionAdminService)
            .add(CodecService.class, codecService);
    BaseResource.setServiceDirectory(testDirectory);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:RegionsResourceTest.java

示例5: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionAdminService service = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    List<DeviceId> dids = devIds.stream().map(s ->
            DeviceId.deviceId(s)).collect(Collectors.toList());

    service.removeDevices(regionId, dids);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:RegionRemoveDevicesCommand.java

示例6: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionAdminService service = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    service.removeRegion(regionId);
    print("Region with id %s is successfully removed.", regionId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:RegionRemoveCommand.java

示例7: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionAdminService service = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    List<DeviceId> dids = devIds.stream().map(s ->
            DeviceId.deviceId(s)).collect(Collectors.toList());

    service.addDevices(regionId, dids);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:RegionAddDevicesCommand.java

示例8: setupTest

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
/**
 * Sets up the global values for all the tests.
 */
@Before
public void setupTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    ServiceDirectory testDirectory =
            new TestServiceDirectory()
            .add(RegionService.class, mockRegionService)
            .add(RegionAdminService.class, mockRegionAdminService)
            .add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:15,代码来源:RegionsResourceTest.java

示例9: execute

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
@Override
protected void execute() {
    RegionAdminService service = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);

    NetworkConfigService cfgService = get(NetworkConfigService.class);
    BasicRegionConfig cfg = cfgService.addConfig(regionId, BasicRegionConfig.class);
    setConfigurationData(cfg);

    List<Set<NodeId>> masters = parseMasterArgs();
    service.createRegion(regionId, name, REGION_TYPE_MAP.get(type), masters);
    print("Region successfully added.");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:14,代码来源:RegionAddCommand.java

示例10: getAdminDefaultPerms

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
private static List<Permission> getAdminDefaultPerms() {
        List<Permission> permSet = Lists.newArrayList();
        permSet.add(new ServicePermission(ApplicationAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LeadershipAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterMetadataAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MastershipAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DriverAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(HostAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceKeyAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LinkAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ResourceAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(RegionAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PartitionAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(StorageAdminService.class.getName(), ServicePermission.GET));

        permSet.add(new ServicePermission(ApplicationService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ComponentConfigService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterMetadataService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LeadershipService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(CodecService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(CoreService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(EventDeliveryService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MastershipService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MastershipTermService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(BasicNetworkConfigService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(NetworkConfigService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceClockService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DriverService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(EdgePortService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(FlowRuleService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(FlowObjectiveService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(GroupService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(HostService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentClockService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentExtensionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentPartitionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceKeyService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LinkService.class.getName(), ServicePermission.GET));
//        permSet.add(new ServicePermission(MulticastRouteService.class.getName(), ServicePermission.GET));
//        permSet.add(new ServicePermission(MeterService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ResourceService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PacketService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ProxyArpService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(RegionService.class.getName(), ServicePermission.GET));
//      permSet.add(new ServicePermission(LinkResourceService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(FlowStatisticService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(StatisticService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PathService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(TopologyService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PersistenceService.class.getName(), ServicePermission.GET));
//        permSet.add(new ServicePermission(ApiDocService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterCommunicationService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MessagingService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PartitionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LogicalClockService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(StorageService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(UiExtensionService.class.getName(), ServicePermission.GET));

        return permSet;
    }
 
开发者ID:shlee89,项目名称:athena,代码行数:66,代码来源:DefaultPolicyBuilder.java

示例11: wipeOutRegions

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
private void wipeOutRegions() {
    print("Wiping regions");
    RegionAdminService service = get(RegionAdminService.class);
    service.getRegions().forEach(r -> service.removeRegion(r.id()));
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:6,代码来源:WipeOutCommand.java

示例12: getAdminDefaultPerms

import org.onosproject.net.region.RegionAdminService; //导入依赖的package包/类
private static List<Permission> getAdminDefaultPerms() {
        List<Permission> permSet = Lists.newArrayList();
        permSet.add(new ServicePermission(ApplicationAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LeadershipAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterMetadataAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MastershipAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DriverAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(HostAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceKeyAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LinkAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ResourceAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(RegionAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PartitionAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(StorageAdminService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ApplicationService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ComponentConfigService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterMetadataService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LeadershipService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(CodecService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(CoreService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(EventDeliveryService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MastershipService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MastershipTermService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(BasicNetworkConfigService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(NetworkConfigService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceClockService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DriverService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(EdgePortService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(FlowRuleService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(FlowObjectiveService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(GroupService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(HostService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentClockService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(IntentExtensionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(WorkPartitionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(DeviceKeyService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LinkService.class.getName(), ServicePermission.GET));
//        permSet.add(new ServicePermission(MulticastRouteService.class.getName(), ServicePermission.GET));
//        permSet.add(new ServicePermission(MeterService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ResourceService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PacketService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(RegionService.class.getName(), ServicePermission.GET));
//      permSet.add(new ServicePermission(LinkResourceService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(FlowStatisticService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(StatisticService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PathService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(TopologyService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PersistenceService.class.getName(), ServicePermission.GET));
//        permSet.add(new ServicePermission(ApiDocService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(ClusterCommunicationService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(MessagingService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(PartitionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(LogicalClockService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(StorageService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(UiExtensionService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(UpgradeService.class.getName(), ServicePermission.GET));
        permSet.add(new ServicePermission(UpgradeAdminService.class.getName(), ServicePermission.GET));
        return permSet;
    }
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:65,代码来源:DefaultPolicyBuilder.java


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