本文整理汇总了Java中org.onosproject.net.PortNumber.toLong方法的典型用法代码示例。如果您正苦于以下问题:Java PortNumber.toLong方法的具体用法?Java PortNumber.toLong怎么用?Java PortNumber.toLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.net.PortNumber
的用法示例。
在下文中一共展示了PortNumber.toLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDeleteVirtualPort
import org.onosproject.net.PortNumber; //导入方法依赖的package包/类
/**
* Tests removing a virtual port with DELETE request.
*/
@Test
public void testDeleteVirtualPort() {
NetworkId networkId = networkId3;
DeviceId deviceId = devId2;
PortNumber portNum = portNumber(2);
mockVnetAdminService.removeVirtualPort(networkId, deviceId, portNum);
expectLastCall();
replay(mockVnetAdminService);
WebTarget wt = target()
.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
String reqLocation = "vnets/" + networkId.toString()
+ "/devices/" + deviceId.toString() + "/ports/" + portNum.toLong();
Response response = wt.path(reqLocation)
.request(MediaType.APPLICATION_JSON_TYPE)
.delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockVnetAdminService);
}
示例2: addLink
import org.onosproject.net.PortNumber; //导入方法依赖的package包/类
@Override
public void addLink(IsisLink isisLink) {
log.debug("Addlink {}", isisLink.localSystemId());
LinkDescription linkDes = buildLinkDes(isisLink);
//Updating ports of the link
//If already link exists, return
if (linkService.getLink(linkDes.src(), linkDes.dst()) != null || linkProviderService == null) {
return;
}
ConnectPoint destconnectPoint = linkDes.dst();
PortNumber destport = destconnectPoint.port();
if (destport.toLong() != 0) {
deviceProviderService.updatePorts(linkDes.src().deviceId(),
buildPortDescriptions(linkDes.src().deviceId(),
linkDes.src().port()));
deviceProviderService.updatePorts(linkDes.dst().deviceId(),
buildPortDescriptions(linkDes.dst().deviceId(),
linkDes.dst().port()));
registerBandwidth(linkDes, isisLink);
linkProviderService.linkDetected(linkDes);
System.out.println("link desc " + linkDes.toString());
}
}
示例3: encode
import org.onosproject.net.PortNumber; //导入方法依赖的package包/类
@Override
public int encode(PortNumber resource) {
return (int) resource.toLong();
}