@Override public NetworkProxy getNetworkProxy( String networkProxyId ) throws RepositoryAdminException { for ( NetworkProxy networkProxy : getNetworkProxies() ) { if ( StringUtils.equals( networkProxyId, networkProxy.getId() ) ) { return networkProxy; } } return null; }
networkProxy.setType( proxyConnector.getProtocol() ); networkProxy.setHost( proxyConnector.getHost() ); networkProxy.setPort( proxyConnector.getPort() ); networkProxy.setUserName( proxyConnector.getUsername() ); networkProxy.setPassword( proxyConnector.getPassword() );
@Override public Wagon getWagon( WagonFactoryRequest wagonFactoryRequest ) throws WagonFactoryException { try { String protocol = StringUtils.startsWith( wagonFactoryRequest.getProtocol(), "wagon#" ) ? wagonFactoryRequest.getProtocol() : "wagon#" + wagonFactoryRequest.getProtocol(); // if it's a ntlm proxy we have to lookup the wagon light which support thats // wagon http client doesn't support that if ( wagonFactoryRequest.getNetworkProxy() != null && wagonFactoryRequest.getNetworkProxy().isUseNtlm() ) { protocol = protocol + "-ntlm"; } Wagon wagon = applicationContext.getBean( protocol, Wagon.class ); wagon.addTransferListener( debugTransferListener ); configureUserAgent( wagon, wagonFactoryRequest ); return wagon; } catch ( BeansException e ) { throw new WagonFactoryException( e.getMessage(), e ); } }
if (networkProxy != null) { proxyInfo = new ProxyInfo(); proxyInfo.setType(networkProxy.getProtocol()); proxyInfo.setHost(networkProxy.getHost()); proxyInfo.setPort(networkProxy.getPort()); proxyInfo.setUserName(networkProxy.getUsername()); proxyInfo.setPassword(networkProxy.getPassword());
@Override public Wagon getWagon( WagonFactoryRequest wagonFactoryRequest ) throws WagonFactoryException { try { String protocol = StringUtils.startsWith( wagonFactoryRequest.getProtocol(), "wagon#" ) ? wagonFactoryRequest.getProtocol() : "wagon#" + wagonFactoryRequest.getProtocol(); // if it's a ntlm proxy we have to lookup the wagon light which support thats // wagon http client doesn't support that if ( wagonFactoryRequest.getNetworkProxy() != null && wagonFactoryRequest.getNetworkProxy().isUseNtlm() ) { protocol = protocol + "-ntlm"; } Wagon wagon = applicationContext.getBean( protocol, Wagon.class ); wagon.addTransferListener( debugTransferListener ); configureUserAgent( wagon, wagonFactoryRequest ); return wagon; } catch ( BeansException e ) { throw new WagonFactoryException( e.getMessage(), e ); } }
if (networkProxy != null) { proxyInfo = new ProxyInfo(); proxyInfo.setType(networkProxy.getProtocol()); proxyInfo.setHost(networkProxy.getHost()); proxyInfo.setPort(networkProxy.getPort()); proxyInfo.setUserName(networkProxy.getUsername()); proxyInfo.setPassword(networkProxy.getPassword());
@Override public void addNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation ) throws RepositoryAdminException { if ( networkProxy == null ) { return; } if ( getNetworkProxy( networkProxy.getId() ) != null ) { throw new RepositoryAdminException( "cannot add NetworkProxy with id " + networkProxy.getId() + " already exist" ); } Configuration configuration = getArchivaConfiguration().getConfiguration(); configuration.addNetworkProxy( getNetworkProxyConfiguration( networkProxy ) ); triggerAuditEvent( networkProxy.getId(), null, AuditEvent.ADD_NETWORK_PROXY, auditInformation ); saveConfiguration( configuration ); }
networkProxy.setType( proxyConnector.getProtocol() ); networkProxy.setHost( proxyConnector.getHost() ); networkProxy.setPort( proxyConnector.getPort() ); networkProxy.setUserName( proxyConnector.getUsername() ); networkProxy.setPassword( proxyConnector.getPassword() );
@Override public void updateNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation ) throws RepositoryAdminException { if ( networkProxy == null ) { return; } if ( getNetworkProxy( networkProxy.getId() ) == null ) { throw new RepositoryAdminException( "cannot update NetworkProxy with id " + networkProxy.getId() + " as not exist" ); } Configuration configuration = getArchivaConfiguration().getConfiguration(); NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy ); configuration.removeNetworkProxy( networkProxyConfiguration ); configuration.addNetworkProxy( networkProxyConfiguration ); triggerAuditEvent( networkProxy.getId(), null, AuditEvent.MODIFY_NETWORK_PROXY, auditInformation ); saveConfiguration( configuration ); }
proxyInfo.setType( this.networkProxy.getProtocol() ); proxyInfo.setHost( this.networkProxy.getHost() ); proxyInfo.setPort( this.networkProxy.getPort() ); proxyInfo.setUserName( this.networkProxy.getUsername() ); proxyInfo.setPassword( this.networkProxy.getPassword() );
@Override public void deleteNetworkProxy( String networkProxyId, AuditInformation auditInformation ) throws RepositoryAdminException { NetworkProxy networkProxy = getNetworkProxy( networkProxyId ); if ( networkProxy == null ) { throw new RepositoryAdminException( "cannot delete NetworkProxy with id " + networkProxyId + " as not exist" ); } Configuration configuration = getArchivaConfiguration().getConfiguration(); NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy ); configuration.removeNetworkProxy( networkProxyConfiguration ); for ( RemoteRepositoryConfiguration rrc : configuration.getRemoteRepositories() ) { if ( StringUtils.equals( rrc.getRemoteDownloadNetworkProxyId(), networkProxyId ) ) { rrc.setRemoteDownloadNetworkProxyId( null ); } } triggerAuditEvent( networkProxy.getId(), null, AuditEvent.DELETE_NETWORK_PROXY, auditInformation ); saveConfiguration( configuration ); }
proxyInfo.setType( networkProxy.getProtocol( ) ); proxyInfo.setHost( networkProxy.getHost( ) ); proxyInfo.setPort( networkProxy.getPort( ) ); proxyInfo.setUserName( networkProxy.getUsername( ) ); proxyInfo.setPassword( networkProxy.getPassword( ) );