本文整理汇总了Java中org.onosproject.incubator.net.virtual.NetworkId.id方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkId.id方法的具体用法?Java NetworkId.id怎么用?Java NetworkId.id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.incubator.net.virtual.NetworkId
的用法示例。
在下文中一共展示了NetworkId.id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAuditWithExtraneousMissingGroups
import org.onosproject.incubator.net.virtual.NetworkId; //导入方法依赖的package包/类
private void testAuditWithExtraneousMissingGroups(NetworkId networkId,
DeviceId deviceId) {
VirtualNetworkGroupManager groupManager;
VirtualGroupProviderService providerService;
if (networkId.id() == 1) {
groupManager = groupManager1;
providerService = providerService1;
} else {
groupManager = groupManager2;
providerService = providerService2;
}
PortNumber[] ports1 = {PortNumber.portNumber(31),
PortNumber.portNumber(32)};
PortNumber[] ports2 = {PortNumber.portNumber(41),
PortNumber.portNumber(42)};
GroupId gId1 = new GroupId(1);
Group group1 = createSouthboundGroupEntry(gId1,
Arrays.asList(ports1),
0, deviceId);
GroupId gId2 = new GroupId(2);
Group group2 = createSouthboundGroupEntry(gId2,
Arrays.asList(ports2),
0, deviceId);
List<Group> groupEntries = Arrays.asList(group1, group2);
providerService.pushGroupMetrics(deviceId, groupEntries);
GroupKey key = new DefaultGroupKey("group1BeforeAudit".getBytes());
Group createdGroup = groupManager.getGroup(deviceId, key);
List<GroupOperation> expectedGroupOps = Arrays.asList(
GroupOperation.createDeleteGroupOperation(gId1,
Group.Type.SELECT),
GroupOperation.createDeleteGroupOperation(gId2,
Group.Type.SELECT),
GroupOperation.createAddGroupOperation(createdGroup.id(),
Group.Type.SELECT,
createdGroup.buckets()));
if (deviceId.equals(VDID1)) {
provider.validate(networkId, deviceId, expectedGroupOps);
}
}
示例2: testPurgeGroupEntry
import org.onosproject.incubator.net.virtual.NetworkId; //导入方法依赖的package包/类
private void testPurgeGroupEntry(NetworkId networkId, DeviceId deviceId) {
VirtualNetworkGroupManager groupManager;
if (networkId.id() == 1) {
groupManager = groupManager1;
} else {
groupManager = groupManager2;
}
assertEquals(1, Iterables.size(groupManager.getGroups(deviceId, appId)));
groupManager.purgeGroupEntries(deviceId);
assertEquals(0, Iterables.size(groupManager.getGroups(deviceId, appId)));
}
示例3: testRemoveGroup
import org.onosproject.incubator.net.virtual.NetworkId; //导入方法依赖的package包/类
private void testRemoveGroup(NetworkId networkId, DeviceId deviceId) {
VirtualNetworkGroupManager groupManager;
VirtualGroupProviderService providerService;
TestGroupListener listener;
if (networkId.id() == 1) {
groupManager = groupManager1;
providerService = providerService1;
listener = listener1;
} else {
groupManager = groupManager2;
providerService = providerService2;
listener = listener2;
}
GroupKey currKey = new DefaultGroupKey("group1RemoveBuckets".getBytes());
Group existingGroup = groupManager.getGroup(deviceId, currKey);
groupManager.removeGroup(deviceId, currKey, appId);
List<GroupOperation> expectedGroupOps = Collections.singletonList(
GroupOperation.createDeleteGroupOperation(existingGroup.id(),
Group.Type.SELECT));
if (deviceId.equals(VDID1)) {
provider.validate(networkId, deviceId, expectedGroupOps);
}
List<Group> groupEntries = Collections.emptyList();
providerService.pushGroupMetrics(deviceId, groupEntries);
listener.validateEvent(Collections.singletonList(GroupEvent.Type.GROUP_REMOVED));
}
示例4: testInitialAuditWithPendingGroupRequests
import org.onosproject.incubator.net.virtual.NetworkId; //导入方法依赖的package包/类
private void testInitialAuditWithPendingGroupRequests(NetworkId networkId,
DeviceId deviceId) {
VirtualNetworkGroupManager groupManager;
VirtualGroupProviderService providerService;
if (networkId.id() == 1) {
groupManager = groupManager1;
providerService = providerService1;
} else {
groupManager = groupManager2;
providerService = providerService2;
}
PortNumber[] ports1 = {PortNumber.portNumber(31),
PortNumber.portNumber(32)};
PortNumber[] ports2 = {PortNumber.portNumber(41),
PortNumber.portNumber(42)};
GroupId gId1 = new GroupId(1);
Group group1 = createSouthboundGroupEntry(gId1,
Arrays.asList(ports1),
0, deviceId);
GroupId gId2 = new GroupId(2);
// Non zero reference count will make the group manager to queue
// the extraneous groups until reference count is zero.
Group group2 = createSouthboundGroupEntry(gId2,
Arrays.asList(ports2),
2, deviceId);
List<Group> groupEntries = Arrays.asList(group1, group2);
providerService.pushGroupMetrics(deviceId, groupEntries);
// First group metrics would trigger the device audit completion
// post which all pending group requests are also executed.
GroupKey key = new DefaultGroupKey("group1BeforeAudit".getBytes());
Group createdGroup = groupManager.getGroup(deviceId, key);
int createdGroupId = createdGroup.id().id();
assertNotEquals(gId1.id().intValue(), createdGroupId);
assertNotEquals(gId2.id().intValue(), createdGroupId);
List<GroupOperation> expectedGroupOps = Arrays.asList(
GroupOperation.createDeleteGroupOperation(gId1,
Group.Type.SELECT),
GroupOperation.createAddGroupOperation(
createdGroup.id(),
Group.Type.SELECT,
createdGroup.buckets()));
if (deviceId.equals(VDID1)) {
provider.validate(networkId, deviceId, expectedGroupOps);
}
}