NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/beisregistration/BeisRegistrationUpdateAccountIdLdapComponent.java
/**
     * Read the exchange property and if exists, set the uid on the foundation layer party service for the user. 
     * @throws NdsBusinessException 
     */
Read the exchange property and if exists, set the uid on the foundation layer party service for the user.
Read the exchange property and if exists set the uid on the foundation layer party service for the user .
@Override
    protected void doProcess(BeisRegistrationNdsRequest request, DirectoryAccessConnection directoryConnection,
            NdsSoapRequestAdapterExchangeProxy ndsExchange, DirectoryConnectionConfig directoryConnectionConfigImpl)
                    throws NdsApplicationException, NdsBusinessException, DirectoryException {
        if( ndsExchange.getAnExchangeProperty(EXCHANGE_PROPERTY_ACCOUNT_ID) != null){
            String accountId = ndsExchange.getAnExchangeProperty(EXCHANGE_PROPERTY_ACCOUNT_ID).toString();   
            BeisRegistrationDetails registrationDetails = request.getRegistrationDetails();
            BeisUserDetails userDetails = registrationDetails.getUserDetails();
            ConfigurationManager configurationManager = ConfigurationFactory.getConfiguration();
            String serviceName = configurationManager.getString("service.foundationLayerPartyService.name");
            String servicednForTheUser = getNdsServiceByUserDn(configurationManager, userDetails.getUsername(), registrationDetails.getTenant(), serviceName);
            logger.info("About to set the accountId to " + accountId + "For Dn" + servicednForTheUser);
            String ldapAttributeServiceUid = configurationManager.getString("attribute.userid");           
            HashMap<String, String> changes = new HashMap<String, String>();
            changes.put(ldapAttributeServiceUid, accountId);   
            try{                
                getUserManager().setAttributesOnEntry(directoryConnection, servicednForTheUser, changes);
            } catch (DirectoryUnwillingToPerformOperationException e) {
                throw new NdsBusinessException(e.getMessage());
            } catch (DirectoryException e) {
                throw new NdsDirectoryException(e.getMessage(), e);
            }
        }
        else{
            throw new NdsApplicationException("Null accountId provided");
        }                
    }
@ Override protected void doProcess ( BeisRegistrationNdsRequest request , DirectoryAccessConnection directoryConnection , NdsSoapRequestAdapterExchangeProxy ndsExchange , DirectoryConnectionConfig directoryConnectionConfigImpl ) throws NdsApplicationException , NdsBusinessException , DirectoryException { if ( ndsExchange . getAnExchangeProperty ( EXCHANGE_PROPERTY_ACCOUNT_ID ) != null ) { String accountId = ndsExchange . getAnExchangeProperty ( EXCHANGE_PROPERTY_ACCOUNT_ID ) . toString ( ) ; BeisRegistrationDetails registrationDetails = request . getRegistrationDetails ( ) ; BeisUserDetails userDetails = registrationDetails . getUserDetails ( ) ; ConfigurationManager configurationManager = ConfigurationFactory . getConfiguration ( ) ; String serviceName = configurationManager . getString ( "service.foundationLayerPartyService.name" ) ; String servicednForTheUser = getNdsServiceByUserDn ( configurationManager , userDetails . getUsername ( ) , registrationDetails . getTenant ( ) , serviceName ) ; logger . info ( "About to set the accountId to " + accountId + "For Dn" + servicednForTheUser ) ; String ldapAttributeServiceUid = configurationManager . getString ( "attribute.userid" ) ; HashMap < String , String > changes = new HashMap < String , String > ( ) ; changes . put ( ldapAttributeServiceUid , accountId ) ; try { getUserManager ( ) . setAttributesOnEntry ( directoryConnection , servicednForTheUser , changes ) ; } catch ( DirectoryUnwillingToPerformOperationException e ) { throw new NdsBusinessException ( e . getMessage ( ) ) ; } catch ( DirectoryException e ) { throw new NdsDirectoryException ( e . getMessage ( ) , e ) ; } } else { throw new NdsApplicationException ( "Null accountId provided" ) ; } }
Read the exchange property and if exists, set the uid on the foundation layer party service for the user.
Read the exchange property and if exists set the uid on the foundation layer party service for the user .
//Read property for account id //Get the service name //Create hash map to update the uid on the service for the user. // Any attributes to be changed on the new user after copying the template user // account Id should not be null - fail fast so it can be investigated