001 /* 002 * Sonar, open source software quality management tool. 003 * Copyright (C) 2009 SonarSource SA 004 * mailto:contact AT sonarsource DOT com 005 * 006 * Sonar is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 3 of the License, or (at your option) any later version. 010 * 011 * Sonar is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with Sonar; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 019 */ 020 package org.sonar.api.database.daos; 021 022 import org.sonar.api.database.model.RuleFailureModel; 023 import org.sonar.api.database.model.Snapshot; 024 import org.sonar.api.profiles.RulesProfile; 025 import org.sonar.api.rules.ActiveRule; 026 import org.sonar.api.rules.Rule; 027 import org.sonar.api.rules.RuleParam; 028 import org.sonar.api.rules.RulesCategory; 029 030 import java.util.Collections; 031 import java.util.List; 032 033 /** 034 * @deprecated since 2.3 035 */ 036 @Deprecated 037 public class RulesDao { 038 039 private org.sonar.jpa.dao.RulesDao target; 040 041 public RulesDao(org.sonar.jpa.dao.RulesDao target) { 042 this.target = target; 043 } 044 045 public List<Rule> getRules() { 046 return target.getRules(); 047 } 048 049 public List<Rule> getRulesByPlugin(String pluginKey) { 050 return target.getRulesByPlugin(pluginKey); 051 } 052 053 public List<Rule> getRulesByCategory(RulesCategory categ) { 054 return Collections.emptyList(); 055 } 056 057 public Rule getRuleByKey(String pluginKey, String ruleKey) { 058 return target.getRuleByKey(pluginKey, ruleKey); 059 } 060 061 public Long countRules(List<String> plugins, String categoryName) { 062 return target.countRules(plugins); 063 } 064 065 public List<RulesCategory> getCategories() { 066 return Collections.emptyList(); 067 } 068 069 public RulesCategory getCategory(String key) { 070 return null; 071 } 072 073 public List<RuleParam> getRuleParams() { 074 return target.getRuleParams(); 075 } 076 077 public RuleParam getRuleParam(Rule rule, String paramKey) { 078 return target.getRuleParam(rule, paramKey); 079 } 080 081 public void addActiveRulesToProfile(List<ActiveRule> activeRules, int profileId, String pluginKey) { 082 target.addActiveRulesToProfile(activeRules, profileId, pluginKey); 083 } 084 085 public List<RuleFailureModel> getViolations(Snapshot snapshot) { 086 return target.getViolations(snapshot); 087 } 088 089 public void synchronizeRuleOfActiveRule(ActiveRule activeRule, String pluginKey) { 090 target.synchronizeRuleOfActiveRule(activeRule, pluginKey); 091 } 092 093 public boolean isRuleParamEqual(RuleParam ruleParam, RuleParam ruleParamFromDatabase, String ruleKey, String pluginKey) { 094 return target.isRuleParamEqual(ruleParam, ruleParamFromDatabase, ruleKey, pluginKey); 095 } 096 097 public RulesProfile getProfileById(int profileId) { 098 return target.getProfileById(profileId); 099 } 100 }