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; } }
if ( cRemoteAuthentication.getKeyStore() != null ) serializer.startTag( NAMESPACE, "keyStore" ).text( cRemoteAuthentication.getKeyStore() ).endTag( NAMESPACE, "keyStore" );