本文整理汇总了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);
}
}
}
}
示例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));
}
示例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;
}
示例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;
}
示例5: nonNullFormat
import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
protected String nonNullFormat(Object value) {
ApplicationId appId = (ApplicationId) value;
return appId.id() + " : " + appId.name();
}
示例6: compare
import org.onosproject.core.ApplicationId; //导入方法依赖的package包/类
@Override
public int compare(ApplicationId id1, ApplicationId id2) {
return id1.id() - id2.id();
}
示例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();
}