Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup: more WhiteList->Autorouting renames

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
  • Loading branch information...
commit 3fca1452929426197c9154cf2cd8b01c9043e920 1 parent d3832ef
@ifedorenko ifedorenko authored
Showing with 278 additions and 271 deletions.
  1. +3 −3 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepository.java
  2. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/DiscoveryConfig.java
  3. +39 −36 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/Manager.java
  4. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/PrefixSource.java
  5. +4 −4 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/ProxyRequestFilter.java
  6. +6 −6 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/PublishingStatus.java
  7. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/discovery/DiscoveryResult.java
  8. +3 −3 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/discovery/RemoteStrategy.java
  9. +5 −5 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ConfigImpl.java
  10. +17 −17 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/EventDispatcher.java
  11. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/FilePrefixSource.java
  12. +12 −11 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ManagerImpl.java
  13. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/PathMatcher.java
  14. +3 −3 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ProxyRequestFilterImpl.java
  15. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/RemotePrefixFileStrategy.java
  16. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/TextFilePrefixSourceMarshaller.java
  17. +8 −6 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/WritablePrefixSourceModifier.java
  18. +3 −3 ...re/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/task/executor/ConstrainedExecutorImpl.java
  19. +122 −122 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/routing/internal/PathMatcherTest.java
  20. +16 −15 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/routing/internal/PrefixFileMaintenanceTest.java
  21. +15 −15 .../test/java/org/sonatype/nexus/proxy/maven/routing/internal/PrefixFileUpdatePropagationGroupUpdatesTest.java
  22. +4 −4 ...xus-it-helper-plugin/src/main/java/org/sonatype/nexus/plugins/routing/api/RoutingWaitForPlexusResource.java
  23. +4 −4 nexus-test/nexus-test-harness-launcher/src/main/java/org/sonatype/nexus/test/booter/Jetty8NexusBooter.java
  24. +3 −3 ...s/restlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/rest/routing/RoutingConfigResource.java
  25. +1 −1  .../restlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/rest/routing/RoutingResourceSupport.java
  26. +3 −3 ...s/restlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/rest/routing/RoutingStatusResource.java
