本文整理汇总了Java中org.onosproject.vtnrsc.DefaultPortPair.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultPortPair.Builder方法的具体用法?Java DefaultPortPair.Builder怎么用?Java DefaultPortPair.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.vtnrsc.DefaultPortPair
的用法示例。
在下文中一共展示了DefaultPortPair.Builder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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();
}
示例4: 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;
}