当前位置: 首页>>代码示例>>Java>>正文


Java SlaveServer.setName方法代码示例

本文整理汇总了Java中org.pentaho.di.cluster.SlaveServer.setName方法的典型用法代码示例。如果您正苦于以下问题:Java SlaveServer.setName方法的具体用法?Java SlaveServer.setName怎么用?Java SlaveServer.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.cluster.SlaveServer的用法示例。


在下文中一共展示了SlaveServer.setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkNetworkInterfaceSetting

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
private void checkNetworkInterfaceSetting(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 (!Const.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);
				LogWriter.getInstance().logBasic("Slave server configuration", "Hostname for slave server ["+slaveServer.getName()+"] is set to ["+newHostname+"], information derived from network "+networkInterfaceName);
			}
		} catch (SocketException e) {
			LogWriter.getInstance().logError("Slave server configuration", "Unable to get the IP address for network interface "+networkInterfaceName+" for slave server ["+slaveServer.getName()+"]", e);
		}
	}

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:SlaveServerConfig.java

示例2: checkNetworkInterfaceSetting

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
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 (!Const.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);
		}
	}

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:SlaveServerConfig.java

示例3: loadSlaveServer

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public SlaveServer loadSlaveServer(ObjectId id_slave_server) throws KettleException {
  SlaveServer slaveServer = new SlaveServer();

  slaveServer.setObjectId(id_slave_server);

  RowMetaAndData row = getSlaveServer(id_slave_server);
  if (row == null) {
    throw new KettleDatabaseException(BaseMessages.getString(PKG, "SlaveServer.SlaveCouldNotBeFound", id_slave_server.toString())); //$NON-NLS-1$
  }

  slaveServer.setName(row.getString(KettleDatabaseRepository.FIELD_SLAVE_NAME, null)); //$NON-NLS-1$
  slaveServer.setHostname(row.getString(KettleDatabaseRepository.FIELD_SLAVE_HOST_NAME, null)); //$NON-NLS-1$
  slaveServer.setPort(row.getString(KettleDatabaseRepository.FIELD_SLAVE_PORT, null)); //$NON-NLS-1$
  slaveServer.setWebAppName(row.getString(KettleDatabaseRepository.FIELD_SLAVE_WEB_APP_NAME, null)); //$NON-NLS-1$
  slaveServer.setUsername(row.getString(KettleDatabaseRepository.FIELD_SLAVE_USERNAME, null)); //$NON-NLS-1$
  slaveServer.setPassword(Encr.decryptPasswordOptionallyEncrypted(row.getString(
      KettleDatabaseRepository.FIELD_SLAVE_PASSWORD, null))); //$NON-NLS-1$
  slaveServer.setProxyHostname(row.getString(KettleDatabaseRepository.FIELD_SLAVE_PROXY_HOST_NAME, null)); //$NON-NLS-1$
  slaveServer.setProxyPort(row.getString(KettleDatabaseRepository.FIELD_SLAVE_PROXY_PORT, null)); //$NON-NLS-1$
  slaveServer.setNonProxyHosts(row.getString(KettleDatabaseRepository.FIELD_SLAVE_NON_PROXY_HOSTS, null)); //$NON-NLS-1$
  slaveServer.setMaster(row.getBoolean(KettleDatabaseRepository.FIELD_SLAVE_MASTER, false)); //$NON-NLS-1$

  return slaveServer;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:25,代码来源:KettleDatabaseRepositorySlaveServerDelegate.java


注:本文中的org.pentaho.di.cluster.SlaveServer.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。