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


Java DefaultGroupId类代码示例

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


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


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