class SonarConnection implements MetricCapability, TestCapability {

    @Override
    public Map<SoftwareProjectId, String> listSoftwareProjectIds() {
        checkConnected();
        Map<SoftwareProjectId, String> projects = new HashMap<SoftwareProjectId, String>();
        try {
            List<Project> names = sonarClient.findProjects().getProjects();
            for (Project project : names) {
                String key = project.getKey();
                projects.put(new SoftwareProjectId(key), project.getName());
            }
        } catch (SonarProjectsNotFoundException e) {
            LOG.warn(e.getMessage(), e);
        }
        return projects;
    }

    public  SonarConnection();

}