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.List; 031 032 @Deprecated 033 public class RulesDao { 034 035 private org.sonar.jpa.dao.RulesDao target; 036 037 public RulesDao(org.sonar.jpa.dao.RulesDao target) { 038 this.target = target; 039 } 040 041 public List<Rule> getRules() { 042 return target.getRules(); 043 } 044 045 public List<Rule> getRulesByPlugin(String pluginKey) { 046 return target.getRulesByPlugin(pluginKey); 047 } 048 049 public List<Rule> getRulesByCategory(RulesCategory categ) { 050 return target.getRulesByCategory(categ); 051 } 052 053 public Rule getRuleByKey(String pluginKey, String ruleKey) { 054 return target.getRuleByKey(pluginKey, ruleKey); 055 } 056 057 public Long countRules(List<String> plugins, String categoryName) { 058 return target.countRules(plugins, categoryName); 059 } 060 061 public List<RulesCategory> getCategories() { 062 return target.getCategories(); 063 } 064 065 public RulesCategory getCategory(String key) { 066 return target.getCategory(key); 067 } 068 069 070 public List<RuleParam> getRuleParams() { 071 return target.getRuleParams(); 072 } 073 074 public RuleParam getRuleParam(Rule rule, String paramKey) { 075 return target.getRuleParam(rule, paramKey); 076 } 077 078 public void addActiveRulesToProfile(List<ActiveRule> activeRules, int profileId, String pluginKey) { 079 target.addActiveRulesToProfile(activeRules, profileId, pluginKey); 080 } 081 082 public List<RuleFailureModel> getViolations(Snapshot snapshot) { 083 return target.getViolations(snapshot); 084 } 085 086 public void synchronizeRuleOfActiveRule(ActiveRule activeRule, String pluginKey) { 087 target.synchronizeRuleOfActiveRule(activeRule, pluginKey); 088 } 089 090 public boolean isRuleParamEqual(RuleParam ruleParam, RuleParam ruleParamFromDatabase, String ruleKey, String pluginKey) { 091 return target.isRuleParamEqual(ruleParam, ruleParamFromDatabase, ruleKey, pluginKey); 092 } 093 094 public RulesProfile getProfileById(int profileId) { 095 return target.getProfileById(profileId); 096 } 097 }