本文整理汇总了Java中org.pentaho.di.core.encryption.Encr.decryptPasswordOptionallyEncrypted方法的典型用法代码示例。如果您正苦于以下问题:Java Encr.decryptPasswordOptionallyEncrypted方法的具体用法?Java Encr.decryptPasswordOptionallyEncrypted怎么用?Java Encr.decryptPasswordOptionallyEncrypted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.encryption.Encr
的用法示例。
在下文中一共展示了Encr.decryptPasswordOptionallyEncrypted方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
if ( !super.init( smi, sdi ) ) {
return false;
}
meta = (ZendeskInputMeta) smi;
data = (ZendeskInputData) sdi;
String subDomain = environmentSubstitute( meta.getSubDomain() );
String username = environmentSubstitute( meta.getUsername() );
String password = Encr.decryptPasswordOptionallyEncrypted( environmentSubstitute( meta.getPassword() ) );
if ( Const.isEmpty( subDomain ) || Const.isEmpty( username ) || Const.isEmpty( password ) ) {
logError( BaseMessages.getString( PKG, "ZendeskInput.Error.MissingCredentials" ) );
return false;
}
data.conn = createConnection( subDomain, username, password, meta.isToken() );
if ( data.conn == null || data.conn.isClosed() ) {
return false;
}
return true;
}
示例2: readRep
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override
public void readRep(Repository rep, IMetaStore metastore, ObjectId id_step, List<DatabaseMeta> databases)
throws KettleException {
this.cassandraNodes = rep.getStepAttributeString(id_step, 0, CASSANDRA_NODES);
this.cassandraPort = rep.getStepAttributeString(id_step, 0, CASSANDRA_PORT);
this.username = rep.getStepAttributeString(id_step, 0, USERNAME);
this.password = rep.getStepAttributeString(id_step, 0, PASSWORD);
if (!Const.isEmpty(this.password)) {
this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
}
this.keyspace = rep.getStepAttributeString(id_step, 0, CASSANDRA_KEYSPACE);
this.SslEnabled = rep.getStepAttributeBoolean(id_step, 0, CASSANDRA_WITH_SSL);
this.trustStoreFilePath = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_FILE_PATH);
this.trustStorePass = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_PASS);
if (!Const.isEmpty(this.trustStorePass)) {
this.trustStorePass = Encr.decryptPasswordOptionallyEncrypted(this.trustStorePass);
}
this.columnfamily = rep.getStepAttributeString(id_step, 0, CASSANDRA_COLUMN_FAMILY);
this.syncMode = rep.getStepAttributeBoolean(id_step, 0, SYNC_ENABLED);
String batchSize = rep.getStepAttributeString(id_step, 0, BATCH_SIZE);
this.batchSize = (Const.isEmpty(batchSize) ? 1000 : Integer.valueOf(batchSize));
String sCompression = rep.getStepAttributeString(id_step, 0, QUERY_COMPRESSION);
this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
this.specifyFields = rep.getStepAttributeBoolean(id_step, 0, SPECIFY_FIELDS);
int nrCols = rep.countNrStepAttributes(id_step, COLUMN_NAME);
int nrStreams = rep.countNrStepAttributes(id_step, STREAM_NAME);
int nrRows = nrCols < nrStreams ? nrStreams : nrCols;
allocate(nrRows);
for (int idx = 0; idx < nrRows; idx++) {
this.cassandraFields[idx] = Const.NVL(rep.getStepAttributeString(id_step, idx, COLUMN_NAME), "");
this.streamFields[idx] = Const.NVL(rep.getStepAttributeString(id_step, idx, STREAM_NAME), "");
}
this.ttl = Const.toInt(rep.getStepAttributeString(id_step, 0, TTL), 0);
}
示例3: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metastore) throws KettleXMLException {
this.cassandraNodes = XMLHandler.getTagValue(stepnode, CASSANDRA_NODES);
this.cassandraPort = XMLHandler.getTagValue(stepnode, CASSANDRA_PORT);
this.username = XMLHandler.getTagValue(stepnode, USERNAME);
this.password = XMLHandler.getTagValue(stepnode, PASSWORD);
if (!Const.isEmpty(this.password)) {
this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
}
this.keyspace = XMLHandler.getTagValue(stepnode, CASSANDRA_KEYSPACE);
this.SslEnabled = "Y".equals(XMLHandler.getTagValue(stepnode, CASSANDRA_WITH_SSL));
this.trustStoreFilePath = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_FILE_PATH);
this.trustStorePass = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_PASS);
String sCompression = XMLHandler.getTagValue(stepnode, COMPRESSION);
this.cqlStatement = XMLHandler.getTagValue(stepnode, CQL);
this.executeForEachInputRow = "Y".equals(XMLHandler.getTagValue(stepnode, EXECUTE_FOR_EACH_INPUT));
String sRowLimit = XMLHandler.getTagValue(stepnode, ROW_LIMIT);
checkNulls();
if (this.cqlStatement == null) {
this.cqlStatement = "";
}
if (!Const.isEmpty(sRowLimit)) {
this.rowLimit = Integer.parseInt(sRowLimit);
}
this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
}
示例4: readRep
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override
public void readRep(Repository rep, IMetaStore metastore, ObjectId id_step, List<DatabaseMeta> databases)
throws KettleException {
this.cassandraNodes = rep.getStepAttributeString(id_step, 0, CASSANDRA_NODES);
this.cassandraPort = rep.getStepAttributeString(id_step, 0, CASSANDRA_PORT);
this.username = rep.getStepAttributeString(id_step, 0, USERNAME);
this.password = rep.getStepAttributeString(id_step, 0, PASSWORD);
if (!Const.isEmpty(this.password)) {
this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
}
this.keyspace = rep.getStepAttributeString(id_step, 0, CASSANDRA_KEYSPACE);
this.SslEnabled = rep.getStepAttributeBoolean(id_step, CASSANDRA_WITH_SSL);
this.trustStoreFilePath = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_FILE_PATH);
this.trustStorePass = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_PASS);
String sCompression = rep.getStepAttributeString(id_step, 0, COMPRESSION);
this.cqlStatement = rep.getStepAttributeString(id_step, 0, CQL);
this.executeForEachInputRow = rep.getStepAttributeBoolean(id_step, EXECUTE_FOR_EACH_INPUT);
this.rowLimit = ((int) rep.getStepAttributeInteger(id_step, ROW_LIMIT));
if (!Const.isEmpty(this.trustStorePass)) {
this.trustStorePass = Encr.decryptPasswordOptionallyEncrypted(this.trustStorePass);
}
checkNulls();
if (this.cqlStatement == null) {
this.cqlStatement = "";
}
this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
}
示例5: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore )
throws KettleXMLException {
try {
broker = XMLHandler.getTagValue( stepnode, "BROKER" );
topic = XMLHandler.getTagValue( stepnode, "TOPIC" );
String topicFromField = XMLHandler.getTagValue( stepnode, "TOPIC_IS_FROM_FIELD" );
if ( !Const.isEmpty( topicFromField ) ) {
m_topicIsFromField = topicFromField.equalsIgnoreCase( "Y" );
}
field = XMLHandler.getTagValue( stepnode, "FIELD" );
clientId = XMLHandler.getTagValue( stepnode, "CLIENT_ID" );
timeout = XMLHandler.getTagValue( stepnode, "TIMEOUT" );
qos = XMLHandler.getTagValue( stepnode, "QOS" );
requiresAuth = Boolean.parseBoolean( XMLHandler.getTagValue( stepnode, "REQUIRES_AUTH" ) );
username = XMLHandler.getTagValue( stepnode, "USERNAME" );
password = XMLHandler.getTagValue( stepnode, "PASSWORD" );
if ( !Const.isEmpty( password ) ) {
password = Encr.decryptPasswordOptionallyEncrypted( password );
}
Node sslNode = XMLHandler.getSubNode( stepnode, "SSL" );
if ( sslNode != null ) {
sslCaFile = XMLHandler.getTagValue( sslNode, "CA_FILE" );
sslCertFile = XMLHandler.getTagValue( sslNode, "CERT_FILE" );
sslKeyFile = XMLHandler.getTagValue( sslNode, "KEY_FILE" );
sslKeyFilePass = XMLHandler.getTagValue( sslNode, "KEY_FILE_PASS" );
}
} catch ( Exception e ) {
throw new KettleXMLException( BaseMessages.getString( PKG, "MQTTClientMeta.Exception.loadXml" ), e );
}
}
示例6: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public void loadXML(Node stepnode, List<DatabaseMeta> databases,
Map<String, Counter> counters) throws KettleXMLException {
m_cassandraHost = XMLHandler.getTagValue(stepnode, "cassandra_host");
m_cassandraPort = XMLHandler.getTagValue(stepnode, "cassandra_port");
m_username = XMLHandler.getTagValue(stepnode, "username");
m_password = XMLHandler.getTagValue(stepnode, "password");
if (!Const.isEmpty(m_password)) {
m_password = Encr.decryptPasswordOptionallyEncrypted(m_password);
}
m_cassandraKeyspace = XMLHandler
.getTagValue(stepnode, "cassandra_keyspace");
m_cqlSelectQuery = XMLHandler.getTagValue(stepnode, "cql_select_query");
m_useCompression = XMLHandler.getTagValue(stepnode, "use_compression")
.equalsIgnoreCase("Y");
String kV = XMLHandler.getTagValue(stepnode,
"output_key_value_timestamp_tuples");
if (kV != null) {
m_outputKeyValueTimestampTuples = kV.equalsIgnoreCase("Y");
}
String thrift = XMLHandler.getTagValue(stepnode, "use_thrift_io");
if (thrift != null) {
m_useThriftIO = thrift.equalsIgnoreCase("Y");
}
m_socketTimeout = XMLHandler.getTagValue(stepnode, "socket_timeout");
}
示例7: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep)
throws KettleXMLException
{
try
{
super.loadXML(entrynode, databases, slaveServers);
repositoryname = XMLHandler.getTagValue(entrynode, "repositoryname");
username = XMLHandler.getTagValue(entrynode, "username");
password = Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue(entrynode, "password") );
targetfilename = XMLHandler.getTagValue(entrynode, "targetfilename");
iffileexists = XMLHandler.getTagValue(entrynode, "iffileexists");
export_type = XMLHandler.getTagValue(entrynode, "export_type");
directoryPath = XMLHandler.getTagValue(entrynode, "directoryPath");
add_date = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_date"));
add_time = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_time"));
SpecifyFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyFormat"));
date_time_format = XMLHandler.getTagValue(entrynode, "date_time_format");
createfolder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "createfolder"));
newfolder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "newfolder"));
add_result_filesname = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_result_filesname"));
nr_errors_less_than = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
}
catch(KettleXMLException xe)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "JobExportRepository.Meta.UnableLoadXML"), xe);
}
}
示例8: init
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public boolean init(StepMetaInterface smi, StepDataInterface sdi)
{
meta=(LDAPOutputMeta)smi;
data=(LDAPOutputData)sdi;
if (super.init(smi, sdi)) {
try {
// Define new LDAP connection
data.connection = new LDAPConnection(log, environmentSubstitute(meta.getHost()),
Const.toInt(environmentSubstitute(meta.getPort()), LDAPConnection.DEFAULT_PORT));
data.connection.setReferral(LDAPOutputMeta.getReferralTypeCode(meta.getReferralType()));
data.connection.setDerefAliases(LDAPOutputMeta.getDerefAliasesCode(meta.getDerefAliasesType()));
data.connection.setProtocol(LDAPConnection.getProtocolFromCode(meta.getProtocol()));
if(meta.isUseCertificate()) {
data.connection.setTrustStorePath(meta.getTrustStorePath());
data.connection.setTrustStorePassword(meta.getTrustStorePassword());
data.connection.trustAllCertificates(meta.isTrustAllCertificates());
}
// connect
if (meta.UseAuthentication()) {
String username=environmentSubstitute(meta.getUserName());
String password=Encr.decryptPasswordOptionallyEncrypted(environmentSubstitute(meta.getPassword()));
data.connection.connect(username, password);
}else {
data.connection.connect();
}
data.separator= environmentSubstitute(meta.getMultiValuedSeparator());
}catch(Exception e) {
logError(BaseMessages.getString(PKG, "LDAPOutput.Error.Init", e));
stopAll();
setErrors(1);
return false;
}
return true;
}
return false;
}
示例9: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep) throws KettleXMLException
{
try
{
super.loadXML(entrynode, databases, slaveServers);
serverName = XMLHandler.getTagValue(entrynode, "servername");
serverPort = XMLHandler.getTagValue(entrynode, "serverport");
userName = XMLHandler.getTagValue(entrynode, "username");
password = Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue(entrynode, "password") );
sftpDirectory = XMLHandler.getTagValue(entrynode, "sftpdirectory");
targetDirectory = XMLHandler.getTagValue(entrynode, "targetdirectory");
wildcard = XMLHandler.getTagValue(entrynode, "wildcard");
remove = "Y".equalsIgnoreCase( XMLHandler.getTagValue(entrynode, "remove") );
String addresult = XMLHandler.getTagValue(entrynode, "isaddresult");
if(Const.isEmpty(addresult))
isaddresult = true;
else
isaddresult = "Y".equalsIgnoreCase(addresult);
createtargetfolder = "Y".equalsIgnoreCase( XMLHandler.getTagValue(entrynode, "createtargetfolder") );
copyprevious = "Y".equalsIgnoreCase( XMLHandler.getTagValue(entrynode, "copyprevious") );
}
catch(KettleXMLException xe)
{
throw new KettleXMLException("Unable to load job entry of type 'SFTP' from XML node", xe);
}
}
示例10: readRep
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleException {
try
{
dynamicCommandField=rep.getStepAttributeBoolean(id_step, "dynamicCommandField");
command = rep.getStepAttributeString(id_step, "command");
commandfieldname = rep.getStepAttributeString(id_step, "commandfieldname"); //$NON-NLS-1$
serverName = rep.getStepAttributeString(id_step, "servername");
port = rep.getStepAttributeString(id_step, "port");
userName = rep.getStepAttributeString(id_step, "userName");
password = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString (id_step, "password") );
usePrivateKey=rep.getStepAttributeBoolean(id_step, "usePrivateKey");
keyFileName=rep.getStepAttributeString(id_step, "keyFileName");
passPhrase=rep.getStepAttributeString(id_step, "passPhrase");
stdOutFieldName=rep.getStepAttributeString(id_step, "stdOutFieldName");
stdErrFieldName=rep.getStepAttributeString(id_step, "stdErrFieldName");
timeOut=rep.getStepAttributeString(id_step, "timeOut");
proxyHost=rep.getStepAttributeString(id_step, "proxyHost");
proxyPort=rep.getStepAttributeString(id_step, "proxyPort");
proxyUsername=rep.getStepAttributeString(id_step, "proxyUsername");
proxyPassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString (id_step, "proxyPassword") );
}
catch (Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "SSHMeta.Exception.UnexpectedErrorReadingStepInfo"), e); //$NON-NLS-1$
}
}
示例11: loadRep
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public void loadRep(Repository rep, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException
{
try
{
serverName = rep.getJobEntryAttributeString(id_jobentry, "servername");
userName = rep.getJobEntryAttributeString(id_jobentry, "username");
password = Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString(id_jobentry, "password") );
serverPort =rep.getJobEntryAttributeString(id_jobentry, "serverport");
ftpDirectory = rep.getJobEntryAttributeString(id_jobentry, "ftpdirectory");
localDirectory = rep.getJobEntryAttributeString(id_jobentry, "localdirectory");
wildcard = rep.getJobEntryAttributeString(id_jobentry, "wildcard");
onlyGettingNewFiles = rep.getJobEntryAttributeBoolean(id_jobentry, "only_new");
usehttpproxy = rep.getJobEntryAttributeBoolean(id_jobentry, "usehttpproxy");
httpproxyhost = rep.getJobEntryAttributeString(id_jobentry, "httpproxyhost");
httpproxyusername = rep.getJobEntryAttributeString(id_jobentry, "httpproxyusername");
httpProxyPassword = rep.getJobEntryAttributeString(id_jobentry, "httpproxypassword");
publicpublickey = rep.getJobEntryAttributeBoolean(id_jobentry, "publicpublickey");
keyFilename = rep.getJobEntryAttributeString(id_jobentry, "keyfilename");
keyFilePass = rep.getJobEntryAttributeString(id_jobentry, "keyfilepass");
useBasicAuthentication = rep.getJobEntryAttributeBoolean(id_jobentry, "usebasicauthentication");
createRemoteFolder = rep.getJobEntryAttributeBoolean(id_jobentry, "createremotefolder");
afterFtpPut = rep.getJobEntryAttributeString(id_jobentry, "afterftpput");
destinationfolder = rep.getJobEntryAttributeString(id_jobentry, "destinationfolder");
createDestinationFolder = rep.getJobEntryAttributeBoolean(id_jobentry, "createdestinationfolder");
cachehostkey = rep.getJobEntryAttributeBoolean(id_jobentry, "cachehostkey");
timeout = (int)rep.getJobEntryAttributeInteger(id_jobentry, "timeout");
}
catch(KettleException dbe)
{
throw new KettleException(BaseMessages.getString(PKG, "JobSSH2PUT.Log.UnableLoadRep",""+id_jobentry,dbe.getMessage()));
}
}
示例12: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep)
throws KettleXMLException
{
try
{
super.loadXML(entrynode, databases, slaveServers);
repositoryname = XMLHandler.getTagValue(entrynode, "repositoryname");
username = XMLHandler.getTagValue(entrynode, "username");
password = Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue(entrynode, "password") );
targetfilename = XMLHandler.getTagValue(entrynode, "targetfilename");
iffileexists = XMLHandler.getTagValue(entrynode, "iffileexists");
export_type = XMLHandler.getTagValue(entrynode, "export_type");
directoryPath = XMLHandler.getTagValue(entrynode, "directoryPath");
add_date = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_date"));
add_time = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_time"));
SpecifyFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyFormat"));
date_time_format = XMLHandler.getTagValue(entrynode, "date_time_format");
createfolder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "createfolder"));
newfolder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "newfolder"));
add_result_filesname = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_result_filesname"));
nr_errors_less_than = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
}
catch(KettleXMLException xe)
{
throw new KettleXMLException(Messages.getString("JobExportRepository.Meta.UnableLoadXML"), xe);
}
}
示例13: SlaveServer
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
public SlaveServer(Node slaveNode)
{
this();
this.name = XMLHandler.getTagValue(slaveNode, "name"); //$NON-NLS-1$
this.hostname = XMLHandler.getTagValue(slaveNode, "hostname"); //$NON-NLS-1$
this.port = XMLHandler.getTagValue(slaveNode, "port"); //$NON-NLS-1$
this.username = XMLHandler.getTagValue(slaveNode, "username"); //$NON-NLS-1$
this.password = Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue(slaveNode, "password") ); //$NON-NLS-1$
this.proxyHostname = XMLHandler.getTagValue(slaveNode, "proxy_hostname"); //$NON-NLS-1$
this.proxyPort = XMLHandler.getTagValue(slaveNode, "proxy_port"); //$NON-NLS-1$
this.nonProxyHosts = XMLHandler.getTagValue(slaveNode, "non_proxy_hosts"); //$NON-NLS-1$
this.master = "Y".equalsIgnoreCase( XMLHandler.getTagValue(slaveNode, "master") ); //$NON-NLS-1$ //$NON-NLS-2$
initializeVariablesFrom(null);
}
示例14: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metastore) throws KettleXMLException {
this.cassandraNodes = XMLHandler.getTagValue(stepnode, CASSANDRA_NODES);
this.cassandraPort = XMLHandler.getTagValue(stepnode, CASSANDRA_PORT);
this.username = XMLHandler.getTagValue(stepnode, USERNAME);
this.password = XMLHandler.getTagValue(stepnode, PASSWORD);
if (!Const.isEmpty(this.password)) {
this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
}
this.keyspace = XMLHandler.getTagValue(stepnode, CASSANDRA_KEYSPACE);
this.SslEnabled = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, CASSANDRA_WITH_SSL));
this.trustStoreFilePath = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_FILE_PATH);
this.trustStorePass = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_PASS);
if (!Const.isEmpty(this.trustStorePass)) {
this.trustStorePass = Encr.decryptPasswordOptionallyEncrypted(this.trustStorePass);
}
this.columnfamily = XMLHandler.getTagValue(stepnode, CASSANDRA_COLUMN_FAMILY);
this.syncMode = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, SYNC_ENABLED));
String batchSize = XMLHandler.getTagValue(stepnode, BATCH_SIZE);
this.batchSize = (Const.isEmpty(batchSize) ? 1000 : Integer.valueOf(batchSize));
String sCompression = XMLHandler.getTagValue(stepnode, QUERY_COMPRESSION);
this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
this.specifyFields = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, SPECIFY_FIELDS));
Node fields = XMLHandler.getSubNode(stepnode, FIELD_MAPPING);
int nrRows = XMLHandler.countNodes(fields, FIELD);
allocate(nrRows);
for (int i = 0; i < nrRows; i++) {
Node knode = XMLHandler.getSubNodeByNr(fields, FIELD, i);
this.cassandraFields[i] = XMLHandler.getTagValue(knode, COLUMN_NAME);
this.streamFields[i] = XMLHandler.getTagValue(knode, STREAM_NAME);
}
this.ttl = Const.toInt(XMLHandler.getTagValue(stepnode, TTL), 0);
}
示例15: loadXML
import org.pentaho.di.core.encryption.Encr; //导入方法依赖的package包/类
@Override public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore )
throws KettleXMLException {
m_broker = XMLHandler.getTagValue( stepnode, "BROKER" );
String topics = XMLHandler.getTagValue( stepnode, "TOPICS" );
m_topics = new ArrayList<>();
if ( !Const.isEmpty( topics ) ) {
String[] parts = topics.split( "," );
for ( String p : parts ) {
m_topics.add( p.trim() );
}
}
m_messageType = XMLHandler.getTagValue( stepnode, "MESSAGE_TYPE" );
if ( Const.isEmpty( m_messageType ) ) {
m_messageType = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING );
}
m_clientId = XMLHandler.getTagValue( stepnode, "CLIENT_ID" );
m_timeout = XMLHandler.getTagValue( stepnode, "TIMEOUT" );
m_keepAliveInterval = XMLHandler.getTagValue( stepnode, "KEEP_ALIVE" );
m_executeForDuration = XMLHandler.getTagValue( stepnode, "EXECUTE_FOR_DURATION" );
m_qos = XMLHandler.getTagValue( stepnode, "QOS" );
m_requiresAuth = Boolean.parseBoolean( XMLHandler.getTagValue( stepnode, "REQUIRES_AUTH" ) );
m_username = XMLHandler.getTagValue( stepnode, "USERNAME" );
m_password = XMLHandler.getTagValue( stepnode, "PASSWORD" );
if ( !Const.isEmpty( m_password ) ) {
m_password = Encr.decryptPasswordOptionallyEncrypted( m_password );
}
String allowObjects = XMLHandler.getTagValue( stepnode, "READ_OBJECTS" );
if ( !Const.isEmpty( allowObjects ) ) {
m_allowReadObjectMessageType = Boolean.parseBoolean( allowObjects );
}
Node sslNode = XMLHandler.getSubNode( stepnode, "SSL" );
if ( sslNode != null ) {
m_sslCaFile = XMLHandler.getTagValue( sslNode, "CA_FILE" );
m_sslCertFile = XMLHandler.getTagValue( sslNode, "CERT_FILE" );
m_sslKeyFile = XMLHandler.getTagValue( sslNode, "KEY_FILE" );
m_sslKeyFilePass = XMLHandler.getTagValue( sslNode, "KEY_FILE_PASS" );
}
}