@Override protected RemoteHttpProxySettings createSettings() { return new RemoteHttpProxySettings(); }
@Override protected void onDisable( final RemoteHttpProxySettings settings ) { settings.setProxyHostname( null ); }
/** * Externalized Nexus object to DTO's conversion. * * @param resource */ public static RemoteHttpProxySettings convert( CRemoteHttpProxySettings settings ) { if ( settings == null ) { return null; } RemoteHttpProxySettings result = new RemoteHttpProxySettings(); result.setProxyHostname( settings.getProxyHostname() ); result.setProxyPort( settings.getProxyPort() ); result.setAuthentication( convert( settings.getAuthentication() ) ); result.setNonProxyHosts( settings.getNonProxyHosts() ); return result; }
&& !StringUtils.isEmpty( resource.getGlobalHttpProxySettings().getProxyHostname() ) ) getGlobalHttpProxySettings().setHostname( s.getProxyHostname() ); getGlobalHttpProxySettings().setPort( s.getProxyPort() ); List<String> nonProxyHosts = resource.getGlobalHttpProxySettings().getNonProxyHosts(); if ( nonProxyHosts != null && !nonProxyHosts.isEmpty() ) if ( s.getAuthentication() != null ) auth.setUsername( s.getAuthentication().getUsername() ); auth.setPassword( this.getActualPassword( s.getAuthentication().getPassword(), oldPassword ) ); auth.setNtlmDomain( s.getAuthentication().getNtlmDomain() ); auth.setNtlmHost( s.getAuthentication().getNtlmHost() );
protected CRemoteHttpProxySettings convertHttpProxySettings( RemoteHttpProxySettings remoteHttpProxySettings, String oldPassword ) { if ( remoteHttpProxySettings == null ) { return null; } CRemoteHttpProxySettings httpProxySettings = new CRemoteHttpProxySettings(); httpProxySettings.setProxyHostname( remoteHttpProxySettings.getProxyHostname() ); httpProxySettings.setProxyPort( remoteHttpProxySettings.getProxyPort() ); httpProxySettings.setAuthentication( convertAuthentication( remoteHttpProxySettings.getAuthentication(), oldPassword ) ); return httpProxySettings; }
@Override protected void setSettingsIn( final RemoteHttpProxySettings settings, final GlobalConfigurationResource configuration ) { if ( settings.getProxyHostname() == null ) { configuration.setGlobalHttpProxySettings( null ); } else { configuration.setGlobalHttpProxySettings( settings ); } }
/** * Externalized Nexus object to DTO's conversion. * * @param resource */ public static RemoteHttpProxySettings convert( GlobalHttpProxySettings settings ) { if ( settings == null || !settings.isEnabled() ) { return null; } RemoteHttpProxySettings result = new RemoteHttpProxySettings(); result.setProxyHostname( settings.getHostname() ); result.setProxyPort( settings.getPort() ); result.setAuthentication( convert( settings.getProxyAuthentication() ) ); result.setNonProxyHosts( new ArrayList<String>( settings.getNonProxyHosts() ) ); return result; }