Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

NEXUS-5639: "Deep" rename WL to Routing

Initial code changes, bundle smoke tested and is working.

Tests and ITs not verified yet.
  • Loading branch information...
commit 2dbec3c14b99ba2ac92b698a7d4a5023981be033 1 parent a7444cd
Tamas Cservenak cstamas authored
Showing with 989 additions and 1,047 deletions.
  1. +22 −24 ...t-core-testsuite/src/test/java/org/sonatype/nexus/client/testsuite/{WhitelistIT.java → RoutingIT.java}
  2. +2 −2 ...c/main/java/org/sonatype/nexus/client/core/subsystem/{whitelist → routing}/DiscoveryConfiguration.java
  3. +9 −9 ...c/main/java/org/sonatype/nexus/client/core/subsystem/{whitelist/Whitelist.java → routing/Routing.java}
  4. +5 −5 ...s-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/{whitelist → routing}/Status.java
  5. +22 −22 ...us/client/internal/rest/jersey/subsystem/{whitelist/JerseyWhitelist.java → routing/JerseyRouting.java}
  6. +9 −9 .../sonatype/nexus/client/rest/jersey/subsystem/{JerseyWhitelistFactory.java → JerseyRoutingFactory.java}
  7. +4 −4 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepository.java
  8. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl/WLConfig.java → routing/Config.java}
  9. +3 −3 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl/WLDiscoveryConfig.java → routing/DiscoveryConfig.java}
  10. +4 −4 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl/WLDiscoveryStatus.java → routing/DiscoveryStatus.java}
  11. +15 −15 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl/WLManager.java → routing/Manager.java}
  12. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/PrefixSource.java
  13. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/ProxyRequestFilter.java
  14. +3 −3 .../main/java/org/sonatype/nexus/proxy/maven/{wl/WLPublishingStatus.java → routing/PublishingStatus.java}
  15. +8 −8 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl/WLStatus.java → routing/RoutingStatus.java}
  16. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/WritablePrefixSource.java
  17. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/DiscoveryResult.java
  18. +1 −1  ...core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/LocalContentDiscoverer.java
  19. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/Prioritized.java
  20. +1 −1  ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/RemoteContentDiscoverer.java
  21. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/RemoteStrategy.java
  22. +1 −1  ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/StrategyFailedException.java
  23. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/StrategyResult.java
  24. +4 −4 .../maven/{wl/events/AbstractWLRepositoryEvent.java → routing/events/AbstractRoutingRepositoryEvent.java}
  25. +11 −11 ...n/{wl/events/WLPublishedRepositoryEvent.java → routing/events/PrefixFilePublishedRepositoryEvent.java}
  26. +6 −6 ...l/events/WLUnpublishedRepositoryEvent.java → routing/events/PrefixFileUnpublishedRepositoryEvent.java}
  27. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/AbstractPrioritized.java
  28. +2 −2 ...-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/AbstractRemoteStrategy.java
  29. +2 −2 ...s-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/ArrayListPrefixSource.java
  30. +15 −15 ...java/org/sonatype/nexus/proxy/maven/{wl/internal/WLConfigImpl.java → routing/internal/ConfigImpl.java}
  31. +13 −13 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/EventDispatcher.java
  32. +9 −9 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/FilePrefixSource.java
  33. +1 −1  ...s-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/InvalidInputException.java
  34. +6 −6 ...e/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/LocalContentDiscovererImpl.java
  35. +92 −92 ...va/org/sonatype/nexus/proxy/maven/{wl/internal/WLManagerImpl.java → routing/internal/ManagerImpl.java}
  36. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PathMatcher.java
  37. +6 −6 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PropfileDiscoveryStatusSource.java
  38. +32 −32 ...-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/ProxyRequestFilterImpl.java
  39. +7 −7 .../src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteContentDiscovererImpl.java
  40. +10 −10 ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemotePrefixFileStrategy.java
  41. +10 −10 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteScrapeStrategy.java
  42. +3 −3 ...c/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/TextFilePrefixSourceMarshaller.java
  43. +6 −6 ...y/maven/{wl/internal/WLUpdateRepositoryRunnable.java → routing/internal/UpdateRepositoryRunnable.java}
  44. +9 −9 ...src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/WritablePrefixSourceModifier.java
  45. +5 −5 ...a/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AbstractGeneratedIndexPageScraper.java
  46. +3 −3 ...-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AbstractScraper.java
  47. +1 −1  .../src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AmazonS3IndexScraper.java
  48. +1 −1  ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/HttpdIndexScraper.java
  49. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/NexusScraper.java
  50. +1 −1  ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/NginxIndexScraper.java
  51. +1 −1  nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/Page.java
  52. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/ScrapeContext.java
  53. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/Scraper.java
  54. +1 −1  ...-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/SvnIndexScraper.java
  55. +4 −4 nexus-core/src/test/java/org/sonatype/nexus/NexusAppTestSupport.java
  56. +3 −3 nexus-core/src/test/java/org/sonatype/nexus/proxy/RequestFlagsTest.java
  57. +8 −7 ...us/proxy/maven/{wl/internal/AbstractWLProxyTest.java → routing/internal/AbstractRoutingProxyTest.java}
  58. +1 −1  ...core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/GenerateRandomBehaviour.java
  59. +5 −5 ...c/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/LocalContentDiscovererImplTest.java
  60. +2 −1  nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PathMatcherTest.java
  61. +8 −8 ...xus/proxy/maven/{wl/internal/WLMaintenanceTest.java → routing/internal/PrefixFileMaintenanceTest.java}
  62. +19 −19 ...al/WLUpdatePropagationContentTest.java → routing/internal/PrefixFileUpdatePropagationContentTest.java}
  63. +9 −9 ...ePropagationGroupUpdatesTest.java → routing/internal/PrefixFileUpdatePropagationGroupUpdatesTest.java}
  64. +10 −10 ...ven/{wl/internal/WLUpdatePropagationTest.java → routing/internal/PrefixFileUpdatePropagationTest.java}
  65. +8 −7 ...est/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PropfileDiscoveryStatusSourceTest.java
  66. +7 −5 ...e/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/ProxyRequestFilterImplTest.java
  67. +31 −30 .../test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteContentDiscovererImplTest.java
  68. +7 −5 ...rc/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemotePrefixFileIsGarbageTest.java
  69. +6 −5 ...src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemotePrefixFileStrategyTest.java
  70. +4 −3 ...ore/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteScrapeStrategyTest.java
  71. +26 −25 .../proxy/maven/{wl/internal/WLAndLocalStatusTest.java → routing/internal/RoutingAndLocalStatusTest.java}
  72. +26 −25 ...exus/proxy/maven/{wl/internal/WLAndProxyModeTest.java → routing/internal/RoutingAndProxyModeTest.java}
  73. +4 −2 ...st/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/TextFilePrefixSourceMarshallerTest.java
  74. +4 −3 ...test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/WritablePrefixSourceModifierTest.java
  75. +6 −2 .../test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AmazonS3IndexScraperTest.java
  76. +1 −1  ...core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/DeliverBehaviour.java
  77. +1 −1  .../test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/DeliverTemplateBehaviour.java
  78. +5 −2 ...core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/NexusScraperTest.java
  79. +4 −2 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/PageTest.java
  80. +5 −2 ...e/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/SvnIndexScraperTest.java
  81. +19 −19 ...-testsuite/src/test/java/core/{whitelist/WhitelistDisabledSmokeIT.java → routing/DisabledSmokeIT.java}
  82. +14 −14 ...list/WhitelistEnableDisableDoesNotLoosePeriodIT.java → routing/EnableDisableDoesNotLoosePeriodIT.java}
  83. +24 −24 ...xus-core-testsuite/src/test/java/core/{whitelist/WhitelistFilteringIT.java → routing/FilteringIT.java}
  84. +119 −0 nexus-test/nexus-core-testsuite/src/test/java/core/routing/ITSupport.java
  85. +11 −11 ...est/nexus-core-testsuite/src/test/java/core/{whitelist/WhitelistSanityIT.java → routing/SanityIT.java}
  86. +23 −23 ...-test/nexus-core-testsuite/src/test/java/core/{whitelist/WhitelistSmokeIT.java → routing/SmokeIT.java}
  87. +13 −13 ...rc/test/java/core/{whitelist/WhitelistWithGroupRepositoryIT.java → routing/WithGroupRepositoryIT.java}
  88. +7 −8 .../test/java/core/{whitelist/WhitelistWithHostedRepositoryIT.java → routing/WithHostedRepositoryIT.java}
  89. +16 −16 ...rc/test/java/core/{whitelist/WhitelistWithProxyRepositoryIT.java → routing/WithProxyRepositoryIT.java}
  90. +0 −202 nexus-test/nexus-core-testsuite/src/test/java/core/whitelist/WhitelistITSupport.java
  91. +9 −9 ...ns/{whitelist/api/WhitelistWaitForPlexusResource.java → routing/api/RoutingWaitForPlexusResource.java}
  92. +2 −2 ...est/nexus-test-harness-its/src/test/java/org/sonatype/nexus/integrationtests/nexus3860/AbstractCargoIT.java
  93. +2 −2 nexus-test/nexus-test-harness-launcher/src/main/java/org/sonatype/nexus/test/booter/Jetty8NexusBooter.java
  94. +11 −11 ...suite-client/src/main/java/org/sonatype/nexus/testsuite/client/{WhitelistTest.java → RoutingTest.java}
  95. +5 −4 ...ient/exception/{WhitelistJobsAreStillRunningException.java → RoutingJobsAreStillRunningException.java}
  96. +15 −15 .../java/org/sonatype/nexus/testsuite/client/internal/{JerseyWhitelistTest.java → JerseyRoutingTest.java}
  97. +9 −9 ...tsuite/client/rest/{JerseyWhitelistTestSubsystemFactory.java → JerseyRoutingTestSubsystemFactory.java}
  98. +6 −6 ...let1x/nexus-restlet1x-model/src/main/java/org/sonatype/nexus/rest/model/XStreamConfiguratorLightweight.java
  99. +21 −21 plugins/restlet1x/nexus-restlet1x-model/src/main/mdo/vos.xml
  100. +21 −21 ...src/main/java/org/sonatype/nexus/rest/{mwl/WLConfigResource.java → routing/RoutingConfigResource.java}
  101. +8 −8 ...c/main/java/org/sonatype/nexus/rest/{mwl/WLResourceSupport.java → routing/RoutingResourceSupport.java}
  102. +26 −26 ...src/main/java/org/sonatype/nexus/rest/{mwl/WLStatusResource.java → routing/RoutingStatusResource.java}
  103. +9 −9 .../java/org/sonatype/nexus/rest/{mwl/WLStatusResourceTest.java → routing/RoutingStatusResourceTest.java}
