本文整理汇总了Java中org.onosproject.vtnrsc.TenantId.tenantId方法的典型用法代码示例。如果您正苦于以下问题:Java TenantId.tenantId方法的具体用法?Java TenantId.tenantId怎么用?Java TenantId.tenantId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.vtnrsc.TenantId
的用法示例。
在下文中一共展示了TenantId.tenantId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
TenantNetworkService service = get(TenantNetworkService.class);
TenantNetwork network = new DefaultTenantNetwork(TenantNetworkId.networkId(id), name,
adminStateUp,
TenantNetwork.State.valueOf(state),
shared, TenantId.tenantId(tenantID),
routerExternal,
TenantNetwork.Type.valueOf(type),
PhysicalNetwork.physicalNetwork(physicalNetwork),
SegmentationId.segmentationId(segmentationID));
Set<TenantNetwork> networksSet = Sets.newHashSet();
networksSet.add(network);
service.updateNetworks(networksSet);
}
示例2: codecPortPairTest
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
/**
* Checks that a simple port pair decodes properly.
*
* @throws IOException if the resource cannot be processed
*/
@Test
public void codecPortPairTest() throws IOException {
PortPair portPair = getPortPair("portPair.json");
assertThat(portPair, notNullValue());
PortPairId portPairId = PortPairId.of("78dcd363-fc23-aeb6-f44b-56dc5e2fb3ae");
TenantId tenantId = TenantId.tenantId("d382007aa9904763a801f68ecf065cf5");
assertThat(portPair.portPairId().toString(), is(portPairId.toString()));
assertThat(portPair.name(), is("PP1"));
assertThat(portPair.tenantId().toString(), is(tenantId.toString()));
assertThat(portPair.description(), is("SF-A"));
assertThat(portPair.ingress().toString(), is("dace4513-24fc-4fae-af4b-321c5e2eb3d1"));
assertThat(portPair.egress().toString(), is("aef3478a-4a56-2a6e-cd3a-9dee4e2ec345"));
}
示例3: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
FloatingIpService service = get(FloatingIpService.class);
try {
FloatingIp floatingIpObj = new DefaultFloatingIp(
FloatingIpId.of(id),
TenantId.tenantId(tenantId),
TenantNetworkId.networkId(networkId),
VirtualPortId.portId(portId),
RouterId.valueOf(routerId),
floatingIp == null ? null : IpAddress.valueOf(floatingIp),
fixedIp == null ? null : IpAddress.valueOf(fixedIp),
status == null ? Status.ACTIVE
: Status.valueOf(status));
Set<FloatingIp> floatingIpSet = Sets.newHashSet(floatingIpObj);
service.createFloatingIps(floatingIpSet);
} catch (Exception e) {
print(null, e.getMessage());
}
}
示例4: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
SubnetService service = get(SubnetService.class);
if (id == null || networkId == null || tenantId == null) {
print("id,networkId,tenantId can not be null");
return;
}
Subnet subnet = new DefaultSubnet(SubnetId.subnetId(id), subnetName,
TenantNetworkId.networkId(networkId),
TenantId.tenantId(tenantId), ipVersion,
cidr == null ? null : IpPrefix.valueOf(cidr),
gatewayIp == null ? null : IpAddress.valueOf(gatewayIp),
dhcpEnabled, shared, hostRoutes,
ipV6AddressMode == null ? null : Mode.valueOf(ipV6AddressMode),
ipV6RaMode == null ? null : Mode.valueOf(ipV6RaMode),
allocationPools);
Set<Subnet> subnetsSet = Sets.newHashSet();
subnetsSet.add(subnet);
service.updateSubnets(subnetsSet);
}
示例5: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
VirtualPortService service = get(VirtualPortService.class);
Map<String, String> strMap = Maps.newHashMap();
strMap.putIfAbsent("name", name);
strMap.putIfAbsent("deviceOwner", deviceOwner);
strMap.putIfAbsent("bindingvnicType", bindingvnicType);
strMap.putIfAbsent("bindingvifType", bindingvifType);
strMap.putIfAbsent("bindingvnicDetails", bindingvnicDetails);
VirtualPort virtualPort = new DefaultVirtualPort(VirtualPortId.portId(id),
TenantNetworkId.networkId(networkId),
false, strMap, VirtualPort.State.ACTIVE,
MacAddress.valueOf(macAddress),
TenantId.tenantId(tenantId),
DeviceId.deviceId(deviceId), Sets.newHashSet(fixedIp),
BindingHostId.bindingHostId(bindingHostId),
allowedAddressPairs, securityGroups);
Set<VirtualPort> virtualPorts = Sets.newHashSet(virtualPort);
service.updatePorts(virtualPorts);
}
示例6: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
RouterService service = get(RouterService.class);
RouterId routerId = RouterId.valueOf(id);
Router router = get(RouterService.class).getRouter(routerId);
try {
List<String> routes = new ArrayList<String>();
Router routerObj = new DefaultRouter(
RouterId.valueOf(id),
routerName == null ? router.name() : routerName,
adminStateUp,
status == null ? Status.ACTIVE
: Status.valueOf(status),
distributed,
null,
gatewayPortId == null ? router.gatewayPortid()
: VirtualPortId.portId(gatewayPortId),
tenantId == null ? router.tenantId()
: TenantId.tenantId(tenantId),
routes);
Set<Router> routerSet = Sets.newHashSet(routerObj);
service.createRouters(routerSet);
} catch (Exception e) {
print(null, e.getMessage());
}
}
示例7: testUpdateFlowClassifier
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
/**
* Checks the operation of updateFlowClassifier() method.
*/
@Test
public void testUpdateFlowClassifier() {
// create a flow classifier
testCreateFlowClassifier();
// new updates
final String name2 = "FlowClassifier2";
final String description2 = "FlowClassifier2";
final String ethType2 = "IPv6";
final String protocol2 = "tcp";
final TenantId tenantId2 = TenantId.tenantId("10");
final VirtualPortId virtualSrcPort2 = VirtualPortId.portId("300");
final VirtualPortId virtualDstPort2 = VirtualPortId.portId("400");
flowClassifier = flowClassifierBuilder.setFlowClassifierId(flowClassifierId)
.setTenantId(tenantId2).setName(name2).setDescription(description2).setEtherType(ethType2)
.setProtocol(protocol2).setMinSrcPortRange(minSrcPortRange).setMaxSrcPortRange(maxSrcPortRange)
.setMinDstPortRange(minDstPortRange).setMaxDstPortRange(maxDstPortRange).setSrcIpPrefix(srcIpPrefix)
.setDstIpPrefix(dstIpPrefix).setSrcPort(virtualSrcPort2).setDstPort(virtualDstPort2).build();
assertThat(flowClassifierMgr.updateFlowClassifier(flowClassifier), is(true));
}
示例8: codecPortChainTest
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
/**
* Checks that a simple rule decodes properly.
*
* @throws IOException if the resource cannot be processed
*/
@Test
public void codecPortChainTest() throws IOException {
PortChain portChain = getPortChain("portChain.json");
assertThat(portChain, notNullValue());
PortChainId portChainId = PortChainId.of("1278dcd4-459f-62ed-754b-87fc5e4a6751");
TenantId tenantId = TenantId.tenantId("d382007aa9904763a801f68ecf065cf5");
assertThat(portChain.portChainId().toString(), is(portChainId.toString()));
assertThat(portChain.name(), is("PC2"));
assertThat(portChain.tenantId().toString(), is(tenantId.toString()));
assertThat(portChain.description(), is("Two flows and two port-pair-groups"));
assertThat(portChain.flowClassifiers(), notNullValue());
assertThat(portChain.portPairGroups(), notNullValue());
}
示例9: codecFlowClassifierTest
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
/**
* Checks that a simple flow classifier decodes properly.
*
* @throws IOException if the resource cannot be processed
*/
@Test
public void codecFlowClassifierTest() throws IOException {
FlowClassifier flowClassifier = getFlowClassifier("flowClassifier.json");
assertThat(flowClassifier, notNullValue());
FlowClassifierId flowClassifierId = FlowClassifierId.of("4a334cd4-fe9c-4fae-af4b-321c5e2eb051");
TenantId tenantId = TenantId.tenantId("1814726e2d22407b8ca76db5e567dcf1");
assertThat(flowClassifier.flowClassifierId().toString(), is(flowClassifierId.toString()));
assertThat(flowClassifier.name(), is("flow1"));
assertThat(flowClassifier.tenantId().toString(), is(tenantId.toString()));
assertThat(flowClassifier.description(), is("flow classifier"));
assertThat(flowClassifier.protocol(), is("tcp"));
assertThat(flowClassifier.priority(), is(65535));
assertThat(flowClassifier.minSrcPortRange(), is(22));
assertThat(flowClassifier.maxSrcPortRange(), is(4000));
assertThat(flowClassifier.minDstPortRange(), is(80));
assertThat(flowClassifier.maxDstPortRange(), is(80));
}
示例10: testOnPortPairDeleted
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的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);
}
示例11: testConstruction
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
/**
* Checks the construction of a RouterInterface object.
*/
@Test
public void testConstruction() {
final TenantId tenantId = TenantId.tenantId(tenantIdStr);
final VirtualPortId portId = VirtualPortId.portId(virtualPortId);
final RouterId routerId1 = RouterId.valueOf(routeIdStr1);
final SubnetId subnet = SubnetId.subnetId(subnetIdStr);
RouterInterface ri1 = RouterInterface.routerInterface(subnet, portId,
routerId1,
tenantId);
assertThat(portId, is(notNullValue()));
assertThat(portId, is(ri1.portId()));
assertThat(tenantId, is(notNullValue()));
assertThat(tenantId, is(ri1.tenantId()));
assertThat(routerId1, is(notNullValue()));
assertThat(routerId1, is(ri1.routerId()));
assertThat(subnet, is(notNullValue()));
assertThat(subnet, is(ri1.subnetId()));
}
示例12: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
SubnetService service = get(SubnetService.class);
if (id == null || networkId == null || tenantId == null) {
print("id,networkId,tenantId can not be null");
return;
}
Subnet subnet = new DefaultSubnet(SubnetId.subnetId(id), subnetName,
TenantNetworkId.networkId(networkId),
TenantId.tenantId(tenantId), ipVersion,
cidr == null ? null : IpPrefix.valueOf(cidr),
gatewayIp == null ? null : IpAddress.valueOf(gatewayIp),
dhcpEnabled, shared, hostRoutes,
ipV6AddressMode == null ? null : Mode.valueOf(ipV6AddressMode),
ipV6RaMode == null ? null : Mode.valueOf(ipV6RaMode),
allocationPools);
Set<Subnet> subnetsSet = Sets.newHashSet(subnet);
service.createSubnets(subnetsSet);
}
示例13: execute
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
@Override
protected void execute() {
RouterService service = get(RouterService.class);
try {
List<String> routes = new ArrayList<String>();
Router router = new DefaultRouter(
RouterId.valueOf(id),
routerName,
adminStateUp,
status == null ? Status.ACTIVE
: Status.valueOf(status),
distributed,
null,
VirtualPortId.portId(gatewayPortId),
TenantId.tenantId(tenantId),
routes);
Set<Router> routerSet = Sets.newHashSet(router);
service.createRouters(routerSet);
} catch (Exception e) {
print(null, e.getMessage());
}
}
示例14: createFlowClassifier
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的package包/类
private FlowClassifier createFlowClassifier(FlowClassifierId id) {
final String name = "FlowClassifier1";
final String description = "FlowClassifier1";
final String ethType = "IPv4";
final String protocol = "tcp";
final int minSrcPortRange = 5;
final int maxSrcPortRange = 10;
final int minDstPortRange = 5;
final int maxDstPortRange = 10;
final TenantId tenantId = TenantId.tenantId("1");
final IpPrefix srcIpPrefix = IpPrefix.valueOf("0.0.0.0/0");
final IpPrefix dstIpPrefix = IpPrefix.valueOf("10.10.10.10/0");
final VirtualPortId virtualSrcPort = id1;
final VirtualPortId virtualDstPort = id2;
DefaultFlowClassifier.Builder flowClassifierBuilder = new DefaultFlowClassifier.Builder();
final FlowClassifier flowClassifier = flowClassifierBuilder.setFlowClassifierId(id)
.setTenantId(tenantId).setName(name).setDescription(description).setEtherType(ethType)
.setProtocol(protocol).setMinSrcPortRange(minSrcPortRange).setMaxSrcPortRange(maxSrcPortRange)
.setMinDstPortRange(minDstPortRange).setMaxDstPortRange(maxDstPortRange).setSrcIpPrefix(srcIpPrefix)
.setDstIpPrefix(dstIpPrefix).setSrcPort(virtualSrcPort).setDstPort(virtualDstPort).build();
return flowClassifier;
}
示例15: testOnPortPairCreated
import org.onosproject.vtnrsc.TenantId; //导入方法依赖的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);
}