如何将自定义函数与tmap结合使用,或者可以使用tsystem。我想用我的自定义函数即时解密加密的列。我可以将所有加密值写入文件,然后从文件写入tsystem或tmap,并解密值。这是最好的方法是什么?Talend自定义函数
0
A
回答
3
使用Java例程。你可以创建java方法并在任何地方调用。例如
public static String decrypt(String encryptStr){
String decrypted = null;
try {
while(encryptStr != null){
try
{
String key = "Bar12345Bar12345"; // 128 bit key
// Create key and cipher
Key aesKey = new SecretKeySpec(key.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES");
// encrypt the text
cipher.init(Cipher.ENCRYPT_MODE, aesKey);
// for decryption
byte[] bb = new byte[encryptStr.length()];
for (int i=0; i<encryptStr.length(); i++) {
bb[i] = (byte) encryptStr.charAt(i);
}
// decrypt the text
cipher.init(Cipher.DECRYPT_MODE, aesKey);
decrypted = new String(cipher.doFinal(bb));
}
catch(Exception e)
{
e.printStackTrace();
}
}
} catch (IOException ex) {
Logger.getLogger(Snake_H.class.getName()).log(Level.SEVERE, null, ex);
}
return decrypted;
}
对于加密,请遵循相同类型的方法。你可以随时随地在像调用这个Java方法TMAP
参考Talend Routines
1
如果您正在讲例程,只需调用所需的方法,您可以在任何地方放置一些java代码。
例如,作为输出流的表达式,您可以使用类似于:yourClass.yourMethod(...)
希望这会有所帮助。
相关问题
- 1. TalenD自定义组件 - UIManager
- 2. 定义和调用自定义函数
- 3. 在python中定义自定义函数
- 4. Java Array自定义函数
- 5. 自定义空()函数
- 6. NOTORM自定义mysql函数
- 7. 内自定义的函数
- 8. 用LessCSS自定义函数?
- 9. 自定义MySQL函数类
- 10. dplyr自定义函数
- 11. 自定义函数(R)
- 12. jQuery自定义函数
- 13. 自定义jQuery函数
- 14. Cuda Thrust自定义函数
- 15. Saltstack multidot自定义函数
- 16. AngularJS OrderBy自定义函数
- 17. makefile自定义函数
- 18. 自定义AuthorizeAttribute OnAuthorizationAsync函数
- 19. jQuery自定义函数 - this.each
- 20. Thrust :: transform自定义函数
- 21. jQuery像自定义函数
- 22. 自定义ROW_NUMBER函数
- 23. 用于自定义递归函数的通用函数定义
- 24. Joomla 3和自定义jQuery函数 - 未定义函数
- 25. 为unordered_map定义自定义哈希函数和相等函数
- 26. 使用我的自定义函数敲除自定义绑定
- 27. 自动更新自定义函数
- 28. 自定义中间件检查模型自定义函数返回值的错误自定义函数Laravel 5.1
- 29. 自定义函数来确定
- 30. knockout.js调用自定义绑定函数
你应该可以,只要你的jar载入到项目中来访问您的自定义的公共职能。 – tobi6