46 .../sonatype/nexus/client/testsuite/WhitelistIT.java → ...rg/sonatype/nexus/client/testsuite/RoutingIT.java
View
@@ -20,15 +20,13 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
-import java.util.concurrent.TimeUnit;
-
import org.junit.Test;
import org.sonatype.nexus.client.core.exception.NexusClientBadRequestException;
import org.sonatype.nexus.client.core.exception.NexusClientNotFoundException;
-import org.sonatype.nexus.client.core.subsystem.whitelist.DiscoveryConfiguration;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Status;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Status.Outcome;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Whitelist;
+import org.sonatype.nexus.client.core.subsystem.routing.DiscoveryConfiguration;
+import org.sonatype.nexus.client.core.subsystem.routing.Routing;
+import org.sonatype.nexus.client.core.subsystem.routing.Status;
+import org.sonatype.nexus.client.core.subsystem.routing.Status.Outcome;
/**
* Will not work until proxy404 merged into master, AND at least one CI build/deploys of that master, as it seems Sisu
@@ -36,30 +34,30 @@
*
* @author cstamas
*/
-public class WhitelistIT
+public class RoutingIT
extends NexusClientITSupport
{
- public WhitelistIT( final String nexusBundleCoordinates )
+ public RoutingIT( final String nexusBundleCoordinates )
{
super( nexusBundleCoordinates );
}
- private Whitelist whitelist()
+ private Routing routing()
{
- return client().getSubsystem( Whitelist.class );
+ return client().getSubsystem( Routing.class );
}
@Test( expected = NexusClientNotFoundException.class )
public void getNonExistentStatus()
{
- final Status status = whitelist().getWhitelistStatus( "no-such-repo-id" );
+ final Status status = routing().getStatus( "no-such-repo-id" );
}
@Test
public void getReleaseStatus()
{
- final Status status = whitelist().getWhitelistStatus( "releases" );
+ final Status status = routing().getStatus( "releases" );
assertThat( status, is( not( nullValue() ) ) );
assertThat( status.getPublishedStatus(), equalTo( Outcome.SUCCEEDED ) );
assertThat( status.getPublishedMessage(), is( notNullValue() ) );
@@ -70,7 +68,7 @@ public void getReleaseStatus()
@Test
public void getSnapshotsStatus()
{
- final Status status = whitelist().getWhitelistStatus( "snapshots" );
+ final Status status = routing().getStatus( "snapshots" );
assertThat( status, is( not( nullValue() ) ) );
assertThat( status.getPublishedStatus(), equalTo( Outcome.SUCCEEDED ) );
assertThat( status.getPublishedMessage(), is( notNullValue() ) );
@@ -81,19 +79,19 @@ public void getSnapshotsStatus()
@Test( expected = NexusClientBadRequestException.class )
public void getCentralM1Status()
{
- final Status status = whitelist().getWhitelistStatus( "central-m1" );
+ final Status status = routing().getStatus( "central-m1" );
}
@Test( expected = NexusClientNotFoundException.class )
public void getNonExistentConfig()
{
- final DiscoveryConfiguration config = whitelist().getDiscoveryConfigurationFor( "no-such-repo-id" );
+ final DiscoveryConfiguration config = routing().getDiscoveryConfigurationFor( "no-such-repo-id" );
}
@Test
public void getCentralDefaultConfig()
{
- final DiscoveryConfiguration config = whitelist().getDiscoveryConfigurationFor( "central" );
+ final DiscoveryConfiguration config = routing().getDiscoveryConfigurationFor( "central" );
assertThat( config, is( notNullValue() ) );
assertThat( config.isEnabled(), is( true ) );
assertThat( config.getIntervalHours(), is( 24 ) );
@@ -103,13 +101,13 @@ public void getCentralDefaultConfig()
public void modifyDiscoveryConfig()
{
{
- final DiscoveryConfiguration config = whitelist().getDiscoveryConfigurationFor( "central" );
+ final DiscoveryConfiguration config = routing().getDiscoveryConfigurationFor( "central" );
config.setEnabled( false );
config.setIntervalHours( 12 );
- whitelist().setDiscoveryConfigurationFor( "central", config );
+ routing().setDiscoveryConfigurationFor( "central", config );
}
{
- final DiscoveryConfiguration config = whitelist().getDiscoveryConfigurationFor( "central" );
+ final DiscoveryConfiguration config = routing().getDiscoveryConfigurationFor( "central" );
assertThat( config.isEnabled(), is( false ) );
assertThat( config.getIntervalHours(), is( 12 ) );
}
@@ -118,30 +116,30 @@ public void modifyDiscoveryConfig()
@Test
public void updateReleases()
{
- whitelist().updateWhitelist( "releases" );
+ routing().updatePrefixFile( "releases" );
}
@Test
public void updateSnapshots()
{
- whitelist().updateWhitelist( "snapshots" );
+ routing().updatePrefixFile( "snapshots" );
}
@Test
public void updateCentral()
{
- whitelist().updateWhitelist( "central" );
+ routing().updatePrefixFile( "central" );
}
@Test( expected = NexusClientBadRequestException.class )
public void updateCentralM1()
{
- whitelist().updateWhitelist( "central-m1" );
+ routing().updatePrefixFile( "central-m1" );
}
@Test( expected = NexusClientNotFoundException.class )
public void updateNonExistent()
{
- whitelist().updateWhitelist( "no-such-repo-id" );
+ routing().updatePrefixFile( "no-such-repo-id" );
}
}
4 ...e/subsystem/whitelist/DiscoveryConfiguration.java → ...ore/subsystem/routing/DiscoveryConfiguration.java
View
@@ -10,12 +10,12 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.client.core.subsystem.whitelist;
+package org.sonatype.nexus.client.core.subsystem.routing;
import static com.google.common.base.Preconditions.checkArgument;
/**
- * The whitelist discovery configuration for a proxy repository.
+ * The routing discovery configuration for a proxy repository.
*
* @author cstamas
* @since 2.4
18 ...us/client/core/subsystem/whitelist/Whitelist.java → .../nexus/client/core/subsystem/routing/Routing.java
View
@@ -10,39 +10,39 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.client.core.subsystem.whitelist;
+package org.sonatype.nexus.client.core.subsystem.routing;
import org.sonatype.nexus.client.core.exception.NexusClientErrorResponseException;
import org.sonatype.nexus.client.core.exception.NexusClientNotFoundException;
/**
- * Client subsystem for Nexus Whitelist feature.
+ * Client subsystem for Nexus Automatic Routing feature.
*
* @author cstamas
* @since 2.4
*/
-public interface Whitelist
+public interface Routing
{
/**
- * Returns the status of the Whitelist of a Maven Repository (proxy, hosted or group).
+ * Returns the status of the Automatic Routing of a Maven Repository (proxy, hosted or group).
*
* @param mavenRepositoryId the ID of the Maven repository you want get status for.
* @return the status for given repository.
* @throws NexusClientNotFoundException if the passed in ID does not exists.
*/
- Status getWhitelistStatus( String mavenRepositoryId );
+ Status getStatus( String mavenRepositoryId );
/**
- * Perform a forced update of the Whitelist of a Maven repository. This method returns immediately, but it spawns a
- * background operation on Nexus that will perform the update and it's outcome will be reflected in status when
+ * Perform a forced update of the prefix file of a Maven repository. This method returns immediately, but it spawns
+ * a background operation on Nexus that will perform the update and it's outcome will be reflected in status when
* update is done.
*
- * @param mavenRepositoryId the ID of the Maven Repository you want update the whitelist for (see throws for what
+ * @param mavenRepositoryId the ID of the Maven Repository you want update the prefix file for (see throws for what
* kind of repositories this call is allowed).
* @throws NexusClientErrorResponseException if the passed in ID is not a Maven Proxy repository.
* @throws NexusClientNotFoundException if the passed in ID does not exists.
*/
- void updateWhitelist( String mavenRepositoryId )
+ void updatePrefixFile( String mavenRepositoryId )
throws NexusClientErrorResponseException, NexusClientNotFoundException;
/**
10 ...nexus/client/core/subsystem/whitelist/Status.java → ...e/nexus/client/core/subsystem/routing/Status.java
View
@@ -10,10 +10,10 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.client.core.subsystem.whitelist;
+package org.sonatype.nexus.client.core.subsystem.routing;
/**
- * The whitelist status for a Maven repository.
+ * The routing status for a Maven repository.
*
* @author cstamas
* @since 2.4
@@ -42,7 +42,7 @@
}
/**
- * The whitelist discovery status for a Maven Proxy repository.
+ * The routing discovery status for a Maven Proxy repository.
*/
public static class DiscoveryStatus
{
@@ -175,7 +175,7 @@ public long getDiscoveryLastRunTimestamp()
private final long publishedTimestamp;
/**
- * The URL of the published WL prefix file or {@code null} if not published.
+ * The URL of the published prefix file or {@code null} if not published.
*/
private final String publishedUrl;
@@ -234,7 +234,7 @@ public long getPublishedTimestamp()
}
/**
- * Returns the URL of the published whitelist file, or {@code null} if not published.
+ * Returns the URL of the published prefix file, or {@code null} if not published.
*
* @return the prefix file URL if published, or {@code null}.
*/
44 ...t/jersey/subsystem/whitelist/JerseyWhitelist.java → .../rest/jersey/subsystem/routing/JerseyRouting.java
View
@@ -10,37 +10,37 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.client.internal.rest.jersey.subsystem.whitelist;
+package org.sonatype.nexus.client.internal.rest.jersey.subsystem.routing;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.sonatype.nexus.client.core.exception.NexusClientNotFoundException;
import org.sonatype.nexus.client.core.spi.SubsystemSupport;
-import org.sonatype.nexus.client.core.subsystem.whitelist.DiscoveryConfiguration;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Status;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Status.DiscoveryStatus;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Status.Outcome;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Whitelist;
+import org.sonatype.nexus.client.core.subsystem.routing.DiscoveryConfiguration;
+import org.sonatype.nexus.client.core.subsystem.routing.Routing;
+import org.sonatype.nexus.client.core.subsystem.routing.Status;
+import org.sonatype.nexus.client.core.subsystem.routing.Status.DiscoveryStatus;
+import org.sonatype.nexus.client.core.subsystem.routing.Status.Outcome;
import org.sonatype.nexus.client.rest.jersey.JerseyNexusClient;
-import org.sonatype.nexus.rest.model.WLConfigMessage;
-import org.sonatype.nexus.rest.model.WLConfigMessageWrapper;
-import org.sonatype.nexus.rest.model.WLStatusMessage;
-import org.sonatype.nexus.rest.model.WLStatusMessageWrapper;
+import org.sonatype.nexus.rest.model.RoutingConfigMessage;
+import org.sonatype.nexus.rest.model.RoutingConfigMessageWrapper;
+import org.sonatype.nexus.rest.model.RoutingStatusMessage;
+import org.sonatype.nexus.rest.model.RoutingStatusMessageWrapper;
import com.google.common.base.Throwables;
import com.sun.jersey.api.client.ClientHandlerException;
import com.sun.jersey.api.client.UniformInterfaceException;
/**
- * Jersey based {@link Whitelist} implementation.
+ * Jersey based {@link Routing} implementation.
*
* @author cstamas
* @since 2.4
*/
-public class JerseyWhitelist
+public class JerseyRouting
extends SubsystemSupport<JerseyNexusClient>
- implements Whitelist
+ implements Routing
{
/**
@@ -48,18 +48,18 @@
*
* @param nexusClient
*/
- public JerseyWhitelist( final JerseyNexusClient nexusClient )
+ public JerseyRouting( final JerseyNexusClient nexusClient )
{
super( nexusClient );
}
@Override
- public Status getWhitelistStatus( final String mavenRepositoryId )
+ public Status getStatus( final String mavenRepositoryId )
{
try
{
- final WLStatusMessage message =
- getNexusClient().serviceResource( wlPath( mavenRepositoryId ) ).get( WLStatusMessageWrapper.class ).getData();
+ final RoutingStatusMessage message =
+ getNexusClient().serviceResource( wlPath( mavenRepositoryId ) ).get( RoutingStatusMessageWrapper.class ).getData();
final DiscoveryStatus discoveryStatus;
if ( message.getDiscovery() == null )
@@ -93,7 +93,7 @@ public Status getWhitelistStatus( final String mavenRepositoryId )
}
@Override
- public void updateWhitelist( final String mavenProxyRepositoryId )
+ public void updatePrefixFile( final String mavenProxyRepositoryId )
throws IllegalArgumentException, NexusClientNotFoundException
{
try
@@ -116,9 +116,9 @@ public DiscoveryConfiguration getDiscoveryConfigurationFor( final String mavenPr
{
try
{
- final WLConfigMessage message =
+ final RoutingConfigMessage message =
getNexusClient().serviceResource( wlConfigPath( mavenProxyRepositoryId ) ).get(
- WLConfigMessageWrapper.class ).getData();
+ RoutingConfigMessageWrapper.class ).getData();
return new DiscoveryConfiguration( message.isDiscoveryEnabled(), message.getDiscoveryIntervalHours() );
}
catch ( UniformInterfaceException e )
@@ -138,10 +138,10 @@ public void setDiscoveryConfigurationFor( final String mavenProxyRepositoryId,
{
try
{
- final WLConfigMessage message = new WLConfigMessage();
+ final RoutingConfigMessage message = new RoutingConfigMessage();
message.setDiscoveryEnabled( configuration.isEnabled() );
message.setDiscoveryIntervalHours( configuration.getIntervalHours() );
- final WLConfigMessageWrapper wrapper = new WLConfigMessageWrapper();
+ final RoutingConfigMessageWrapper wrapper = new RoutingConfigMessageWrapper();
wrapper.setData( message );
getNexusClient().serviceResource( wlConfigPath( mavenProxyRepositoryId ) ).put( wrapper );
}
18 ...rest/jersey/subsystem/JerseyWhitelistFactory.java → ...t/rest/jersey/subsystem/JerseyRoutingFactory.java
View
@@ -18,19 +18,19 @@
import org.sonatype.nexus.client.core.Condition;
import org.sonatype.nexus.client.core.condition.NexusStatusConditions;
import org.sonatype.nexus.client.core.spi.SubsystemFactory;
-import org.sonatype.nexus.client.core.subsystem.whitelist.Whitelist;
-import org.sonatype.nexus.client.internal.rest.jersey.subsystem.whitelist.JerseyWhitelist;
+import org.sonatype.nexus.client.core.subsystem.routing.Routing;
+import org.sonatype.nexus.client.internal.rest.jersey.subsystem.routing.JerseyRouting;
import org.sonatype.nexus.client.rest.jersey.JerseyNexusClient;
/**
- * Jersey based {@link Whitelist} subsystem factory.
+ * Jersey based {@link Routing} subsystem factory.
*
* @since 2.4
*/
@Named
@Singleton
-public class JerseyWhitelistFactory
- implements SubsystemFactory<Whitelist, JerseyNexusClient>
+public class JerseyRoutingFactory
+ implements SubsystemFactory<Routing, JerseyNexusClient>
{
@Override
public Condition availableWhen()
@@ -39,14 +39,14 @@ public Condition availableWhen()
}
@Override
- public Class<Whitelist> getType()
+ public Class<Routing> getType()
{
- return Whitelist.class;
+ return Routing.class;
}
@Override
- public Whitelist create( final JerseyNexusClient nexusClient )
+ public Routing create( final JerseyNexusClient nexusClient )
{
- return new JerseyWhitelist( nexusClient );
+ return new JerseyRouting( nexusClient );
}
}
8 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepository.java
View
@@ -47,8 +47,8 @@
import org.sonatype.nexus.proxy.item.uid.IsHiddenAttribute;
import org.sonatype.nexus.proxy.maven.EvictUnusedMavenItemsWalkerProcessor.EvictUnusedMavenItemsWalkerFilter;
import org.sonatype.nexus.proxy.maven.packaging.ArtifactPackagingMapper;
-import org.sonatype.nexus.proxy.maven.wl.ProxyRequestFilter;
-import org.sonatype.nexus.proxy.maven.wl.WLManager;
+import org.sonatype.nexus.proxy.maven.routing.ProxyRequestFilter;
+import org.sonatype.nexus.proxy.maven.routing.Manager;
import org.sonatype.nexus.proxy.repository.AbstractProxyRepository;
import org.sonatype.nexus.proxy.repository.DefaultRepositoryKind;
import org.sonatype.nexus.proxy.repository.HostedRepository;
@@ -464,7 +464,7 @@ protected boolean shouldTryRemote( final ResourceStoreRequest request )
if ( !uid.getBooleanAttributeValue( IsHiddenAttribute.class ) )
{
// but filter it only if request is not marked as NFS
- if ( !request.getRequestContext().containsKey( WLManager.WL_REQUEST_NFS_FLAG_KEY ) )
+ if ( !request.getRequestContext().containsKey( Manager.ROUTING_REQUEST_NFS_FLAG_KEY ) )
{
final boolean proxyFilterAllowed = getProxyRequestFilter().allowed( this, request );
if ( !proxyFilterAllowed )
@@ -598,7 +598,7 @@ private void putChecksumItem( Map<String, StorageItem> checksums, ResourceStoreR
protected boolean shouldAddToNotFoundCache( final ResourceStoreRequest request )
{
boolean shouldAddToNFC = super.shouldAddToNotFoundCache( request );
- if ( shouldAddToNFC && request.getRequestContext().containsKey( WLManager.WL_REQUEST_REJECTED_FLAG_KEY ) )
+ if ( shouldAddToNFC && request.getRequestContext().containsKey( Manager.ROUTING_REQUEST_REJECTED_FLAG_KEY ) )
{
// TODO: should we un-flag the request?
shouldAddToNFC = false;
4 ...a/org/sonatype/nexus/proxy/maven/wl/WLConfig.java → ...rg/sonatype/nexus/proxy/maven/routing/Config.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import java.util.List;
@@ -20,7 +20,7 @@
* @author cstamas
* @since 2.4
*/
-public interface WLConfig
+public interface Config
{
/**
* Returns {@code true} if feature is instance-wide active, {@code false} otherwise. This method is needed for UT
6 ...atype/nexus/proxy/maven/wl/WLDiscoveryConfig.java → ...pe/nexus/proxy/maven/routing/DiscoveryConfig.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import static com.google.common.base.Preconditions.checkArgument;
@@ -20,7 +20,7 @@
* @author cstamas
* @since 2.4
*/
-public class WLDiscoveryConfig
+public class DiscoveryConfig
{
private final boolean enabled;
@@ -32,7 +32,7 @@
* @param enabled
* @param discoveryInterval
*/
- public WLDiscoveryConfig( final boolean enabled, final long discoveryInterval )
+ public DiscoveryConfig( final boolean enabled, final long discoveryInterval )
{
checkArgument( discoveryInterval > 0, "Discovery interval must be strictly positive, greater than 0!" );
this.enabled = enabled;
8 ...atype/nexus/proxy/maven/wl/WLDiscoveryStatus.java → ...pe/nexus/proxy/maven/routing/DiscoveryStatus.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -21,7 +21,7 @@
* @author cstamas
* @since 2.4
*/
-public class WLDiscoveryStatus
+public class DiscoveryStatus
{
/**
* Remote discovery status enumeration.
@@ -88,7 +88,7 @@ public boolean isEnabled()
*
* @param status
*/
- public WLDiscoveryStatus( final DStatus status )
+ public DiscoveryStatus( final DStatus status )
{
checkArgument( status.ordinal() < DStatus.ENABLED_NOT_POSSIBLE.ordinal() );
this.status = checkNotNull( status );
@@ -105,7 +105,7 @@ public WLDiscoveryStatus( final DStatus status )
* @param lastDiscoveryMessage
* @param lastDiscoveryTimestamp
*/
- public WLDiscoveryStatus( final DStatus status, final String lastDiscoveryStrategy,
+ public DiscoveryStatus( final DStatus status, final String lastDiscoveryStrategy,
final String lastDiscoveryMessage, final long lastDiscoveryTimestamp )
{
checkArgument( status.ordinal() >= DStatus.ENABLED_NOT_POSSIBLE.ordinal() );
30 .../org/sonatype/nexus/proxy/maven/wl/WLManager.java → ...g/sonatype/nexus/proxy/maven/routing/Manager.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import java.io.IOException;
@@ -27,21 +27,21 @@
* @author cstamas
* @since 2.4
*/
-public interface WLManager
+public interface Manager
{
/**
* 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.
*/
- String WL_INITIATED_FILE_OPERATION_FLAG_KEY = WLManager.class.getName() + ".fileOperation";
+ String ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY = Manager.class.getName() + ".fileOperation";
/**
* Key that is put into {@link ResourceStoreRequest}'s context when {@link ProxyRequestFilter} rejects a request.
* Only the presence (or no presence) of this key is used for flagging, the value mapped under this key is
* irrelevant.
*/
- String WL_REQUEST_REJECTED_FLAG_KEY = WLManager.class.getName() + ".requestRejected";
+ String ROUTING_REQUEST_REJECTED_FLAG_KEY = Manager.class.getName() + ".requestRejected";
/**
* Key that when put into {@link ResourceStoreRequest}'s context, the given request becomes a
@@ -50,7 +50,7 @@
* 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.
*/
- String WL_REQUEST_NFS_FLAG_KEY = WLManager.class.getName() + ".requestNfs";
+ String ROUTING_REQUEST_NFS_FLAG_KEY = Manager.class.getName() + ".requestNfs";
/**
* Startup. This method should not be invoked by any code (maybe except in UTs).
@@ -68,7 +68,7 @@
*
* @param mavenRepository
*/
- void initializeWhitelist( MavenRepository mavenRepository );
+ void initializePrefixFile( MavenRepository mavenRepository );
/**
* Executes an update of WL for given repository. In case of {@link MavenProxyRepository} instance, it might not do
@@ -82,7 +82,7 @@
* @throws IllegalStateException when the passed in repository is unsupported, or for some reason not in state to be
* updated (out of service, or in case of proxy, it's proxyMode does not allow remote access and such).
*/
- boolean updateWhitelist( MavenRepository mavenRepository )
+ boolean updatePrefixFile( MavenRepository mavenRepository )
throws IllegalStateException;
/**
@@ -96,7 +96,7 @@ boolean updateWhitelist( MavenRepository mavenRepository )
* @throws IllegalStateException when the passed in repository is unsupported, or for some reason not in state to be
* updated (out of service, or in case of proxy, it's proxyMode does not allow remote access and such).
*/
- boolean forceUpdateWhitelist( MavenRepository mavenRepository )
+ boolean forceUpdatePrefixFile( MavenRepository mavenRepository )
throws IllegalStateException;
/**
@@ -110,7 +110,7 @@ boolean forceUpdateWhitelist( MavenRepository mavenRepository )
* @throws IllegalStateException when the passed in repository is unsupported, or for some reason not in state to be
* updated (out of service, or in case of proxy, it's proxyMode does not allow remote access and such).
*/
- void forceProxyQuickUpdateWhitelist( MavenProxyRepository mavenProxyRepository )
+ void forceProxyQuickUpdatePrefixFile( MavenProxyRepository mavenProxyRepository )
throws IllegalStateException;
/**
@@ -128,7 +128,7 @@ void forceProxyQuickUpdateWhitelist( MavenProxyRepository mavenProxyRepository )
* @param mavenRepository
* @return the status, never {@code null}.
*/
- WLStatus getStatusFor( MavenRepository mavenRepository );
+ RoutingStatus getStatusFor( MavenRepository mavenRepository );
/**
* Returns the current (in effect) configuration of the remote discovery for given {@link MavenProxyRepository}
@@ -137,7 +137,7 @@ void forceProxyQuickUpdateWhitelist( MavenProxyRepository mavenProxyRepository )
* @param mavenProxyRepository
* @return the configuration, never {@code null}.
*/
- WLDiscoveryConfig getRemoteDiscoveryConfig( MavenProxyRepository mavenProxyRepository );
+ DiscoveryConfig getRemoteDiscoveryConfig( MavenProxyRepository mavenProxyRepository );
/**
* Sets the current (in effect) configuration of the remote discovery for given {@link MavenProxyRepository}
@@ -147,7 +147,7 @@ void forceProxyQuickUpdateWhitelist( MavenProxyRepository mavenProxyRepository )
* @param config
* @throws IOException
*/
- void setRemoteDiscoveryConfig( MavenProxyRepository mavenProxyRepository, WLDiscoveryConfig config )
+ void setRemoteDiscoveryConfig( MavenProxyRepository mavenProxyRepository, DiscoveryConfig config )
throws IOException;
/**
@@ -159,7 +159,7 @@ void setRemoteDiscoveryConfig( MavenProxyRepository mavenProxyRepository, WLDisc
* @return {@code true} if WL was changed, {@code false} otherwise.
* @throws IOException in case of some IO problem.
*/
- boolean offerWLEntry( final MavenHostedRepository mavenHostedRepository, String entry )
+ boolean offerEntry( final MavenHostedRepository mavenHostedRepository, String entry )
throws IOException;
/**
@@ -171,7 +171,7 @@ boolean offerWLEntry( final MavenHostedRepository mavenHostedRepository, String
* @return {@code true} if WL was changed, {@code false} otherwise.
* @throws IOException in case of some IO problem.
*/
- boolean revokeWLEntry( final MavenHostedRepository mavenHostedRepository, String entry )
+ boolean revokeEntry( final MavenHostedRepository mavenHostedRepository, String entry )
throws IOException;
/**
@@ -211,5 +211,5 @@ void unpublish( MavenRepository mavenRepository )
* @param evt
* @return {@code true} if item event is about WL file.
*/
- boolean isEventAboutWLFile( final RepositoryItemEvent evt );
+ boolean isEventAboutPrefixFile( final RepositoryItemEvent evt );
}
2  ...g/sonatype/nexus/proxy/maven/wl/PrefixSource.java → ...atype/nexus/proxy/maven/routing/PrefixSource.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import java.io.IOException;
import java.util.List;
2  ...type/nexus/proxy/maven/wl/ProxyRequestFilter.java → ...nexus/proxy/maven/routing/ProxyRequestFilter.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import org.sonatype.nexus.proxy.ResourceStoreRequest;
import org.sonatype.nexus.proxy.maven.MavenProxyRepository;
6 ...type/nexus/proxy/maven/wl/WLPublishingStatus.java → ...e/nexus/proxy/maven/routing/PublishingStatus.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -20,7 +20,7 @@
* @author cstamas
* @since 2.4
*/
-public class WLPublishingStatus
+public class PublishingStatus
{
/**
* Status enumeration.
@@ -54,7 +54,7 @@
* @param lastPublishedTimestamp
* @param lastPublishedFilePath
*/
- public WLPublishingStatus( final PStatus status, final String lastPublishedMessage,
+ public PublishingStatus( final PStatus status, final String lastPublishedMessage,
final long lastPublishedTimestamp, final String lastPublishedFilePath )
{
this.status = checkNotNull( status );
16 ...a/org/sonatype/nexus/proxy/maven/wl/WLStatus.java → ...type/nexus/proxy/maven/routing/RoutingStatus.java
View
@@ -10,21 +10,21 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import static com.google.common.base.Preconditions.checkNotNull;
/**
- * WL Status.
+ * Routing Status.
*
* @author cstamas
* @since 2.4
*/
-public class WLStatus
+public class RoutingStatus
{
- private final WLPublishingStatus publishingStatus;
+ private final PublishingStatus publishingStatus;
- private final WLDiscoveryStatus discoveryStatus;
+ private final DiscoveryStatus discoveryStatus;
/**
* Constructor.
@@ -32,7 +32,7 @@
* @param publishingStatus
* @param discoveryStatus
*/
- public WLStatus( final WLPublishingStatus publishingStatus, final WLDiscoveryStatus discoveryStatus )
+ public RoutingStatus( final PublishingStatus publishingStatus, final DiscoveryStatus discoveryStatus )
{
this.publishingStatus = checkNotNull( publishingStatus );
this.discoveryStatus = checkNotNull( discoveryStatus );
@@ -43,7 +43,7 @@ public WLStatus( final WLPublishingStatus publishingStatus, final WLDiscoverySta
*
* @return the publishing status.
*/
- public WLPublishingStatus getPublishingStatus()
+ public PublishingStatus getPublishingStatus()
{
return publishingStatus;
}
@@ -53,7 +53,7 @@ public WLPublishingStatus getPublishingStatus()
*
* @return the discovery status.
*/
- public WLDiscoveryStatus getDiscoveryStatus()
+ public DiscoveryStatus getDiscoveryStatus()
{
return discoveryStatus;
}
2  ...pe/nexus/proxy/maven/wl/WritablePrefixSource.java → ...xus/proxy/maven/routing/WritablePrefixSource.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl;
+package org.sonatype.nexus.proxy.maven.routing;
import java.io.IOException;
4 ...xus/proxy/maven/wl/discovery/DiscoveryResult.java → ...roxy/maven/routing/discovery/DiscoveryResult.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -19,7 +19,7 @@
import java.util.List;
import org.sonatype.nexus.proxy.maven.MavenRepository;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
/**
* Carries the results of a discovery.
2  ...xy/maven/wl/discovery/LocalContentDiscoverer.java → ...ven/routing/discovery/LocalContentDiscoverer.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
import java.io.IOException;
2  ...e/nexus/proxy/maven/wl/discovery/Prioritized.java → ...us/proxy/maven/routing/discovery/Prioritized.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
import java.util.Comparator;
2  ...y/maven/wl/discovery/RemoteContentDiscoverer.java → ...en/routing/discovery/RemoteContentDiscoverer.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
import java.util.List;
2  ...exus/proxy/maven/wl/discovery/RemoteStrategy.java → ...proxy/maven/routing/discovery/RemoteStrategy.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
import java.io.IOException;
2  ...y/maven/wl/discovery/StrategyFailedException.java → ...en/routing/discovery/StrategyFailedException.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
/**
* This is an exception to mark that a strategy has failed to do the work. This exception should be used to mark some
4 ...exus/proxy/maven/wl/discovery/StrategyResult.java → ...proxy/maven/routing/discovery/StrategyResult.java
View
@@ -10,11 +10,11 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.discovery;
+package org.sonatype.nexus.proxy.maven.routing.discovery;
import static com.google.common.base.Preconditions.checkNotNull;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
/**
* The result of a strategy discovery.
8 ...xy/maven/wl/events/AbstractWLRepositoryEvent.java → ...outing/events/AbstractRoutingRepositoryEvent.java
View
@@ -10,21 +10,21 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.events;
+package org.sonatype.nexus.proxy.maven.routing.events;
import org.sonatype.nexus.proxy.events.RepositoryEvent;
import org.sonatype.nexus.proxy.maven.MavenRepository;
/**
- * Parent abstract class for WL related events.
+ * Parent abstract class for routing related events.
*
* @author cstamas
* @since 2.4
*/
-public abstract class AbstractWLRepositoryEvent
+public abstract class AbstractRoutingRepositoryEvent
extends RepositoryEvent
{
- protected AbstractWLRepositoryEvent( final MavenRepository mavenRepository )
+ protected AbstractRoutingRepositoryEvent( final MavenRepository mavenRepository )
{
super( mavenRepository );
}
22 ...y/maven/wl/events/WLPublishedRepositoryEvent.java → ...ng/events/PrefixFilePublishedRepositoryEvent.java
View
@@ -10,34 +10,34 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.events;
+package org.sonatype.nexus.proxy.maven.routing.events;
import static com.google.common.base.Preconditions.checkNotNull;
import org.sonatype.nexus.proxy.maven.MavenRepository;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
-import org.sonatype.nexus.proxy.maven.wl.WLManager;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.Manager;
/**
- * Event fired when a {@link MavenRepository} publishes it's WL. The WL is carried along with this event in form of
- * {@link PrefixSource} but you can also use {@link WLManager} to get repository entry source, as it is already available
- * in the moment you process this event.
+ * Event fired when a {@link MavenRepository} publishes it's prefix file. The prefix source (backed by new file) is
+ * carried along with this event in form of {@link PrefixSource} but you can also use {@link Manager} to get repository
+ * entry source, as it is already available in the moment you process this event.
*
* @author cstamas
* @since 2.4
*/
-public class WLPublishedRepositoryEvent
- extends AbstractWLRepositoryEvent
+public class PrefixFilePublishedRepositoryEvent
+ extends AbstractRoutingRepositoryEvent
{
private final PrefixSource prefixSource;
/**
* Constructor.
*
- * @param mavenRepository the repository published it's WL.
- * @param prefixSource the WL in form of {@link PrefixSource}.
+ * @param mavenRepository the repository published it's prefix file.
+ * @param prefixSource the prefix file in form of {@link PrefixSource}.
*/
- public WLPublishedRepositoryEvent( final MavenRepository mavenRepository, final PrefixSource prefixSource )
+ public PrefixFilePublishedRepositoryEvent( final MavenRepository mavenRepository, final PrefixSource prefixSource )
{
super( mavenRepository );
this.prefixSource = checkNotNull( prefixSource );
12 ...maven/wl/events/WLUnpublishedRepositoryEvent.java → .../events/PrefixFileUnpublishedRepositoryEvent.java
View
@@ -10,25 +10,25 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.events;
+package org.sonatype.nexus.proxy.maven.routing.events;
import org.sonatype.nexus.proxy.maven.MavenRepository;
/**
- * Event fired when a repository "unpublishes" it's WL.
+ * Event fired when a repository "unpublishes" (removes) it's prefix file.
*
* @author cstamas
* @since 2.4
*/
-public class WLUnpublishedRepositoryEvent
- extends AbstractWLRepositoryEvent
+public class PrefixFileUnpublishedRepositoryEvent
+ extends AbstractRoutingRepositoryEvent
{
/**
* Constructor.
*
- * @param mavenRepository the repository that unpublished the WL.
+ * @param mavenRepository the repository that unpublished (removed) the prefix file.
*/
- public WLUnpublishedRepositoryEvent( final MavenRepository mavenRepository )
+ public PrefixFileUnpublishedRepositoryEvent( final MavenRepository mavenRepository )
{
super( mavenRepository );
}
4 .../proxy/maven/wl/internal/AbstractPrioritized.java → ...y/maven/routing/internal/AbstractPrioritized.java
View
@@ -10,10 +10,10 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import org.sonatype.nexus.logging.AbstractLoggingComponent;
-import org.sonatype.nexus.proxy.maven.wl.discovery.Prioritized;
+import org.sonatype.nexus.proxy.maven.routing.discovery.Prioritized;
/**
* Abstract class for {@link Prioritized} implementations.
4 ...oxy/maven/wl/internal/AbstractRemoteStrategy.java → ...aven/routing/internal/AbstractRemoteStrategy.java
View
@@ -10,11 +10,11 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import static com.google.common.base.Preconditions.checkNotNull;
-import org.sonatype.nexus.proxy.maven.wl.discovery.RemoteStrategy;
+import org.sonatype.nexus.proxy.maven.routing.discovery.RemoteStrategy;
/**
* Abstract class for {@link RemoteStrategy} implementations.
4 ...roxy/maven/wl/internal/ArrayListPrefixSource.java → ...maven/routing/internal/ArrayListPrefixSource.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -19,7 +19,7 @@
import java.util.Collections;
import java.util.List;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
/**
* {@link PrefixSource} implementation backed by {@link ArrayList}.
30 ...e/nexus/proxy/maven/wl/internal/WLConfigImpl.java → ...exus/proxy/maven/routing/internal/ConfigImpl.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import java.util.ArrayList;
import java.util.List;
@@ -18,7 +18,7 @@
import javax.inject.Named;
import javax.inject.Singleton;
-import org.sonatype.nexus.proxy.maven.wl.WLConfig;
+import org.sonatype.nexus.proxy.maven.routing.Config;
import org.sonatype.nexus.util.SystemPropertiesHelper;
/**
@@ -32,8 +32,8 @@
*/
@Named
@Singleton
-public class WLConfigImpl
- implements WLConfig
+public class ConfigImpl
+ implements Config
{
/**
* System property key that is used to read up boolean value controlling is WL feature active or not. Main use case
@@ -41,7 +41,7 @@
* dispatcher is active by default, to deactivate it, specify a system property like this:
*
* <pre>
- * org.sonatype.nexus.proxy.maven.wl.WLConfig.featureActive = false
+ * org.sonatype.nexus.proxy.maven.routing.Config.featureActive = false
* </pre>
*
* Note: This does NOT REMOVE the Feature itself! The feature will be still present and working but remote content
@@ -50,31 +50,31 @@
* 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 = WLConfig.class.getName() + ".featureActive";
+ public static final String FEATURE_ACTIVE_KEY = Config.class.getName() + ".featureActive";
private static final String LOCAL_NO_SCRAPE_FLAG_PATH = "/.meta/noscrape.txt";
private static final String LOCAL_PREFIX_FILE_PATH = "/.meta/prefixes.txt";
private static final String[] EXTRA_REMOTE_NO_SCRAPE_FLAG_PATHS =
- SystemPropertiesHelper.getStringlist( WLConfig.class.getName() + ".extraRemoteNoscrapeFlagPaths" );
+ SystemPropertiesHelper.getStringlist( Config.class.getName() + ".extraRemoteNoscrapeFlagPaths" );
private static final String[] EXTRA_REMOTE_PREFIX_FILE_PATHS =
- SystemPropertiesHelper.getStringlist( WLConfig.class.getName() + ".extraRemotePrefixFilePaths" );
+ SystemPropertiesHelper.getStringlist( Config.class.getName() + ".extraRemotePrefixFilePaths" );
- private static final int REMOTE_SCRAPE_DEPTH = SystemPropertiesHelper.getInteger( WLConfig.class.getName()
+ private static final int REMOTE_SCRAPE_DEPTH = SystemPropertiesHelper.getInteger( Config.class.getName()
+ ".remoteScrapeDepth", 2 );
- private static final int LOCAL_SCRAPE_DEPTH = SystemPropertiesHelper.getInteger( WLConfig.class.getName()
+ private static final int LOCAL_SCRAPE_DEPTH = SystemPropertiesHelper.getInteger( Config.class.getName()
+ ".localScrapeDepth", 2 );
- private static final int PREFIX_FILE_MAX_ENTRY_COUNT = SystemPropertiesHelper.getInteger( WLConfig.class.getName()
+ private static final int PREFIX_FILE_MAX_ENTRY_COUNT = SystemPropertiesHelper.getInteger( Config.class.getName()
+ ".prefixFileMaxEntryCount", 10000 ); // 10000 lines
- private static final int PREFIX_FILE_MAX_LINE_LENGTH = SystemPropertiesHelper.getInteger( WLConfig.class.getName()
+ private static final int PREFIX_FILE_MAX_LINE_LENGTH = SystemPropertiesHelper.getInteger( Config.class.getName()
+ ".prefixFileMaxLineLength", 250 ); // 250 chars
- private static final int PREFIX_FILE_MAX_SIZE = SystemPropertiesHelper.getInteger( WLConfig.class.getName()
+ private static final int PREFIX_FILE_MAX_SIZE = SystemPropertiesHelper.getInteger( Config.class.getName()
+ ".prefixFileMaxSize", 100000 ); // 100 KB
private final boolean featureActive;
@@ -82,7 +82,7 @@
/**
* Default constructor.
*/
- public WLConfigImpl()
+ public ConfigImpl()
{
this( SystemPropertiesHelper.getBoolean( FEATURE_ACTIVE_KEY, true ) );
}
@@ -92,7 +92,7 @@ public WLConfigImpl()
*
* @param featureActive
*/
- public WLConfigImpl( final boolean featureActive )
+ public ConfigImpl( final boolean featureActive )
{
this.featureActive = featureActive;
}
26 ...exus/proxy/maven/wl/internal/EventDispatcher.java → ...proxy/maven/routing/internal/EventDispatcher.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -31,8 +31,8 @@
import org.sonatype.nexus.proxy.maven.MavenHostedRepository;
import org.sonatype.nexus.proxy.maven.MavenRepository;
import org.sonatype.nexus.proxy.maven.maven2.Maven2ContentClass;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
-import org.sonatype.nexus.proxy.maven.wl.WLManager;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.Manager;
import org.sonatype.nexus.proxy.repository.Repository;
import org.sonatype.nexus.proxy.repository.ShadowRepository;
import org.sonatype.nexus.proxy.utils.RepositoryStringUtils;
@@ -41,12 +41,12 @@
import com.google.common.eventbus.Subscribe;
/**
- * Internal class routing various Nexus events to {@link WLManager}.
+ * Internal class routing various Nexus events to {@link Manager}.
* <p>
* Note: This component was initially marked as {@code @EagerSingleton}, but it did not play well with rest of plexus
* components, as it broke everything. Seems like this component was created "too early", also, some UTs does not
* prepare environment properly (like DefaultPasswordGeneratorTest, that does not set even the minimal properties
- * needed). Hence, this component is made a "plain" singleton (not eager), and {@link WLManager} implementation will
+ * needed). Hence, this component is made a "plain" singleton (not eager), and {@link Manager} implementation will
* pull it up, to have it created and to start ticking.
*
* @author cstamas
@@ -56,7 +56,7 @@
{
private final Logger logger;
- private final WLManager wlManager;
+ private final Manager wlManager;
private final boolean active;
@@ -66,7 +66,7 @@
* @param wlManager
* @param active
*/
- public EventDispatcher( final WLManager wlManager, final boolean active )
+ public EventDispatcher( final Manager wlManager, final boolean active )
{
this.logger = LoggerFactory.getLogger( getClass() );
this.wlManager = checkNotNull( wlManager );
@@ -82,14 +82,14 @@ protected Logger getLogger()
protected void handleRepositoryAdded( final MavenRepository mavenRepository )
{
- wlManager.initializeWhitelist( mavenRepository );
+ wlManager.initializePrefixFile( mavenRepository );
}
protected void handleRepositoryModified( final MavenRepository mavenRepository )
{
try
{
- wlManager.forceUpdateWhitelist( mavenRepository );
+ wlManager.forceUpdatePrefixFile( mavenRepository );
}
catch ( IllegalStateException e )
{
@@ -132,7 +132,7 @@ protected void offerPath( final MavenHostedRepository mavenHostedRepository, Str
{
try
{
- wlManager.offerWLEntry( mavenHostedRepository, path );
+ wlManager.offerEntry( mavenHostedRepository, path );
}
catch ( IOException e )
{
@@ -145,7 +145,7 @@ protected void revokePath( final MavenHostedRepository mavenHostedRepository, St
{
try
{
- wlManager.revokeWLEntry( mavenHostedRepository, path );
+ wlManager.revokeEntry( mavenHostedRepository, path );
}
catch ( IOException e )
{
@@ -163,7 +163,7 @@ protected boolean isActive()
protected boolean isRequestContextMarked( final RequestContext context )
{
- return context.containsKey( WLManager.WL_INITIATED_FILE_OPERATION_FLAG_KEY );
+ return context.containsKey( Manager.ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY );
}
protected boolean isRepositoryHandled( final Repository repository )
@@ -180,7 +180,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.isEventAboutWLFile( evt );
+ && wlManager.isEventAboutPrefixFile( evt );
}
protected boolean isPlainItemEvent( final RepositoryItemEvent evt )
18 ...xus/proxy/maven/wl/internal/FilePrefixSource.java → ...roxy/maven/routing/internal/FilePrefixSource.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -32,10 +32,10 @@
import org.sonatype.nexus.proxy.item.StorageFileItem;
import org.sonatype.nexus.proxy.item.StorageItem;
import org.sonatype.nexus.proxy.maven.MavenRepository;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
-import org.sonatype.nexus.proxy.maven.wl.WLConfig;
-import org.sonatype.nexus.proxy.maven.wl.WLManager;
-import org.sonatype.nexus.proxy.maven.wl.WritablePrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.Config;
+import org.sonatype.nexus.proxy.maven.routing.Manager;
+import org.sonatype.nexus.proxy.maven.routing.WritablePrefixSource;
import org.sonatype.nexus.proxy.storage.UnsupportedStorageOperationException;
import com.google.common.base.Throwables;
@@ -65,7 +65,7 @@
* @param path
* @param prefixFileMaxEntryCount
*/
- protected FilePrefixSource( final MavenRepository mavenRepository, final String path, final WLConfig config )
+ protected FilePrefixSource( final MavenRepository mavenRepository, final String path, final Config config )
{
this.mavenRepository = checkNotNull( mavenRepository );
this.path = checkNotNull( path );
@@ -246,7 +246,7 @@ protected StorageFileItem getFileItem()
final ResourceStoreRequest request = new ResourceStoreRequest( getFilePath() );
request.setRequestLocalOnly( true );
request.setRequestGroupLocalOnly( true );
- request.getRequestContext().put( WLManager.WL_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE );
+ request.getRequestContext().put( Manager.ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE );
@SuppressWarnings( "deprecation" )
final StorageItem item = getMavenRepository().retrieveItem( true, request );
if ( item instanceof StorageFileItem )
@@ -276,7 +276,7 @@ protected void putFileItem( final ContentLocator content )
final ResourceStoreRequest request = new ResourceStoreRequest( getFilePath() );
request.setRequestLocalOnly( true );
request.setRequestGroupLocalOnly( true );
- request.getRequestContext().put( WLManager.WL_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE );
+ request.getRequestContext().put( Manager.ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE );
final DefaultStorageFileItem file =
new DefaultStorageFileItem( getMavenRepository(), request, true, true, content );
try
@@ -300,7 +300,7 @@ protected void deleteFileItem()
final ResourceStoreRequest request = new ResourceStoreRequest( getFilePath() );
request.setRequestLocalOnly( true );
request.setRequestGroupLocalOnly( true );
- request.getRequestContext().put( WLManager.WL_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE );
+ request.getRequestContext().put( Manager.ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE );
try
{
getMavenRepository().deleteItem( true, request );
2  ...roxy/maven/wl/internal/InvalidInputException.java → ...maven/routing/internal/InvalidInputException.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import java.io.IOException;
12 ...maven/wl/internal/LocalContentDiscovererImpl.java → .../routing/internal/LocalContentDiscovererImpl.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -27,9 +27,9 @@
import org.sonatype.nexus.proxy.item.StorageFileItem;
import org.sonatype.nexus.proxy.item.StorageItem;
import org.sonatype.nexus.proxy.maven.MavenHostedRepository;
-import org.sonatype.nexus.proxy.maven.wl.WLConfig;
-import org.sonatype.nexus.proxy.maven.wl.discovery.DiscoveryResult;
-import org.sonatype.nexus.proxy.maven.wl.discovery.LocalContentDiscoverer;
+import org.sonatype.nexus.proxy.maven.routing.Config;
+import org.sonatype.nexus.proxy.maven.routing.discovery.DiscoveryResult;
+import org.sonatype.nexus.proxy.maven.routing.discovery.LocalContentDiscoverer;
import org.sonatype.nexus.proxy.walker.AbstractWalkerProcessor;
import org.sonatype.nexus.proxy.walker.DefaultStoreWalkerFilter;
import org.sonatype.nexus.proxy.walker.DefaultWalkerContext;
@@ -53,7 +53,7 @@
{
private static final String ID = "local";
- private final WLConfig config;
+ private final Config config;
private final Walker walker;
@@ -64,7 +64,7 @@
* @param walker
*/
@Inject
- public LocalContentDiscovererImpl( final WLConfig config, final Walker walker )
+ public LocalContentDiscovererImpl( final Config config, final Walker walker )
{
this.config = checkNotNull( config );
this.walker = checkNotNull( walker );
184 .../nexus/proxy/maven/wl/internal/WLManagerImpl.java → ...xus/proxy/maven/routing/internal/ManagerImpl.java
View
@@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-package org.sonatype.nexus.proxy.maven.wl.internal;
+package org.sonatype.nexus.proxy.maven.routing.internal;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -49,22 +49,22 @@
import org.sonatype.nexus.proxy.maven.MavenRepository;
import org.sonatype.nexus.proxy.maven.MavenShadowRepository;
import org.sonatype.nexus.proxy.maven.maven2.Maven2ContentClass;
-import org.sonatype.nexus.proxy.maven.wl.PrefixSource;
-import org.sonatype.nexus.proxy.maven.wl.WLConfig;
-import org.sonatype.nexus.proxy.maven.wl.WLDiscoveryConfig;
-import org.sonatype.nexus.proxy.maven.wl.WLDiscoveryStatus;
-import org.sonatype.nexus.proxy.maven.wl.WLDiscoveryStatus.DStatus;
-import org.sonatype.nexus.proxy.maven.wl.WLManager;
-import org.sonatype.nexus.proxy.maven.wl.WLPublishingStatus;
-import org.sonatype.nexus.proxy.maven.wl.WLPublishingStatus.PStatus;
-import org.sonatype.nexus.proxy.maven.wl.WLStatus;
-import org.sonatype.nexus.proxy.maven.wl.discovery.DiscoveryResult;
-import org.sonatype.nexus.proxy.maven.wl.discovery.DiscoveryResult.Outcome;
-import org.sonatype.nexus.proxy.maven.wl.discovery.LocalContentDiscoverer;
-import org.sonatype.nexus.proxy.maven.wl.discovery.RemoteContentDiscoverer;
-import org.sonatype.nexus.proxy.maven.wl.discovery.RemoteStrategy;
-import org.sonatype.nexus.proxy.maven.wl.events.WLPublishedRepositoryEvent;
-import org.sonatype.nexus.proxy.maven.wl.events.WLUnpublishedRepositoryEvent;
+import org.sonatype.nexus.proxy.maven.routing.PrefixSource;
+import org.sonatype.nexus.proxy.maven.routing.Config;
+import org.sonatype.nexus.proxy.maven.routing.DiscoveryConfig;
+import org.sonatype.nexus.proxy.maven.routing.DiscoveryStatus;
+import org.sonatype.nexus.proxy.maven.routing.Manager;
+import org.sonatype.nexus.proxy.maven.routing.PublishingStatus;
+import org.sonatype.nexus.proxy.maven.routing.RoutingStatus;
+import org.sonatype.nexus.proxy.maven.routing.DiscoveryStatus.DStatus;
+import org.sonatype.nexus.proxy.maven.routing.PublishingStatus.PStatus;
+import org.sonatype.nexus.proxy.maven.routing.discovery.DiscoveryResult;
+import org.sonatype.nexus.proxy.maven.routing.discovery.LocalContentDiscoverer;
+import org.sonatype.nexus.proxy.maven.routing.discovery.RemoteContentDiscoverer;
+import org.sonatype.nexus.proxy.maven.routing.discovery.RemoteStrategy;
+import org.sonatype.nexus.proxy.maven.routing.discovery.DiscoveryResult.Outcome;
+import org.sonatype.nexus.proxy.maven.routing.events.PrefixFilePublishedRepositoryEvent;
+import org.sonatype.nexus.proxy.maven.routing.events.PrefixFileUnpublishedRepositoryEvent;
import org.sonatype.nexus.proxy.registry.RepositoryRegistry;
import org.sonatype.nexus.proxy.repository.GroupRepository;
import org.sonatype.nexus.proxy.repository.LocalStatus;
@@ -93,9 +93,9 @@
*/
@Named
@Singleton
-public class WLManagerImpl
+public class ManagerImpl
extends AbstractLoggingComponent
- implements WLManager
+ implements Manager
{
private final EventBus eventBus;
@@ -105,7 +105,7 @@
private final RepositoryRegistry repositoryRegistry;
- private final WLConfig config;
+ private final Config config;
private final LocalContentDiscoverer localContentDiscoverer;
@@ -142,9 +142,9 @@
* @param quickRemoteStrategy
*/
@Inject
- public WLManagerImpl( final EventBus eventBus, final ApplicationStatusSource applicationStatusSource,
+ public ManagerImpl( final EventBus eventBus, final ApplicationStatusSource applicationStatusSource,
final ApplicationConfiguration applicationConfiguration,
- final RepositoryRegistry repositoryRegistry, final WLConfig config,
+ final RepositoryRegistry repositoryRegistry, final Config config,
final LocalContentDiscoverer localContentDiscoverer,
final RemoteContentDiscoverer remoteContentDiscoverer,
@Named( RemotePrefixFileStrategy.ID ) final RemoteStrategy quickRemoteStrategy )
@@ -190,7 +190,7 @@ public void startup()
if ( isMavenRepositorySupported( mavenRepository )
&& mavenRepository.getLocalStatus().shouldServiceRequest() )
{
- if ( doInitializeWhitelistOnStartup( mavenRepository ) )
+ if ( doInitializePrefixFileOnStartup( mavenRepository ) )
{
// collect those marked as need-update
needUpdateRepositories.add( mavenRepository );
@@ -209,7 +209,7 @@ public void startup()
&& mavenRepository.getLocalStatus().shouldServiceRequest() )
{
// groups will not be collected to needs-update list
- doInitializeWhitelistOnStartup( mavenRepository );
+ doInitializePrefixFileOnStartup( mavenRepository );
}
}
}
@@ -217,17 +217,17 @@ public void startup()
// these will maintaing groups too as needed
for ( MavenRepository mavenRepository : needUpdateRepositories )
{
- updateWhitelist( mavenRepository );
+ updatePrefixFile( mavenRepository );
}
- // schedule the "updater" that ping hourly the mayUpdateProxyWhitelist method
+ // schedule the "updater" that ping hourly the mayUpdateAllProxyPrefixFiles method
// but wait 1 minute for boot to calm down and then start
this.executor.scheduleAtFixedRate( new Runnable()
{
@Override
public void run()
{
- mayUpdateAllProxyWhitelists();
+ mayUpdateAllProxyPrefixFiles();
}
}, TimeUnit.MINUTES.toMillis( 1 ), TimeUnit.HOURS.toMillis( 1 ), TimeUnit.MILLISECONDS );
// register event dispatcher, to start receiving events
@@ -254,7 +254,7 @@ public void shutdown()
}
@Override
- public void initializeWhitelist( final MavenRepository mavenRepository )
+ public void initializePrefixFile( final MavenRepository mavenRepository )
{
getLogger().debug( "Initializing prefix file of newly added {}", mavenRepository );
try
@@ -263,7 +263,7 @@ public void initializeWhitelist( final MavenRepository mavenRepository )
unpublish( mavenRepository );
// spawn update, this will do whatever is needed (and handle cases like blocked, out of service etc),
// and publish
- updateWhitelist( mavenRepository );
+ updatePrefixFile( mavenRepository );
getLogger().info( "Initializing non-existing prefix file of newly added {}",
RepositoryStringUtils.getHumanizedNameString( mavenRepository ) );
}
@@ -289,7 +289,7 @@ public void initializeWhitelist( final MavenRepository mavenRepository )
* @param mavenRepository
* @return {@code true} if repository needs update.
*/
- protected boolean doInitializeWhitelistOnStartup( final MavenRepository mavenRepository )
+ protected boolean doInitializePrefixFileOnStartup( final MavenRepository mavenRepository )
{
getLogger().debug( "Initializing prefix file of {}", mavenRepository );
final PrefixSource prefixSource = getPrefixSourceFor( mavenRepository );
@@ -333,16 +333,16 @@ protected boolean doInitializeWhitelistOnStartup( final MavenRepository mavenRep
* 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.
*/
- protected void mayUpdateAllProxyWhitelists()
+ protected void mayUpdateAllProxyPrefixFiles()
{
- getLogger().trace( "mayUpdateAllProxyWhitelists started" );
+ getLogger().trace( "mayUpdateAllProxyPrefixFiles started" );
final List<MavenProxyRepository> mavenProxyRepositories =
repositoryRegistry.getRepositoriesWithFacet( MavenProxyRepository.class );
for ( MavenProxyRepository mavenProxyRepository : mavenProxyRepositories )
{
try
{
- mayUpdateProxyWhitelist( mavenProxyRepository );
+ mayUpdateProxyPrefixFile( mavenProxyRepository );
}
catch ( IllegalStateException e )
{
@@ -366,15 +366,15 @@ protected void mayUpdateAllProxyWhitelists()
* @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).
*/
- protected boolean mayUpdateProxyWhitelist( final MavenProxyRepository mavenProxyRepository )
+ protected boolean mayUpdateProxyPrefixFile( final MavenProxyRepository mavenProxyRepository )
{
- final WLDiscoveryStatus discoveryStatus = getStatusFor( mavenProxyRepository ).getDiscoveryStatus();
+ final DiscoveryStatus discoveryStatus = getStatusFor( mavenProxyRepository ).getDiscoveryStatus();
if ( discoveryStatus.getStatus().isEnabled() )
{
// 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
- final WLDiscoveryConfig config = getRemoteDiscoveryConfig( mavenProxyRepository );
+ final DiscoveryConfig config = getRemoteDiscoveryConfig( mavenProxyRepository );
if ( discoveryStatus.getStatus() == DStatus.ERROR
|| discoveryStatus.getStatus() == DStatus.ENABLED_NOT_POSSIBLE
|| ( ( System.currentTimeMillis() - discoveryStatus.getLastDiscoveryTimestamp() ) > config.getDiscoveryInterval() ) )
@@ -395,7 +395,7 @@ else if ( discoveryStatus.getStatus() == DStatus.ERROR )
{
getLogger().debug( "Proxy {} needs periodic remote discovery update", mavenProxyRepository );
}
- final boolean updateSpawned = doUpdateWhitelistAsync( false, mavenProxyRepository );
+ final boolean updateSpawned = doUpdatePrefixFileAsync( false, mavenProxyRepository );
if ( !updateSpawned )
{
// this means that either remote discovery takes too long or user might pressed Force discovery
@@ -420,23 +420,23 @@ else if ( discoveryStatus.getStatus() == DStatus.ERROR )
}
@Override
- public boolean updateWhitelist( final MavenRepository mavenRepository )
+ public boolean updatePrefixFile( final MavenRepository mavenRepository )
throws IllegalStateException
{
checkUpdateConditions( mavenRepository );
- return doUpdateWhitelistAsync( false, mavenRepository );
+ return doUpdatePrefixFileAsync( false, mavenRepository );
}
@Override
- public boolean forceUpdateWhitelist( final MavenRepository mavenRepository )
+ public boolean forceUpdatePrefixFile( final MavenRepository mavenRepository )
throws IllegalStateException
{
checkUpdateConditions( mavenRepository );
- return doUpdateWhitelistAsync( true, mavenRepository );
+ return doUpdatePrefixFileAsync( true, mavenRepository );
}
@Override
- public void forceProxyQuickUpdateWhitelist( final MavenProxyRepository mavenProxyRepository )
+ public void forceProxyQuickUpdatePrefixFile( final MavenProxyRepository mavenProxyRepository )
throws IllegalStateException
{
checkUpdateConditions( mavenProxyRepository );
@@ -445,7 +445,7 @@ public void forceProxyQuickUpdateWhitelist( final MavenProxyRepository mavenProx
getLogger().debug( "Quick updating prefix file of {}", mavenProxyRepository );
constrainedExecutor.cancelRunningWithKey( mavenProxyRepository.getId() );
final PrefixSource prefixSource =
- updateProxyWhitelist( mavenProxyRepository, Collections.singletonList( quickRemoteStrategy ) );
+ updateProxyPrefixFile( mavenProxyRepository, Collections.singletonList( quickRemoteStrategy ) );
if ( prefixSource != null )
{
getLogger().info( "Updated and published prefix file of {}",
@@ -526,10 +526,10 @@ protected void checkUpdateConditions( final MavenRepository mavenRepository )
* {@code forced=false}, return value {@code true} means this invocation did schedule a job, otherwise it
* did not, as another job for same repository was already running.
*/
- protected boolean doUpdateWhitelistAsync( final boolean forced, final MavenRepository mavenRepository )
+ protected boolean doUpdatePrefixFileAsync( final boolean forced, final MavenRepository mavenRepository )
{
- final WLUpdateRepositoryRunnable updateRepositoryJob =
- new WLUpdateRepositoryRunnable( new LoggingProgressListener( getLogger() ), applicationStatusSource, this,
+ final UpdateRepositoryRunnable updateRepositoryJob =
+ new UpdateRepositoryRunnable( new LoggingProgressListener( getLogger() ), applicationStatusSource, this,
mavenRepository );
if ( forced )
{
@@ -557,14 +557,14 @@ protected boolean doUpdateWhitelistAsync( final boolean forced, final MavenRepos
* @return {@code true} if there are prefix file update jobs running.
*/
@VisibleForTesting
- public boolean isUpdateWhitelistJobRunning()
+ public boolean isUpdatePrefixFileJobRunning()
{
final Statistics statistics = constrainedExecutor.getStatistics();
getLogger().debug( "Running update jobs for {}", statistics.getCurrentlyRunningJobKeys() );
return !statistics.getCurrentlyRunningJobKeys().isEmpty();
}
- protected void updateAndPublishWhitelist( final MavenRepository mavenRepository, final boolean notify )
+ protected void updateAndPublishPrefixFile( final MavenRepository mavenRepository, final boolean notify )
throws IOException
{
getLogger().debug( "Updating prefix file of {}", mavenRepository );
@@ -573,15 +573,15 @@ protected void updateAndPublishWhitelist( final MavenRepository mavenRepository,
final PrefixSource prefixSource;
if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenGroupRepository.class ) )
{
- prefixSource = updateGroupWhitelist( mavenRepository.adaptToFacet( MavenGroupRepository.class ) );
+ prefixSource = updateGroupPrefixFile( mavenRepository.adaptToFacet( MavenGroupRepository.class ) );
}
else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenProxyRepository.class ) )
{
- prefixSource = updateProxyWhitelist( mavenRepository.adaptToFacet( MavenProxyRepository.class ), null );
+ prefixSource = updateProxyPrefixFile( mavenRepository.adaptToFacet( MavenProxyRepository.class ), null );
}
else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenHostedRepository.class ) )
{
- prefixSource = updateHostedWhitelist( mavenRepository.adaptToFacet( MavenHostedRepository.class ) );
+ prefixSource = updateHostedPrefixFile( mavenRepository.adaptToFacet( MavenHostedRepository.class ) );
}
else
{
@@ -616,7 +616,7 @@ else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenHostedRepos
}
}
- protected PrefixSource updateProxyWhitelist( final MavenProxyRepository mavenProxyRepository,
+ protected PrefixSource updateProxyPrefixFile( final MavenProxyRepository mavenProxyRepository,
final List<RemoteStrategy> remoteStrategies )
throws IllegalStateException, IOException
{
@@ -628,8 +628,8 @@ protected PrefixSource updateProxyWhitelist( final MavenProxyRepository mavenPro
final ProxyMode proxyMode = mavenProxyRepository.getProxyMode();
if ( !proxyMode.shouldProxy() )
{
- final WLDiscoveryStatus discoveryStatus =
- new WLDiscoveryStatus( DStatus.ENABLED_NOT_POSSIBLE, "none", "Proxy repository is blocked.",
+ final DiscoveryStatus discoveryStatus =
+ new DiscoveryStatus( DStatus.ENABLED_NOT_POSSIBLE, "none", "Proxy repository is blocked.",
System.currentTimeMillis() );
discoveryStatusSource.write( discoveryStatus );
throw new IllegalStateException( "Maven repository "
@@ -638,7 +638,7 @@ protected PrefixSource updateProxyWhitelist( final MavenProxyRepository mavenPro
}
PrefixSource prefixSource = null;
- final WLDiscoveryConfig config = getRemoteDiscoveryConfig( mavenProxyRepository );
+ final DiscoveryConfig config = getRemoteDiscoveryConfig( mavenProxyRepository );
if ( config.isEnabled() )
{
final DiscoveryResult<MavenProxyRepository> discoveryResult;
@@ -677,8 +677,8 @@ protected PrefixSource updateProxyWhitelist( final MavenProxyRepository mavenPro
status = DStatus.ERROR;
}
}
- final WLDiscoveryStatus discoveryStatus =
- new WLDiscoveryStatus( status, lastOutcome.getStrategyId(), lastOutcome.getMessage(),
+ final DiscoveryStatus discoveryStatus =
+ new DiscoveryStatus( status, lastOutcome.getStrategyId(), lastOutcome.getMessage(),
System.currentTimeMillis() );
discoveryStatusSource.write( discoveryStatus );
}
@@ -690,7 +690,7 @@ protected PrefixSource updateProxyWhitelist( final MavenProxyRepository mavenPro
return prefixSource;
}
- protected PrefixSource updateHostedWhitelist( final MavenHostedRepository mavenHostedRepository )
+ protected PrefixSource updateHostedPrefixFile( final MavenHostedRepository mavenHostedRepository )
throws IllegalStateException, IOException
{
checkUpdateConditions( mavenHostedRepository );
@@ -708,13 +708,13 @@ protected PrefixSource updateHostedWhitelist( final MavenHostedRepository mavenH
return prefixSource;
}
- protected PrefixSource updateGroupWhitelist( final MavenGroupRepository mavenGroupRepository )
+ protected PrefixSource updateGroupPrefixFile( final MavenGroupRepository mavenGroupRepository )
throws IllegalStateException, IOException
{
checkUpdateConditions( mavenGroupRepository );
PrefixSource prefixSource = null;
// save merged WL into group's local storage (if all members has WL)
- boolean allMembersHaveWLPublished = true;
+ boolean allMembersHavePublished = true;
final LinkedHashSet<String> entries = new LinkedHashSet<String>();
for ( Repository member : mavenGroupRepository.getMemberRepositories() )
{
@@ -732,7 +732,7 @@ protected PrefixSource updateGroupWhitelist( final MavenGroupRepository mavenGro
{
if ( !memberEntrySource.exists() )
{
- allMembersHaveWLPublished = false;
+ allMembersHavePublished = false;
break;
}
entries.addAll( memberEntrySource.readEntries() );
@@ -744,7 +744,7 @@ protected PrefixSource updateGroupWhitelist( final MavenGroupRepository mavenGro
}
}
}
- if ( allMembersHaveWLPublished )
+ if ( allMembersHavePublished )
{
prefixSource = new ArrayListPrefixSource( new ArrayList<String>( entries ) );
}
@@ -754,13 +754,13 @@ protected PrefixSource updateGroupWhitelist( final MavenGroupRepository mavenGro
// ==
@Override
- public WLStatus getStatusFor( final MavenRepository mavenRepository )
+ public RoutingStatus getStatusFor( final MavenRepository mavenRepository )
{
final MavenProxyRepository mavenProxyRepository = mavenRepository.adaptToFacet( MavenProxyRepository.class );
final boolean remoteDiscoveryEnabled;
if ( mavenProxyRepository != null )
{
- final WLDiscoveryConfig discoveryConfig = getRemoteDiscoveryConfig( mavenProxyRepository );
+ final DiscoveryConfig discoveryConfig = getRemoteDiscoveryConfig( mavenProxyRepository );
remoteDiscoveryEnabled = discoveryConfig.isEnabled();
}
else
@@ -768,8 +768,8 @@ public WLStatus getStatusFor( final MavenRepository mavenRepository )
remoteDiscoveryEnabled = false;
}
- WLPublishingStatus publishingStatus = null;
- WLDiscoveryStatus discoveryStatus = null;
+ PublishingStatus publishingStatus = null;
+ DiscoveryStatus discoveryStatus = null;
// publish status
final FilePrefixSource publishedEntrySource = getPrefixSourceFor( mavenRepository );
@@ -782,7 +782,7 @@ public WLStatus getStatusFor( final MavenRepository mavenRepository )
{
final MavenGroupRepository mavenGroupRepository =
mavenRepository.adaptToFacet( MavenGroupRepository.class );
- final List<String> membersWithoutWhitelists = new ArrayList<String>();
+ final List<String> membersWithoutPrefixFiles = new ArrayList<String>();
for ( Repository member : mavenGroupRepository.getMemberRepositories() )
{
final MavenRepository memberMavenRepository = member.adaptToFacet( MavenRepository.class );
@@ -791,13 +791,13 @@ public WLStatus getStatusFor( final MavenRepository mavenRepository )
final PrefixSource ps = getPrefixSourceFor( memberMavenRepository );
if ( !ps.exists() )
{
- membersWithoutWhitelists.add( memberMavenRepository.getName() );
+ membersWithoutPrefixFiles.add( memberMavenRepository.getName() );
}
}
}
message =
"Publishing not possible, following members have no published prefix file: "
- + Joiner.on( ", " ).join( membersWithoutWhitelists );
+ + Joiner.on( ", " ).join( membersWithoutPrefixFiles );
}