Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Java Doc

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
  • Loading branch information...
commit 3cfe3b4787e4ca637c74329e8bb9c7e846defdd1 1 parent 08412e9
@adreghiciu adreghiciu authored
Showing with 215 additions and 3 deletions.
  1. +8 −0 nexus/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/GroupRepository.java
  2. +27 −0 ...s/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/HostedRepository.java
  3. +44 −1 nexus/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/ProxyRepository.java
  4. +8 −0 ...us-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/ProxyRepositoryStatus.java
  5. +34 −0 nexus/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/Repositories.java
  6. +45 −0 nexus/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/Repository.java
  7. +5 −0 ...s/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/RepositoryStatus.java
  8. +8 −0 ...s/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/ShadowRepository.java
  9. +3 −0  ...ient-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenGroupRepository.java
  10. +13 −0 ...ent-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenHostedRepository.java
  11. +15 −0 ...ient-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenProxyRepository.java
  12. +3 −0  ...ent-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenShadowRepository.java
  13. +2 −2 ...rc/main/java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyProxyRepository.java
View
8 ...nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/GroupRepository.java
@@ -13,12 +13,20 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * A Nexus group {@link Repository}.
+ *
* @since 2.3
*/
public interface GroupRepository<T extends GroupRepository>
extends Repository<T, RepositoryStatus>
{
+ /**
+ * Configures member repositories. Provided member repositories will replace exiting members (if any).
+ *
+ * @param memberRepositoryIds id of member repositories to be added (cannot be null)
+ * @return itself, for fluent api usage
+ */
T ofRepositories( String... memberRepositoryIds );
}
View
27 ...exus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/HostedRepository.java
@@ -13,6 +13,8 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * A Nexus hosted {@link Repository}.
+ *
* @since 2.3
*/
public interface HostedRepository<T extends HostedRepository>
@@ -21,14 +23,39 @@
T withRepoPolicy( final String policy );
+ /**
+ * Makes repository a read-only repository.
+ *
+ * @return itself, for fluent api usage
+ */
T readOnly();
+ /**
+ * Allow redeploy of items into repository.
+ *
+ * @return itself, for fluent api usage
+ */
T allowRedeploy();
+ /**
+ * Do not allow redeployment into repository (items cannot be updated)
+ *
+ * @return itself, for fluent api usage
+ */
T disableRedeploy();
+ /**
+ * Enable browsing (see content of repository)
+ *
+ * @return itself, for fluent api usage
+ */
T enableBrowsing();
+ /**
+ * Disable browsing (see content of repository).
+ *
+ * @return itself, for fluent api usage
+ */
T disableBrowsing();
}
View
45 ...nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/ProxyRepository.java
@@ -13,26 +13,69 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * A Nexus proxy {@link Repository}.
+ *
* @since 2.3
*/
public interface ProxyRepository<T extends ProxyRepository>
extends Repository<T, ProxyRepositoryStatus>
{
+ /**
+ * @return proxied URI
+ */
String proxyUri();
+ /**
+ * Configures repository policy (RELEASES/SNAPSHOTS/MIXED).
+ *
+ * @param policy repository policy
+ * @return itself, for fluent api usage
+ */
T withRepoPolicy( final String policy );
- T asProxyOf( String remoteUrl );
+ /**
+ * Sets the URI of proxied repository.
+ *
+ * @param remoteUri of proxied repository
+ * @return itself, for fluent api usage
+ */
+ T asProxyOf( String remoteUri );
+ /**
+ * Auto block the repository if proxied repository is unresponsive.
+ *
+ * @return itself, for fluent api usage
+ */
T autoBlock();
+ /**
+ * Do not auto block the repository if proxied repository is unresponsive.
+ *
+ * @return itself, for fluent api usage
+ */
T doNotAutoBlock();
+ /**
+ * Directly blocks the repository (no save required).
+ *
+ * @return itself, for fluent api usage
+ */
T block();
+ /**
+ * Directly unblocks the repository (no save required).
+ *
+ * @return itself, for fluent api usage
+ */
T unblock();
+ /**
+ * Sets the number of minutes that not found items will be kept in NFC.
+ *
+ * @param minutes not found cache TTL in minutes
+ * @return itself, for fluent api usage
+ */
T withNotFoundCacheTTL( int minutes );
}
View
8 ...client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/ProxyRepositoryStatus.java
@@ -13,14 +13,22 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * Status of a {@link ProxyRepository}.
+ *
* @since 2.3
*/
public interface ProxyRepositoryStatus
extends RepositoryStatus
{
+ /**
+ * @return if repository is currently blocked (manual or automatic)
+ */
boolean isBlocked();
+ /**
+ * @return if repository is currently automatically blocked
+ */
boolean isAutoBlocked();
}
View
34 nexus/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/Repositories.java
@@ -15,19 +15,53 @@
import java.util.Collection;
/**
+ * Repositories subsystem.
+ *
* @since 2.3
*/
public interface Repositories
{
+ /**
+ * Retrieves an existing repository by id.
+ *
+ * @param id of repository to be retrieved (cannot be null)
+ * @return repository with specified id
+ */
<R extends Repository> R get( String id );
+ /**
+ * Retrieves an existing repository by id.
+ *
+ * @param type expected type of retrieved repository (cannot be null)
+ * @param id of repository to be retrieved (cannot be null)
+ * @return repository with specified id
+ * @throws ClassCastException - if repository with specified id is not to expected type
+ */
<R extends Repository> R get( Class<R> type, String id );
+ /**
+ * Retrieves all existing repositories.
+ *
+ * @return all exiting repositories (never null)
+ */
Collection<Repository> get();
+ /**
+ * Retrieves all existing repositories of specified type.
+ *
+ * @param type expected type of retrieved repository (cannot be null)
+ * @return all exiting repositories of expected type (never null)
+ */
<R extends Repository> Collection<R> get( Class<R> type );
+ /**
+ * Creates a new repository of specified type / id.
+ *
+ * @param type of created repository
+ * @param id of new repository
+ * @return created repository (never null)
+ */
<R extends Repository> R create( Class<R> type, String id );
}
View
45 nexus/nexus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/Repository.java
@@ -13,29 +13,74 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * A Nexus repository.
+ *
* @since 2.3
*/
public interface Repository<T extends Repository, U extends RepositoryStatus>
{
+ /**
+ * @return repository id (never null)
+ */
String id();
+ /**
+ * @return repository name
+ */
String name();
+ /**
+ * @return content URI (null when repository does not publish its URI)
+ */
String contentUri();
+ /**
+ * @return repository status.
+ */
U status();
+ /**
+ * Sets repository name.
+ *
+ * @param name repository name
+ * @return itself, for fluent api usage
+ */
T withName( String name );
+ /**
+ * Directly puts repository out of service (no save required).
+ *
+ * @return itself, for fluent api usage
+ */
T putOutOfService();
+ /**
+ * Directly puts repository in service (no save required).
+ *
+ * @return itself, for fluent api usage
+ */
T putInService();
+ /**
+ * Refreshes repository, replacing any current changes.
+ *
+ * @return itself, for fluent api usage
+ */
T refresh();
+ /**
+ * Saves current changes.
+ *
+ * @return itself, for fluent api usage
+ */
T save();
+ /**
+ * Removes the repository.
+ *
+ * @return itself, for fluent api usage
+ */
T remove();
}
View
5 ...exus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/RepositoryStatus.java
@@ -13,11 +13,16 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * Status of a {@link Repository}.
+ *
* @since 2.3
*/
public interface RepositoryStatus
{
+ /**
+ * @return ir repository is in service or not
+ */
boolean isInService();
}
View
8 ...exus-client-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/ShadowRepository.java
@@ -13,12 +13,20 @@
package org.sonatype.nexus.client.core.subsystem.repository;
/**
+ * A Nexus virtual (shadow) {@link Repository}.
+ *
* @since 2.3
*/
public interface ShadowRepository<T extends ShadowRepository>
extends Repository<T, RepositoryStatus>
{
+ /**
+ * Specify the id of virtualized repository.
+ *
+ * @param repositoryId of virtualized repository
+ * @return itself, for fluent api usage
+ */
T asShadowOf( String repositoryId );
}
View
3  ...t-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenGroupRepository.java
@@ -13,8 +13,11 @@
package org.sonatype.nexus.client.core.subsystem.repository.maven;
import org.sonatype.nexus.client.core.subsystem.repository.GroupRepository;
+import org.sonatype.nexus.client.core.subsystem.repository.Repository;
/**
+ * A Nexus Maven group {@link Repository}.
+ *
* @since 2.3
*/
public interface MavenGroupRepository
View
13 ...-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenHostedRepository.java
@@ -13,16 +13,29 @@
package org.sonatype.nexus.client.core.subsystem.repository.maven;
import org.sonatype.nexus.client.core.subsystem.repository.HostedRepository;
+import org.sonatype.nexus.client.core.subsystem.repository.Repository;
/**
+ * A Nexus Maven hosted {@link Repository}.
+ *
* @since 2.3
*/
public interface MavenHostedRepository
extends HostedRepository<MavenHostedRepository>
{
+ /**
+ * Artifact of this repository will be included in search results.
+ *
+ * @return itself, for fluent api usage
+ */
MavenHostedRepository includeInSearchResults();
+ /**
+ * Artifact of this repository will be excluded from search results.
+ *
+ * @return itself, for fluent api usage
+ */
MavenHostedRepository excludeFromSearchResults();
}
View
15 ...t-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenProxyRepository.java
@@ -13,16 +13,31 @@
package org.sonatype.nexus.client.core.subsystem.repository.maven;
import org.sonatype.nexus.client.core.subsystem.repository.ProxyRepository;
+import org.sonatype.nexus.client.core.subsystem.repository.Repository;
/**
+ * A Nexus Maven proxy {@link Repository}.
+ *
* @since 2.3
*/
public interface MavenProxyRepository
extends ProxyRepository<MavenProxyRepository>
{
+ /**
+ * Configures number of minutes artifacts will be cached.
+ *
+ * @param minutes to be cached
+ * @return itself, for fluent api usage
+ */
MavenProxyRepository withArtifactMaxAge( int minutes );
+ /**
+ * Configures number of minutes artifact metadata will be cached.
+ *
+ * @param minutes to be cached
+ * @return itself, for fluent api usage
+ */
MavenProxyRepository withMetadataMaxAge( int minutes );
}
View
3  ...-core/src/main/java/org/sonatype/nexus/client/core/subsystem/repository/maven/MavenShadowRepository.java
@@ -12,9 +12,12 @@
*/
package org.sonatype.nexus.client.core.subsystem.repository.maven;
+import org.sonatype.nexus.client.core.subsystem.repository.Repository;
import org.sonatype.nexus.client.core.subsystem.repository.ShadowRepository;
/**
+ * A Nexus Maven M2 -> M1 virtual {@link Repository}.
+ *
* @since 2.3
*/
public interface MavenShadowRepository
View
4 ...main/java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyProxyRepository.java
@@ -103,7 +103,7 @@ public T withRepoPolicy( final String policy )
}
@Override
- public T asProxyOf( final String remoteUrl )
+ public T asProxyOf( final String remoteUri )
{
RepositoryResourceRemoteStorage remoteStorage = settings().getRemoteStorage();
if ( remoteStorage == null )
@@ -111,7 +111,7 @@ public T asProxyOf( final String remoteUrl )
remoteStorage = new RepositoryResourceRemoteStorage();
settings().setRemoteStorage( remoteStorage );
}
- remoteStorage.setRemoteStorageUrl( remoteUrl );
+ remoteStorage.setRemoteStorageUrl( remoteUri );
return me();
}
Please sign in to comment.
Something went wrong with that request. Please try again.