X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Fmain%2FMusicCore.java;h=658f2124211402f399e4550b7c30457bbd69a4e9;hb=90d35b7f55d1ea3eb6ccf8218d9ac42412fd0d90;hp=1f1d6a163c4ef022f6ce4b08fd1b5a2bde00b242;hpb=7a8411afab33104f8bea2048411bb9da5e7b0f68;p=music.git diff --git a/src/main/java/org/onap/music/main/MusicCore.java b/src/main/java/org/onap/music/main/MusicCore.java index 1f1d6a16..658f2124 100644 --- a/src/main/java/org/onap/music/main/MusicCore.java +++ b/src/main/java/org/onap/music/main/MusicCore.java @@ -24,8 +24,18 @@ package org.onap.music.main; import java.util.List; import java.util.Map; + +import javax.ws.rs.core.MultivaluedMap; + import org.onap.music.datastore.Condition; import org.onap.music.datastore.PreparedQueryObject; +import org.onap.music.datastore.jsonobjects.JsonDelete; +import org.onap.music.datastore.jsonobjects.JsonIndex; +import org.onap.music.datastore.jsonobjects.JsonInsert; +import org.onap.music.datastore.jsonobjects.JsonKeySpace; +import org.onap.music.datastore.jsonobjects.JsonSelect; +import org.onap.music.datastore.jsonobjects.JsonTable; +import org.onap.music.datastore.jsonobjects.JsonUpdate; import org.onap.music.eelf.logging.EELFLoggerDelegate; import org.onap.music.exceptions.MusicLockingException; import org.onap.music.exceptions.MusicQueryException; @@ -34,6 +44,7 @@ import org.onap.music.lockingservice.cassandra.CassaLockStore; import org.onap.music.lockingservice.cassandra.LockType; import org.onap.music.lockingservice.cassandra.MusicLockState; import org.onap.music.service.MusicCoreService; + import com.datastax.driver.core.ResultSet; public class MusicCore { @@ -78,6 +89,10 @@ public class MusicCore { return musicCore.createLockReference(fullyQualifiedKey, locktype); } + public static String createLockReference(String fullyQualifiedKey, LockType locktype, String owner) throws MusicLockingException { + return musicCore.createLockReference(fullyQualifiedKey, locktype, owner); + } + public static ResultType createTable(String keyspace, String table, PreparedQueryObject tableQueryObject, String consistency) throws MusicServiceException { return musicCore.createTable(keyspace, table, tableQueryObject, consistency); @@ -106,6 +121,10 @@ public class MusicCore { public static List getCurrentLockHolders(String fullyQualifiedKey) { return musicCore.getCurrentLockHolders(fullyQualifiedKey); } + + public static ReturnType promoteLock(String lockIdToPromote) throws MusicLockingException { + return musicCore.promoteLock(lockIdToPromote); + } public static void destroyLockRef(String lockId) throws MusicLockingException { musicCore.destroyLockRef(lockId); @@ -181,7 +200,61 @@ public class MusicCore { public static MusicLockState releaseLock(String lockId, boolean voluntaryRelease) throws MusicLockingException { return musicCore.releaseLock(lockId, voluntaryRelease); } + + public static List releaseAllLocksForOwner(String ownerId, String keyspace, String table) throws MusicLockingException, MusicServiceException, MusicQueryException { + return musicCore.releaseAllLocksForOwner(ownerId, keyspace, table); + } - + //Added changes for orm implementation. + + public static ResultType createKeyspace(JsonKeySpace jsonKeySpaceObject, String consistencyInfo) + throws MusicServiceException, MusicQueryException { + return musicCore.createKeyspace(jsonKeySpaceObject,consistencyInfo); + } + + public static ResultType dropKeyspace(JsonKeySpace josnKeyspaceObject, String consistencyInfo) + throws MusicServiceException,MusicQueryException { + return musicCore.dropKeyspace(josnKeyspaceObject, consistencyInfo); + } + + public static ResultType createTable(JsonTable jsonTableObject,String consistencyInfo) + throws MusicServiceException,MusicQueryException { + return musicCore.createTable(jsonTableObject, consistencyInfo); + } + + public static ResultType dropTable(JsonTable jsonTableObject, String consistencyInfo) + throws MusicServiceException, MusicQueryException { + return musicCore.dropTable(jsonTableObject, consistencyInfo); + } + + public static ResultType createIndex(JsonIndex jsonIndexObject, String consistencyInfo) + throws MusicServiceException,MusicQueryException { + return musicCore.createIndex(jsonIndexObject, consistencyInfo); + } + + public static ResultSet select(JsonSelect jsonSelect, MultivaluedMap rowParams) + throws MusicServiceException, MusicQueryException{ + return musicCore.select(jsonSelect, rowParams); + } + + public static ResultSet selectCritical(JsonInsert jsonInsertObj, MultivaluedMap rowParams) + throws MusicLockingException, MusicQueryException, MusicServiceException{ + return musicCore.selectCritical(jsonInsertObj, rowParams); + } + + + public static ReturnType insertIntoTable(JsonInsert jsonInsert) throws MusicLockingException, MusicQueryException, MusicServiceException{ + return musicCore.insertIntoTable(jsonInsert); + } + + public static ReturnType updateTable(JsonUpdate jsonUpdateObj,MultivaluedMap rowParams) + throws MusicLockingException, MusicQueryException, MusicServiceException{ + return musicCore.updateTable(jsonUpdateObj, rowParams); + } + + public static ReturnType deleteFromTable(JsonDelete jsonDeleteObj,MultivaluedMap rowParams) + throws MusicLockingException, MusicQueryException, MusicServiceException{ + return musicCore.deleteFromTable(jsonDeleteObj,rowParams); + } }