- if ( ctype == ServiceType.AAF_Admin ) {
- mechIdProperty = "aaf.AdminUser";
- pwdProperty = "aaf.AdminPassword";
- } else if ( ctype == ServiceType.AAF_TopicMgr ){
- mechIdProperty = "aaf.TopicMgrUser";
- pwdProperty = "aaf.TopicMgrPassword";
- } else {
- logger.error( "Unexpected case for AAF credential type: " + ctype );
- return null;
- }
- String user = p.getProperty( mechIdProperty, "noMechId@domain.netset.com" );
- //String dClass = p.getProperty( "AafDecryption.Class", "org.openecomp.dmaapbc.aaf.ClearDecrypt");
- String pwd = "";
- String encPwd = p.getProperty( pwdProperty, "notSet" );
- //DecryptionInterface dec = null;
- //try {
- // dec = (DecryptionInterface) (Class.forName(dClass).newInstance());
- // dec.init( p.getProperty("CredentialCodecKeyfile", "LocalKey"));
- //} catch (Exception ee ) {
- // errorLogger.error(DmaapbcLogMessageEnum.UNEXPECTED_CONDITION, "attempting to use " + dClass + " to decrypt " + encPwd );
- //}
- //try {
- // pwd = dec.decrypt( encPwd );
- //} catch( IOException io ) {
- // errorLogger.error(DmaapbcLogMessageEnum.DECRYPT_IO_ERROR, dClass, encPwd );
- //}
-
- pwd = decryptor.decrypt(encPwd);
-
- if ( wPwd ) {
- return user + ":" + pwd;
- } else {
- return user;
- }
-
-
- }
-
- public AafService(ServiceType t ) {
- DmaapConfig p = (DmaapConfig)DmaapConfig.getConfig();
- aafURL = p.getProperty( "aaf.URL", "https://authentication.domain.netset.com:8095/proxy/");
- initAafService( t );
- }
- public AafService( ServiceType t, String url ) {
- aafURL = url;
- initAafService( t );
- }
-
- private void initAafService( ServiceType t ) {
- ctype = t;
- aaf = new AafConnection( getCred( true ) );
- }
-
- public int addPerm(DmaapPerm perm) {