public RemoteAuthenticationSettings convertAndValidateFromModel( CRemoteAuthentication model ) throws ConfigurationException { if ( model != null ) { doValidate( model ); if ( StringUtils.isNotBlank( model.getKeyStore() ) || StringUtils.isNotBlank( model.getTrustStore() ) ) { return new ClientSSLRemoteAuthenticationSettings( new File( model.getTrustStore() ), model .getTrustStorePassword(), new File( model.getKeyStore() ), model.getKeyStorePassword() ); } else if ( StringUtils.isNotBlank( model.getNtlmDomain() ) ) { return new NtlmRemoteAuthenticationSettings( model.getUsername(), model.getPassword(), model .getNtlmDomain(), model.getNtlmHost() ); } else { return new UsernamePasswordRemoteAuthenticationSettings( model.getUsername(), model.getPassword() ); } } else { return null; } }
/** * Externalized Nexus object to DTO's conversion. */ public static AuthenticationSettings convert(CRemoteAuthentication settings) { if (settings == null) { return null; } AuthenticationSettings auth = new AuthenticationSettings(); auth.setUsername(settings.getUsername()); auth.setPassword(PASSWORD_PLACE_HOLDER); auth.setNtlmHost(settings.getNtlmHost()); auth.setNtlmDomain(settings.getNtlmDomain()); // auth.setPrivateKey( settings.getPrivateKey() ); // auth.setPassphrase( settings.getPassphrase() ); return auth; }
/** * Externalized Nexus object to DTO's conversion. * * @param resource */ public static AuthenticationSettings convert( CRemoteAuthentication settings ) { if ( settings == null ) { return null; } AuthenticationSettings auth = new AuthenticationSettings(); auth.setUsername( settings.getUsername() ); auth.setPassword( PASSWORD_PLACE_HOLDER ); auth.setNtlmHost( settings.getNtlmHost() ); auth.setNtlmDomain( settings.getNtlmDomain() ); // auth.setPrivateKey( settings.getPrivateKey() ); // auth.setPassphrase( settings.getPassphrase() ); return auth; }
if ( cRemoteAuthentication.getUsername() != null ) serializer.startTag( NAMESPACE, "username" ).text( cRemoteAuthentication.getUsername() ).endTag( NAMESPACE, "username" );