@Override public boolean containsItem( long newerThen, ProxyRepository repository, ResourceStoreRequest request ) throws RemoteStorageException { return checkRemoteAvailability( newerThen, repository, request, true ); }
@Override public boolean containsItem( ProxyRepository repository, ResourceStoreRequest request ) throws RemoteStorageException { return containsItem( 0, repository, request ); }
/** * Returns {@code true} if only and only if we are positive that remote peer (remote URL of passed in * ProxyRepository) points to a remote repository that is hosted by Amazon S3 Storage. This method will return false * as long as we don't make very 1st HTTP request to remote peer. After that 1st request, we retain the status until * ProxyRepository configuration changes. See NEXUS-3338 for more. * * @param repository that needs to be checked. * @return true only if we know that ProxyRepository in question points to Amazon S3 storage. * @throws RemoteStorageException in case of some error. */ public boolean isRemotePeerAmazonS3Storage( final ProxyRepository repository ) throws RemoteStorageException { RemoteStorageContext ctx = getRemoteStorageContext( repository ); // it is S3 if we have CTX_KEY_S3_FLAG set, the flag value is not null, and flag value is true // if flag is False, we know it is not S3 // if flag is null, we still did not contact remote, so we were not able to tell yet return ctx.hasContextObject( getS3FlagKey() ) && ( (DefaultRemoteStorageContext.BooleanFlagHolder) ctx.getContextObject( getS3FlagKey() ) ).isFlag(); }
public void setRemoteConnectionSettings( RemoteConnectionSettings settings ) { getRemoteStorageContext().setRemoteConnectionSettings( settings ); }
protected AsyncHttpClient getClient( final ProxyRepository repository ) throws RemoteStorageException { RemoteStorageContext ctx = getRemoteStorageContext( repository ); AsyncHttpClient httpClient = (AsyncHttpClient) ctx.getContextObject( CTX_KEY_CLIENT ); return httpClient; }
public String getHttpRoleHint( final String hint ) { if ( isHttpProviderForced() || StringUtils.isBlank( hint ) ) { return getDefaultHttpRoleHint(); } else { return hint; } } }
@Override public void setRemoteProxySettings( RemoteProxySettings settings ) { putContextObject( RemoteProxySettings.class.getName(), settings ); }
@Override public void removeRemoteConnectionSettings() { removeContextObject( RemoteConnectionSettings.class.getName() ); }
@Override public boolean hasRemoteProxySettings() { return hasContextObject( RemoteProxySettings.class.getName() ); }
@Override public RemoteConnectionSettings getRemoteConnectionSettings() { return (RemoteConnectionSettings) getContextObject( RemoteConnectionSettings.class.getName() ); }
protected boolean isRemoteStorageReachable( ResourceStoreRequest request ) throws StorageException { return getRemoteStorage().isReachable( this, request ); }
public RemoteAuthenticationSettings getRemoteAuthenticationSettings() { return getRemoteStorageContext().getRemoteAuthenticationSettings(); }
public RemoteConnectionSettings getRemoteConnectionSettings() { return getRemoteStorageContext().getRemoteConnectionSettings(); }
@Override public void setRemoteAuthenticationSettings( RemoteAuthenticationSettings settings ) { putContextObject( RemoteAuthenticationSettings.class.getName(), settings ); }
@Override public void removeRemoteProxySettings() { removeContextObject( RemoteProxySettings.class.getName() ); }
@Override public boolean hasRemoteAuthenticationSettings() { return hasContextObject( RemoteAuthenticationSettings.class.getName() ); }
@Override public RemoteAuthenticationSettings getRemoteAuthenticationSettings() { return (RemoteAuthenticationSettings) getContextObject( RemoteAuthenticationSettings.class.getName() ); }
@Override public void setRemoteConnectionSettings( RemoteConnectionSettings settings ) { putContextObject( RemoteConnectionSettings.class.getName(), settings ); }
@Override public void removeRemoteAuthenticationSettings() { removeContextObject( RemoteAuthenticationSettings.class.getName() ); }
@Override public boolean hasRemoteConnectionSettings() { return hasContextObject( RemoteConnectionSettings.class.getName() ); }