org.pentaho.di.core.util.Utils.resolvePassword()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(77)

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

Utils.resolvePassword介绍

[英]Resolves password from variable if it's necessary and decrypts if the password was encrypted
[中]如果需要,从变量解析密码,如果密码已加密,则解密

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @param password string for resolving
 * @return Returns resolved decrypted password or null
 * in case of param returns null.
 */
public String getRealPassword( String password ) {
 return Utils.resolvePassword( variables, password );
}

代码示例来源:origin: pentaho/pentaho-kettle

public String getRealPassword( String password ) {
 return Utils.resolvePassword( variables, password );
}

代码示例来源:origin: pentaho/pentaho-kettle

public LdapSslProtocol( LogChannelInterface log, VariableSpace variableSpace, LdapMeta meta,
 Collection<String> binaryAttributes ) {
 super( log, variableSpace, meta, binaryAttributes );
 String trustStorePath = null;
 String trustStorePassword = null;
 boolean trustAllCertificates = false;
 if ( meta.isUseCertificate() ) {
  trustStorePath = variableSpace.environmentSubstitute( meta.getTrustStorePath() );
  trustStorePassword =  Utils.resolvePassword( variableSpace,
      meta.getTrustStorePassword() );
  trustAllCertificates = meta.isTrustAllCertificates();
 }
 this.trustAllCertificates = trustAllCertificates;
 this.trustStorePath = trustStorePath;
 this.trustStorePassword = trustStorePassword;
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * transformation run initialize, may create the output file if specified by user options
 *
 * @see org.pentaho.di.trans.step.BaseStep#init(org.pentaho.di.trans.step.StepMetaInterface,
 * org.pentaho.di.trans.step.StepDataInterface)
 */
@Override
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
 meta = (ExcelWriterStepMeta) smi;
 data = (ExcelWriterStepData) sdi;
 if ( super.init( smi, sdi ) ) {
  data.splitnr = 0;
  data.datalines = 0;
  data.realSheetname = environmentSubstitute( meta.getSheetname() );
  data.realTemplateSheetName = environmentSubstitute( meta.getTemplateSheetName() );
  data.realTemplateFileName = environmentSubstitute( meta.getTemplateFileName() );
  data.realStartingCell = environmentSubstitute( meta.getStartingCell() );
  data.realPassword = Utils.resolvePassword( variables, meta.getPassword() );
  data.realProtectedBy = environmentSubstitute( meta.getProtectedBy() );
  data.shiftExistingCells = ExcelWriterStepMeta.ROW_WRITE_PUSH_DOWN.equals( meta.getRowWritingMethod() );
  data.createNewSheet = ExcelWriterStepMeta.IF_SHEET_EXISTS_CREATE_NEW.equals( meta.getIfSheetExists() );
  data.createNewFile = ExcelWriterStepMeta.IF_FILE_EXISTS_CREATE_NEW.equals( meta.getIfFileExists() );
  return true;
 }
 return false;
}

代码示例来源:origin: pentaho/pentaho-kettle

private SalesforceConnection getConnection() throws KettleException {
 String url = transMeta.environmentSubstitute( wURL.getText() );
 // Define a new Salesforce connection
 SalesforceConnection connection =
  new SalesforceConnection( log, url, transMeta.environmentSubstitute( wUserName.getText() ),
   Utils.resolvePassword( transMeta, wPassword.getText() ) );
 int realTimeOut = Const.toInt( transMeta.environmentSubstitute( wTimeOut.getText() ), 0 );
 connection.setTimeOut( realTimeOut );
 // connect to Salesforce
 connection.connect();
 return connection;
}

代码示例来源:origin: pentaho/pentaho-kettle

