private void sendContentValidationEvents( ResourceStoreRequest request, List<RepositoryItemValidationEvent> events, boolean isContentValid ) { if ( getLogger().isDebugEnabled() && !isContentValid ) { getLogger().debug( "Item " + request.toString() + " failed content integrity validation." ); } for ( RepositoryItemValidationEvent event : events ) { eventBus().post( event ); } }
/** * Beside original behavior, only add to NFC when we are not in BLOCKED mode. * * @since 2.0 */ @Override protected boolean shouldAddToNotFoundCache( final ResourceStoreRequest request ) { boolean shouldAddToNFC = super.shouldAddToNotFoundCache( request ); if ( shouldAddToNFC ) { shouldAddToNFC = getProxyMode() == null || getProxyMode().shouldProxy(); if ( !shouldAddToNFC && getLogger().isDebugEnabled() ) { getLogger().debug( String.format( "Proxy repository '%s' is is not allowed to issue remote requests (%s), not adding path '%s' to NFC", getId(), getProxyMode(), request.getRequestPath() ) ); } } return shouldAddToNFC; }
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 ); }
&& cause instanceof RemoteAccessDeniedException ) getLogger().debug( "Not autoblocking repository id " + getId() + "since this is Amazon S3 proxy repo" ); return; getLogger().debug( "Unable to validate if proxy repository id " + getId() + "is Amazon S3", e ); if ( getLogger().isDebugEnabled() ) getLogger().warn( sb.toString(), cause ); getLogger().warn( sb.toString() );
/** * 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 ); // } }
if ( getLogger().isDebugEnabled() ) getLogger().debug( "Item " + request.toString() + " is old, checking for newer file on remote then local: " if ( getLogger().isDebugEnabled() ) getLogger().debug( "No newer version of item " + request.toString() + " found on remote storage." ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Newer version of item " + request.toString() + " is found on remote storage." ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Item " + request.toString() + " found in remote storage." ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Item " + request.toString() + " not found in remote storage." ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Item " + request.toString()
protected Collection<String> doEvictUnusedItems( ResourceStoreRequest request, final long timestamp, EvictUnusedItemsWalkerProcessor processor, WalkerFilter filter ) { getLogger().info( String.format( "Evicting unused items from proxy repository %s from path=\"%s\"", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) ); request.setRequestLocalOnly( true ); DefaultWalkerContext ctx = new DefaultWalkerContext( this, request, filter ); ctx.getProcessors().add( processor ); // and let it loose try { getWalker().walk( ctx ); } catch ( WalkerException e ) { if ( !( e.getWalkerContext().getStopCause() instanceof ItemNotFoundException ) ) { // everything that is not ItemNotFound should be reported, // otherwise just neglect it throw e; } } return processor.getFiles(); }
getLogger().debug( String.format( "Expiring proxy cache in repository %s from path=\"%s\"", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) ); if ( getLogger().isDebugEnabled() ) getLogger().info( String.format( "Proxy cache was expired for repository %s from path=\"%s\"", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) ); getLogger().debug( String.format( "Proxy cache not altered for repository %s from path=\"%s\"", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) );
if ( getLogger().isDebugEnabled() ) getLogger().debug( "Mirror count:" + mirrors.size() ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Using mirror URL:" + mirror.getUrl() + ", retryCount=" + retryCount ); if ( getLogger().isDebugEnabled() ) getLogger().error( String.format( "Got RemoteStorageException in proxy repository %s while retrieving remote artifact \"%s\" from URL %s, this is %s (re)try, cause: %s: %s", if ( getLogger().isDebugEnabled() ) getLogger().error( String.format( "Got LocalStorageException in proxy repository %s while caching retrieved artifact \"%s\" got from URL %s, will attempt next mirror, cause: %s: %s", getLogger().warn( "Unexpected Exception in " + RepositoryStringUtils.getHumanizedNameString( this ), e );
if ( getLogger().isDebugEnabled() ) getLogger().debug( "Caching item " + item.getRepositoryItemUid().toString() + " in local storage of repository." ); getLogger().warn( "Nexus BUG in " + RepositoryStringUtils.getHumanizedNameString( this ) getLogger().warn( "LocalStorage or repository " + RepositoryStringUtils.getHumanizedNameString( this ) + " does not handle STORE operation, not caching remote fetched item.", ex );