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


Java GroupService类代码示例

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


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

示例1: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.deviceId = deviceId;

    // Initialize OFDPA group handler
    groupHandler = new CpqdOfdpa2GroupHandler();
    groupHandler.init(deviceId, context);

    serviceDirectory = context.directory();
    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();
    deviceService = serviceDirectory.get(DeviceService.class);

    driverId = coreService.registerApplication(
            "org.onosproject.driver.CpqdOfdpa2Pipeline");

    initializePipeline();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:CpqdOfdpa2Pipeline.java

示例2: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.deviceId = deviceId;

    // Initialize OFDPA group handler
    groupHandler = new Ofdpa2GroupHandler();
    groupHandler.init(deviceId, context);

    serviceDirectory = context.directory();
    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();
    deviceService = serviceDirectory.get(DeviceService.class);

    driverId = coreService.registerApplication(
            "org.onosproject.driver.Ofdpa2Pipeline");

    initializePipeline();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:Ofdpa2Pipeline.java

示例3: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.deviceId = deviceId;

    // Initialize OFDPA group handler
    groupHandler = new CpqdOfdpa2GroupHandler();
    groupHandler.init(deviceId, context);

    serviceDirectory = context.directory();
    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();
    deviceService = serviceDirectory.get(DeviceService.class);

    driverId = coreService.registerApplication(
            "org.onosproject.driver.CpqdOfdpa2VlanPipeline");

    initializePipeline();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:CpqdOfdpa2VlanPipeline.java

示例4: DefaultGroupHandler

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
protected DefaultGroupHandler(DeviceId deviceId,
                           ApplicationId appId,
                           DeviceProperties config,
                           LinkService linkService,
                           GroupService groupService) {
    this.deviceId = checkNotNull(deviceId);
    this.appId = checkNotNull(appId);
    this.deviceConfig = checkNotNull(config);
    this.linkService = checkNotNull(linkService);
    this.groupService = checkNotNull(groupService);
    allSegmentIds = checkNotNull(config.getAllDeviceSegmentIds());
    nodeSegmentId = config.getSegmentId(deviceId);
    isEdgeRouter = config.isEdgeDevice(deviceId);
    nodeMacAddr = checkNotNull(config.getDeviceMac(deviceId));

    this.groupService.addListener(listener);

    populateNeighborMaps();
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:20,代码来源:DefaultGroupHandler.java

示例5: createGroupHandler

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
/**
 * Creates a group handler object based on the type of device. If
 * device is of edge type it returns edge group handler, else it
 * returns transit group handler.
 *
 * @param deviceId device identifier
 * @param appId application identifier
 * @param config interface to retrieve the device properties
 * @param linkService link service object
 * @param groupService group service object
 * @return default group handler type
 */
public static DefaultGroupHandler createGroupHandler(DeviceId deviceId,
                                              ApplicationId appId,
                                              DeviceProperties config,
                                              LinkService linkService,
                                              GroupService groupService) {
    if (config.isEdgeDevice(deviceId)) {
        return new DefaultEdgeGroupHandler(deviceId,
                                           appId,
                                           config,
                                           linkService,
                                           groupService);
    } else {
        return new DefaultTransitGroupHandler(deviceId,
                                              appId,
                                              config,
                                              linkService,
                                              groupService);
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:32,代码来源:DefaultGroupHandler.java

示例6: getExistingOutputPorts

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
/**
 * Returns the set of existing output ports in the group represented by
 * allActiveKeys.
 *
 * @param allActiveKeys list of group key chain
 * @param groupService the group service to get group information
 * @param deviceId the device id to get group
 * @return a set of output port from the list of group key chain
 */
public static Set<PortNumber> getExistingOutputPorts(List<Deque<GroupKey>> allActiveKeys,
                                                 GroupService groupService,
                                                 DeviceId deviceId) {
    Set<PortNumber> existingPorts = Sets.newHashSet();

    allActiveKeys.forEach(keyChain -> {
        GroupKey ifaceGroupKey = keyChain.peekLast();
        Group ifaceGroup = groupService.getGroup(deviceId, ifaceGroupKey);
        if (ifaceGroup != null && !ifaceGroup.buckets().buckets().isEmpty()) {
            ifaceGroup.buckets().buckets().forEach(bucket -> {
                PortNumber portNumber = readOutPortFromTreatment(bucket.treatment());
                if (portNumber != null) {
                    existingPorts.add(portNumber);
                }
            });
        }
    });
    return existingPorts;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:29,代码来源:OfdpaGroupHandlerUtility.java

示例7: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.deviceId = deviceId;

    serviceDirectory = context.directory();
    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();
    deviceService = serviceDirectory.get(DeviceService.class);

    initDriverId();
    initGroupHander(context);

    initializePipeline();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:17,代码来源:Ofdpa2Pipeline.java

示例8: DefaultOFSwitch

import org.onosproject.net.group.GroupService; //导入依赖的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

示例9: setUpTest

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    // Mock device service
    expect(mockDeviceService.getDevice(deviceId1))
            .andReturn(device1);
    expect(mockDeviceService.getDevice(deviceId2))
            .andReturn(device2);
    expect(mockDeviceService.getDevices())
            .andReturn(ImmutableSet.of(device1, device2));

    // Mock Core Service
    expect(mockCoreService.getAppId(anyShort()))
            .andReturn(NetTestTools.APP_ID).anyTimes();
    expect(mockCoreService.registerApplication(GroupCodec.REST_APP_ID))
            .andReturn(APP_ID).anyTimes();
    replay(mockCoreService);

    // Register the services needed for the test
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    ServiceDirectory testDirectory =
            new TestServiceDirectory()
                    .add(GroupService.class, mockGroupService)
                    .add(DeviceService.class, mockDeviceService)
                    .add(CodecService.class, codecService)
                    .add(CoreService.class, mockCoreService);

    BaseResource.setServiceDirectory(testDirectory);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:33,代码来源:GroupsResourceTest.java

示例10: populateTable

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
protected void populateTable(TableModel tm, ObjectNode payload) {
    String uri = string(payload, "devId");
    if (!Strings.isNullOrEmpty(uri)) {
        DeviceId deviceId = DeviceId.deviceId(uri);
        GroupService gs = get(GroupService.class);
        for (Group group : gs.getGroups(deviceId)) {
            populateRow(tm.addRow(), group);
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:GroupViewMessageHandler.java

示例11: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.serviceDirectory = context.directory();
    this.deviceId = deviceId;

    pendingGroups = CacheBuilder.newBuilder()
            .expireAfterWrite(20, TimeUnit.SECONDS)
            .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> {
                if (notification.getCause() == RemovalCause.EXPIRED) {
                    fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED);
                }
            }).build();

    groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500, TimeUnit.MILLISECONDS);

    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();

    groupService.addListener(new InnerGroupListener());

    appId = coreService.registerApplication(
            "org.onosproject.driver.CentecV350Pipeline");

    initializePipeline();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:CentecV350Pipeline.java

示例12: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.serviceDirectory = context.directory();
    this.deviceId = deviceId;

    pendingGroups = CacheBuilder
            .newBuilder()
            .expireAfterWrite(20, TimeUnit.SECONDS)
            .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> {
                                 if (notification.getCause() == RemovalCause.EXPIRED) {
                                     fail(notification.getValue(),
                                          ObjectiveError.GROUPINSTALLATIONFAILED);
                                 }
                             }).build();

    groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500,
                                     TimeUnit.MILLISECONDS);

    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();

    groupService.addListener(new InnerGroupListener());

    appId = coreService
            .registerApplication("org.onosproject.driver.SpringOpenTTP");

    setTableMissEntries();
    log.info("Spring Open TTP driver initialized");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:SpringOpenTTP.java

示例13: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    log.debug("Initiate OLT pipeline");
    this.serviceDirectory = context.directory();
    this.deviceId = deviceId;

    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    coreService = serviceDirectory.get(CoreService.class);
    groupService = serviceDirectory.get(GroupService.class);
    flowObjectiveStore = context.store();
    storageService = serviceDirectory.get(StorageService.class);

    appId = coreService.registerApplication(
            "org.onosproject.driver.OLTPipeline");


    pendingGroups = CacheBuilder.newBuilder()
            .expireAfterWrite(20, TimeUnit.SECONDS)
            .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> {
                if (notification.getCause() == RemovalCause.EXPIRED) {
                    fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED);
                }
            }).build();

    groupService.addListener(new InnerGroupListener());

}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:OltPipeline.java

