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


Java ApplicationId.id方法代码示例

本文整理汇总了Java中org.onosproject.core.ApplicationId.id方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationId.id方法的具体用法?Java ApplicationId.id怎么用?Java ApplicationId.id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.core.ApplicationId的用法示例。


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

示例1: execute

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
protected void execute() {
    DeviceService deviceService = get(DeviceService.class);
    CoreService coreService = get(CoreService.class);
    FlowRuleService flowRuleService = get(FlowRuleService.class);
    ApplicationId appId = coreService.registerApplication("eval.add.dummy");

    Iterable<Device> devices = deviceService.getDevices();

    for (Device d : devices) {
        for (FlowEntry r : flowRuleService.getFlowEntries(d.id())) {
            if (r.appId() == appId.id()) {
                flowRuleService.removeFlowRules((FlowRule) r);
            }
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:RemoveDummyFlowsCommand.java

示例2: DefaultFlowRule

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
/**
 * Support for the third party flow rule. Creates a flow rule of flow table.
 *
 * @param deviceId the identity of the device where this rule applies
 * @param selector the traffic selector that identifies what traffic this
 *            rule
 * @param treatment the traffic treatment that applies to selected traffic
 * @param priority the flow rule priority given in natural order
 * @param appId the application id of this flow
 * @param timeout the timeout for this flow requested by an application
 * @param permanent whether the flow is permanent i.e. does not time out
 * @param payLoad 3rd-party origin private flow
 */
public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
                       TrafficTreatment treatment, int priority,
                       ApplicationId appId, int timeout, boolean permanent,
                       FlowRuleExtPayLoad payLoad) {

    checkArgument(priority >= MIN_PRIORITY, "Priority cannot be less than " +
            MIN_PRIORITY);
    checkArgument(priority <= MAX_PRIORITY, "Priority cannot be greater than " +
            MAX_PRIORITY);

    this.deviceId = deviceId;
    this.priority = priority;
    this.selector = selector;
    this.treatment = treatment;
    this.appId = appId.id();
    this.groupId = new DefaultGroupId(0);
    this.timeout = timeout;
    this.permanent = permanent;
    this.tableId = 0;
    this.created = System.currentTimeMillis();
    this.payLoad = payLoad;

    /*
     * 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:shlee89,项目名称:athena,代码行数:44,代码来源:DefaultFlowRule.java

示例3: getFlowRulesById

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
public Iterable<FlowRule> getFlowRulesById(ApplicationId id) {
    checkPermission(FLOWRULE_READ);

    Set<FlowRule> flowEntries = Sets.newHashSet();
    for (Device d : deviceService.getDevices()) {
        for (FlowEntry flowEntry : store.getFlowEntries(d.id())) {
            if (flowEntry.appId() == id.id()) {
                flowEntries.add(flowEntry);
            }
        }
    }
    return flowEntries;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:FlowRuleManager.java

示例4: getFlowRulesByGroupId

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
public Iterable<FlowRule> getFlowRulesByGroupId(ApplicationId appId, short groupId) {
    checkPermission(FLOWRULE_READ);

    Set<FlowRule> matches = Sets.newHashSet();
    long toLookUp = ((long) appId.id() << 16) | groupId;
    for (Device d : deviceService.getDevices()) {
        for (FlowEntry flowEntry : store.getFlowEntries(d.id())) {
            if ((flowEntry.id().value() >>> 32) == toLookUp) {
                matches.add(flowEntry);
            }
        }
    }
    return matches;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:FlowRuleManager.java

示例5: nonNullFormat

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
protected String nonNullFormat(Object value) {
    ApplicationId appId = (ApplicationId) value;
    return appId.id() + " : " + appId.name();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:AppIdFormatter.java

示例6: compare

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
public int compare(ApplicationId id1, ApplicationId id2) {
    return id1.id() - id2.id();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:Comparators.java

示例7: hasApplicationId

import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
/**
 * Creates a predicate that checks the application ID of a flow entry is the same as
 * the specified application ID.
 *
 * @param appId application ID to be checked
 * @return predicate
 */
private static Predicate<FlowEntry> hasApplicationId(ApplicationId appId) {
    return flowEntry -> flowEntry.appId() == appId.id();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:StatisticManager.java


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