本文整理汇总了Java中org.onosproject.incubator.net.tunnel.TunnelSubscription类的典型用法代码示例。如果您正苦于以下问题:Java TunnelSubscription类的具体用法?Java TunnelSubscription怎么用?Java TunnelSubscription使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TunnelSubscription类属于org.onosproject.incubator.net.tunnel包,在下文中一共展示了TunnelSubscription类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Activate
public void activate() {
KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(MultiValuedTimestamp.class);
tunnelIdAsKeyStore = storageService
.<TunnelId, Tunnel>eventuallyConsistentMapBuilder()
.withName("all_tunnel").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
orderRelationship = storageService
.<ApplicationId, Set<TunnelSubscription>>eventuallyConsistentMapBuilder()
.withName("type_tunnel").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
idGenerator = coreService.getIdGenerator(tunnelOpTopic);
tunnelIdAsKeyStore.addListener(tunnelUpdateListener);
log.info("Started");
}
示例2: borrowTunnel
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Tunnel borrowTunnel(ApplicationId appId, TunnelId tunnelId,
Annotations... annotations) {
Set<TunnelSubscription> orderSet = orderRelationship.get(appId);
if (orderSet == null) {
orderSet = new HashSet<TunnelSubscription>();
}
TunnelSubscription order = new TunnelSubscription(appId, null, null, tunnelId, null, null,
annotations);
Tunnel result = tunnelIdAsKeyStore.get(tunnelId);
if (result == null || Tunnel.State.INACTIVE.equals(result.state())) {
return null;
}
orderSet.add(order);
orderRelationship.put(appId, orderSet);
return result;
}
示例3: returnTunnel
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public boolean returnTunnel(ApplicationId appId, TunnelName tunnelName,
Annotations... annotations) {
TunnelSubscription order = new TunnelSubscription(appId, null, null, null, null, tunnelName,
annotations);
return deleteOrder(order);
}
示例4: deleteOrder
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
private boolean deleteOrder(TunnelSubscription order) {
Set<TunnelSubscription> orderSet = orderRelationship.get(order.consumerId());
if (orderSet == null) {
return true;
}
if (orderSet.contains(order)) {
orderSet.remove(order);
return true;
}
return false;
}
示例5: execute
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
protected void execute() {
TunnelService service = get(TunnelService.class);
ApplicationId applicationId = new DefaultApplicationId(1, consumerId);
Collection<TunnelSubscription> tunnelSet = service.queryTunnelSubscription(applicationId);
for (TunnelSubscription order : tunnelSet) {
print(FMT, order.consumerId(), order.src(), order.dst(),
order.type(), order.tunnelId());
}
}
示例6: queryTunnelSubscription
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
return Collections.emptySet();
}
示例7: queryTunnelSubscription
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
return store.queryTunnelSubscription(consumerId);
}
示例8: queryTunnelSubscription
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId appId) {
return orderRelationship.get(appId) != null ? ImmutableSet.copyOf(orderRelationship
.get(appId)) : Collections.emptySet();
}
示例9: queryTunnelSubscription
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
return null;
}
示例10: queryTunnelSubscription
import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
// TODO Auto-generated method stub
return null;
}