Java Code Examples for org.sonatype.nexus.repository.types.ProxyType#NAME

The following examples show how to use org.sonatype.nexus.repository.types.ProxyType#NAME . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MavenApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public AbstractApiRepository adapt(final Repository repository) {
  boolean online = repository.getConfiguration().isOnline();
  String name = repository.getName();
  String url = repository.getUrl();

  switch (repository.getType().toString()) {
    case HostedType.NAME:
      return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), createMavenAttributes(repository));
    case ProxyType.NAME:
      return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), getProxyAttributes(repository),
          getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository),
          createMavenAttributes(repository));
    default:
      return super.adapt(repository);
  }
}
 
Example 2
Source File: AptApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public AbstractApiRepository adapt(final Repository repository) {
  boolean online = repository.getConfiguration().isOnline();
  String name = repository.getName();
  String url = repository.getUrl();

  switch (repository.getType().toString()) {
    case HostedType.NAME:
      return new AptHostedApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), createAptHostedRepositoriesAttributes(repository),
          createAptSigningRepositoriesAttributes(repository));
    case ProxyType.NAME:
      return new AptProxyApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), createAptProxyRepositoriesAttributes(repository),
          getProxyAttributes(repository), getNegativeCacheAttributes(repository),
          getHttpClientAttributes(repository), getRoutingRuleName(repository));
  }
  return null;
}
 
Example 3
Source File: ProxyRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@SuppressWarnings("squid:S00107") // suppress constructor parameter count
@JsonCreator
public ProxyRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("format") final String format,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final StorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup,
    @JsonProperty("proxy") final ProxyAttributes proxy,
    @JsonProperty("negativeCache") final NegativeCacheAttributes negativeCache,
    @JsonProperty("httpClient") final HttpClientAttributes httpClient,
    @JsonProperty("routingRule") final String routingRule)
{
  super(name, format, ProxyType.NAME, online);
  this.storage = storage;
  this.cleanup = cleanup;
  this.proxy = proxy;
  this.negativeCache = negativeCache;
  this.httpClient = httpClient;
  this.routingRule = routingRule;
}
 
Example 4
Source File: SimpleApiProxyRepository.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@JsonCreator
public SimpleApiProxyRepository(
    @JsonProperty("name") final String name,
    @JsonProperty("format") final String format,
    @JsonProperty("url") final String url,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final StorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup,
    @JsonProperty("proxy") final ProxyAttributes proxy,
    @JsonProperty("negativeCache") final NegativeCacheAttributes negativeCache,
    @JsonProperty("httpClient") final HttpClientAttributes httpClient,
    @JsonProperty("routingRuleName") final String routingRuleName)
{
  super(name, format, ProxyType.NAME, url, online);
  this.storage = storage;
  this.cleanup = cleanup;
  this.proxy = proxy;
  this.negativeCache = negativeCache;
  this.httpClient = httpClient;
  this.routingRuleName = routingRuleName;
}
 
Example 5
Source File: SimpleApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public AbstractApiRepository adapt(final Repository repository) {
  boolean online = repository.getConfiguration().isOnline();
  String name = repository.getName();
  String format = repository.getFormat().toString();
  String url = repository.getUrl();

  switch (repository.getType().toString()) {
    case GroupType.NAME:
      return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository),
          getGroupAttributes(repository));
    case HostedType.NAME:
      return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository));
    case ProxyType.NAME:
      return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), getProxyAttributes(repository),
          getNegativeCacheAttributes(repository), getHttpClientAttributes(repository),
          getRoutingRuleName(repository));
    default:
      return null;
  }
}
 
Example 6
Source File: AptProxyRecipe.java    From nexus-repository-apt with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
public AptProxyRecipe(@Named(ProxyType.NAME) Type type, @Named(AptFormat.NAME) Format format) {
  super(type, format);
}
 
Example 7
Source File: AptProxyRecipe.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
public AptProxyRecipe(final HighAvailabilitySupportChecker highAvailabilitySupportChecker,
                      @Named(ProxyType.NAME) final Type type, @Named(AptFormat.NAME) final Format format)
{
  super(highAvailabilitySupportChecker, type, format);
}
 
Example 8
Source File: CocoapodsProxyRecipe.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
public CocoapodsProxyRecipe(@Named(ProxyType.NAME) Type type, @Named(CocoapodsFormat.NAME) Format format) {
  super(type, format);
}