class BambooConnection implements BuildCapability, TestCapability {

    @Override
    public boolean isProjectDisabled(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException {
        checkConnected();
        checkSoftwareProjectId(softwareProjectId);
        String planKey = softwareProjectId.getProjectId();
        try {
            Plan plan = bamboo.findPlan(planKey);
            return !plan.isEnabled();
        } catch (BambooPlanNotFoundException e) {
            throw new ProjectNotFoundException("Can't find plan with software project id: " + softwareProjectId, e);
        }
    }

}