public void setProxyMode( ProxyMode proxyMode ) { setProxyMode( proxyMode, true, null ); }
public void setAutoBlockActive( boolean val ) { // NEXUS-3516: if user disables autoblock, and repo is auto-blocked, unblock it if ( !val && ProxyMode.BLOCKED_AUTO.equals( getProxyMode() ) ) { getLogger().warn( String.format( "Proxy Repository %s was auto-blocked, but user disabled this feature. Unblocking repository, but this MAY cause Nexus to leak connections (if remote repository is still down)!", RepositoryStringUtils.getHumanizedNameString( this ) ) ); setProxyMode( ProxyMode.ALLOW ); } getExternalConfiguration( true ).setAutoBlockActive( val ); }
/** * This method should be called by AbstractProxyRepository and it's descendants only. Since this method modifies the * ProxyMode property of this repository, and this property is part of configuration, this call will result in * configuration flush too (potentially saving any other unsaved changes)! */ protected void autoUnBlockProxying() { setRemoteStatus( RemoteStatus.AVAILABLE, null ); ProxyMode oldProxyMode = getProxyMode(); if ( oldProxyMode.shouldAutoUnblock() ) { // log the event getLogger().warn( String.format( "Remote peer of proxy repository %s detected as healthy, un-blocking the proxy repository (it was AutoBlocked by Nexus).", RepositoryStringUtils.getHumanizedNameString( this ) ) ); setProxyMode( ProxyMode.ALLOW, true, null ); } // NEXUS-3552: Do NOT save configuration, just make it applied (see setProxyMode() how it is done) // try // { // getApplicationConfiguration().saveConfiguration(); // } // catch ( IOException e ) // { // getLogger().warn( // "Cannot save configuration after AutoBlocking repository \"" + getName() + "\" (id=" + getId() + ")", e ); // } }
public void setRemoteAuthenticationSettings( RemoteAuthenticationSettings settings ) { getRemoteStorageContext().setRemoteAuthenticationSettings( settings ); if ( getProxyMode() != null && getProxyMode().shouldAutoUnblock() ) { // perm changes? retry if autoBlocked setProxyMode( ProxyMode.ALLOW ); } }
public void setRemoteProxySettings( RemoteProxySettings settings ) { getRemoteStorageContext().setRemoteProxySettings( settings ); if ( getProxyMode() != null && getProxyMode().shouldAutoUnblock() ) { // perm changes? retry if autoBlocked setProxyMode( ProxyMode.ALLOW ); } }
setProxyMode( ProxyMode.BLOCKED_AUTO, true, cause );