protected MapiSocket getMonetDBConnection() throws Exception {
 if ( this.meta == null ) {
  throw new KettleException( "No metadata available to determine connection information from." );
 }
 DatabaseMeta dm = meta.getDatabaseMeta();
 String hostname = environmentSubstitute( Const.NVL( dm.getHostname(), "" ) );
 String portnum = environmentSubstitute( Const.NVL( dm.getDatabasePortNumberString(), "" ) );
 String user = environmentSubstitute( Const.NVL( dm.getUsername(), "" ) );
 String password = Utils.resolvePassword( variables, Const.NVL( dm.getPassword(), "" ) );
 String db = environmentSubstitute( Const.NVL( dm.getDatabaseName(), "" ) );
 MapiSocket mserver = getMonetDBConnection( hostname, Integer.valueOf( portnum ), user, password, db, log );
 return mserver;
}

代码示例来源:origin: pentaho/pentaho-kettle

String realPassword = Utils.resolvePassword( transMeta, meta.getPassword() );
int realTimeOut = Const.toInt( transMeta.environmentSubstitute( meta.getTimeout() ), 0 );

代码示例来源:origin: pentaho/pentaho-kettle

SFTPClient createSFTPClient() throws UnknownHostException, KettleJobException {
 // Create sftp client to host ...
 sftpclient =
  new SFTPClient(
   InetAddress.getByName(
    transMeta.environmentSubstitute( wServerName.getText() ) ),
   Const.toInt( transMeta.environmentSubstitute( wServerPort.getText() ), 22 ),
   transMeta.environmentSubstitute( wUserName.getText() ),
   transMeta.environmentSubstitute( wKeyFilename.getText() ),
   transMeta.environmentSubstitute( wkeyfilePass.getText() ) );
 // Set proxy?
 String realProxyHost = transMeta.environmentSubstitute( wProxyHost.getText() );
 if ( !Utils.isEmpty( realProxyHost ) ) {
  // Set proxy
  sftpclient.setProxy(
   realProxyHost,
   transMeta.environmentSubstitute( wProxyPort.getText() ),
   transMeta.environmentSubstitute( wProxyUsername.getText() ),
   Utils.resolvePassword( transMeta,  wProxyPassword.getText() ),
   wProxyType.getText() );
 }
 // login to ftp host ...
 sftpclient.login( Utils.resolvePassword( transMeta, wPassword.getText() ) );
 return sftpclient;
}

代码示例来源:origin: pentaho/pentaho-kettle

sftpclient.login( Utils.resolvePassword( jobMeta, wPassword.getText() ) );
pwdFolder = sftpclient.pwd();

代码示例来源:origin: pentaho/pentaho-kettle

public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
 meta = (HTTPMeta) smi;
 data = (HTTPData) sdi;
 if ( super.init( smi, sdi ) ) {
  // get authentication settings once
  data.realProxyHost = environmentSubstitute( meta.getProxyHost() );
  data.realProxyPort = Const.toInt( environmentSubstitute( meta.getProxyPort() ), 8080 );
  data.realHttpLogin = environmentSubstitute( meta.getHttpLogin() );
  data.realHttpPassword = Utils.resolvePassword( variables, meta.getHttpPassword() );
  data.realSocketTimeout = Const.toInt( environmentSubstitute( meta.getSocketTimeout() ), -1 );
  data.realConnectionTimeout = Const.toInt( environmentSubstitute( meta.getSocketTimeout() ), -1 );
  return true;
 }
 return false;
}

代码示例来源:origin: pentaho/pentaho-kettle

String realserver = transMeta.environmentSubstitute( wServerName.getText() );
String realuser = transMeta.environmentSubstitute( wUserName.getText() );
String realpass = Utils.resolvePassword( transMeta, wPassword.getText() );
String realProxyUsername = transMeta.environmentSubstitute( wProxyUsername.getText() );
int realport = Const.toInt( transMeta.environmentSubstitute( wPort.getText() ), -1 );

代码示例来源:origin: pentaho/pentaho-kettle

