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


Java GroupId类代码示例

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


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

示例1: load

import org.onosproject.core.GroupId; //导入依赖的package包/类
@Override
public Load load(Link link, ApplicationId appId, Optional<GroupId> groupId) {
    checkPermission(STATISTIC_READ);

    Statistics stats = getStatistics(link.src());
    if (!stats.isValid()) {
        return new DefaultLoad();
    }

    ImmutableSet<FlowEntry> current = FluentIterable.from(stats.current())
            .filter(hasApplicationId(appId))
            .filter(hasGroupId(groupId))
            .toSet();
    ImmutableSet<FlowEntry> previous = FluentIterable.from(stats.previous())
            .filter(hasApplicationId(appId))
            .filter(hasGroupId(groupId))
            .toSet();

    return new DefaultLoad(aggregate(current), aggregate(previous));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:StatisticManager.java

示例2: createSouthboundGroupEntry

import org.onosproject.core.GroupId; //导入依赖的package包/类
private Group createSouthboundGroupEntry(GroupId gId,
                                         List<PortNumber> ports,
                                         long referenceCount, DeviceId deviceId) {
    List<PortNumber> outPorts = new ArrayList<>();
    outPorts.addAll(ports);

    List<GroupBucket> buckets = new ArrayList<>();
    for (PortNumber portNumber : outPorts) {
        TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();
        tBuilder.setOutput(portNumber)
                .setEthDst(MacAddress.valueOf("00:00:00:00:00:02"))
                .setEthSrc(MacAddress.valueOf("00:00:00:00:00:01"))
                .pushMpls()
                .setMpls(MplsLabel.mplsLabel(106));
        buckets.add(DefaultGroupBucket.createSelectGroupBucket(
                tBuilder.build()));
    }
    GroupBuckets groupBuckets = new GroupBuckets(buckets);
    StoredGroupEntry group = new DefaultGroup(
            gId, deviceId, Group.Type.SELECT, groupBuckets);
    group.setReferenceCount(referenceCount);
    return group;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:GroupManagerTest.java

示例3: removeGroupEntry

import org.onosproject.core.GroupId; //导入依赖的package包/类
/**
 * Removes the group entry from store.
 *
 * @param group group entry
 */
@Override
public void removeGroupEntry(Group group) {
    StoredGroupEntry existing = (groupEntriesById.get(
                     group.deviceId()) != null) ?
                     groupEntriesById.get(group.deviceId()).get(group.id()) :
                     null;

    if (existing != null) {
        ConcurrentMap<GroupKey, StoredGroupEntry> keyTable =
                getGroupKeyTable(existing.deviceId());
        ConcurrentMap<GroupId, StoredGroupEntry> idTable =
                getGroupIdTable(existing.deviceId());
        idTable.remove(existing.id());
        keyTable.remove(existing.appCookie());
        notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing));
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:SimpleGroupStore.java

示例4: getProviderGroup

import org.onosproject.core.GroupId; //导入依赖的package包/类
private GroupId getProviderGroup(ServiceNetwork provider, DeviceId deviceId) {
    GroupKey groupKey = getGroupKey(provider.id());
    Group group = groupService.getGroup(deviceId, groupKey);
    GroupId groupId = getGroupId(provider.id(), deviceId);

    if (group != null) {
        return groupId;
    }

    GroupBuckets buckets = getProviderGroupBuckets(
            deviceId, provider.segmentId().id(), getInstances(provider.id()));
    GroupDescription groupDescription = new DefaultGroupDescription(
            deviceId,
            GroupDescription.Type.SELECT,
            buckets,
            groupKey,
            groupId.id(),
            appId);

    groupService.addGroup(groupDescription);
    return groupId;
}
 
开发者ID:opencord,项目名称:vtn,代码行数:23,代码来源:DependencyHandler.java

示例5: DefaultFlowRule

import org.onosproject.core.GroupId; //导入依赖的package包/类
public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
                       TrafficTreatment treatment, int priority, ApplicationId appId,
                       GroupId groupId, int timeout, boolean permanent) {

    if (priority < FlowRule.MIN_PRIORITY) {
        throw new IllegalArgumentException("Priority cannot be less than " + MIN_PRIORITY);
    }

    this.deviceId = deviceId;
    this.priority = priority;
    this.selector = selector;
    this.treatment = treatment;
    this.appId = appId.id();
    this.groupId = groupId;
    this.timeout = timeout;
    this.permanent = permanent;
    this.created = System.currentTimeMillis();
    this.type = Type.DEFAULT;

    /*
     * id consists of the following.
     * | appId (16 bits) | groupId (16 bits) | flowId (32 bits) |
     */
    this.id = FlowId.valueOf((((long) this.appId) << 48) | (((long) this.groupId.id()) << 32)
            | (this.hash() & 0xffffffffL));
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:27,代码来源:DefaultFlowRule.java

示例6: load

import org.onosproject.core.GroupId; //导入依赖的package包/类
@Override
public Load load(Link link, ApplicationId appId, Optional<GroupId> groupId) {
    Statistics stats = getStatistics(link.src());
    if (!stats.isValid()) {
        return new DefaultLoad();
    }

    ImmutableSet<FlowEntry> current = FluentIterable.from(stats.current())
            .filter(hasApplicationId(appId))
            .filter(hasGroupId(groupId))
            .toSet();
    ImmutableSet<FlowEntry> previous = FluentIterable.from(stats.previous())
            .filter(hasApplicationId(appId))
            .filter(hasGroupId(groupId))
            .toSet();

    return new DefaultLoad(aggregate(current), aggregate(previous));
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:19,代码来源:StatisticManager.java

示例7: createSouthboundGroupEntry

import org.onosproject.core.GroupId; //导入依赖的package包/类
private Group createSouthboundGroupEntry(GroupId gId,
                                         List<PortNumber> ports,
                                         long referenceCount) {
    List<PortNumber> outPorts = new ArrayList<PortNumber>();
    outPorts.addAll(ports);

    List<GroupBucket> buckets = new ArrayList<GroupBucket>();
    for (PortNumber portNumber: outPorts) {
        TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();
        tBuilder.setOutput(portNumber)
                .setEthDst(MacAddress.valueOf("00:00:00:00:00:02"))
                .setEthSrc(MacAddress.valueOf("00:00:00:00:00:01"))
                .pushMpls()
                .setMpls(MplsLabel.mplsLabel(106));
        buckets.add(DefaultGroupBucket.createSelectGroupBucket(
                                                    tBuilder.build()));
    }
    GroupBuckets groupBuckets = new GroupBuckets(buckets);
    StoredGroupEntry group = new DefaultGroup(
                        gId, DID, Group.Type.SELECT, groupBuckets);
    group.setReferenceCount(referenceCount);
    return group;
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:24,代码来源:GroupManagerTest.java

示例8: storeGroupDescriptionInternal

import org.onosproject.core.GroupId; //导入依赖的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

示例9: addOrUpdateExtraneousGroupEntry

import org.onosproject.core.GroupId; //导入依赖的package包/类
@Override
public void addOrUpdateExtraneousGroupEntry(Group group) {
    log.trace("addOrUpdateExtraneousGroupEntry: add/update extraneous "
            + "group entry {} in device {}",
            group.id(),
            group.deviceId());
    ConcurrentMap<GroupId, Group> extraneousIdTable =
            getExtraneousGroupIdTable(group.deviceId());
    extraneousIdTable.put(group.id(), group);
    // Check the reference counter
    if (group.referenceCount() == 0) {
        log.trace("addOrUpdateExtraneousGroupEntry: Flow reference "
                + "counter is zero and triggering remove",
                group.id(),
                group.deviceId());
        notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, group));
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:19,代码来源:DistributedGroupStore.java

示例10: getFreeGroupIdValue

import org.onosproject.core.GroupId; //导入依赖的package包/类
private int getFreeGroupIdValue(DeviceId deviceId) {
    int freeId = groupIdGen.incrementAndGet();

    while (true) {
        Group existing = getGroup(deviceId, new GroupId(freeId));
        if (existing == null) {
            existing = (
                    extraneousGroupEntriesById.get(deviceId) != null) ?
                    extraneousGroupEntriesById.get(deviceId).
                            get(new GroupId(freeId)) :
                    null;
        }
        if (existing != null) {
            freeId = groupIdGen.incrementAndGet();
        } else {
            break;
        }
    }
    log.debug("getFreeGroupIdValue: Next Free ID is {}", freeId);
    return freeId;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:22,代码来源:DistributedGroupStore.java

示例11: testTunnelAdded

import org.onosproject.core.GroupId; //导入依赖的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 GroupId(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:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:OvsdbTunnelProviderTest.java

示例12: testTunnelRemoved

import org.onosproject.core.GroupId; //导入依赖的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 GroupId(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:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:OvsdbTunnelProviderTest.java

示例13: DefaultTunnelDescription

import org.onosproject.core.GroupId; //导入依赖的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,
                                GroupId 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:opennetworkinglab,项目名称:onos,代码行数:32,代码来源:DefaultTunnelDescription.java

示例14: DefaultTunnel

import org.onosproject.core.GroupId; //导入依赖的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,
                     GroupId 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:opennetworkinglab,项目名称:onos,代码行数:30,代码来源:DefaultTunnel.java

示例15: getFreeGroupIdValue

import org.onosproject.core.GroupId; //导入依赖的package包/类
private int getFreeGroupIdValue(DeviceId deviceId) {
    int freeId = groupIdGen.incrementAndGet();

    while (true) {
        Group existing = (
                groupEntriesById.get(deviceId) != null) ?
                groupEntriesById.get(deviceId).get(new GroupId(freeId)) :
                null;
        if (existing == null) {
            existing = (
                    extraneousGroupEntriesById.get(deviceId) != null) ?
                    extraneousGroupEntriesById.get(deviceId).
                    get(new GroupId(freeId)) :
                    null;
        }
        if (existing != null) {
            freeId = groupIdGen.incrementAndGet();
        } else {
            break;
        }
    }
    return freeId;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:24,代码来源:SimpleGroupStore.java


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