本文整理了Java中org.pentaho.di.core.Const.getIPAddress()
方法的一些代码示例,展示了Const.getIPAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.getIPAddress()
方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:getIPAddress
[英]Determins the IP address of the machine Kettle is running on.
[中]确定正在运行的计算机的IP地址。
代码示例来源:origin: pentaho/pentaho-kettle
String ip = getIPAddress();
String mac = "none";
String os = getOS();
代码示例来源:origin: pentaho/pentaho-kettle
case TYPE_SYSTEM_INFO_IP_ADDRESS:
try {
row[index] = Const.getIPAddress();
} catch ( Exception e ) {
throw new KettleException( e );
代码示例来源:origin: pentaho/pentaho-kettle
private void checkNetworkInterfaceSetting( LogChannelInterface log, Node slaveNode, SlaveServer slaveServer ) {
// See if we need to grab the network interface to use and then override the host name
//
String networkInterfaceName = XMLHandler.getTagValue( slaveNode, "network_interface" );
if ( !Utils.isEmpty( networkInterfaceName ) ) {
// OK, so let's try to get the IP address for this network interface...
//
try {
String newHostname = Const.getIPAddress( networkInterfaceName );
if ( newHostname != null ) {
slaveServer.setHostname( newHostname );
// Also change the name of the slave...
//
slaveServer.setName( slaveServer.getName() + "-" + newHostname );
log.logBasic( "Hostname for slave server ["
+ slaveServer.getName() + "] is set to [" + newHostname + "], information derived from network "
+ networkInterfaceName );
}
} catch ( SocketException e ) {
log.logError( "Unable to get the IP address for network interface "
+ networkInterfaceName + " for slave server [" + slaveServer.getName() + "]", e );
}
}
}
内容来源于网络,如有侵权,请联系作者删除!