View
6 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepository.java
@@ -459,7 +459,7 @@ protected boolean shouldTryRemote( final ResourceStoreRequest request )
{
return false;
}
- // apply WLFilter to "normal" requests only, not hidden (which is meta or plain hidden)
+ // apply autorouting filter to "normal" requests only, not hidden (which is meta or plain hidden)
final RepositoryItemUid uid = createUid( request.getRequestPath() );
if ( !uid.getBooleanAttributeValue( IsHiddenAttribute.class ) )
{
@@ -590,7 +590,7 @@ private void putChecksumItem( Map<String, StorageItem> checksums, ResourceStoreR
}
/**
- * Beside original behavior, only add to NFC when it's not WL that rejected remote access.
+ * Beside original behavior, only add to NFC when remote access is not rejected by autorouting.
*
* @since 2.4
*/
@@ -602,7 +602,7 @@ protected boolean shouldAddToNotFoundCache( final ResourceStoreRequest request )
{
// TODO: should we un-flag the request?
shouldAddToNFC = false;
- getLogger().debug( "Maven proxy repository {} WL rejected this request, not adding path {} to NFC.",
+ getLogger().debug( "Maven proxy repository {} autorouting rejected this request, not adding path {} to NFC.",
RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() );
}
return shouldAddToNFC;
View
2  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/DiscoveryConfig.java
@@ -15,7 +15,7 @@
import static com.google.common.base.Preconditions.checkArgument;
/**
- * Configuration properties of the WL.
+ * Configuration properties of the autorouting.
*
* @author cstamas
* @since 2.4
View
75 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/Manager.java
@@ -22,7 +22,7 @@
import org.sonatype.nexus.proxy.storage.remote.RemoteRepositoryStorage;
/**
- * WL Manager component.
+ * Autorouting Manager component.
*
* @author cstamas
* @since 2.4
@@ -31,8 +31,8 @@
{
/**
* Key that is put into {@link ResourceStoreRequest}'s context for prefix file related operations, to mark that the
- * file operation is initiated by WL feature. Only the presence (or no presence) of this key is used for flagging,
- * the value mapped under this key is irrelevant.
+ * file operation is initiated by autorouting feature. Only the presence (or no presence) of this key is used for
+ * flagging, the value mapped under this key is irrelevant.
*/
String ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY = Manager.class.getName() + ".fileOperation";
@@ -45,10 +45,10 @@
/**
* Key that when put into {@link ResourceStoreRequest}'s context, the given request becomes a
- * "not a filtering subject". WL's {@link ProxyRequestFilter} will not interfere with that request, it will be not
- * subject for filtering. It should be used sparingly, only in cases when you know that WL might interfere with your
- * request, usually because of stale WL. Only the presence (or no presence) of this key is used for flagging, the
- * value mapped under this key is irrelevant.
+ * "not a filtering subject". Autorouting's {@link ProxyRequestFilter} will not interfere with that request, it will
+ * be not subject for filtering. It should be used sparingly, only in cases when you know that autorouting might
+ * interfere with your request, usually because of stale prefix list. Only the presence (or no presence) of this key
+ * is used for flagging, the value mapped under this key is irrelevant.
*/
String ROUTING_REQUEST_NFS_FLAG_KEY = Manager.class.getName() + ".requestNfs";
@@ -63,7 +63,7 @@
void shutdown();
/**
- * Initializes WL of given repository (used on repository addition and on boot when called with all defined
+ * Initializes prefix list of given repository (used on repository addition and on boot when called with all defined
* repository during boot up).
*
* @param mavenRepository
@@ -71,9 +71,10 @@
void initializePrefixFile( MavenRepository mavenRepository );
/**
- * Executes an update of WL for given repository. In case of {@link MavenProxyRepository} instance, it might not do
- * anything, depending is configuration returned by {@link #getRemoteDiscoveryConfig(MavenProxyRepository)} for it
- * enabled or not. This method invocation will spawn the update in background, and return immediately.
+ * Executes an update of prefix list for given repository. In case of {@link MavenProxyRepository} instance, it
+ * might not do anything, depending is configuration returned by
+ * {@link #getRemoteDiscoveryConfig(MavenProxyRepository)} for it enabled or not. This method invocation will spawn
+ * the update in background, and return immediately.
*
* @param mavenRepository
* @return {@code true} if the update job was actually spawned, or {@code false} if not since one is already running
@@ -86,10 +87,11 @@ boolean updatePrefixFile( MavenRepository mavenRepository )
throws IllegalStateException;
/**
- * Executes an update of WL for given repository. In case of {@link MavenProxyRepository} instance, it might not do
- * anything, depending is configuration returned by {@link #getRemoteDiscoveryConfig(MavenProxyRepository)} for it
- * enabled or not. This method invocation will always spawn the update in background, and return immediately. Also,
- * this method will cancel any currently running updates on same repository.
+ * Executes an update of prefix list for given repository. In case of {@link MavenProxyRepository} instance, it
+ * might not do anything, depending is configuration returned by
+ * {@link #getRemoteDiscoveryConfig(MavenProxyRepository)} for it enabled or not. This method invocation will always
+ * spawn the update in background, and return immediately. Also, this method will cancel any currently running
+ * updates on same repository.
*
* @param mavenRepository
* @return {@code true} if another already running update was cancelled to execute this forced update.
@@ -100,11 +102,12 @@ boolean forceUpdatePrefixFile( MavenRepository mavenRepository )
throws IllegalStateException;
/**
- * Special version of update of WL for given Maven2 proxy repository. This method will execute <b>synchronously</b>
- * and doing "quick" update only (will never scrape, only will try prefix file fetch from remote). Usable in special
- * cases when you know remote should have prefix file published, and you are interested in results immediately (or
- * at least ASAP). Still, consider that this method does remote access (using {@link RemoteRepositoryStorage} of the
- * given repository), hence, might have longer runtime (network latency, remote server load and such).
+ * Special version of update of prefix list for given Maven2 proxy repository. This method will execute
+ * <b>synchronously</b> and doing "quick" update only (will never scrape, only will try prefix file fetch from
+ * remote). Usable in special cases when you know remote should have prefix file published, and you are interested
+ * in results immediately (or at least ASAP). Still, consider that this method does remote access (using
+ * {@link RemoteRepositoryStorage} of the given repository), hence, might have longer runtime (network latency,
+ * remote server load and such).
*
* @param mavenProxyRepository
* @throws IllegalStateException when the passed in repository is unsupported, or for some reason not in state to be
@@ -114,16 +117,16 @@ void forceProxyQuickUpdatePrefixFile( MavenProxyRepository mavenProxyRepository
throws IllegalStateException;
/**
- * Queries is the given {@link MavenRepository} supported by WL feature (as not all Maven2 nor all
+ * Queries is the given {@link MavenRepository} supported by autorouting feature (as not all Maven2 nor all
* {@link MavenRepository} implementations are supported! We exclude Maven1 layout and Maven2 shadow repositories).
*
* @param mavenRepository
- * @return {@code true} if WL feature is supported for given repository instance.
+ * @return {@code true} if autorouting feature is supported for given repository instance.
*/
boolean isMavenRepositorySupported( final MavenRepository mavenRepository );
/**
- * Returns the WL status for given repository.
+ * Returns the autorouting status for given repository.
*
* @param mavenRepository
* @return the status, never {@code null}.
@@ -151,33 +154,33 @@ void setRemoteDiscoveryConfig( MavenProxyRepository mavenProxyRepository, Discov
throws IOException;
/**
- * Maintains the WL of a hosted repository. Offers entries to WL, and method updates the WL of given hosted
- * repository if needed. If WL modified, returns {@code true}.
+ * Maintains the prefix list of a hosted repository. Offers entries to prefix list, and method updates the prefix
+ * list of given hosted repository if needed. If prefix list modified, returns {@code true}.
*
- * @param mavenHostedRepository the hosted repository to which WL we offer entries.
+ * @param mavenHostedRepository the hosted repository to which prefix list we offer entries.
* @param entry the entry offered.
- * @return {@code true} if WL was changed, {@code false} otherwise.
+ * @return {@code true} if prefix list was changed, {@code false} otherwise.
* @throws IOException in case of some IO problem.
*/
boolean offerEntry( final MavenHostedRepository mavenHostedRepository, String entry )
throws IOException;
/**
- * Maintains the WL of a hosted repository. Revokes entries from WL, and method updates the WL of given hosted
- * repository if needed. If WL modified, returns {@code true}.
+ * Maintains the prefix list of a hosted repository. Revokes entries from prefix list, and method updates the prefix
+ * list of given hosted repository if needed. If prefix list modified, returns {@code true}.
*
- * @param mavenHostedRepository the hosted repository from which WL we revoke entries.
+ * @param mavenHostedRepository the hosted repository from which prefix list we revoke entries.
* @param entry the entry revoked.
- * @return {@code true} if WL was changed, {@code false} otherwise.
+ * @return {@code true} if prefix list was changed, {@code false} otherwise.
* @throws IOException in case of some IO problem.
*/
boolean revokeEntry( final MavenHostedRepository mavenHostedRepository, String entry )
throws IOException;
/**
- * Returns {@link PrefixSource} for given {@link MavenRepository}.For the existence of the WL in question (if you
- * want to read it), check {@link PrefixSource#exists()} and {@link PrefixSource#supported()} method! Never returns
- * {@code null}.
+ * Returns {@link PrefixSource} for given {@link MavenRepository}.For the existence of the prefix list in question
+ * (if you want to read it), check {@link PrefixSource#exists()} and {@link PrefixSource#supported()} method! Never
+ * returns {@code null}.
*
* @param mavenRepository
* @return the {@link PrefixSource} for given repository.
@@ -206,11 +209,11 @@ void unpublish( MavenRepository mavenRepository )
// ==
/**
- * Checks whether the passed in item event is about WL file. In other words, is event originating from a
+ * Checks whether the passed in item event is about prefix list file. In other words, is event originating from a
* {@link MavenRepository} and has specific path.
*
* @param evt
- * @return {@code true} if item event is about WL file.
+ * @return {@code true} if item event is about prefix list file.
*/
boolean isEventAboutPrefixFile( final RepositoryItemEvent evt );
}
View
2  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/PrefixSource.java
@@ -16,7 +16,7 @@
import java.util.List;
/**
- * Prefix source main purpose is to serve/read-up WL prefix entries. It might be backed (or sourced) from multiple
+ * Prefix source main purpose is to serve/read-up prefix list entries. It might be backed (or sourced) from multiple
* things, like file or even a plain array of strings.
*
* @author cstamas
View
8 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/ProxyRequestFilter.java
@@ -27,10 +27,10 @@
{
/**
* Evaluates the passed in combination of {@link MavenProxyRepository} and {@link ResourceStoreRequest} and decides
- * does the WL (if any) of given repository allows the request to be passed to remote storage of proxy repository.
- * If allows, will return {@code true}, if not, it returns {@code false}. Still, possibility is left to this method
- * to throw some exceptions too to signal some extraordinary information, or, to provide extra information why some
- * request should result in "not found" response.
+ * does the prefix list (if any) of given repository allows the request to be passed to remote storage of proxy
+ * repository. If allows, will return {@code true}, if not, it returns {@code false}. Still, possibility is left to
+ * this method to throw some exceptions too to signal some extraordinary information, or, to provide extra
+ * information why some request should result in "not found" response.
*
* @param mavenProxyRepository
* @param resourceStoreRequest
View
12 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/PublishingStatus.java
@@ -28,12 +28,12 @@
public static enum PStatus
{
/**
- * WL is published okay for given repository.
+ * Prefix list is published okay for given repository.
*/
PUBLISHED,
/**
- * WL is not published for given repository.
+ * Prefix list is not published for given repository.
*/
NOT_PUBLISHED;
}
@@ -84,9 +84,9 @@ public String getLastPublishedMessage()
}
/**
- * Time stamp (milliseconds) of the last published WL, or -1 if not published.
+ * Time stamp (milliseconds) of the last published prefix list, or -1 if not published.
*
- * @return time stamp (milliseconds) of the last published WL, or -1 if not published.
+ * @return time stamp (milliseconds) of the last published prefix list, or -1 if not published.
*/
public long getLastPublishedTimestamp()
{
@@ -101,9 +101,9 @@ public long getLastPublishedTimestamp()
}
/**
- * Repository path of the published WL file, or, {@code null} if not published.
+ * Repository path of the published prefix list file, or, {@code null} if not published.
*
- * @return repository path of the published WL file, or, {@code null} if not published.
+ * @return repository path of the published prefix list file, or, {@code null} if not published.
*/
public String getLastPublishedFilePath()
{
View
2  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/discovery/DiscoveryResult.java
@@ -222,7 +222,7 @@ public void recordSuccess( final String usedStrategyId, final String message, fi
/**
* Records a failure on behalf of a strategy, if this has not yet recorded a success, in which case this method will
- * do nothing. A failure simply means "this strategy failed to get remote WL".
+ * do nothing. A failure simply means "this strategy failed to get remote prefix list".
*
* @param usedStrategyId
* @param message
View
6 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/discovery/RemoteStrategy.java
@@ -18,9 +18,9 @@
import org.sonatype.nexus.proxy.maven.MavenRepository;
/**
- * Strategy for remote content discovery for WL by some means. It is identified by {@link #getId()} and has priority
- * {@link #getPriority()}. Latter is used to sort (using natural order of integers) the instances and try the one by one
- * in sorted order.
+ * Strategy for remote content discovery for prefix list by some means. It is identified by {@link #getId()} and has
+ * priority {@link #getPriority()}. Latter is used to sort (using natural order of integers) the instances and try the
+ * one by one in sorted order.
*
* @author cstamas
* @since 2.4
View
10 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ConfigImpl.java
@@ -33,8 +33,8 @@
implements Config
{
/**
- * System property key that is used to read up boolean value controlling is WL feature active or not. Main use case
- * is to disable this in "legacy" UTs and ITs, but might serve too as troubleshooting in some cases. Event
+ * System property key that is used to read up boolean value controlling if autorouting feature active or not. Main
+ * use case is to disable this in "legacy" UTs and ITs, but might serve too as troubleshooting in some cases. Event
* dispatcher is active by default, to deactivate it, specify a system property like this:
*
* <pre>
@@ -43,9 +43,9 @@
*
* Note: This does NOT REMOVE the Feature itself! The feature will be still present and working but remote content
* discovery will be completely disabled, hence, all the proxies and groups having proxies as members will simply be
- * marked for noscrape. Also, since no WL will be published, no "proxy optimization" will happen either. If neglect
- * the noscape, Nexus will work as it was working before 2.4 release. Using system property with this key should be
- * restricted to tests or some troubleshooting only.
+ * marked for noscrape. Also, since no prefix list will be published, no "proxy optimization" will happen either. If
+ * neglect the noscape, Nexus will work as it was working before 2.4 release. Using system property with this key
+ * should be restricted to tests or some troubleshooting only.
*/
public static final String FEATURE_ACTIVE_KEY = Config.class.getName() + ".featureActive";
View
34 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/EventDispatcher.java
@@ -56,17 +56,17 @@
{
private final Logger logger;
- private final Manager wlManager;
+ private final Manager manager;
/**
* Da constructor.
*
- * @param wlManager
+ * @param manager
*/
- public EventDispatcher( final Manager wlManager )
+ public EventDispatcher( final Manager manager )
{
this.logger = LoggerFactory.getLogger( getClass() );
- this.wlManager = checkNotNull( wlManager );
+ this.manager = checkNotNull( manager );
}
protected Logger getLogger()
@@ -78,14 +78,14 @@ protected Logger getLogger()
protected void handleRepositoryAdded( final MavenRepository mavenRepository )
{
- wlManager.initializePrefixFile( mavenRepository );
+ manager.initializePrefixFile( mavenRepository );
}
protected void handleRepositoryModified( final MavenRepository mavenRepository )
{
try
{
- wlManager.forceUpdatePrefixFile( mavenRepository );
+ manager.forceUpdatePrefixFile( mavenRepository );
}
catch ( IllegalStateException e )
{
@@ -100,8 +100,8 @@ protected void handlePrefixFileUpdate( final RepositoryItemEvent evt )
final MavenRepository mavenRepository = (MavenRepository) evt.getRepository();
try
{
- final PrefixSource prefixSource = wlManager.getPrefixSourceFor( mavenRepository );
- wlManager.publish( mavenRepository, prefixSource );
+ final PrefixSource prefixSource = manager.getPrefixSourceFor( mavenRepository );
+ manager.publish( mavenRepository, prefixSource );
}
catch ( IOException e )
{
@@ -115,7 +115,7 @@ protected void handlePrefixFileRemoval( final RepositoryItemEvent evt )
final MavenRepository mavenRepository = (MavenRepository) evt.getRepository();
try
{
- wlManager.unpublish( mavenRepository );
+ manager.unpublish( mavenRepository );
}
catch ( IOException e )
{
@@ -128,7 +128,7 @@ protected void offerPath( final MavenHostedRepository mavenHostedRepository, Str
{
try
{
- wlManager.offerEntry( mavenHostedRepository, path );
+ manager.offerEntry( mavenHostedRepository, path );
}
catch ( IOException e )
{
@@ -141,7 +141,7 @@ protected void revokePath( final MavenHostedRepository mavenHostedRepository, St
{
try
{
- wlManager.revokeEntry( mavenHostedRepository, path );
+ manager.revokeEntry( mavenHostedRepository, path );
}
catch ( IOException e )
{
@@ -170,7 +170,7 @@ protected boolean isPrefixFileEvent( final RepositoryItemEvent evt )
{
// is not fired as side effect of Publisher publishing this
return isRepositoryHandled( evt.getRepository() ) && !isRequestContextMarked( evt.getItem().getItemContext() )
- && wlManager.isEventAboutPrefixFile( evt );
+ && manager.isEventAboutPrefixFile( evt );
}
protected boolean isPlainItemEvent( final RepositoryItemEvent evt )
@@ -186,7 +186,7 @@ protected boolean isPlainFileItemEvent( final RepositoryItemEvent evt )
return isPlainItemEvent( evt ) && evt.getItem() instanceof StorageFileItem;
}
- // == handlers for item events (to maintain WL file)
+ // == handlers for item events (to maintain prefix list file)
/**
* Event handler.
@@ -203,7 +203,7 @@ public void onRepositoryItemEventStore( final RepositoryItemEventStore evt )
}
else if ( isPlainFileItemEvent( evt ) )
{
- // we maintain WL for hosted reposes only!
+ // we maintain prefix list for hosted reposes only!
final MavenHostedRepository mavenHostedRepository =
evt.getRepository().adaptToFacet( MavenHostedRepository.class );
if ( mavenHostedRepository != null )
@@ -228,7 +228,7 @@ public void onRepositoryItemEventCache( final RepositoryItemEventCache evt )
}
else if ( isPlainFileItemEvent( evt ) )
{
- // we maintain WL for hosted reposes only!
+ // we maintain prefix list for hosted reposes only!
final MavenHostedRepository mavenHostedRepository =
evt.getRepository().adaptToFacet( MavenHostedRepository.class );
if ( mavenHostedRepository != null )
@@ -253,7 +253,7 @@ public void onRepositoryItemEventDelete( final RepositoryItemEventDelete evt )
}
else if ( evt instanceof RepositoryItemEventDeleteRoot && isPlainItemEvent( evt ) )
{
- // we maintain WL for hosted reposes only!
+ // we maintain prefix list for hosted reposes only!
final MavenHostedRepository mavenHostedRepository =
evt.getRepository().adaptToFacet( MavenHostedRepository.class );
if ( mavenHostedRepository != null )
@@ -263,7 +263,7 @@ else if ( evt instanceof RepositoryItemEventDeleteRoot && isPlainItemEvent( evt
}
}
- // == Handler for WL initialization
+ // == Handler for prefix list initialization
/**
* Event handler.
View
2  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/FilePrefixSource.java
@@ -42,7 +42,7 @@
/**
* {@link WritablePrefixSource} implementation that is backed by a {@link StorageFileItem} in a {@link MavenRepository}.
- * Also serves as "the main" WL source. This is the only implementation of the {@link WritablePrefixSource}.
+ * Also serves as "the main" prefix list source. This is the only implementation of the {@link WritablePrefixSource}.
*
* @author cstamas
* @since 2.4
View
23 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ManagerImpl.java
@@ -130,9 +130,9 @@
/**
* Plain executor for background batch-updates. This executor runs 1 periodic thread (see constructor) that performs
- * periodic remote WL update, but also executes background "force" updates (initiated by user over REST or when
- * repository is added). But, as background threads are bounded by presence of proxy repositories, and introduce
- * hard limit of possible max executions, it protects this instance that is basically unbounded.
+ * periodic remote prefix list update, but also executes background "force" updates (initiated by user over REST or
+ * when repository is added). But, as background threads are bounded by presence of proxy repositories, and
+ * introduce hard limit of possible max executions, it protects this instance that is basically unbounded.
*/
private final ScheduledExecutorService executor;
@@ -282,8 +282,8 @@ public void initializePrefixFile( final MavenRepository mavenRepository )
}
/**
- * Method meant to be invoked on regular periods (like hourly, as we defined "resolution" of WL update period in
- * hours too), and will perform WL update only on those proxy repositories that needs it.
+ * Method meant to be invoked on regular periods (like hourly, as we defined "resolution" of prefix list update
+ * period in hours too), and will perform prefix list update only on those proxy repositories that needs it.
*/
protected void mayUpdateAllProxyPrefixFiles()
{
@@ -323,12 +323,13 @@ protected void mayUpdateAllProxyPrefixFiles()
}
/**
- * Method meant to be invoked on regular periods (like hourly, as we defined "resolution" of WL update period in
- * hours too), and will perform WL update on proxy repository only if needed (WL is stale, or does not exists).
+ * Method meant to be invoked on regular periods (like hourly, as we defined "resolution" of prefix list update
+ * period in hours too), and will perform prefix list update on proxy repository only if needed (prefix list is
+ * stale, or does not exists).
*
* @param mavenProxyRepository
- * @return {@code true} if update has been spawned, {@code false} if no update needed (WL is up to date or remote
- * discovery is disable for repository).
+ * @return {@code true} if update has been spawned, {@code false} if no update needed (prefix list is up to date or
+ * remote discovery is disable for repository).
*/
protected boolean mayUpdateProxyPrefixFile( final MavenProxyRepository mavenProxyRepository )
{
@@ -337,7 +338,7 @@ protected boolean mayUpdateProxyPrefixFile( final MavenProxyRepository mavenProx
{
// only update if any of these below are true:
// status is ERROR or ENABLED_NOT_POSSIBLE (hit an error during last discovery)
- // status is anything else and WL update period is here
+ // status is anything else and prefix list update period is here
final DiscoveryConfig config = getRemoteDiscoveryConfig( mavenProxyRepository );
if ( discoveryStatus.getStatus() == DStatus.ERROR
|| discoveryStatus.getStatus() == DStatus.ENABLED_NOT_POSSIBLE
@@ -671,7 +672,7 @@ protected PrefixSource updateGroupPrefixFile( final MavenGroupRepository mavenGr
{
checkUpdateConditions( mavenGroupRepository );
PrefixSource prefixSource = null;
- // save merged WL into group's local storage (if all members has WL)
+ // save merged prefix list into group's local storage (if all members has prefix list)
boolean allMembersHavePublished = true;
final LinkedHashSet<String> entries = new LinkedHashSet<String>();
for ( Repository member : mavenGroupRepository.getMemberRepositories() )
View
2  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/PathMatcher.java
@@ -25,7 +25,7 @@
import com.google.common.annotations.VisibleForTesting;
/**
- * A path matcher, that performs "path matching" using the WL prefix entries. Implemented using {@link ParentOMatic},
+ * A path matcher, that performs "path matching" using the prefix list entries. Implemented using {@link ParentOMatic},
* and performs matching by building a maximized (capped) tree in memory out of path entries.
*
* @author cstamas
View
6 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ProxyRequestFilterImpl.java
@@ -55,15 +55,15 @@
*
* @param eventBus
* @param applicationStatusSource
- * @param wlManager
+ * @param manager
*/
@Inject
public ProxyRequestFilterImpl( final EventBus eventBus, final ApplicationStatusSource applicationStatusSource,
- final Manager wlManager )
+ final Manager manager )
{
checkNotNull( eventBus );
this.applicationStatusSource = checkNotNull( applicationStatusSource );
- this.manager = checkNotNull( wlManager );
+ this.manager = checkNotNull( manager );
eventBus.register( this );
}
View
2  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/RemotePrefixFileStrategy.java
@@ -70,7 +70,7 @@ public StrategyResult discover( final MavenProxyRepository mavenProxyRepository
StorageFileItem item;
String path = config.getRemotePrefixFilePath();
getLogger().debug( "Looking for remote prefix on {} at path {}", mavenProxyRepository, path );
- // we keep exclusive lock on UID during discovery to prevent other WL threads grabbing this file
+ // we keep exclusive lock on UID during discovery to prevent other threads grabbing this file
// prematurely. We release the lock only when file is present locally, and is validated.
// in that moment it's not published yet, but the content is correct and it will be
// the same that will get published.
View
2  ...s-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/TextFilePrefixSourceMarshaller.java
@@ -85,7 +85,7 @@ public boolean supported()
/**
* Constructor.
*
- * @param config the WL config.
+ * @param config the autorouting config.
*/
public TextFilePrefixSourceMarshaller( final Config config )
{
View
14 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/WritablePrefixSourceModifier.java
@@ -27,8 +27,8 @@
/**
* A modifier for {@link WritablePrefixSource}, that makes you able to "edit" it by adding and removing entries from it.
- * It performs entry source changes only when needed (entries added or removed does modify WL), and defers saving of
- * modified WL until you invoke {@link #apply()}.
+ * It performs entry source changes only when needed (entries added or removed does modify prefix list), and defers
+ * saving of modified prefix list until you invoke {@link #apply()}.
*
* @author cstamas
* @since 2.4
@@ -72,10 +72,11 @@ public WritablePrefixSourceModifier( final WritablePrefixSource writablePrefixSo
/**
* Adds entry to {@link WritablePrefixSource} being modified. Returns {@code true} if the invocation actually did
- * change the WL. Changes are cached, entry source is not modified until you invoke {@link #apply()} method.
+ * change the prefix list. Changes are cached, entry source is not modified until you invoke {@link #apply()}
+ * method.
*
* @param entry
- * @return {@code true} if the invocation actually did change the WL.
+ * @return {@code true} if the invocation actually did change the prefix list.
*/
public boolean offerEntry( final String entry )
{
@@ -91,10 +92,11 @@ public boolean offerEntry( final String entry )
/**
* Removes entry from {@link WritablePrefixSource} being modified. Returns {@code true} if the invocation actually
- * did change the WL. Changes are cached, entry source is not modified until you invoke {@link #apply()} method.
+ * did change the prefix list. Changes are cached, entry source is not modified until you invoke {@link #apply()}
+ * method.
*
* @param entry
- * @return {@code true} if the invocation actually did change the WL.
+ * @return {@code true} if the invocation actually did change the prefix list.
*/
public boolean revokeEntry( final String entry )
{
View
6 ...src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/task/executor/ConstrainedExecutorImpl.java
@@ -34,9 +34,9 @@
{
/**
* Plain executor for background batch-updates. This executor runs 1 periodic thread (see constructor) that performs
- * periodic remote WL update, but also executes background "force" updates (initiated by user over REST or when
- * repository is added). But, as background threads are bounded by presence of proxy repositories, and introduce
- * hard limit of possible max executions, it protects this instance that is basically unbounded.
+ * periodic remote prexif list update, but also executes background "force" updates (initiated by user over REST or
+ * when repository is added). But, as background threads are bounded by presence of proxy repositories, and
+ * introduce hard limit of possible max executions, it protects this instance that is basically unbounded.
*/
private final java.util.concurrent.Executor executor;
View
244 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/routing/internal/PathMatcherTest.java
@@ -31,172 +31,172 @@
@Test
public void smoke()
{
- final PathMatcher wl = new PathMatcher( entries1, 2 );
+ final PathMatcher pm = new PathMatcher( entries1, 2 );
- assertThat( "Should not match!", !wl.matches( "/org" ) );
- assertThat( "Should not match!", !wl.matches( "/archetype" ) );
- assertThat( "Should not match!", !wl.matches( "/archetype-metadata" ) );
+ assertThat( "Should not match!", !pm.matches( "/org" ) );
+ assertThat( "Should not match!", !pm.matches( "/archetype" ) );
+ assertThat( "Should not match!", !pm.matches( "/archetype-metadata" ) );
- assertThat( "Should match!", wl.matches( "/archetype-metadata.xml" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype/" ) );
+ assertThat( "Should match!", pm.matches( "/archetype-metadata.xml" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype/" ) );
// we constructed WL with depth of 2, so all these below will match
// even if WL does contain more specific entries, since
// WL keeps the tree up to 2 level deep only
// per-prefix
- assertThat( "Should match!", wl.matches( "/org/sonatype" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype/" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype/nexus" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype/nexus/plugins" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype/barfoo" ) );
- assertThat( "Should match!", wl.matches( "/org/sonatype/foobar" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype/" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype/nexus" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype/nexus/plugins" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype/barfoo" ) );
+ assertThat( "Should match!", pm.matches( "/org/sonatype/foobar" ) );
// per-prefix
- assertThat( "Should match!", wl.matches( "/com/sonatype" ) );
- assertThat( "Should match!", wl.matches( "/com/sonatype/" ) );
- assertThat( "Should match!", wl.matches( "/com/sonatype/nexus" ) );
- assertThat( "Should match!", wl.matches( "/com/sonatype/nexus/plugins" ) );
- assertThat( "Should match!", wl.matches( "/com/sonatype/barfoo" ) );
- assertThat( "Should match!", wl.matches( "/com/sonatype/foobar" ) );
+ assertThat( "Should match!", pm.matches( "/com/sonatype" ) );
+ assertThat( "Should match!", pm.matches( "/com/sonatype/" ) );
+ assertThat( "Should match!", pm.matches( "/com/sonatype/nexus" ) );
+ assertThat( "Should match!", pm.matches( "/com/sonatype/nexus/plugins" ) );
+ assertThat( "Should match!", pm.matches( "/com/sonatype/barfoo" ) );
+ assertThat( "Should match!", pm.matches( "/com/sonatype/foobar" ) );
// per-prefix
- assertThat( "Should match!", wl.matches( "/biz/sonatype" ) );
- assertThat( "Should match!", wl.matches( "/biz/sonatype/" ) );
- assertThat( "Should match!", wl.matches( "/biz/sonatype/nexus" ) );
- assertThat( "Should match!", wl.matches( "/biz/sonatype/nexus/plugins" ) );
- assertThat( "Should match!", wl.matches( "/biz/sonatype/barfoo" ) );
- assertThat( "Should match!", wl.matches( "/biz/sonatype/foobar" ) );
+ assertThat( "Should match!", pm.matches( "/biz/sonatype" ) );
+ assertThat( "Should match!", pm.matches( "/biz/sonatype/" ) );
+ assertThat( "Should match!", pm.matches( "/biz/sonatype/nexus" ) );
+ assertThat( "Should match!", pm.matches( "/biz/sonatype/nexus/plugins" ) );
+ assertThat( "Should match!", pm.matches( "/biz/sonatype/barfoo" ) );
+ assertThat( "Should match!", pm.matches( "/biz/sonatype/foobar" ) );
}
- protected void check( PathMatcher wl, String path, boolean shouldMatch )
+ protected void check( PathMatcher pm, String path, boolean shouldMatch )
{
if ( shouldMatch )
{
- assertThat( path + " should match!", wl.matches( path ) );
+ assertThat( path + " should match!", pm.matches( path ) );
}
else
{
- assertThat( path + " should not match!", !wl.matches( path ) );
+ assertThat( path + " should not match!", !pm.matches( path ) );
}
}
@Test
public void testMaxDepth()
{
- final PathMatcher wl1 = new PathMatcher( entries2, 2 );
- final PathMatcher wl2 = new PathMatcher( entries2, 3 );
- final PathMatcher wl3 = new PathMatcher( entries2, 4 );
+ final PathMatcher pm1 = new PathMatcher( entries2, 2 );
+ final PathMatcher pm2 = new PathMatcher( entries2, 3 );
+ final PathMatcher pm3 = new PathMatcher( entries2, 4 );
// wl1 is 2 deep, so whatever is on level 3+ is neglected
- check( wl1, "/A/1/X/3/4/5/6/7/8/9/0", true );
- check( wl1, "/B/1/X/3/4/5/6/7/8/9/0", true );
- check( wl1, "/C/1/X/3/4/5/6/7/8/9/0", true );
- check( wl1, "/D/1/X/3/4/5/6/7/8/9/0", true );
- check( wl1, "/E/1/X/3/4/5/6/7/8/9/0", true );
- check( wl1, "/F/1/X/3/4/5/6/7/8/9/0", false );
-
- check( wl1, "/A/1/2/X/4/5/6/7/8/9/0", true );
- check( wl1, "/B/1/2/X/4/5/6/7/8/9/0", true );
- check( wl1, "/C/1/2/X/4/5/6/7/8/9/0", true );
- check( wl1, "/D/1/2/X/4/5/6/7/8/9/0", true );
- check( wl1, "/E/1/2/X/4/5/6/7/8/9/0", true );
- check( wl1, "/F/1/2/X/4/5/6/7/8/9/0", false );
-
- check( wl1, "/A/1/2/3/X/5/6/7/8/9/0", true );
- check( wl1, "/B/1/2/3/X/5/6/7/8/9/0", true );
- check( wl1, "/C/1/2/3/X/5/6/7/8/9/0", true );
- check( wl1, "/D/1/2/3/X/5/6/7/8/9/0", true );
- check( wl1, "/E/1/2/3/X/5/6/7/8/9/0", true );
- check( wl1, "/F/1/2/3/X/5/6/7/8/9/0", false );
+ check( pm1, "/A/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm1, "/B/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm1, "/C/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm1, "/D/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm1, "/E/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm1, "/F/1/X/3/4/5/6/7/8/9/0", false );
+
+ check( pm1, "/A/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm1, "/B/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm1, "/C/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm1, "/D/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm1, "/E/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm1, "/F/1/2/X/4/5/6/7/8/9/0", false );
+
+ check( pm1, "/A/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm1, "/B/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm1, "/C/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm1, "/D/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm1, "/E/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm1, "/F/1/2/3/X/5/6/7/8/9/0", false );
// wl2 is 3 deep
- check( wl2, "/A/1/X/3/4/5/6/7/8/9/0", true );
- check( wl2, "/B/1/X/3/4/5/6/7/8/9/0", false );
- check( wl2, "/C/1/X/3/4/5/6/7/8/9/0", false );
- check( wl2, "/D/1/X/3/4/5/6/7/8/9/0", false );
- check( wl2, "/E/1/X/3/4/5/6/7/8/9/0", false );
- check( wl2, "/F/1/X/3/4/5/6/7/8/9/0", false );
-
- check( wl2, "/A/1/2/X/4/5/6/7/8/9/0", true );
- check( wl2, "/B/1/2/X/4/5/6/7/8/9/0", true );
- check( wl2, "/C/1/2/X/4/5/6/7/8/9/0", true );
- check( wl2, "/D/1/2/X/4/5/6/7/8/9/0", true );
- check( wl2, "/E/1/2/X/4/5/6/7/8/9/0", true );
- check( wl2, "/F/1/2/X/4/5/6/7/8/9/0", false );
-
- check( wl2, "/A/1/2/3/X/5/6/7/8/9/0", true );
- check( wl2, "/B/1/2/3/X/5/6/7/8/9/0", true );
- check( wl2, "/C/1/2/3/X/5/6/7/8/9/0", true );
- check( wl2, "/D/1/2/3/X/5/6/7/8/9/0", true );
- check( wl2, "/E/1/2/3/X/5/6/7/8/9/0", true );
- check( wl2, "/F/1/2/3/X/5/6/7/8/9/0", false );
+ check( pm2, "/A/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm2, "/B/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm2, "/C/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm2, "/D/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm2, "/E/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm2, "/F/1/X/3/4/5/6/7/8/9/0", false );
+
+ check( pm2, "/A/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm2, "/B/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm2, "/C/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm2, "/D/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm2, "/E/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm2, "/F/1/2/X/4/5/6/7/8/9/0", false );
+
+ check( pm2, "/A/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm2, "/B/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm2, "/C/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm2, "/D/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm2, "/E/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm2, "/F/1/2/3/X/5/6/7/8/9/0", false );
// wl3 is 4 deep
- check( wl3, "/A/1/X/3/4/5/6/7/8/9/0", true );
- check( wl3, "/B/1/X/3/4/5/6/7/8/9/0", false );
- check( wl3, "/C/1/X/3/4/5/6/7/8/9/0", false );
- check( wl3, "/D/1/X/3/4/5/6/7/8/9/0", false );
- check( wl3, "/E/1/X/3/4/5/6/7/8/9/0", false );
- check( wl3, "/F/1/X/3/4/5/6/7/8/9/0", false );
-
- check( wl3, "/A/1/2/X/4/5/6/7/8/9/0", true );
- check( wl3, "/B/1/2/X/4/5/6/7/8/9/0", true );
- check( wl3, "/C/1/2/X/4/5/6/7/8/9/0", false );
- check( wl3, "/D/1/2/X/4/5/6/7/8/9/0", false );
- check( wl3, "/E/1/2/X/4/5/6/7/8/9/0", false );
- check( wl3, "/F/1/2/X/4/5/6/7/8/9/0", false );
-
- check( wl3, "/A/1/2/3/X/5/6/7/8/9/0", true );
- check( wl3, "/B/1/2/3/X/5/6/7/8/9/0", true );
- check( wl3, "/C/1/2/3/X/5/6/7/8/9/0", true );
- check( wl3, "/D/1/2/3/X/5/6/7/8/9/0", true );
- check( wl3, "/E/1/2/3/X/5/6/7/8/9/0", true );
- check( wl3, "/F/1/2/3/X/5/6/7/8/9/0", false );
+ check( pm3, "/A/1/X/3/4/5/6/7/8/9/0", true );
+ check( pm3, "/B/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm3, "/C/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm3, "/D/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm3, "/E/1/X/3/4/5/6/7/8/9/0", false );
+ check( pm3, "/F/1/X/3/4/5/6/7/8/9/0", false );
+
+ check( pm3, "/A/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm3, "/B/1/2/X/4/5/6/7/8/9/0", true );
+ check( pm3, "/C/1/2/X/4/5/6/7/8/9/0", false );
+ check( pm3, "/D/1/2/X/4/5/6/7/8/9/0", false );
+ check( pm3, "/E/1/2/X/4/5/6/7/8/9/0", false );
+ check( pm3, "/F/1/2/X/4/5/6/7/8/9/0", false );
+
+ check( pm3, "/A/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm3, "/B/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm3, "/C/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm3, "/D/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm3, "/E/1/2/3/X/5/6/7/8/9/0", true );
+ check( pm3, "/F/1/2/3/X/5/6/7/8/9/0", false );
}
@Test
public void testLeastSpecificWinsMaxDepth3()
{
- final PathMatcher wl = new PathMatcher( Arrays.asList( "/a/b/c", "/a/b/c/d/e", "/a/b" ), 3 );
- check( wl, "/a/b/c/d/e", true );
- check( wl, "/a/b/c/d", true );
- check( wl, "/a/b/c", true );
- check( wl, "/a/b", true ); // "/a/b" won
- check( wl, "/a", false );
- assertThat( wl.contains( "/a" ), is( true ) );
- check( wl, "/a/X", false );
- assertThat( wl.contains( "/a/X" ), is( false ) );
+ final PathMatcher pm = new PathMatcher( Arrays.asList( "/a/b/c", "/a/b/c/d/e", "/a/b" ), 3 );
+ check( pm, "/a/b/c/d/e", true );
+ check( pm, "/a/b/c/d", true );
+ check( pm, "/a/b/c", true );
+ check( pm, "/a/b", true ); // "/a/b" won
+ check( pm, "/a", false );
+ assertThat( pm.contains( "/a" ), is( true ) );
+ check( pm, "/a/X", false );
+ assertThat( pm.contains( "/a/X" ), is( false ) );
}
@Test
public void testLeastSpecificWinsMaxDepth2()
{
- final PathMatcher wl = new PathMatcher( Arrays.asList( "/a/b/c", "/a/b/c/d/e", "/a/b" ), 2 );
- check( wl, "/a/b/c/d/e", true );
- check( wl, "/a/b/c/d", true );
- check( wl, "/a/b/c", true );
- check( wl, "/a/b", true ); // "/a/b" won
- check( wl, "/a", false );
- assertThat( wl.contains( "/a" ), is( true ) );
- check( wl, "/a/c", false );
- assertThat( wl.contains( "/a/c" ), is( false ) );
- check( wl, "/X", false );
- assertThat( wl.contains( "/X" ), is( false ) );
+ final PathMatcher pm = new PathMatcher( Arrays.asList( "/a/b/c", "/a/b/c/d/e", "/a/b" ), 2 );
+ check( pm, "/a/b/c/d/e", true );
+ check( pm, "/a/b/c/d", true );
+ check( pm, "/a/b/c", true );
+ check( pm, "/a/b", true ); // "/a/b" won
+ check( pm, "/a", false );
+ assertThat( pm.contains( "/a" ), is( true ) );
+ check( pm, "/a/c", false );
+ assertThat( pm.contains( "/a/c" ), is( false ) );
+ check( pm, "/X", false );
+ assertThat( pm.contains( "/X" ), is( false ) );
}
@Test
public void testLeastSpecificWinsMaxDepth2EntriesLongerThenDepth()
{
- final PathMatcher wl = new PathMatcher( Arrays.asList( "/a/b/c/d/e", "/a/b/c/d/e/f", "/a/b/c" ), 2 );
- check( wl, "/a/b/c/d/e", true );
- check( wl, "/a/b/c/d", true );
- check( wl, "/a/b/c", true );
- check( wl, "/a/b", true ); // "/a/b" won
- check( wl, "/a", false );
- assertThat( wl.contains( "/a" ), is( true ) );
- check( wl, "/a/c", false );
- assertThat( wl.contains( "/a/c" ), is( false ) );
- check( wl, "/X", false );
- assertThat( wl.contains( "/X" ), is( false ) );
+ final PathMatcher pm = new PathMatcher( Arrays.asList( "/a/b/c/d/e", "/a/b/c/d/e/f", "/a/b/c" ), 2 );
+ check( pm, "/a/b/c/d/e", true );
+ check( pm, "/a/b/c/d", true );
+ check( pm, "/a/b/c", true );
+ check( pm, "/a/b", true ); // "/a/b" won
+ check( pm, "/a", false );
+ assertThat( pm.contains( "/a" ), is( true ) );
+ check( pm, "/a/c", false );
+ assertThat( pm.contains( "/a/c" ), is( false ) );
+ check( pm, "/X", false );
+ assertThat( pm.contains( "/X" ), is( false ) );
}
}
View
31 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/routing/internal/PrefixFileMaintenanceTest.java
@@ -108,19 +108,19 @@ protected boolean enableAutomaticRoutingFeature()
return true;
}
- protected Manager wlManager;
+ protected Manager manager;
@Before
public void prepare()
throws Exception
{
- wlManager = lookup( Manager.class );
+ manager = lookup( Manager.class );
}
protected List<String> getEntriesOf( final MavenRepository mavenRepository )
throws IOException
{
- final PrefixSource entrySource = wlManager.getPrefixSourceFor( mavenRepository );
+ final PrefixSource entrySource = manager.getPrefixSourceFor( mavenRepository );
final ArrayList<String> result = new ArrayList<String>( entrySource.readEntries() );
Collections.sort( result );
return result;
@@ -148,13 +148,13 @@ protected void removeSomeContent( final MavenRepository mavenRepository, final L
}
/**
- * Test is WL maintained properly during content changes in hosted repository (only type where we maintain WL based
- * on deploys or deletions). But, there is a trick: when you delete an artifact (by using "direct" full URL like the
- * one you deployed it with), Nexus will leave parent directories empty. While when crawling this is handled (we
- * crawl all way down to content, but "cut the tree" at needed level), with events in case of DELETE is not so
- * simple. First, if you delete the given artifact only, Nexus will leave parent directories untouched even if they
- * are empty, no events will be emitted. So, entry deletion only works in cases when: a) the given folder is deleted
- * that is in the whitelist (see in test), OR, b) full update of given hosted repo is done.
+ * Test is prefix list maintained properly during content changes in hosted repository (only type where we maintain
+ * prefix list based on deploys or deletions). But, there is a trick: when you delete an artifact (by using "direct"
+ * full URL like the one you deployed it with), Nexus will leave parent directories empty. While when crawling this
+ * is handled (we crawl all way down to content, but "cut the tree" at needed level), with events in case of DELETE
+ * is not so simple. First, if you delete the given artifact only, Nexus will leave parent directories untouched
+ * even if they are empty, no events will be emitted. So, entry deletion only works in cases when: a) the given
+ * folder is deleted that is in the whitelist (see in test), OR, b) full update of given hosted repo is done.
*
* @throws Exception
*/
@@ -165,7 +165,7 @@ public void smoke()
final MavenHostedRepository mavenRepository =
getRepositoryRegistry().getRepositoryWithFacet( REPO_ID, MavenHostedRepository.class );
- // initially WL is empty
+ // initially prefix list is empty
{
final List<String> entries = getEntriesOf( mavenRepository );
assertThat( entries, hasSize( 0 ) );
@@ -193,8 +193,9 @@ public void smoke()
"/com/sonatype", "/org/apache", "/org/sonatype" ) );
}
- // PATHS3 contains full paths, but WL contains "/org/sonatype" and nothing will emit event carrying that path!
- // so, the WL remains unchanged!
+ // PATHS3 contains full paths, but prefix list contains "/org/sonatype" and nothing will emit event carrying
+ // that path!
+ // so, the prefix list remains unchanged!
removeSomeContent( mavenRepository, PATHS3 );
{
@@ -207,7 +208,7 @@ public void smoke()
}
// by deleting given folder, we will get the needed result.
- // WL entry "/org/sonatype" should be removed as we deleted the "/org/sonatype" folder
+ // prefix list entry "/org/sonatype" should be removed as we deleted the "/org/sonatype" folder
removeSomeContent( mavenRepository, Arrays.asList( "/org/sonatype" ) );
{
@@ -220,7 +221,7 @@ public void smoke()
}
// by deleting a parent of the given folder, we will also get the needed result.
- // WL entry "/com/sonatype" should be removed as we deleted the "/com" folder
+ // prefix list entry "/com/sonatype" should be removed as we deleted the "/com" folder
removeSomeContent( mavenRepository, Arrays.asList( "/com" ) );
{
View
30 ...st/java/org/sonatype/nexus/proxy/maven/routing/internal/PrefixFileUpdatePropagationGroupUpdatesTest.java
@@ -63,21 +63,21 @@
private static final String GROUP2_REPO_ID = "group2";
- private final WLUpdateListener wlUpdateListener;
+ private final PrefixFileUpdateListener prefixFileUpdateListener;
public PrefixFileUpdatePropagationGroupUpdatesTest()
throws Exception
{
- this.wlUpdateListener = new WLUpdateListener();
+ this.prefixFileUpdateListener = new PrefixFileUpdateListener();
}
- protected static class WLUpdateListener
+ protected static class PrefixFileUpdateListener
{
private final List<String> publishedIds;
private final List<String> unpublishedIds;
- public WLUpdateListener()
+ public PrefixFileUpdateListener()
{
this.publishedIds = new ArrayList<String>();
this.unpublishedIds = new ArrayList<String>();
@@ -231,7 +231,7 @@ public void buildEnvironment( AbstractProxyTestEnvironment env )
}
// register it here BEFORE boot process starts but plx is already created
- container.lookup( EventBus.class ).register( wlUpdateListener );
+ container.lookup( EventBus.class ).register( prefixFileUpdateListener );
}
};
}
@@ -255,10 +255,10 @@ public void testUpdateCountOnBootWithoutWL()
// or
// HOSTED1, HOSTED2, GROUP1, GROUP1, GROUP2, GROUP...
// (group1 one or two times updated).
- assertThat( wlUpdateListener.getPublished(), hasItem( HOSTED1_REPO_ID ) );
- assertThat( wlUpdateListener.getPublished(), hasItem( HOSTED2_REPO_ID ) );
- assertThat( wlUpdateListener.getPublished(), hasItem( GROUP1_REPO_ID ) );
- assertThat( wlUpdateListener.getPublished(), hasItem( GROUP2_REPO_ID ) );
+ assertThat( prefixFileUpdateListener.getPublished(), hasItem( HOSTED1_REPO_ID ) );
+ assertThat( prefixFileUpdateListener.getPublished(), hasItem( HOSTED2_REPO_ID ) );
+ assertThat( prefixFileUpdateListener.getPublished(), hasItem( GROUP1_REPO_ID ) );
+ assertThat( prefixFileUpdateListener.getPublished(), hasItem( GROUP2_REPO_ID ) );
}
@Test
@@ -268,7 +268,7 @@ public void testUpdateCountOnGroupMemberChange()
// in case of group member changes, the "cascade" is sync, hence
// we have no ordering problem as we have with async updates of proxy/hosted
// reposes on boot
- wlUpdateListener.reset();
+ prefixFileUpdateListener.reset();
final MavenGroupRepository mgr =
getRepositoryRegistry().getRepositoryWithFacet( GROUP1_REPO_ID, MavenGroupRepository.class );
@@ -277,13 +277,13 @@ public void testUpdateCountOnGroupMemberChange()
getApplicationConfiguration().saveConfiguration();
waitForRoutingBackgroundUpdates();
- assertThat( wlUpdateListener.getPublished(), contains( GROUP1_REPO_ID, GROUP2_REPO_ID ) );
+ assertThat( prefixFileUpdateListener.getPublished(), contains( GROUP1_REPO_ID, GROUP2_REPO_ID ) );
mgr.addMemberRepositoryId( HOSTED1_REPO_ID );
getApplicationConfiguration().saveConfiguration();
waitForRoutingBackgroundUpdates();
- assertThat( wlUpdateListener.getPublished(),
+ assertThat( prefixFileUpdateListener.getPublished(),
contains( GROUP1_REPO_ID, GROUP2_REPO_ID, GROUP1_REPO_ID, GROUP2_REPO_ID ) );
}
@@ -294,7 +294,7 @@ public void testUpdateCountOnGroupOfGroupMemberChange()
// in case of group member changes, the "cascade" is sync, hence
// we have no ordering problem as we have with async updates of proxy/hosted
// reposes on boot
- wlUpdateListener.reset();
+ prefixFileUpdateListener.reset();
final MavenGroupRepository mgr =
getRepositoryRegistry().getRepositoryWithFacet( GROUP2_REPO_ID, MavenGroupRepository.class );
@@ -304,13 +304,13 @@ public void testUpdateCountOnGroupOfGroupMemberChange()
getApplicationConfiguration().saveConfiguration();
waitForRoutingBackgroundUpdates();
- assertThat( wlUpdateListener.getPublished(), contains( GROUP2_REPO_ID ) );
+ assertThat( prefixFileUpdateListener.getPublished(), contains( GROUP2_REPO_ID ) );
mgr.addMemberRepositoryId( HOSTED2_REPO_ID );
getApplicationConfiguration().saveConfiguration();
waitForRoutingBackgroundUpdates();
- assertThat( wlUpdateListener.getPublished(),
+ assertThat( prefixFileUpdateListener.getPublished(),
contains( GROUP2_REPO_ID, GROUP2_REPO_ID ) );
}
}
View
8 ...-it-helper-plugin/src/main/java/org/sonatype/nexus/plugins/routing/api/RoutingWaitForPlexusResource.java
@@ -44,12 +44,12 @@
private static final String RESOURCE_URI = "/routing/waitFor";
- private final Manager wlManager;
+ private final Manager manager;
@Inject
- public RoutingWaitForPlexusResource( final Manager wlManager )
+ public RoutingWaitForPlexusResource( final Manager manager )
{
- this.wlManager = checkNotNull( wlManager );
+ this.manager = checkNotNull( manager );
}
@Override
@@ -80,7 +80,7 @@ public Object get( Context context, Request request, Response response, Variant
final long startTime = System.currentTimeMillis();
while ( System.currentTimeMillis() - startTime <= timeout )
{
- if ( !( (ManagerImpl) wlManager ).isUpdatePrefixFileJobRunning() )
+ if ( !( (ManagerImpl) manager ).isUpdatePrefixFileJobRunning() )
{
response.setStatus( Status.SUCCESS_OK );
return "Ok";
View
8 nexus-test/nexus-test-harness-launcher/src/main/java/org/sonatype/nexus/test/booter/Jetty8NexusBooter.java
@@ -157,11 +157,11 @@ public Jetty8NexusBooter( final File bundleBasedir, final int port )
// sort of "try-wait-try-failAfterSomeRetries" the search operation itself.
System.setProperty( "mavenIndexerBlockingCommits", Boolean.TRUE.toString() );
- // Note: WL initialization prevented
+ // Note: autorouting initialization prevented
// Presence breaks many ITs, especially those that either listen for proxy requests (will be more coz of prefix file
- // and scrape discovery), or because remote proxy setup happens after nexus boot, and WL discovery makes proxies autoblock.
- // In either case, IT working with WL should explicitly enable it.
- // As "legacy" ITs are coming anyway from pre-WL era, they will have WL disabled ALWAYS
+ // and scrape discovery), or because remote proxy setup happens after nexus boot, and autorouting discovery makes proxies autoblock.
+ // In either case, IT working with autorouting should explicitly enable it.
+ // As "legacy" ITs are coming anyway from pre-WL era, they will have autorouting disabled ALWAYS
// To write IT covering WL you'd use anyway the "new" IT infrastructure instead of this.
System.setProperty( ConfigImpl.FEATURE_ACTIVE_KEY, Boolean.FALSE.toString() );
View
6 ...estlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/rest/routing/RoutingConfigResource.java
@@ -39,7 +39,7 @@
import com.google.common.primitives.Ints;
/**
- * WL Configuration REST resource, usable only on Maven Proxy repositories.
+ * Autorouting Configuration REST resource, usable only on Maven Proxy repositories.
*
* @author cstamas
* @since 2.4
@@ -74,7 +74,7 @@ public PathProtectionDescriptor getResourceProtection()
}
/**
- * Returns the current WL configuration for given repository.
+ * Returns the current autorouting configuration for given repository.
*/
@Override
@GET
@@ -94,7 +94,7 @@ public RoutingConfigMessageWrapper get( final Context context, final Request req
}
/**
- * Sets the WL configuration for given repository.
+ * Sets the autorouting configuration for given repository.
*/
@Override
@PUT
View
2  ...stlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/rest/routing/RoutingResourceSupport.java
@@ -23,7 +23,7 @@
import org.sonatype.nexus.rest.AbstractNexusPlexusResource;
/**
- * WL REST resource support.
+ * Autorouting REST resource support.
*
* @author cstamas
* @since 2.4
View
6 ...estlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/rest/routing/RoutingStatusResource.java
@@ -49,7 +49,7 @@
import com.google.common.primitives.Ints;
/**
- * WL Status REST resource.
+ * Autorouting Status REST resource.
*
* @author cstamas
* @since 2.4
@@ -178,8 +178,8 @@ public RoutingStatusMessageWrapper get( final Context context, final Request req
}
/**
- * Force updates WL for given repository. If invoked for non-Maven repository, or a Maven Group repository, response
- * is Bad Request.
+ * Force updates prefix list for given repository. If invoked for non-Maven repository, or a Maven Group repository,
+ * response is Bad Request.
*/
@Override
@DELETE
Please sign in to comment.
Something went wrong with that request. Please try again.