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


Java DefaultTunnelDescription类代码示例

本文整理汇总了Java中org.onosproject.incubator.net.tunnel.DefaultTunnelDescription的典型用法代码示例。如果您正苦于以下问题:Java DefaultTunnelDescription类的具体用法?Java DefaultTunnelDescription怎么用?Java DefaultTunnelDescription使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DefaultTunnelDescription类属于org.onosproject.incubator.net.tunnel包,在下文中一共展示了DefaultTunnelDescription类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTunnelAdded

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Test
public void testTunnelAdded() {
    TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.1"));
    TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.3"));
    SparseAnnotations annotations = DefaultAnnotations.builder()
            .set("bandwidth", "1024").build();

    List<Link> links = new ArrayList<Link>();
    links.add(link);
    TunnelDescription tunnel = new DefaultTunnelDescription(
                                                            TunnelId.valueOf("1234"),
                                                            src,
                                                            dst,
                                                            Tunnel.Type.VXLAN,
                                                            new DefaultGroupId(0),
                                                            this.provider.id(),
                                                            TunnelName.tunnelName("tunnel12"),
                                                            new DefaultPath(this.provider.id(), links, 0.3),
                                                            annotations);
    provider.tunnelAdded(tunnel);
    assertEquals(1, providerService.tunnelSet.size());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:OvsdbTunnelProviderTest.java

示例2: testTunnelRemoved

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Test
public void testTunnelRemoved() {
    TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.1"));
    TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.3"));
    SparseAnnotations annotations = DefaultAnnotations.builder()
            .set("bandwidth", "1024").build();

    List<Link> links = new ArrayList<Link>();
    links.add(link);
    TunnelDescription tunnel = new DefaultTunnelDescription(
                                                            TunnelId.valueOf("1234"),
                                                            src,
                                                            dst,
                                                            Tunnel.Type.VXLAN,
                                                            new DefaultGroupId(0),
                                                            this.provider.id(),
                                                            TunnelName.tunnelName("tunnel1"),
                                                            new DefaultPath(this.provider.id(), links, 0.3),
                                                            annotations);
    provider.tunnelRemoved(tunnel);
    assertEquals(0, providerService.tunnelSet.size());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:OvsdbTunnelProviderTest.java

示例3: testTunnelAdded

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Test
public void testTunnelAdded() {
    TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.1"));
    TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.3"));
    SparseAnnotations annotations = DefaultAnnotations.builder()
            .set("bandwidth", "1024").build();

    List<Link> links = new ArrayList<Link>();
    links.add(link);
    TunnelDescription tunnel = new DefaultTunnelDescription(
                                                            TunnelId.valueOf("1234"),
                                                            src,
                                                            dst,
                                                            Tunnel.Type.VXLAN,
                                                            new GroupId(0),
                                                            this.provider.id(),
                                                            TunnelName.tunnelName("tunnel12"),
                                                            new DefaultPath(this.provider.id(), links, 0.3),
                                                            annotations);
    provider.tunnelAdded(tunnel);
    assertEquals(1, providerService.tunnelSet.size());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:OvsdbTunnelProviderTest.java

示例4: testTunnelRemoved

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Test
public void testTunnelRemoved() {
    TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.1"));
    TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
            .valueOf("192.168.1.3"));
    SparseAnnotations annotations = DefaultAnnotations.builder()
            .set("bandwidth", "1024").build();

    List<Link> links = new ArrayList<Link>();
    links.add(link);
    TunnelDescription tunnel = new DefaultTunnelDescription(
                                                            TunnelId.valueOf("1234"),
                                                            src,
                                                            dst,
                                                            Tunnel.Type.VXLAN,
                                                            new GroupId(0),
                                                            this.provider.id(),
                                                            TunnelName.tunnelName("tunnel1"),
                                                            new DefaultPath(this.provider.id(), links, 0.3),
                                                            annotations);
    provider.tunnelRemoved(tunnel);
    assertEquals(0, providerService.tunnelSet.size());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:OvsdbTunnelProviderTest.java

示例5: removeOrUpdatetunnel

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
private void removeOrUpdatetunnel(Tunnel tunnel, PccId pccId, PcepLspObject lspObj, ProviderId providerId,
        State tunnelState) {
    DefaultTunnelDescription td = new DefaultTunnelDescription(tunnel.tunnelId(), tunnel.src(), tunnel.dst(),
            tunnel.type(), tunnel.groupId(), providerId, tunnel.tunnelName(), tunnel.path(),
            (SparseAnnotations) tunnel.annotations());
    if (lspObj.getRFlag()) {
        tunnelRemoved(td);
    } else {
        tunnelUpdated(td, tunnelState);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:PcepTunnelProvider.java

示例6: tunnelUpdateInDelegatedCase

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
private void tunnelUpdateInDelegatedCase(PccId pccId, SparseAnnotations annotations,
        DefaultTunnelDescription td, ProviderId providerId) {
    //Wait for 2sec then query tunnel based on ingress PLSP-ID and local LSP-ID

    /*
     * If ONOS is not the master for that PCC then check if D flag is set, if yes wait [while
     * master has added the tunnel to the store] then update the tunnel.
     */
    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();

    // Thread is started after 2 seconds first time later periodically after 2 seconds to update the tunnel
    executor.scheduleAtFixedRate(new UpdateDelegation(td, providerId, annotations, pccId,
            executor), DELAY, DELAY, TimeUnit.SECONDS);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:PcepTunnelProvider.java

示例7: handleEndOfSyncAction

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Override
public void handleEndOfSyncAction(Tunnel tunnel, PcepLspSyncAction endOfSyncAction) {

    if (endOfSyncAction == SEND_UPDATE) {
        updateTunnel(tunnel, tunnel.path());
        return;
    }

    TunnelDescription td = new DefaultTunnelDescription(tunnel.tunnelId(),
                                                        tunnel.src(), tunnel.dst(),
                                                        tunnel.type(),
                                                        tunnel.groupId(),
                                                        tunnel.providerId(),
                                                        tunnel.tunnelName(),
                                                        tunnel.path(),
                                                        (SparseAnnotations) tunnel.annotations());


    if (endOfSyncAction == PcepLspSyncAction.UNSTABLE) {

        // Send PCInit msg again after global reoptimization.
        tunnelUpdated(td, UNSTABLE);

        // To remove the old tunnel from store whose PLSPID is not
        // recognized by ingress PCC.
        tunnelRemoved(td);

    } else if (endOfSyncAction == REMOVE) {
        tunnelRemoved(td);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:PcepTunnelProvider.java

示例8: execute

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Override
protected void execute() {
    TunnelProvider service = get(TunnelProvider.class);
    TunnelId id = TunnelId.valueOf(tunnelId);
    SparseAnnotations annotations = DefaultAnnotations
            .builder()
            .set("bandwidth", bandwidth)
            .build();
    TunnelDescription tunnel = new DefaultTunnelDescription(id, null,
                                                            null,
                                                            null, null,
                                                            null,
                                                            null, null, annotations);
    service.tunnelUpdated(tunnel);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:TunnelUpdateCommand.java

示例9: handleTunnelUpdate

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
private void handleTunnelUpdate(Tunnel tunnel, Path path, State tunnelState) {

        if (tunnel.type() == MPLS) {
            pcepTunnelApiMapper.removeFromCoreTunnelRequestQueue(tunnel.tunnelId());

            TunnelDescription td = new DefaultTunnelDescription(tunnel.tunnelId(), tunnel.src(), tunnel.dst(),
                    tunnel.type(), tunnel.groupId(), tunnel.providerId(),
                    tunnel.tunnelName(), path, tunnel.resource(),
                    (SparseAnnotations) tunnel.annotations());

            service.tunnelUpdated(td, tunnelState);
            return;
        }

        Tunnel tunnelOld = tunnelQueryById(tunnel.tunnelId());
        if (tunnelOld.type() != Tunnel.Type.VLAN) {
            error("Illegal tunnel type. Only support VLAN tunnel update.");
            return;
        }

        long bandwidth = Long
                .parseLong(tunnel.annotations().value("bandwidth"));
        if (bandwidth < MIN_BANDWIDTH || bandwidth > MAX_BANDWIDTH) {
            error("Update failed, invalid bandwidth.");
            return;
        }
        String pcepTunnelId = getPcepTunnelKey(tunnel.tunnelId());

        checkNotNull(pcepTunnelId, "Invalid tunnel id");
        if (!controller.updateTunnelBandwidth(pcepTunnelId, bandwidth)) {
            error("Update failed,maybe invalid bandwidth.");
            return;
        }
        tunnelAdminService.updateTunnel(tunnel, path);
    }
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:36,代码来源:PcepTunnelProvider.java

示例10: removeOrUpdatetunnel

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
private void removeOrUpdatetunnel(Tunnel tunnel, PcepLspObject lspObj, ProviderId providerId,
        State tunnelState, StatefulIPv4LspIdentifiersTlv ipv4LspIdenTlv) {
    DefaultTunnelDescription td = new DefaultTunnelDescription(tunnel.tunnelId(), tunnel.src(), tunnel.dst(),
            tunnel.type(), tunnel.groupId(), providerId, tunnel.tunnelName(), tunnel.path(),
            (SparseAnnotations) tunnel.annotations());
    if (lspObj.getRFlag()) {
        tunnelRemoved(td);
    } else {
        PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, tunnel.path(), LSP_STATE_RPT);
        pcepTunnelData.setStatefulIpv4IndentifierTlv(ipv4LspIdenTlv);
        pcepTunnelApiMapper.addToTunnelIdMap(pcepTunnelData);
        tunnelUpdated(td, tunnelState);
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:15,代码来源:PcepTunnelProvider.java

示例11: tunnelUpdateInDelegatedCase

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
private void tunnelUpdateInDelegatedCase(PccId pccId, SparseAnnotations annotations,
        DefaultTunnelDescription td, ProviderId providerId, State tunnelState,
                                         StatefulIPv4LspIdentifiersTlv ipv4LspIdentifiersTlv) {
    // Wait for 2sec then query tunnel based on ingress PLSP-ID and local LSP-ID

    /*
     * If ONOS is not the master for that PCC then check if D flag is set, if yes wait [while
     * master has added the tunnel to the store] then update the tunnel.
     */
    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();

    // Thread is started after 2 seconds first time later periodically after 2 seconds to update the tunnel
    executor.scheduleAtFixedRate(new UpdateDelegation(td, providerId, annotations, pccId,
            executor, tunnelState, ipv4LspIdentifiersTlv), DELAY, DELAY, TimeUnit.SECONDS);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:16,代码来源:PcepTunnelProvider.java

示例12: handleEndOfSyncAction

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
@Override
public void handleEndOfSyncAction(Tunnel tunnel, PcepLspSyncAction endOfSyncAction) {

    if (endOfSyncAction == SEND_UPDATE) {
        updateTunnel(tunnel, tunnel.path());
        return;
    }

    TunnelDescription td = new DefaultTunnelDescription(tunnel.tunnelId(),
                                                        tunnel.src(), tunnel.dst(),
                                                        tunnel.type(),
                                                        tunnel.groupId(),
                                                        tunnel.providerId(),
                                                        tunnel.tunnelName(),
                                                        tunnel.path(),
                                                        (SparseAnnotations) tunnel.annotations());


    if (endOfSyncAction == PcepLspSyncAction.UNSTABLE) {
        // Send PCInit msg again after global reoptimization.
        tunnelUpdated(td, UNSTABLE);

        // To remove the old tunnel from store whose PLSPID is not recognized by ingress PCC.
        tunnelRemoved(td);
    } else if (endOfSyncAction == REMOVE) {
        tunnelRemoved(td);
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:29,代码来源:PcepTunnelProvider.java

示例13: UpdateDelegation

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
/**
 * Creates an instance of UpdateDelegation.
 *
 * @param td tunnel description
 * @param providerId provider id
 * @param annotations tunnel annotations
 * @param pccId PCEP client id
 * @param executor service of delegated owner
 */
public UpdateDelegation(DefaultTunnelDescription td, ProviderId providerId, SparseAnnotations annotations,
        PccId pccId, ScheduledExecutorService executor, State tunnelState,
                        StatefulIPv4LspIdentifiersTlv ipv4LspIdentifiersTlv) {
    this.td = td;
    this.providerId = providerId;
    this.annotations = annotations;
    this.pccId = pccId;
    this.executor = executor;
    this.tunnelState = tunnelState;
    this.ipv4LspIdentifiersTlv = ipv4LspIdentifiersTlv;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:21,代码来源:PcepTunnelProvider.java

示例14: UpdateDelegation

import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; //导入依赖的package包/类
/**
 * Creates an instance of UpdateDelegation.
 *
 * @param td tunnel description
 * @param providerId provider id
 * @param annotations tunnel annotations
 * @param pccId PCEP client id
 * @param executor service of delegated owner
 */
public UpdateDelegation(DefaultTunnelDescription td, ProviderId providerId, SparseAnnotations annotations,
        PccId pccId, ScheduledExecutorService executor) {
    this.td = td;
    this.providerId = providerId;
    this.annotations = annotations;
    this.pccId = pccId;
    this.executor = executor;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:PcepTunnelProvider.java


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