Permalink
Browse files

Merge pull request #795 from sonatype/nexus-5639-rename-wl-deep

[blocker 2.4] NEXUS-5639: Deep rename of WL into Routing
  • Loading branch information...
2 parents bbb3b51 + 14c8f20 commit 65c609148a640eba826c7be351d0d49ea897131a @cstamas cstamas committed Mar 28, 2013
Showing with 1,030 additions and 1,088 deletions.
  1. +22 −24 ...e-testsuite/src/test/java/org/sonatype/nexus/client/testsuite/{WhitelistIT.java → RoutingIT.java}
  2. +2 −2 ...n/java/org/sonatype/nexus/client/core/subsystem/{whitelist → routing}/DiscoveryConfiguration.java
  3. +9 −9 ...n/java/org/sonatype/nexus/client/core/subsystem/{whitelist/Whitelist.java → routing/Routing.java}
  4. +5 −5 ...ent-core/src/main/java/org/sonatype/nexus/client/core/subsystem/{whitelist → routing}/Status.java
  5. +29 −29 ...ient/internal/rest/jersey/subsystem/{whitelist/JerseyWhitelist.java → routing/JerseyRouting.java}
  6. +9 −9 ...type/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. +10 −10 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepositoryConfiguration.java
  9. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl/WLConfig.java → routing/Config.java}
  10. +3 −3 ...in/java/org/sonatype/nexus/proxy/maven/{wl/WLDiscoveryConfig.java → routing/DiscoveryConfig.java}
  11. +4 −4 ...in/java/org/sonatype/nexus/proxy/maven/{wl/WLDiscoveryStatus.java → routing/DiscoveryStatus.java}
  12. +15 −15 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl/WLManager.java → routing/Manager.java}
  13. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/PrefixSource.java
  14. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/ProxyRequestFilter.java
  15. +3 −3 .../java/org/sonatype/nexus/proxy/maven/{wl/WLPublishingStatus.java → routing/PublishingStatus.java}
  16. +8 −8 ...core/src/main/java/org/sonatype/nexus/proxy/maven/{wl/WLStatus.java → routing/RoutingStatus.java}
  17. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/WritablePrefixSource.java
  18. +2 −2 ...s-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/DiscoveryResult.java
  19. +1 −1 ...src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/LocalContentDiscoverer.java
  20. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/Prioritized.java
  21. +1 −1 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/RemoteContentDiscoverer.java
  22. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/RemoteStrategy.java
  23. +1 −1 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/StrategyFailedException.java
  24. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/discovery/StrategyResult.java
  25. +4 −4 ...n/{wl/events/AbstractWLRepositoryEvent.java → routing/events/AbstractRoutingRepositoryEvent.java}
  26. +11 −11 .../events/WLPublishedRepositoryEvent.java → routing/events/PrefixFilePublishedRepositoryEvent.java}
  27. +6 −6 ...nts/WLUnpublishedRepositoryEvent.java → routing/events/PrefixFileUnpublishedRepositoryEvent.java}
  28. +2 −2 ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/AbstractPrioritized.java
  29. +2 −2 .../src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/AbstractRemoteStrategy.java
  30. +2 −2 ...e/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/ArrayListPrefixSource.java
  31. +15 −15 ...org/sonatype/nexus/proxy/maven/{wl/internal/WLConfigImpl.java → routing/internal/ConfigImpl.java}
  32. +13 −13 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/EventDispatcher.java
  33. +9 −9 ...s-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/FilePrefixSource.java
  34. +1 −1 ...e/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/InvalidInputException.java
  35. +6 −6 .../main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/LocalContentDiscovererImpl.java
  36. +97 −97 ...g/sonatype/nexus/proxy/maven/{wl/internal/WLManagerImpl.java → routing/internal/ManagerImpl.java}
  37. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PathMatcher.java
  38. +6 −6 ...in/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PropfileDiscoveryStatusSource.java
  39. +32 −32 .../src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/ProxyRequestFilterImpl.java
  40. +7 −7 ...main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteContentDiscovererImpl.java
  41. +10 −10 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemotePrefixFileStrategy.java
  42. +10 −10 ...re/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteScrapeStrategy.java
  43. +3 −3 ...n/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/TextFilePrefixSourceMarshaller.java
  44. +12 −12 ...en/{wl/internal/WLUpdateRepositoryRunnable.java → routing/internal/UpdateRepositoryRunnable.java}
  45. +9 −9 ...ain/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/WritablePrefixSourceModifier.java
  46. +5 −5 .../sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AbstractGeneratedIndexPageScraper.java
  47. +3 −3 .../src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AbstractScraper.java
  48. +1 −1 ...main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AmazonS3IndexScraper.java
  49. +1 −1 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/HttpdIndexScraper.java
  50. +1 −1 ...ore/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/NexusScraper.java
  51. +1 −1 ...rc/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/NginxIndexScraper.java
  52. +1 −1 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/Page.java
  53. +2 −2 ...re/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/ScrapeContext.java
  54. +2 −2 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/Scraper.java
  55. +1 −1 .../src/main/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/SvnIndexScraper.java
  56. +4 −4 nexus-core/src/test/java/org/sonatype/nexus/NexusAppTestSupport.java
  57. +1 −1 nexus-core/src/test/java/org/sonatype/nexus/proxy/M2TestsuiteEnvironmentBuilder.java
  58. +3 −3 nexus-core/src/test/java/org/sonatype/nexus/proxy/RequestFlagsTest.java
  59. +8 −7 ...oxy/maven/{wl/internal/AbstractWLProxyTest.java → routing/internal/AbstractRoutingProxyTest.java}
  60. +1 −1 ...src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/GenerateRandomBehaviour.java
  61. +5 −5 ...t/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/LocalContentDiscovererImplTest.java
  62. +2 −1 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PathMatcherTest.java
  63. +8 −8 ...roxy/maven/{wl/internal/WLMaintenanceTest.java → routing/internal/PrefixFileMaintenanceTest.java}
  64. +19 −19 ...UpdatePropagationContentTest.java → routing/internal/PrefixFileUpdatePropagationContentTest.java}
  65. +9 −9 ...agationGroupUpdatesTest.java → routing/internal/PrefixFileUpdatePropagationGroupUpdatesTest.java}
  66. +10 −10 ...wl/internal/WLUpdatePropagationTest.java → routing/internal/PrefixFileUpdatePropagationTest.java}
  67. +8 −7 ...ava/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/PropfileDiscoveryStatusSourceTest.java
  68. +7 −5 .../test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/ProxyRequestFilterImplTest.java
  69. +31 −30 .../java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteContentDiscovererImplTest.java
  70. +7 −5 ...st/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemotePrefixFileIsGarbageTest.java
  71. +6 −5 ...est/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemotePrefixFileStrategyTest.java
  72. +4 −3 ...rc/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/RemoteScrapeStrategyTest.java
  73. +26 −25 ...y/maven/{wl/internal/WLAndLocalStatusTest.java → routing/internal/RoutingAndLocalStatusTest.java}
  74. +26 −25 ...proxy/maven/{wl/internal/WLAndProxyModeTest.java → routing/internal/RoutingAndProxyModeTest.java}
  75. +4 −2 ...va/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/TextFilePrefixSourceMarshallerTest.java
  76. +4 −3 ...java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/WritablePrefixSourceModifierTest.java
  77. +6 −2 .../java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/AmazonS3IndexScraperTest.java
  78. +1 −1 ...src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/DeliverBehaviour.java
  79. +1 −1 .../java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/DeliverTemplateBehaviour.java
  80. +5 −2 ...src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/NexusScraperTest.java
  81. +4 −2 nexus-core/src/test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/PageTest.java
  82. +5 −2 .../test/java/org/sonatype/nexus/proxy/maven/{wl → routing}/internal/scrape/SvnIndexScraperTest.java
  83. +19 −19 ...suite/src/test/java/core/{whitelist/WhitelistDisabledSmokeIT.java → routing/DisabledSmokeIT.java}
  84. +14 −14 ...WhitelistEnableDisableDoesNotLoosePeriodIT.java → routing/EnableDisableDoesNotLoosePeriodIT.java}
  85. +24 −24 ...ore-testsuite/src/test/java/core/{whitelist/WhitelistFilteringIT.java → routing/FilteringIT.java}
  86. +119 −0 nexus-test/nexus-core-testsuite/src/test/java/core/routing/ITSupport.java
  87. +11 −11 ...exus-core-testsuite/src/test/java/core/{whitelist/WhitelistSanityIT.java → routing/SanityIT.java}
  88. +23 −23 .../nexus-core-testsuite/src/test/java/core/{whitelist/WhitelistSmokeIT.java → routing/SmokeIT.java}
  89. +13 −13 ...st/java/core/{whitelist/WhitelistWithGroupRepositoryIT.java → routing/WithGroupRepositoryIT.java}
  90. +7 −8 .../java/core/{whitelist/WhitelistWithHostedRepositoryIT.java → routing/WithHostedRepositoryIT.java}
  91. +16 −16 ...st/java/core/{whitelist/WhitelistWithProxyRepositoryIT.java → routing/WithProxyRepositoryIT.java}
  92. +0 −202 nexus-test/nexus-core-testsuite/src/test/java/core/whitelist/WhitelistITSupport.java
  93. +9 −9 ...hitelist/api/WhitelistWaitForPlexusResource.java → routing/api/RoutingWaitForPlexusResource.java}
  94. +2 −2 ...test-harness-its/src/test/java/org/sonatype/nexus/integrationtests/nexus3860/AbstractCargoIT.java
  95. +2 −2 ...t/nexus-test-harness-launcher/src/main/java/org/sonatype/nexus/test/booter/Jetty8NexusBooter.java
  96. +11 −11 ...-client/src/main/java/org/sonatype/nexus/testsuite/client/{WhitelistTest.java → RoutingTest.java}
  97. +5 −4 ...exception/{WhitelistJobsAreStillRunningException.java → RoutingJobsAreStillRunningException.java}
  98. +15 −15 .../org/sonatype/nexus/testsuite/client/internal/{JerseyWhitelistTest.java → JerseyRoutingTest.java}
  99. +9 −9 ...e/client/rest/{JerseyWhitelistTestSubsystemFactory.java → JerseyRoutingTestSubsystemFactory.java}
  100. +7 −7 ...-webapp/src/main/webapp/js/Sonatype/repoServer/{RepositoryWLPanel.js → RepositoryRoutingPanel.js}
  101. +1 −1 nexus-webapp/src/main/webapp/js/repoServer.js
  102. +6 −6 ...s-restlet1x-model/src/main/java/org/sonatype/nexus/rest/model/XStreamConfiguratorLightweight.java
  103. +21 −21 plugins/restlet1x/nexus-restlet1x-model/src/main/mdo/vos.xml
  104. +23 −23 ...ain/java/org/sonatype/nexus/rest/{mwl/WLConfigResource.java → routing/RoutingConfigResource.java}
  105. +8 −8 ...n/java/org/sonatype/nexus/rest/{mwl/WLResourceSupport.java → routing/RoutingResourceSupport.java}
  106. +28 −28 ...ain/java/org/sonatype/nexus/rest/{mwl/WLStatusResource.java → routing/RoutingStatusResource.java}
  107. +9 −9 .../org/sonatype/nexus/rest/{mwl/WLStatusResourceTest.java → routing/RoutingStatusResourceTest.java}
