如何將自定義函數與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. 了Talend - 自定義聯結部件
- 3. 自定義函數
- 4. 定義自定義GNU make函數
- 5. jQuery定義自定義函數
- 6. 定義和調用自定義函數
- 7. 在python中定義自定義函數
- 8. 自定義模塊未定義函數
- 9. jQuery自定義函數 - this.each
- 10. 等待自定義函數
- 11. AngularJS OrderBy自定義函數
- 12. makefile自定義函數
- 13. 自定義函數查詢
- 14. jQuery自定義函數
- 15. Saltstack multidot自定義函數
- 16. NOTORM自定義mysql函數
- 17. 自定義jQuery函數
- 18. 自定義函數(R)
- 19. 用戶自定義函數
- 20. Cuda Thrust自定義函數
- 21. 調用自定義函數
- 22. jQuery像自定義函數
- 23. 自定義jQuery函數
- 24. 自定義jQuery easeOutElastic函數
- 25. Thrust :: transform自定義函數
- 26. 自定義MySQL函數類
- 27. Java Array自定義函數
- 28. 自定義getLine()函數c
- 29. 自定義ROW_NUMBER函數
- 30. 自定義AuthorizeAttribute OnAuthorizationAsync函數
你應該可以,只要你的jar載入到項目中來訪問您的自定義的公共職能。 – tobi6