-
- private String getCred(boolean wPwd) {
- String mechIdProperty = null;
- String pwdProperty = null;
- DmaapConfig p = (DmaapConfig) DmaapConfig.getConfig();
- AafDecrypt decryptor = new AafDecrypt();
-
- if (ctype == AafService.ServiceType.AAF_Admin) {
- mechIdProperty = "aaf.AdminUser";
- pwdProperty = "aaf.AdminPassword";
- } else if (ctype == AafService.ServiceType.AAF_TopicMgr) {
- mechIdProperty = "aaf.TopicMgrUser";
- pwdProperty = "aaf.TopicMgrPassword";
- } else {
- logger.error("Unexpected case for AAF credential type: " + ctype);
- return null;
- }
- identity = p.getProperty(mechIdProperty, "noMechId@domain.netset.com");
-
- String pwd = "";
- String encPwd = p.getProperty(pwdProperty, "notSet");
-
-
- pwd = decryptor.decrypt(encPwd);
-
- if (wPwd) {
- return identity + ":" + pwd;
- } else {
- return identity;
- }
-
-
- }
-
-
- public AafServiceImpl(AafService.ServiceType t) {
- DmaapConfig p = (DmaapConfig) DmaapConfig.getConfig();
- aafURL = p.getProperty("aaf.URL", "https://authentication.domain.netset.com:8100/proxy/");
- initAafService(t);
- }
-
- public AafServiceImpl(AafService.ServiceType t, String url) {
- aafURL = url;
- initAafService(t);
- }
-
- private void initAafService(AafService.ServiceType t) {
- DmaapConfig p = (DmaapConfig) DmaapConfig.getConfig();
- useAAF = "true".equalsIgnoreCase(p.getProperty("UseAAF", "false"));
- logger.info("AafService initAafService: useAAF=" + useAAF);
-
- ctype = t;
- aaf = new AafConnection(getCred(true));