class AptApiRepositoryAdapter extends SimpleApiRepositoryAdapter {

  @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;
  }

  @Inject public  AptApiRepositoryAdapter(final RoutingRuleStore routingRuleStore);

}