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


Java TunnelSubscription类代码示例

本文整理汇总了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");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:DistributedTunnelStore.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:DistributedTunnelStore.java

示例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);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:8,代码来源:DistributedTunnelStore.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:DistributedTunnelStore.java

示例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());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:TunnelQuerySubscriptionCommand.java

示例6: queryTunnelSubscription

import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
    return Collections.emptySet();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:TunnelServiceAdapter.java

示例7: queryTunnelSubscription

import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
    return store.queryTunnelSubscription(consumerId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:TunnelManager.java

示例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();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:DistributedTunnelStore.java

示例9: queryTunnelSubscription

import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:TunnelServiceAdapter.java

示例10: queryTunnelSubscription

import org.onosproject.incubator.net.tunnel.TunnelSubscription; //导入依赖的package包/类
@Override
public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
    // TODO Auto-generated method stub
    return null;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:6,代码来源:PcepClientControllerImplTest.java


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