本文整理汇总了Java中org.onosproject.core.DefaultGroupId类的典型用法代码示例。如果您正苦于以下问题:Java DefaultGroupId类的具体用法?Java DefaultGroupId怎么用?Java DefaultGroupId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultGroupId类属于org.onosproject.core包,在下文中一共展示了DefaultGroupId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testTunnelAdded
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Test
public void testTunnelAdded() {
TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf("192.168.1.1"));
TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf("192.168.1.3"));
SparseAnnotations annotations = DefaultAnnotations.builder()
.set("bandwidth", "1024").build();
List<Link> links = new ArrayList<Link>();
links.add(link);
TunnelDescription tunnel = new DefaultTunnelDescription(
TunnelId.valueOf("1234"),
src,
dst,
Tunnel.Type.VXLAN,
new DefaultGroupId(0),
this.provider.id(),
TunnelName.tunnelName("tunnel12"),
new DefaultPath(this.provider.id(), links, 0.3),
annotations);
provider.tunnelAdded(tunnel);
assertEquals(1, providerService.tunnelSet.size());
}
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:OvsdbTunnelProviderTest.java
示例2: testTunnelRemoved
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Test
public void testTunnelRemoved() {
TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf("192.168.1.1"));
TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf("192.168.1.3"));
SparseAnnotations annotations = DefaultAnnotations.builder()
.set("bandwidth", "1024").build();
List<Link> links = new ArrayList<Link>();
links.add(link);
TunnelDescription tunnel = new DefaultTunnelDescription(
TunnelId.valueOf("1234"),
src,
dst,
Tunnel.Type.VXLAN,
new DefaultGroupId(0),
this.provider.id(),
TunnelName.tunnelName("tunnel1"),
new DefaultPath(this.provider.id(), links, 0.3),
annotations);
provider.tunnelRemoved(tunnel);
assertEquals(0, providerService.tunnelSet.size());
}
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:OvsdbTunnelProviderTest.java
示例3: DefaultTunnelDescription
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
/**
* Creates a tunnel description using the supplied information.
*
* @param id TunnelId
* @param src TunnelPoint source
* @param dst TunnelPoint destination
* @param type tunnel type
* @param groupId groupId
* @param producerName tunnel producer
* @param tunnelName tunnel name
* @param path the path of tunnel
* @param annotations optional key/value annotations
*/
public DefaultTunnelDescription(TunnelId id, TunnelEndPoint src,
TunnelEndPoint dst, Tunnel.Type type,
DefaultGroupId groupId,
ProviderId producerName,
TunnelName tunnelName,
Path path,
SparseAnnotations... annotations) {
super(annotations);
this.tunnelId = id;
this.src = src;
this.dst = dst;
this.type = type;
this.groupId = groupId;
this.producerName = producerName;
this.tunnelName = tunnelName;
this.path = path;
this.networkRes = null;
}
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:DefaultTunnelDescription.java
示例4: DefaultTunnel
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
/**
* Creates an tunnel using the supplied information.
*
* @param producerName provider identity
* @param src tunnel source
* @param dst tunnel destination
* @param type tunnel type
* @param state tunnel state
* @param groupId groupId
* @param tunnelId tunnelId
* @param tunnelName tunnel name
* @param path the path of tunnel
* @param annotations optional key/value annotations
*/
public DefaultTunnel(ProviderId producerName, TunnelEndPoint src,
TunnelEndPoint dst, Type type, State state,
DefaultGroupId groupId, TunnelId tunnelId,
TunnelName tunnelName, Path path, Annotations... annotations) {
super(producerName, annotations);
this.src = src;
this.dst = dst;
this.type = type;
this.state = state;
this.groupId = groupId;
this.tunnelId = tunnelId;
this.tunnelName = tunnelName;
this.path = path;
this.networkRes = null;
}
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:DefaultTunnel.java
示例5: testConstructor
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
/**
* Checks the operation of equals(), hashCode() and toString() methods.
*/
@Test
public void testConstructor() {
TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf(23423));
TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf(32421));
DefaultGroupId groupId = new DefaultGroupId(92034);
TunnelName tunnelName = TunnelName.tunnelName("TunnelName");
TunnelId tunnelId = TunnelId.valueOf("41654654");
ProviderId producerName1 = new ProviderId("producer1", "13");
Tunnel p1 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
Tunnel.State.ACTIVE, groupId, tunnelId,
tunnelName, null);
TunnelEvent e1 = new TunnelEvent(TunnelEvent.Type.TUNNEL_ADDED, p1);
assertThat(e1, is(notNullValue()));
assertThat(e1.type(), is(TunnelEvent.Type.TUNNEL_ADDED));
assertThat(e1.subject(), is(p1));
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:TunnelEventTest.java
示例6: testEquality
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Test
public void testEquality() {
TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf(23423));
TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
.valueOf(32421));
DefaultGroupId groupId = new DefaultGroupId(92034);
TunnelName tunnelName = TunnelName.tunnelName("TunnelName");
TunnelId tunnelId = TunnelId.valueOf("41654654");
ProviderId producerName1 = new ProviderId("producer1", "13");
ProviderId producerName2 = new ProviderId("producer2", "13");
Tunnel p1 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
Tunnel.State.ACTIVE, groupId, tunnelId,
tunnelName, null);
Tunnel p2 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
Tunnel.State.ACTIVE, groupId, tunnelId,
tunnelName, null);
Tunnel p3 = new DefaultTunnel(producerName2, src, dst, Tunnel.Type.OCH,
Tunnel.State.ACTIVE, groupId, tunnelId,
tunnelName, null);
new EqualsTester().addEqualityGroup(p1, p2).addEqualityGroup(p3)
.testEquals();
}
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:DefaultTunnelTest.java
示例7: DefaultFlowRule
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
TrafficTreatment treatment, Integer priority,
FlowId flowId, Boolean permanent, Integer timeout,
Integer tableId) {
this.deviceId = deviceId;
this.selector = selector;
this.treatment = treatment;
this.priority = priority;
this.appId = (short) (flowId.value() >>> 48);
this.id = flowId;
this.permanent = permanent;
this.timeout = timeout;
this.tableId = tableId;
this.created = System.currentTimeMillis();
//FIXME: fields below will be removed.
this.groupId = new DefaultGroupId(0);
this.payLoad = null;
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:DefaultFlowRule.java
示例8: codecEncodeTest
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Test
public void codecEncodeTest() {
GroupBucket bucket1 = DefaultGroupBucket
.createSelectGroupBucket(DefaultTrafficTreatment.emptyTreatment());
GroupBucket bucket2 = DefaultGroupBucket
.createIndirectGroupBucket(DefaultTrafficTreatment.emptyTreatment());
GroupBuckets buckets = new GroupBuckets(ImmutableList.of(bucket1, bucket2));
DefaultGroup group = new DefaultGroup(
new DefaultGroupId(1),
NetTestTools.did("d1"),
GroupDescription.Type.INDIRECT,
buckets);
MockCodecContext context = new MockCodecContext();
GroupCodec codec = new GroupCodec();
ObjectNode groupJson = codec.encode(group, context);
assertThat(groupJson, matchesGroup(group));
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:GroupCodecTest.java
示例9: getFreeGroupIdValue
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private int getFreeGroupIdValue(DeviceId deviceId) {
int freeId = groupIdGen.incrementAndGet();
while (true) {
Group existing = (
groupEntriesById.get(deviceId) != null) ?
groupEntriesById.get(deviceId).get(new DefaultGroupId(freeId)) :
null;
if (existing == null) {
existing = (
extraneousGroupEntriesById.get(deviceId) != null) ?
extraneousGroupEntriesById.get(deviceId).
get(new DefaultGroupId(freeId)) :
null;
}
if (existing != null) {
freeId = groupIdGen.incrementAndGet();
} else {
break;
}
}
return freeId;
}
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:SimpleGroupStore.java
示例10: getFreeGroupIdValue
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private int getFreeGroupIdValue(DeviceId deviceId) {
int freeId = groupIdGen.incrementAndGet();
while (true) {
Group existing = getGroup(deviceId, new DefaultGroupId(freeId));
if (existing == null) {
existing = (
extraneousGroupEntriesById.get(deviceId) != null) ?
extraneousGroupEntriesById.get(deviceId).
get(new DefaultGroupId(freeId)) :
null;
}
if (existing != null) {
freeId = groupIdGen.incrementAndGet();
} else {
break;
}
}
log.debug("getFreeGroupIdValue: Next Free ID is {}", freeId);
return freeId;
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:DistributedGroupStore.java
示例11: DefaultFlowRule
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
TrafficTreatment treatment, int priority, long flowId,
int timeout, boolean permanent) {
this.deviceId = deviceId;
this.priority = priority;
this.selector = selector;
this.treatment = treatment;
this.timeout = timeout;
this.permanent = permanent;
this.created = System.currentTimeMillis();
this.appId = (short) (flowId >>> 48);
this.groupId = new DefaultGroupId((short) ((flowId >>> 32) & 0xFFFF));
this.id = FlowId.valueOf(flowId);
this.type = Type.DEFAULT;
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:17,代码来源:DefaultFlowRule.java
示例12: storeGroupDescriptionInternal
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private void storeGroupDescriptionInternal(GroupDescription groupDesc) {
// Check if a group is existing with the same key
if (getGroup(groupDesc.deviceId(), groupDesc.appCookie()) != null) {
return;
}
// Get a new group identifier
GroupId id = new DefaultGroupId(getFreeGroupIdValue(groupDesc.deviceId()));
// Create a group entry object
StoredGroupEntry group = new DefaultGroup(id, groupDesc);
// Insert the newly created group entry into concurrent key and id maps
ConcurrentMap<GroupKey, StoredGroupEntry> keyTable =
getGroupKeyTable(groupDesc.deviceId());
keyTable.put(groupDesc.appCookie(), group);
ConcurrentMap<GroupId, StoredGroupEntry> idTable =
getGroupIdTable(groupDesc.deviceId());
idTable.put(id, group);
notifyDelegate(new GroupEvent(GroupEvent.Type.GROUP_ADD_REQUESTED,
group));
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:21,代码来源:SimpleGroupStore.java
示例13: getFreeGroupIdValue
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private int getFreeGroupIdValue(DeviceId deviceId) {
int freeId = groupIdGen.incrementAndGet();
while (true) {
Group existing = getGroup(deviceId, new DefaultGroupId(freeId));
if (existing == null) {
existing = (
extraneousGroupEntriesById.get(deviceId) != null) ?
extraneousGroupEntriesById.get(deviceId).
get(new DefaultGroupId(freeId)) :
null;
}
if (existing != null) {
freeId = groupIdGen.incrementAndGet();
} else {
break;
}
}
return freeId;
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:21,代码来源:DistributedGroupStore.java
示例14: build
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
/**
* Builds a GroupBuckets.
*
* @return GroupBuckets object, a list of GroupBuckets
*/
public GroupBuckets build() {
List<GroupBucket> bucketList = Lists.newArrayList();
for (OFBucket bucket: ofBuckets) {
TrafficTreatment treatment = buildTreatment(bucket.getActions());
// TODO: Use GroupBucketEntry
GroupBucket groupBucket = null;
switch (type) {
case INDIRECT:
groupBucket =
DefaultGroupBucket.createIndirectGroupBucket(treatment);
break;
case SELECT:
groupBucket =
DefaultGroupBucket.createSelectGroupBucket(treatment);
break;
case FF:
PortNumber port =
PortNumber.portNumber(bucket.getWatchPort().getPortNumber());
GroupId groupId =
new DefaultGroupId(bucket.getWatchGroup().getGroupNumber());
groupBucket =
DefaultGroupBucket.createFailoverGroupBucket(treatment,
port, groupId);
break;
case ALL:
groupBucket =
DefaultGroupBucket.createAllGroupBucket(treatment);
break;
default:
log.error("Unsupported Group type : {}", type);
}
if (groupBucket != null) {
bucketList.add(groupBucket);
}
}
return new GroupBuckets(bucketList);
}
开发者ID:shlee89,项目名称:athena,代码行数:44,代码来源:GroupBucketEntryBuilder.java
示例15: addGroup
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Test
public void addGroup() {
GroupId groupId = new DefaultGroupId(1);
List<GroupBucket> bucketList = Lists.newArrayList();
TrafficTreatment.Builder builder = DefaultTrafficTreatment.builder();
builder.setOutput(PortNumber.portNumber(1));
GroupBucket bucket =
DefaultGroupBucket.createSelectGroupBucket(builder.build());
bucketList.add(bucket);
GroupBuckets buckets = new GroupBuckets(bucketList);
List<GroupOperation> operationList = Lists.newArrayList();
GroupOperation operation = GroupOperation.createAddGroupOperation(groupId,
GroupDescription.Type.SELECT, buckets);
operationList.add(operation);
GroupOperations operations = new GroupOperations(operationList);
provider.performGroupOperation(deviceId, operations);
final Dpid dpid = Dpid.dpid(deviceId.uri());
TestOpenFlowSwitch sw = (TestOpenFlowSwitch) controller.getSwitch(dpid);
assertNotNull("Switch should not be nul", sw);
assertNotNull("OFGroupMsg should not be null", sw.msg);
}
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:OpenFlowGroupProviderTest.java
示例16: groupModFailure
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Test
public void groupModFailure() {
TestOpenFlowGroupProviderService testProviderService =
(TestOpenFlowGroupProviderService) providerService;
GroupId groupId = new DefaultGroupId(1);
List<GroupBucket> bucketList = Lists.newArrayList();
TrafficTreatment.Builder builder = DefaultTrafficTreatment.builder();
builder.setOutput(PortNumber.portNumber(1));
GroupBucket bucket =
DefaultGroupBucket.createSelectGroupBucket(builder.build());
bucketList.add(bucket);
GroupBuckets buckets = new GroupBuckets(bucketList);
List<GroupOperation> operationList = Lists.newArrayList();
GroupOperation operation = GroupOperation.createAddGroupOperation(groupId,
GroupDescription.Type.SELECT, buckets);
operationList.add(operation);
GroupOperations operations = new GroupOperations(operationList);
provider.performGroupOperation(deviceId, operations);
OFGroupModFailedErrorMsg.Builder errorBuilder =
OFFactories.getFactory(OFVersion.OF_13).errorMsgs().buildGroupModFailedErrorMsg();
OFGroupMod.Builder groupBuilder = OFFactories.getFactory(OFVersion.OF_13).buildGroupModify();
groupBuilder.setGroupType(OFGroupType.ALL);
groupBuilder.setGroup(OFGroup.of(1));
errorBuilder.setCode(OFGroupModFailedCode.GROUP_EXISTS);
errorBuilder.setXid(provider.getXidAndAdd(0) - 1);
controller.processPacket(dpid1, errorBuilder.build());
assertNotNull("Operation failed should not be null",
testProviderService.failedOperation);
}
开发者ID:shlee89,项目名称:athena,代码行数:35,代码来源:OpenFlowGroupProviderTest.java
示例17: run
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
@Override
public void run() {
Collection<Tunnel> tunnelQueryResult = tunnelService.queryTunnel(td.src(), td.dst());
TunnelId tempTunnelId = null;
for (Tunnel t : tunnelQueryResult) {
if (t.annotations().value(LOCAL_LSP_ID) == null || t.annotations().value(PLSP_ID) == null) {
continue;
}
if (t.annotations().value(LOCAL_LSP_ID).equals(td.annotations().value(LOCAL_LSP_ID))
&& t.annotations().value(PLSP_ID).equals(td.annotations().value(PLSP_ID))
&& ((IpTunnelEndPoint) t.src()).ip().equals(pccId.id())) {
tempTunnelId = t.tunnelId();
break;
}
}
//If tunnel is found update the tunnel and shutdown the thread otherwise thread will be executing
//periodically
if (tempTunnelId != null) {
Tunnel tunnel = new DefaultTunnel(providerId, td.src(), td.dst(), MPLS, new DefaultGroupId(0),
tempTunnelId, td.tunnelName(), td.path(), annotations);
tunnelUpdated(tunnel, td.path());
executor.shutdown();
try {
executor.awaitTermination(WAIT_TIME, TimeUnit.SECONDS);
} catch (InterruptedException e) {
log.error("updating delegation failed");
}
}
}
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:PcepTunnelProvider.java
示例18: testCreationWithPayLoadByGroupTable
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
/**
* Tests creation of a DefaultFlowRule using a PayLoad constructor.
*/
@Test
public void testCreationWithPayLoadByGroupTable() {
final DefaultFlowRule rule =
new DefaultFlowRule(did("1"), null,
null, 22, APP_ID, new DefaultGroupId(0),
44, false, payLoad);
assertThat(rule.deviceId(), is(did("1")));
assertThat(rule.isPermanent(), is(false));
assertThat(rule.priority(), is(22));
assertThat(rule.timeout(), is(44));
assertThat(rule.groupId(), is(new DefaultGroupId(0)));
assertThat(defaultFlowRule1.payLoad(), is(payLoad));
}
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:DefaultFlowRuleTest.java
示例19: testInitialAuditWithPendingGroupRequests
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private void testInitialAuditWithPendingGroupRequests(DeviceId deviceId) {
PortNumber[] ports1 = {PortNumber.portNumber(31),
PortNumber.portNumber(32)};
PortNumber[] ports2 = {PortNumber.portNumber(41),
PortNumber.portNumber(42)};
GroupId gId1 = new DefaultGroupId(1);
Group group1 = createSouthboundGroupEntry(gId1,
Arrays.asList(ports1),
0, deviceId);
GroupId gId2 = new DefaultGroupId(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 = groupService.getGroup(deviceId, key);
int createdGroupId = createdGroup.id().id();
assertNotEquals(gId1.id(), createdGroupId);
assertNotEquals(gId2.id(), createdGroupId);
List<GroupOperation> expectedGroupOps = Arrays.asList(
GroupOperation.createDeleteGroupOperation(gId1,
Group.Type.SELECT),
GroupOperation.createAddGroupOperation(
createdGroup.id(),
Group.Type.SELECT,
createdGroup.buckets()));
if (deviceId.equals(DID)) {
internalProvider.validate(deviceId, expectedGroupOps);
} else {
this.validate(deviceId, expectedGroupOps);
}
}
开发者ID:shlee89,项目名称:athena,代码行数:39,代码来源:GroupManagerTest.java
示例20: testAuditWithExtraneousMissingGroups
import org.onosproject.core.DefaultGroupId; //导入依赖的package包/类
private void testAuditWithExtraneousMissingGroups(DeviceId deviceId) {
PortNumber[] ports1 = {PortNumber.portNumber(31),
PortNumber.portNumber(32)};
PortNumber[] ports2 = {PortNumber.portNumber(41),
PortNumber.portNumber(42)};
GroupId gId1 = new DefaultGroupId(1);
Group group1 = createSouthboundGroupEntry(gId1,
Arrays.asList(ports1),
0, deviceId);
GroupId gId2 = new DefaultGroupId(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 = groupService.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(DID)) {
internalProvider.validate(deviceId, expectedGroupOps);
} else {
this.validate(deviceId, expectedGroupOps);
}
}
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:GroupManagerTest.java
注:本文中的org.onosproject.core.DefaultGroupId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论