示例14: init

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
public void init(DeviceId deviceId, PipelinerContext context) {
    this.serviceDirectory = context.directory();
    this.deviceId = deviceId;

    pendingGroups = CacheBuilder.newBuilder()
            .expireAfterWrite(20, TimeUnit.SECONDS)
            .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> {
                if (notification.getCause() == RemovalCause.EXPIRED) {
                    fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED);
                }
            }).build();

    groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500, TimeUnit.MILLISECONDS);

    coreService = serviceDirectory.get(CoreService.class);
    flowRuleService = serviceDirectory.get(FlowRuleService.class);
    groupService = serviceDirectory.get(GroupService.class);
    meterService = serviceDirectory.get(MeterService.class);
    deviceService = serviceDirectory.get(DeviceService.class);
    flowObjectiveStore = context.store();

    groupService.addListener(new InnerGroupListener());

    appId = coreService.registerApplication(APPID);

    initializePipeline();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:29,代码来源:AbstractCorsaPipeline.java

示例15: execute

import org.onosproject.net.group.GroupService; //导入依赖的package包/类
@Override
protected void execute() {
    DeviceService deviceService = get(DeviceService.class);
    GroupService groupService = get(GroupService.class);
    SortedMap<Device, List<Group>> sortedGroups =
            getSortedGroups(deviceService, groupService);

    if (outputJson()) {
        print("%s", json(sortedGroups));
    } else {
        sortedGroups.forEach((device, groups) -> printGroups(device.id(), groups));
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:GroupsListCommand.java


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