本文整理汇总了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");
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}