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


Java DefaultPortPair类代码示例

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


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

示例1: activate

import org.onosproject.vtnrsc.DefaultPortPair; //导入依赖的package包/类
@Activate
public void activate() {

    eventDispatcher.addSink(PortPairEvent.class, listenerRegistry);
    KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
            .register(KryoNamespaces.API)
            .register(MultiValuedTimestamp.class)
            .register(PortPair.class, PortPairId.class, UUID.class, DefaultPortPair.class, TenantId.class);

    portPairStore = storageService.<PortPairId, PortPair>eventuallyConsistentMapBuilder()
            .withName("portpairstore")
            .withSerializer(serializer)
            .withTimestampProvider((k, v) -> new WallClockTimestamp())
            .build();

    portPairStore.addListener(portPairListener);

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:PortPairManager.java

示例2: testOnPortPairCreated

import org.onosproject.vtnrsc.DefaultPortPair; //导入依赖的package包/类
/**
 * Checks the operation of onPortPairCreated() method.
 */
@Test
public void testOnPortPairCreated() {
    final PortPairId portPairId = PortPairId.of("78888888-fc23-aeb6-f44b-56dc5e2fb3ae");
    final TenantId tenantId = TenantId.tenantId("1");
    final String name = "PortPair";
    final String description = "PortPair";
    final String ingress = "d3333333-24fc-4fae-af4b-321c5e2eb3d1";
    final String egress = "a4444444-4a56-2a6e-cd3a-9dee4e2ec345";
    DefaultPortPair.Builder portPairBuilder = new DefaultPortPair.Builder();
    PortPair portPair = null;
    SfcService sfcService = new SfcManager();

    // create port pair
    portPair = portPairBuilder.setId(portPairId).setTenantId(tenantId).setName(name).setDescription(description)
            .setIngress(ingress).setEgress(egress).build();
    sfcService.onPortPairCreated(portPair);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:SfcManagerTest.java

示例3: testOnPortPairDeleted

import org.onosproject.vtnrsc.DefaultPortPair; //导入依赖的package包/类
/**
 * Checks the operation of onPortPairDeleted() method.
 */
@Test
public void testOnPortPairDeleted() {
    final PortPairId portPairId = PortPairId.of("78888888-fc23-aeb6-f44b-56dc5e2fb3ae");
    final TenantId tenantId = TenantId.tenantId("1");
    final String name = "PortPair";
    final String description = "PortPair";
    final String ingress = "d3333333-24fc-4fae-af4b-321c5e2eb3d1";
    final String egress = "a4444444-4a56-2a6e-cd3a-9dee4e2ec345";
    DefaultPortPair.Builder portPairBuilder = new DefaultPortPair.Builder();
    PortPair portPair = null;
    SfcService sfcService = new SfcManager();

    // create port pair
    portPair = portPairBuilder.setId(portPairId).setTenantId(tenantId).setName(name).setDescription(description)
            .setIngress(ingress).setEgress(egress).build();
    sfcService.onPortPairDeleted(portPair);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:SfcManagerTest.java

示例4: decode

import org.onosproject.vtnrsc.DefaultPortPair; //导入依赖的package包/类
@Override
public PortPair decode(ObjectNode json, CodecContext context) {
    if (json == null || !json.isObject()) {
        return null;
    }

    PortPair.Builder resultBuilder = new DefaultPortPair.Builder();

    CoreService coreService = context.getService(CoreService.class);

    String id = nullIsIllegal(json.get(ID),
                              ID + MISSING_MEMBER_MESSAGE).asText();
    resultBuilder.setId(PortPairId.of(id));

    String tenantId = nullIsIllegal(json.get(TENANT_ID),
                                    TENANT_ID + MISSING_MEMBER_MESSAGE).asText();
    resultBuilder.setTenantId(TenantId.tenantId(tenantId));

    String name = nullIsIllegal(json.get(NAME),
                                NAME + MISSING_MEMBER_MESSAGE).asText();
    resultBuilder.setName(name);

    String description = nullIsIllegal(json.get(DESCRIPTION),
                                       DESCRIPTION + MISSING_MEMBER_MESSAGE).asText();
    resultBuilder.setDescription(description);

    String ingressPort = nullIsIllegal(json.get(INGRESS),
                                       INGRESS + MISSING_MEMBER_MESSAGE).asText();
    resultBuilder.setIngress(ingressPort);

    String egressPort = nullIsIllegal(json.get(EGRESS),
                                      EGRESS + MISSING_MEMBER_MESSAGE).asText();
    resultBuilder.setEgress(egressPort);

    return resultBuilder.build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:37,代码来源:PortPairCodec.java

示例5: createPortPair

import org.onosproject.vtnrsc.DefaultPortPair; //导入依赖的package包/类
private PortPair createPortPair(PortPairId ppId) {
    DefaultPortPair.Builder portPairBuilder = new DefaultPortPair.Builder();
    PortPair portPair = portPairBuilder.setId(ppId).setName(ppName).setTenantId(tenantId)
            .setDescription(ppDescription).setIngress(ingress).setEgress(egress).build();
    return portPair;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:SfcFlowRuleInstallerImplTest.java


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