class MavenApiRepositoryAdapter 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 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);
    }
  }

  @Inject public  MavenApiRepositoryAdapter(final RoutingRuleStore routingRuleStore);

}