org.pentaho.di.core.Const.getIPAddress()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.pentaho.di.core.Const.getIPAddress()方法的一些代码示例,展示了Const.getIPAddress()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.getIPAddress()方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:getIPAddress

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 );
  }
 }
}

相关文章

微信公众号

最新文章

更多