int nrPort = Const.toInt( transMeta.environmentSubstitute( wPort.getText() ), 22 );
String username = transMeta.environmentSubstitute( wUserName.getText() );
String password = Utils.resolvePassword( transMeta,  wPassword.getText() );
String keyFilename = transMeta.environmentSubstitute( wPrivateKey.getText() );
String passphrase = transMeta.environmentSubstitute( wPassphrase.getText() );
int proxyport = Const.toInt( transMeta.environmentSubstitute( wProxyPort.getText() ), 0 );
String proxyusername = transMeta.environmentSubstitute( wProxyUsername.getText() );
String proxypassword = Utils.resolvePassword( transMeta,  wProxyPassword.getText() );

代码示例来源:origin: pentaho/pentaho-kettle

public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
 meta = (HTTPPOSTMeta) smi;
 data = (HTTPPOSTData) sdi;
 if ( super.init( smi, sdi ) ) {
  // get authentication settings once
  data.realProxyHost = environmentSubstitute( meta.getProxyHost() );
  data.realProxyPort = Const.toInt( environmentSubstitute( meta.getProxyPort() ), 8080 );
  data.realHttpLogin = environmentSubstitute( meta.getHttpLogin() );
  data.realHttpPassword = Utils.resolvePassword( variables, meta.getHttpPassword() );
  data.realSocketTimeout = Const.toInt( environmentSubstitute( meta.getSocketTimeout() ), -1 );
  data.realConnectionTimeout = Const.toInt( environmentSubstitute( meta.getSocketTimeout() ), -1 );
  data.realcloseIdleConnectionsTime =
   Const.toInt( environmentSubstitute( meta.getCloseIdleConnectionsTime() ), -1 );
  return true;
 }
 return false;
}

代码示例来源:origin: pentaho/pentaho-kettle

Utils.resolvePassword( transMeta, meta.getPassword() ) );
int realTimeOut = Const.toInt( transMeta.environmentSubstitute( meta.getTimeout() ), 0 );
connection.setTimeOut( realTimeOut );

代码示例来源:origin: pentaho/pentaho-kettle

private String[] getModuleFields() throws KettleException {
 SalesforceUpdateMeta meta = new SalesforceUpdateMeta();
 getInfo( meta );
 SalesforceConnection connection = null;
 String url = transMeta.environmentSubstitute( meta.getTargetURL() );
 try {
  String selectedModule = transMeta.environmentSubstitute( meta.getModule() );
  // Define a new Salesforce connection
  connection =
   new SalesforceConnection( log, url, transMeta.environmentSubstitute( meta.getUsername() ),
    Utils.resolvePassword( transMeta, meta.getPassword() ) );
  int realTimeOut = Const.toInt( transMeta.environmentSubstitute( meta.getTimeout() ), 0 );
  connection.setTimeOut( realTimeOut );
  // connect to Salesforce
  connection.connect();
  // return fieldsname for the module
  return connection.getFields( selectedModule );
 } catch ( Exception e ) {
  throw new KettleException( "Erreur getting fields from module [" + url + "]!", e );
 } finally {
  if ( connection != null ) {
   try {
    connection.close();
   } catch ( Exception e ) { /* Ignore */
   }
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

Utils.resolvePassword( transMeta, meta.getPassword() ) );

代码示例来源:origin: pentaho/pentaho-kettle

Utils.resolvePassword( transMeta, meta.getPassword() ) );

代码示例来源:origin: pentaho/pentaho-kettle

Utils.resolvePassword( transMeta, meta.getPassword() ) );

代码示例来源:origin: pentaho/pentaho-kettle

Utils.resolvePassword( transMeta, meta.getPassword() ) );
int realTimeOut = Const.toInt( transMeta.environmentSubstitute( meta.getTimeout() ), 0 );
connection.setTimeOut( realTimeOut );

代码示例来源:origin: pentaho/pentaho-kettle

String realPassword = Utils.resolvePassword( space, password );
connectString += "JdbcPassword=" + space.environmentSubstitute( realPassword ) + ";";

相关文章