View
46 ...e/nexus/client/testsuite/WhitelistIT.java → ...ype/nexus/client/testsuite/RoutingIT.java
@@ -20,46 +20,44 @@
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
* Maven Bridge will download the "latest" from remote, not use the build from branch.
*
* @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" );
}
}
View
4 ...tem/whitelist/DiscoveryConfiguration.java → ...ystem/routing/DiscoveryConfiguration.java
@@ -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
View
18 ...t/core/subsystem/whitelist/Whitelist.java → ...lient/core/subsystem/routing/Routing.java
@@ -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;
/**
View
10 ...ient/core/subsystem/whitelist/Status.java → ...client/core/subsystem/routing/Status.java
@@ -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}.
*/
View
58 .../subsystem/whitelist/JerseyWhitelist.java → ...rsey/subsystem/routing/JerseyRouting.java
@@ -10,56 +10,56 @@
* 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
{
/**
* Constructor.
*
* @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( routingPath( mavenRepositoryId ) ).get( RoutingStatusMessageWrapper.class ).getData();
final DiscoveryStatus discoveryStatus;
if ( message.getDiscovery() == null )
@@ -93,12 +93,12 @@ public Status getWhitelistStatus( final String mavenRepositoryId )
}
@Override
- public void updateWhitelist( final String mavenProxyRepositoryId )
+ public void updatePrefixFile( final String mavenProxyRepositoryId )
throws IllegalArgumentException, NexusClientNotFoundException
{
try
{
- getNexusClient().serviceResource( wlPath( mavenProxyRepositoryId ) ).delete();
+ getNexusClient().serviceResource( routingPath( mavenProxyRepositoryId ) ).delete();
}
catch ( UniformInterfaceException e )
{
@@ -116,9 +116,9 @@ public DiscoveryConfiguration getDiscoveryConfigurationFor( final String mavenPr
{
try
{
- final WLConfigMessage message =
- getNexusClient().serviceResource( wlConfigPath( mavenProxyRepositoryId ) ).get(
- WLConfigMessageWrapper.class ).getData();
+ final RoutingConfigMessage message =
+ getNexusClient().serviceResource( routingConfigPath( mavenProxyRepositoryId ) ).get(
+ RoutingConfigMessageWrapper.class ).getData();
return new DiscoveryConfiguration( message.isDiscoveryEnabled(), message.getDiscoveryIntervalHours() );
}
catch ( UniformInterfaceException e )
@@ -138,12 +138,12 @@ 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 );
+ getNexusClient().serviceResource( routingConfigPath( mavenProxyRepositoryId ) ).put( wrapper );
}
catch ( UniformInterfaceException e )
{
@@ -157,20 +157,20 @@ public void setDiscoveryConfigurationFor( final String mavenProxyRepositoryId,
// ==
- static String wlPath( final String mavenRepositoryId )
+ static String routingPath( final String mavenRepositoryId )
{
try
{
- return "repositories/" + URLEncoder.encode( mavenRepositoryId, "UTF-8" ) + "/wl";
+ return "repositories/" + URLEncoder.encode( mavenRepositoryId, "UTF-8" ) + "/routing";
}
catch ( UnsupportedEncodingException e )
{
throw Throwables.propagate( e );
}
}
- static String wlConfigPath( final String mavenRepositoryId )
+ static String routingConfigPath( final String mavenRepositoryId )
{
- return wlPath( mavenRepositoryId ) + "/config";
+ return routingPath( mavenRepositoryId ) + "/config";
}
}
View
18 ...sey/subsystem/JerseyWhitelistFactory.java → ...ersey/subsystem/JerseyRoutingFactory.java
@@ -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 );
}
}
View
8 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepository.java
@@ -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;
View
20 ...re/src/main/java/org/sonatype/nexus/proxy/maven/AbstractMavenRepositoryConfiguration.java
@@ -32,9 +32,9 @@
public static final String CLEANSE_REPOSITORY_METADATA = "cleanseRepositoryMetadata";
- public static final String WL_DISCOVERY_ENABLED = "wlDiscoveryEnabled";
+ public static final String ROUTING_DISCOVERY_ENABLED = "routingDiscoveryEnabled";
- public static final String WL_DISCOVERY_INTERVAL = "wlDiscoveryInterval";
+ public static final String ROUTING_DISCOVERY_INTERVAL = "routingDiscoveryInterval";
public AbstractMavenRepositoryConfiguration( Xpp3Dom configuration )
{
@@ -102,24 +102,24 @@ public void setCleanseRepositoryMetadata( boolean val )
setNodeValue( getRootNode(), CLEANSE_REPOSITORY_METADATA, Boolean.toString( val ) );
}
- public boolean isWLDiscoveryEnabled()
+ public boolean isRoutingDiscoveryEnabled()
{
- return Boolean.parseBoolean( getNodeValue( getRootNode(), WL_DISCOVERY_ENABLED, Boolean.TRUE.toString() ) );
+ return Boolean.parseBoolean( getNodeValue( getRootNode(), ROUTING_DISCOVERY_ENABLED, Boolean.TRUE.toString() ) );
}
- public void setWLDiscoveryEnabled( boolean val )
+ public void setRoutingDiscoveryEnabled( boolean val )
{
- setNodeValue( getRootNode(), WL_DISCOVERY_ENABLED, Boolean.toString( val ) );
+ setNodeValue( getRootNode(), ROUTING_DISCOVERY_ENABLED, Boolean.toString( val ) );
}
- public long getWLDiscoveryInterval()
+ public long getRoutingDiscoveryInterval()
{
- return Long.parseLong( getNodeValue( getRootNode(), WL_DISCOVERY_INTERVAL,
+ return Long.parseLong( getNodeValue( getRootNode(), ROUTING_DISCOVERY_INTERVAL,
String.valueOf( TimeUnit.HOURS.toMillis( 24 ) ) ) );
}
- public void setWLDiscoveryInterval( long val )
+ public void setRoutingDiscoveryInterval( long val )
{
- setNodeValue( getRootNode(), WL_DISCOVERY_INTERVAL, String.valueOf( val ) );
+ setNodeValue( getRootNode(), ROUTING_DISCOVERY_INTERVAL, String.valueOf( val ) );
}
}
View
4 ...natype/nexus/proxy/maven/wl/WLConfig.java → ...ype/nexus/proxy/maven/routing/Config.java
@@ -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
View
6 ...xus/proxy/maven/wl/WLDiscoveryConfig.java → .../proxy/maven/routing/DiscoveryConfig.java
@@ -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;
View
8 ...xus/proxy/maven/wl/WLDiscoveryStatus.java → .../proxy/maven/routing/DiscoveryStatus.java
@@ -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() );
View
30 ...atype/nexus/proxy/maven/wl/WLManager.java → ...pe/nexus/proxy/maven/routing/Manager.java
@@ -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 );
}
View
2 ...pe/nexus/proxy/maven/wl/PrefixSource.java → ...xus/proxy/maven/routing/PrefixSource.java
@@ -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;
View
2 ...us/proxy/maven/wl/ProxyRequestFilter.java → ...oxy/maven/routing/ProxyRequestFilter.java
@@ -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;
View
6 ...us/proxy/maven/wl/WLPublishingStatus.java → ...proxy/maven/routing/PublishingStatus.java
@@ -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 );
View
16 ...natype/nexus/proxy/maven/wl/WLStatus.java → ...us/proxy/maven/routing/RoutingStatus.java
@@ -10,29 +10,29 @@
* 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.
*
* @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;
}
View
2 .../proxy/maven/wl/WritablePrefixSource.java → ...y/maven/routing/WritablePrefixSource.java
@@ -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;
View
4 ...y/maven/wl/discovery/DiscoveryResult.java → ...en/routing/discovery/DiscoveryResult.java
@@ -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.
View
2 .../wl/discovery/LocalContentDiscoverer.java → ...ing/discovery/LocalContentDiscoverer.java
@@ -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;
View
2 ...proxy/maven/wl/discovery/Prioritized.java → .../maven/routing/discovery/Prioritized.java
@@ -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;
View
2 ...wl/discovery/RemoteContentDiscoverer.java → ...ng/discovery/RemoteContentDiscoverer.java
@@ -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;
View
2 ...xy/maven/wl/discovery/RemoteStrategy.java → ...ven/routing/discovery/RemoteStrategy.java
@@ -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;
View
2 ...wl/discovery/StrategyFailedException.java → ...ng/discovery/StrategyFailedException.java
@@ -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
View
4 ...xy/maven/wl/discovery/StrategyResult.java → ...ven/routing/discovery/StrategyResult.java
@@ -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.
View
8 .../wl/events/AbstractWLRepositoryEvent.java → ...vents/AbstractRoutingRepositoryEvent.java
@@ -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 );
}
View
22 ...wl/events/WLPublishedRepositoryEvent.java → ...s/PrefixFilePublishedRepositoryEvent.java
@@ -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 );
View
12 .../events/WLUnpublishedRepositoryEvent.java → ...PrefixFileUnpublishedRepositoryEvent.java
@@ -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 );
}
View
4 ...aven/wl/internal/AbstractPrioritized.java → ...routing/internal/AbstractPrioritized.java
@@ -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.
View
4 ...n/wl/internal/AbstractRemoteStrategy.java → ...ting/internal/AbstractRemoteStrategy.java
@@ -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.
View
4 ...en/wl/internal/ArrayListPrefixSource.java → ...uting/internal/ArrayListPrefixSource.java
@@ -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}.
View
30 ...proxy/maven/wl/internal/WLConfigImpl.java → ...xy/maven/routing/internal/ConfigImpl.java
@@ -10,15 +10,15 @@
* 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;
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,16 +32,16 @@
*/
@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
* 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>
- * 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,39 +50,39 @@
* 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;
/**
* 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;
}
View
26 ...xy/maven/wl/internal/EventDispatcher.java → ...ven/routing/internal/EventDispatcher.java
@@ -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 )
View
18 ...y/maven/wl/internal/FilePrefixSource.java → ...en/routing/internal/FilePrefixSource.java
@@ -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 );
View
2 ...en/wl/internal/InvalidInputException.java → ...uting/internal/InvalidInputException.java
@@ -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;
View
12 .../internal/LocalContentDiscovererImpl.java → .../internal/LocalContentDiscovererImpl.java
@@ -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 );
View
194 ...roxy/maven/wl/internal/WLManagerImpl.java → ...y/maven/routing/internal/ManagerImpl.java
@@ -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 )
@@ -158,7 +158,7 @@ public WLManagerImpl( final EventBus eventBus, final ApplicationStatusSource app
this.remoteContentDiscoverer = checkNotNull( remoteContentDiscoverer );
this.quickRemoteStrategy = checkNotNull( quickRemoteStrategy );
this.executor =
- new ScheduledThreadPoolExecutor( 5, new NexusThreadFactory( "wl", "WL-Updater" ),
+ new ScheduledThreadPoolExecutor( 5, new NexusThreadFactory( "ar", "AR-Updater" ),
new ThreadPoolExecutor.AbortPolicy() );
this.constrainedExecutor = new ConstrainedExecutorImpl( executor );
// register event dispatcher
@@ -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,25 +209,25 @@ public void startup()
&& mavenRepository.getLocalStatus().shouldServiceRequest() )
{
// groups will not be collected to needs-update list
- doInitializeWhitelistOnStartup( mavenRepository );
+ doInitializePrefixFileOnStartup( mavenRepository );
}
}
}
// spawn all the needed updates as bg jobs
// 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.
*/