From f42275cef1280bedd2d8736a2e06cce4be585657 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Tue, 16 Apr 2013 11:16:28 +0200 Subject: [PATCH] SONAR-3893 Symbol perspective data persistence in snapshot_data --- .../batch/scan/source/SourceDataCache.java | 45 +++++++++++++++++++ .../scan/source/SymbolDataPersister.java | 30 +++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 sonar-batch/src/main/java/org/sonar/batch/scan/source/SourceDataCache.java create mode 100644 sonar-batch/src/main/java/org/sonar/batch/scan/source/SymbolDataPersister.java diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/source/SourceDataCache.java b/sonar-batch/src/main/java/org/sonar/batch/scan/source/SourceDataCache.java new file mode 100644 index 00000000000..49f1a7af1e3 --- /dev/null +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/source/SourceDataCache.java @@ -0,0 +1,45 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ + +package org.sonar.batch.scan.source; + +import com.google.common.collect.Maps; +import org.sonar.api.BatchComponent; + +import java.util.Map; + +public abstract class SourceDataCache implements BatchComponent { + + protected Map sourceDataByComponent; + + protected SourceDataCache() { + sourceDataByComponent = Maps.newHashMap(); + } + + public void registerSourceData(String componentKey, String serializedData) { + sourceDataByComponent.put(componentKey, serializedData); + } + + public Map getSourceDataByComponent() { + return sourceDataByComponent; + } + + public abstract String getDataType(); +} diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/source/SymbolDataPersister.java b/sonar-batch/src/main/java/org/sonar/batch/scan/source/SymbolDataPersister.java new file mode 100644 index 00000000000..1bbbe1826fd --- /dev/null +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/source/SymbolDataPersister.java @@ -0,0 +1,30 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ + +package org.sonar.batch.scan.source; + +import org.sonar.batch.index.ScanPersister; + +public class SymbolDataPersister implements ScanPersister { + @Override + public void persist() { + //To change body of implemented methods use File | Settings | File Templates. + } +} -- 2.39.5