Implement a new repository client #627

Closed
wants to merge 12 commits into
from

Projects

None yet

3 participants

@adreghiciu
Contributor

Signed-off-by: Alin Dreghiciu adreghiciu@gmail.com

@adreghiciu adreghiciu Implement a new repository client
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
b984063
@adreghiciu adreghiciu Add proxies URL getter
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
69b9df0
@jdillon jdillon commented on an outdated diff Oct 30, 2012
...xus/client/core/NexusUnexpectedResponseException.java
@@ -31,7 +32,7 @@
public NexusUnexpectedResponseException( final int statusCode, final String statusMessage )
{
this( statusCode, statusMessage, String.format( "Unexpected response: %s %s", String.valueOf( statusCode ),
- String.valueOf( statusMessage ) ) );
+ String.valueOf( statusMessage ) ) );
}
@jdillon
jdillon Oct 30, 2012 Contributor

Uneeded String.valueOf() in arguments to String.format()

@jdillon jdillon commented on an outdated diff Oct 30, 2012
...client/core/subsystem/repository/GroupRepository.java
+ * Copyright (c) 2007-2012 Sonatype, Inc.
+ * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
+ *
+ * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
+ * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
+ * 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.repository;
+
+/**
+ * TODO
+ *
+ * @since 2.2
@jdillon
jdillon Oct 30, 2012 Contributor

Should be 2.3 no? Same for all the since tags in here...

@jdillon jdillon commented on an outdated diff Oct 30, 2012
.../subsystem/repository/maven/MavenGroupRepository.java
+ * Copyright (c) 2007-2012 Sonatype, Inc.
+ * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
+ *
+ * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
+ * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
+ * 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.repository.maven;
+
+import org.sonatype.nexus.client.core.subsystem.repository.GroupRepository;
+
+/**
+ * TODO
@jdillon
jdillon Oct 30, 2012 Contributor

Would really like to see less TODO comments... something more appropriate like:

Subsystem for Maven group repositories

etc.

@jdillon jdillon commented on an outdated diff Oct 30, 2012
...est/jersey/subsystem/repository/JerseyRepository.java
+package org.sonatype.nexus.client.internal.rest.jersey.subsystem.repository;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.sonatype.nexus.client.core.spi.SubsystemSupport;
+import org.sonatype.nexus.client.core.subsystem.repository.Repository;
+import org.sonatype.nexus.client.core.subsystem.repository.RepositoryStatus;
+import org.sonatype.nexus.client.rest.jersey.JerseyNexusClient;
+import org.sonatype.nexus.rest.model.RepositoryBaseResource;
+import org.sonatype.nexus.rest.model.RepositoryResourceResponse;
+import org.sonatype.nexus.rest.model.RepositoryStatusResource;
+import org.sonatype.nexus.rest.model.RepositoryStatusResourceResponse;
+import com.google.common.base.Throwables;
+
+public abstract class JerseyRepository<T extends Repository, S extends RepositoryBaseResource, U extends RepositoryStatus>
@jdillon
jdillon Oct 30, 2012 Contributor

Missing javadocs :-(

@jdillon jdillon commented on an outdated diff Oct 30, 2012
...ository/maven/JerseyMavenHostedRepositoryFactory.java
+import org.sonatype.nexus.rest.model.RepositoryBaseResource;
+import org.sonatype.nexus.rest.model.RepositoryResource;
+
+@Named
+@Singleton
+public class JerseyMavenHostedRepositoryFactory
+ extends JerseyHostedRepositoryFactory
+{
+
+ @Override
+ public int canAdapt( final RepositoryBaseResource resource )
+ {
+ int score = super.canAdapt( resource );
+ if ( score > 0 )
+ {
+ if ( "maven2".equals( resource.getProvider() ) )
@jdillon
jdillon Oct 30, 2012 Contributor

Are there any const that can be used instead of duplicating strings like this?

@jdillon jdillon commented on an outdated diff Oct 30, 2012
...atype/plexus/rest/xstream/xml/LookAheadXppDriver.java
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+
+import com.thoughtworks.xstream.io.HierarchicalStreamReader;
+import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
+import com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer;
+import com.thoughtworks.xstream.io.xml.XppDriver;
+
+/**
+ * A HierarchicalStreamDriver that loads the {@link LookAheadXppReader}.
+ */
@jdillon
jdillon Oct 30, 2012 Contributor

missing since tags (in a few places other than this too)

@jdillon
Contributor
jdillon commented Oct 30, 2012

Generally looks good, with some minor clean up (see comments) I'm +1

@adreghiciu
Contributor

I will fix them. Most of the remarks are on sources that were already in but I reformat them. Anyhow good catch. Tx.

adreghiciu added some commits Oct 30, 2012
@adreghiciu adreghiciu Fix @since tags / Drop TODO
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
c0ae0af
@adreghiciu adreghiciu Set log level to DEBUG for http client
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
d98a61d
@adreghiciu adreghiciu Use constants
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
b9ffa50
@adreghiciu adreghiciu Fix @since tags
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
08412e9
@cstamas
Contributor
cstamas commented Oct 30, 2012

+1

adreghiciu added some commits Oct 30, 2012
@adreghiciu adreghiciu Java Doc
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
3cfe3b4
@adreghiciu adreghiciu Rename shadow to virtual
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
c70b5a3
@adreghiciu adreghiciu Format
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
b1b8b62
@adreghiciu adreghiciu Java Doc
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
dd9ef3f
@jdillon
Contributor
jdillon commented Oct 31, 2012

How does this relate to #542 ?

adreghiciu added some commits Oct 31, 2012
@adreghiciu adreghiciu Add virtualized repository getter
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
ea17031
@adreghiciu adreghiciu Add member repositories getter
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
096c9a5
@adreghiciu adreghiciu closed this Oct 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment