Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

NXCM-4861: Applied review comments

  • Loading branch information...
commit 8a44439b25203ef6aebef7534a264004d3571395 1 parent 0b3382c
@cstamas cstamas authored
View
8 nexus/nexus-api/src/main/java/org/sonatype/nexus/proxy/RequestContext.java
@@ -17,6 +17,8 @@
import java.util.Stack;
import org.codehaus.plexus.util.StringUtils;
+import org.sonatype.nexus.proxy.repository.GroupRepository;
+import org.sonatype.nexus.proxy.repository.ProxyRepository;
public class RequestContext
extends HashMap<String, Object>
@@ -30,13 +32,13 @@
/** Context URL of the original resource requested on the incoming connector. */
public static final String CTX_REQUEST_URL = "request.url";
- /** Context flag to mark a request local only (proxy: do not attempt remote access at all, else: no effect). */
+ /** Context flag to mark a request local only. For {@link ProxyRepository} instances: do not attempt remote access at all, else: no effect. */
public static final String CTX_LOCAL_ONLY_FLAG = "request.localOnly";
- /** Context flag to mark a request local only (proxy: force remote access -- might still serve local if up2date, else: no effect). */
+ /** Context flag to mark a request local only. For {@link ProxyRepository} instances: force remote access -- might still serve local if cache is fresh, else: no effect. */
public static final String CTX_REMOTE_ONLY_FLAG = "request.remoteOnly";
- /** Context flag to mark a request local only (group: do not "dive" into members, else: no effect). */
+ /** Context flag to mark a request local only. For {@link GroupRepository} instances: do not "dive" into members, else: no effect. */
public static final String CTX_GROUP_LOCAL_ONLY_FLAG = "request.groupLocalOnly";
/** Context key for condition "if-modified-since" */
View
6 nexus/nexus-api/src/main/java/org/sonatype/nexus/proxy/ResourceStoreRequest.java
@@ -48,9 +48,9 @@
/**
* Constructor.
*
- * @param requestPath
- * @param localOnly
- * @param remoteOnly
+ * @param requestPath the request path.
+ * @param localOnly See {@link RequestContext#CTX_LOCAL_ONLY_FLAG}.
+ * @param remoteOnly See {@link RequestContext#CTX_REMOTE_ONLY_FLAG}.
*/
public ResourceStoreRequest( String requestPath, boolean localOnly, boolean remoteOnly )
{
View
12 .../org/sonatype/nexus/proxy/maven/Nxcm4861Test.java → ...tifactStoreHelper_storeItemWithChecksumsTest.java
@@ -46,11 +46,19 @@
import org.sonatype.nexus.proxy.storage.local.LocalRepositoryStorage;
import org.sonatype.sisu.litmus.testsupport.mock.MockitoRule;
-public class Nxcm4861Test
+/**
+ * UT for NXCM-4861: {@link ArtifactStoreHelper#storeItemWithChecksums(boolean, org.sonatype.nexus.proxy.item.AbstractStorageItem)}
+ * was in some cases causing proxying to kick in (after store item was retrieved from remote -- only in case of procurement reposes
+ * but still wrong).
+ *
+ * Despite extending {@link AbstractProxyTestEnvironment} it actually uses
+ * a hosted repo only, and using spy determines actually happened invocations.
+ */
+public class Nxcm4861ArtifactStoreHelper_storeItemWithChecksumsTest
extends AbstractProxyTestEnvironment
{
- private Logger log = LoggerFactory.getLogger( Nxcm4861Test.class );
+ private Logger log = LoggerFactory.getLogger( Nxcm4861ArtifactStoreHelper_storeItemWithChecksumsTest.class );
private static final String REPO_ID = "inhouse";
Please sign in to comment.
Something went wrong with that request. Please try again.