本文整理汇总了Java中org.onlab.packet.IpAddress.toString方法的典型用法代码示例。如果您正苦于以下问题:Java IpAddress.toString方法的具体用法?Java IpAddress.toString怎么用?Java IpAddress.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onlab.packet.IpAddress
的用法示例。
在下文中一共展示了IpAddress.toString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: privateIpDeleteNotification
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Delete a virtual BNG connection.
*
* @param privateIp IP Address for the BNG private network
* @return 200 OK
*/
@DELETE
@Path("{privateip}")
public Response privateIpDeleteNotification(@PathParam("privateip")
String privateIp) {
String result;
if (privateIp == null) {
log.info("Private IP address to delete is null");
result = "0";
}
log.info("Received a private IP address : {} to delete", privateIp);
IpAddress privateIpAddress = IpAddress.valueOf(privateIp);
VbngService vbngService = get(VbngService.class);
IpAddress assignedPublicIpAddress = null;
// Delete a virtual BNG
assignedPublicIpAddress = vbngService.deleteVbng(privateIpAddress);
if (assignedPublicIpAddress != null) {
result = assignedPublicIpAddress.toString();
} else {
result = "0";
}
return Response.ok().entity(result).build();
}
示例2: uri
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Returns device URI from the given IP address.
*
* @param ipAddress device IP address
* @return device URI
*/
public static URI uri(IpAddress ipAddress) {
try {
return new URI(SCHEME, ipAddress.toString(), null);
} catch (URISyntaxException e) {
return null;
}
}
示例3: setChannel
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
@Override
public final void setChannel(Channel channel) {
this.channel = channel;
final SocketAddress address = channel.getRemoteAddress();
if (address instanceof InetSocketAddress) {
final InetSocketAddress inetAddress = (InetSocketAddress) address;
final IpAddress ipAddress = IpAddress.valueOf(inetAddress.getAddress());
if (ipAddress.isIp4()) {
channelId = ipAddress.toString() + ':' + inetAddress.getPort();
} else {
channelId = '[' + ipAddress.toString() + "]:" + inetAddress.getPort();
}
}
}
示例4: uri
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Produces client URI from the given ip address.
*
* @param ipAddress ip of client
* @return client URI
*/
public static URI uri(IpAddress ipAddress) {
try {
return new URI(SCHEME, ipAddress.toString(), null);
} catch (URISyntaxException e) {
return null;
}
}
示例5: uri
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Produces device URI from the given DPID long.
*
* @param ipAddress device ip address
* @return device URI
*/
public static URI uri(IpAddress ipAddress) {
try {
return new URI(SCHEME, ipAddress.toString(), null);
} catch (URISyntaxException e) {
return null;
}
}
示例6: privateIpAddNotification
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Create a new virtual BNG connection.
*
* @param privateIp IP Address for the BNG private network
* @param mac MAC address for the host
* @param hostName name of the host
* @return public IP address for the new connection
*/
@POST
@Path("{privateip}/{mac}/{hostname}")
public String privateIpAddNotification(@PathParam("privateip")
String privateIp, @PathParam("mac") String mac,
@PathParam("hostname") String hostName) {
log.info("Received creating vBNG request, "
+ "privateIp= {}, mac={}, hostName= {}",
privateIp, mac, hostName);
if (privateIp == null || mac == null || hostName == null) {
log.info("Parameters can not be null");
return "0";
}
IpAddress privateIpAddress = IpAddress.valueOf(privateIp);
MacAddress hostMacAddress = MacAddress.valueOf(mac);
VbngService vbngService = get(VbngService.class);
IpAddress publicIpAddress = null;
// Create a virtual BNG
publicIpAddress = vbngService.createVbng(privateIpAddress,
hostMacAddress,
hostName);
if (publicIpAddress != null) {
return publicIpAddress.toString();
} else {
return "0";
}
}
示例7: OvsdbNodeId
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Creates a new node identifier from an IpAddress ipAddress, a long port.
*
* @param ipAddress node IP address
* @param port node port
*/
public OvsdbNodeId(IpAddress ipAddress, long port) {
// TODO: port is currently not in use, need to remove it later
super(checkNotNull(ipAddress, "ipAddress is not null").toString());
this.ipAddress = ipAddress.toString();
}
示例8: getTunnelName
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Gets tunnel name.
*
* @param tunnelType
* @param dstIp the remote ip address
* @return tunnel name
*/
private String getTunnelName(String tunnelType, IpAddress dstIp) {
return tunnelType + "-" + dstIp.toString();
}
示例9: RestClient
import org.onlab.packet.IpAddress; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param xosServerIpAddress the IP address of the XOS server
* @param xosServerPort the port for the REST service on XOS server
*/
RestClient(IpAddress xosServerIpAddress, int xosServerPort) {
this.url = "http://" + xosServerIpAddress.toString() + ":"
+ xosServerPort + "/xoslib/rs/vbng_mapping/";
}