aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/music/datastore/Condition.java
diff options
context:
space:
mode:
authorMohammad Salehe <salehe@cs.toronto.edu>2019-02-08 11:58:35 -0500
committerMohammad Salehe <salehe@cs.toronto.edu>2019-02-24 22:23:39 -0500
commitee0e4cef1eaba1691f2a69c94f9707a9dbcfcd63 (patch)
tree0ea14a449dd3e1c7cb9269dfba65bd650c8af23c /src/main/java/org/onap/music/datastore/Condition.java
parentf6b5b60d066fa47ef520c58305aa6f28827f106b (diff)
Make MusicCore non-staticdev-cassandra-only
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 <salehe@cs.toronto.edu>
Diffstat (limited to 'src/main/java/org/onap/music/datastore/Condition.java')
-rw-r--r--src/main/java/org/onap/music/datastore/Condition.java35
1 files changed, 16 insertions, 19 deletions
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<String, Object> conditions;
- PreparedQueryObject selectQueryForTheRow;
- private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Condition.class);
- //private static MusicCoreService musicCore = MusicCassaCore.getInstance();
-
- public Condition(Map<String, Object> 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<String, Object> conditions;
+ PreparedQueryObject selectQueryForTheRow;
+ private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Condition.class);
+ //private static MusicCoreService musicCore = MusicCassaCore.getInstance();
+
+ public Condition(Map<String, Object> 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);
+ }
+}