com.mymed.controller.core.manager.storage
Interface IStorageManager

All Known Subinterfaces:
IMyJamStorageManager
All Known Implementing Classes:
MyJamStorageManager, StorageManager

public interface IStorageManager

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.

Author:
lvanni

Field Summary
static org.apache.cassandra.thrift.ConsistencyLevel consistencyOnRead
           
static org.apache.cassandra.thrift.ConsistencyLevel consistencyOnWrite
          Default ConsistencyLevel
 
Method Summary
 int countColumns(java.lang.String tableName, java.lang.String key)
          Count columns in record
 void insertColumn(java.lang.String tableName, java.lang.String primaryKey, 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 primaryKey)
          Get the value of a Column family
 byte[] selectColumn(java.lang.String tableName, java.lang.String primaryKey, 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 list of values of a Super Column Family
 java.util.Map<byte[],byte[]> selectRange(java.lang.String tableName, java.lang.String primaryKey, java.util.List<java.lang.String> columnNames)
          Get the values of a range of columns
 

Field Detail

consistencyOnWrite

static final org.apache.cassandra.thrift.ConsistencyLevel consistencyOnWrite
Default ConsistencyLevel


consistencyOnRead

static final org.apache.cassandra.thrift.ConsistencyLevel consistencyOnRead
Method Detail

insertSlice

void insertSlice(java.lang.String tableName,
                 java.lang.String primaryKey,
                 java.util.Map<java.lang.String,byte[]> args)
                 throws IOBackEndException,
                        InternalBackEndException
Insert a new entry in the database

Parameters:
tableName - the name of the Table/ColumnFamily
primaryKey - the ID of the entry
args - All columnName and the their value
Throws:
IOBackEndException
InternalBackEndException

insertSuperSlice

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
Insert a new entry in the database

Parameters:
superTableName - the name of the Table/SuperColumnFamily
key - the ID of the entry
superKey - the ID of the entry in the SuperColumnFamily
args - All columnName and the their value
Throws:
ServiceManagerException
InternalBackEndException
IOBackEndException

selectColumn

byte[] selectColumn(java.lang.String tableName,
                    java.lang.String primaryKey,
                    java.lang.String columnName)
                    throws IOBackEndException,
                           InternalBackEndException
Get the value of an entry column

Parameters:
tableName - the name of the Table/ColumnFamily
primaryKey - the ID of the entry
columnName - the name of the column
Returns:
the value of the column
Throws:
IOBackEndException
InternalBackEndException

insertColumn

void insertColumn(java.lang.String tableName,
                  java.lang.String primaryKey,
                  java.lang.String columnName,
                  byte[] value)
                  throws InternalBackEndException
Update the value of a Simple Column

Parameters:
tableName - the name of the Table/ColumnFamily
primaryKey - the ID of the entry
columnName - the name of the column
value - the value updated
Throws:
InternalBackEndException

insertSuperColumn

void insertSuperColumn(java.lang.String tableName,
                       java.lang.String key,
                       java.lang.String superColumn,
                       java.lang.String columnName,
                       byte[] value)
                       throws InternalBackEndException
Update the value of a Super Column

Parameters:
tableName - the name of the Table/ColumnFamily
key - the ID of the entry
superColumn - the ID of the superColumn
columnName - the name of the column
value - the value updated
Throws:
InternalBackEndException

selectAll

java.util.Map<byte[],byte[]> selectAll(java.lang.String tableName,
                                       java.lang.String primaryKey)
                                       throws IOBackEndException,
                                              InternalBackEndException
Get the value of a Column family

Parameters:
tableName - the name of the Table/ColumnFamily
primaryKey - the ID of the entry
columnName - the name of the column
Returns:
the value of the column
Throws:
IOBackEndException
InternalBackEndException

selectList

java.util.List<java.util.Map<byte[],byte[]>> selectList(java.lang.String tableName,
                                                        java.lang.String key)
                                                        throws InternalBackEndException,
                                                               IOBackEndException
Get the list of values of a Super Column Family

Parameters:
tableName -
key -
Returns:
Throws:
InternalBackEndException
IOBackEndException

selectRange

java.util.Map<byte[],byte[]> selectRange(java.lang.String tableName,
                                         java.lang.String primaryKey,
                                         java.util.List<java.lang.String> columnNames)
                                         throws IOBackEndException,
                                                InternalBackEndException
Get the values of a range of columns

Parameters:
tableName - the name of the Table/ColumnFamily
primaryKey - the ID of the entry
columnNames - the name of the columns to return the values
Returns:
the value of the columns
Throws:
IOBackEndException
InternalBackEndException

countColumns

int countColumns(java.lang.String tableName,
                 java.lang.String key)
                 throws InternalBackEndException
Count columns in record

Parameters:
key -
parent -
Returns:
Throws:
InternalBackEndException

removeColumn

void removeColumn(java.lang.String tableName,
                  java.lang.String key,
                  java.lang.String columnName)
                  throws IOBackEndException,
                         InternalBackEndException
Remove a specific column defined by the columnName

Parameters:
keyspace -
columnFamily -
key -
columnName -
Throws:
IOBackEndException
InternalBackEndException

removeSuperColumn

void removeSuperColumn(java.lang.String tableName,
                       java.lang.String key,
                       java.lang.String superColumnName)
                       throws InternalBackEndException
Parameters:
tableName -
key -
superColumnName -
Throws:
InternalBackEndException

removeAll

void removeAll(java.lang.String tableName,
               java.lang.String key)
               throws InternalBackEndException
Remove an entry in the columnFamily

Parameters:
keyspace -
columnFamily -
key -
Throws:
InternalBackEndException