本文整理汇总了Java中org.onosproject.incubator.net.domain.TunnelPrimitive类的典型用法代码示例。如果您正苦于以下问题:Java TunnelPrimitive类的具体用法?Java TunnelPrimitive怎么用?Java TunnelPrimitive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TunnelPrimitive类属于org.onosproject.incubator.net.domain包,在下文中一共展示了TunnelPrimitive类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.onosproject.incubator.net.domain.TunnelPrimitive; //导入依赖的package包/类
@Override
protected void execute() {
IntentDomainService service = get(IntentDomainService.class);
ConnectPoint one = ConnectPoint.deviceConnectPoint(oneString);
ConnectPoint two = ConnectPoint.deviceConnectPoint(twoString);
TunnelPrimitive tunnel = new TunnelPrimitive(appId(), one, two);
// get the first domain (there should only be one)
final IntentDomainId domainId;
try {
domainId = service.getDomains().iterator().next().id();
} catch (NoSuchElementException | NullPointerException e) {
print("No domains found");
return;
}
service.request(domainId, tunnel).forEach(r -> service.submit(domainId, r));
print("Intent domain tunnel submitted:\n%s", tunnel);
}