From ee0e4cef1eaba1691f2a69c94f9707a9dbcfcd63 Mon Sep 17 00:00:00 2001 From: Mohammad Salehe Date: Fri, 8 Feb 2019 11:58:35 -0500 Subject: Make MusicCore non-static Make MusicCore and other dependencies (MusicDataStoreHandle) non-static For compatibility, MusicCore still has a singleton instance that is statically instantiated and can be used as needed by legacy users. These changes should be made in calling sites (legacy users using singleton): MusicDataStoreHandle.getDSHandle() -> MusicCore.getInstanceDSHandle() Change-Id: I02b67f316dc21a1498157bc68cc32bf76d3ec01e Issue-ID: MUSIC-148 Signed-off-by: Mohammad Salehe --- .../java/org/onap/music/datastore/Condition.java | 35 ++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src/main/java/org/onap/music/datastore/Condition.java') diff --git a/src/main/java/org/onap/music/datastore/Condition.java b/src/main/java/org/onap/music/datastore/Condition.java index 23994900..4faafb79 100644 --- a/src/main/java/org/onap/music/datastore/Condition.java +++ b/src/main/java/org/onap/music/datastore/Condition.java @@ -31,24 +31,21 @@ import org.onap.music.service.impl.MusicCassaCore; import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Row; - - - public class Condition { - Map conditions; - PreparedQueryObject selectQueryForTheRow; - private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Condition.class); - //private static MusicCoreService musicCore = MusicCassaCore.getInstance(); - - public Condition(Map conditions, PreparedQueryObject selectQueryForTheRow) { - this.conditions = conditions; - this.selectQueryForTheRow = selectQueryForTheRow; - } - - public boolean testCondition() throws Exception { - // first generate the row - ResultSet results = MusicCore.quorumGet(selectQueryForTheRow); - Row row = results.one(); - return MusicDataStoreHandle.getDSHandle().doesRowSatisfyCondition(row, conditions); - } +public class Condition { + Map conditions; + PreparedQueryObject selectQueryForTheRow; + private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Condition.class); + //private static MusicCoreService musicCore = MusicCassaCore.getInstance(); + + public Condition(Map conditions, PreparedQueryObject selectQueryForTheRow) { + this.conditions = conditions; + this.selectQueryForTheRow = selectQueryForTheRow; } + public boolean testCondition() throws Exception { + // first generate the row + ResultSet results = MusicCore.quorumGet(selectQueryForTheRow); + Row row = results.one(); + return MusicDataStore.doesRowSatisfyCondition(row, conditions); + } +} -- cgit 1.2.3-korg