|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mymed.controller.core.manager.storage.StorageManager
public class StorageManager
This class represent the DAO pattern: Access to data varies depending on the source of the data. Access to persistent storage, such as to a database, varies greatly depending on the type of storage Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.
Field Summary |
---|
Fields inherited from interface com.mymed.controller.core.manager.storage.IStorageManager |
---|
consistencyOnRead, consistencyOnWrite |
Constructor Summary | |
---|---|
StorageManager()
Default Constructor: will create a ServiceManger on top of a Cassandra Wrapper |
|
StorageManager(WrapperConfiguration conf)
will create a ServiceManger on top of the WrapperType And use the specific configuration file for the transport layer |
Method Summary | |
---|---|
int |
countColumns(java.lang.String tableName,
java.lang.String key)
Count columns in record |
CassandraWrapper |
getWrapper()
|
void |
insertColumn(java.lang.String tableName,
java.lang.String key,
java.lang.String columnName,
byte[] value)
Update the value of a Simple Column |
void |
insertSlice(java.lang.String tableName,
java.lang.String primaryKey,
java.util.Map<java.lang.String,byte[]> args)
Insert a new entry in the database |
void |
insertSuperColumn(java.lang.String tableName,
java.lang.String key,
java.lang.String superColumn,
java.lang.String columnName,
byte[] value)
Update the value of a Super Column |
void |
insertSuperSlice(java.lang.String superTableName,
java.lang.String key,
java.lang.String superKey,
java.util.Map<java.lang.String,byte[]> args)
Insert a new entry in the database |
void |
removeAll(java.lang.String tableName,
java.lang.String key)
Remove an entry in the columnFamily |
void |
removeColumn(java.lang.String tableName,
java.lang.String key,
java.lang.String columnName)
Remove a specific column defined by the columnName |
void |
removeSuperColumn(java.lang.String tableName,
java.lang.String key,
java.lang.String superColumnName)
|
java.util.Map<byte[],byte[]> |
selectAll(java.lang.String tableName,
java.lang.String key)
Get the value of a column family |
byte[] |
selectColumn(java.lang.String tableName,
java.lang.String key,
java.lang.String columnName)
Get the value of an entry column |
java.util.List<java.util.Map<byte[],byte[]>> |
selectList(java.lang.String tableName,
java.lang.String key)
Get the value of a column family |
java.util.Map<byte[],byte[]> |
selectRange(java.lang.String tableName,
java.lang.String key,
java.util.List<java.lang.String> columnNames)
Get the values of a range of columns |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StorageManager() throws InternalBackEndException
InternalBackEndException
public StorageManager(WrapperConfiguration conf) throws InternalBackEndException
conf
- The configuration of the transport layer
InternalBackEndException
Method Detail |
---|
public byte[] selectColumn(java.lang.String tableName, java.lang.String key, java.lang.String columnName) throws InternalBackEndException, IOBackEndException
selectColumn
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entrycolumnName
- the name of the column
IOBackEndException
InternalBackEndException
public java.util.Map<byte[],byte[]> selectAll(java.lang.String tableName, java.lang.String key) throws InternalBackEndException, IOBackEndException
selectAll
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entrycolumnName
- the name of the column
InternalBackEndException
IOBackEndException
public java.util.List<java.util.Map<byte[],byte[]>> selectList(java.lang.String tableName, java.lang.String key) throws InternalBackEndException, IOBackEndException
selectList
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entrycolumnName
- the name of the column
InternalBackEndException
IOBackEndException
public java.util.Map<byte[],byte[]> selectRange(java.lang.String tableName, java.lang.String key, java.util.List<java.lang.String> columnNames) throws InternalBackEndException, IOBackEndException
selectRange
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entrycolumnNames
- the name of the columns to return the values
InternalBackEndException
IOBackEndException
public int countColumns(java.lang.String tableName, java.lang.String key) throws InternalBackEndException
countColumns
in interface IStorageManager
key
- parent
-
InternalBackEndException
public void insertColumn(java.lang.String tableName, java.lang.String key, java.lang.String columnName, byte[] value) throws InternalBackEndException
insertColumn
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entrycolumnName
- the name of the columnvalue
- the value updated
InternalBackEndException
public void insertSuperColumn(java.lang.String tableName, java.lang.String key, java.lang.String superColumn, java.lang.String columnName, byte[] value) throws InternalBackEndException
insertSuperColumn
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entrysuperColumn
- the ID of the superColumncolumnName
- the name of the columnvalue
- the value updated
InternalBackEndException
public void insertSlice(java.lang.String tableName, java.lang.String primaryKey, java.util.Map<java.lang.String,byte[]> args) throws InternalBackEndException
insertSlice
in interface IStorageManager
tableName
- the name of the Table/ColumnFamilykey
- the ID of the entryargs
- All columnName and the their value
InternalBackEndException
public void insertSuperSlice(java.lang.String superTableName, java.lang.String key, java.lang.String superKey, java.util.Map<java.lang.String,byte[]> args) throws IOBackEndException, InternalBackEndException
insertSuperSlice
in interface IStorageManager
superTableName
- the name of the Table/SuperColumnFamilykey
- the ID of the entrysuperKey
- the ID of the entry in the SuperColumnFamilyargs
- All columnName and the their value
ServiceManagerException
InternalBackEndException
IOBackEndException
public void removeColumn(java.lang.String tableName, java.lang.String key, java.lang.String columnName) throws InternalBackEndException
removeColumn
in interface IStorageManager
keyspace
- columnFamily
- key
- columnName
-
InternalBackEndException
public void removeSuperColumn(java.lang.String tableName, java.lang.String key, java.lang.String superColumnName) throws InternalBackEndException
removeSuperColumn
in interface IStorageManager
tableName
- key
- superColumnName
-
InternalBackEndException
public void removeAll(java.lang.String tableName, java.lang.String key) throws InternalBackEndException
removeAll
in interface IStorageManager
keyspace
- columnFamily
- key
-
InternalBackEndException
public CassandraWrapper getWrapper()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |