DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
Deveel.Data.SystemSchema.OpenSessionsTable Class Reference
Inheritance diagram for Deveel.Data.SystemSchema.OpenSessionsTable:
Deveel.Data.Sql.Tables.GeneratedTable Deveel.Data.Sql.Tables.ITable Deveel.Data.Sql.IDbObject

Public Member Functions

 OpenSessionsTable (ITransaction transaction)
 
override DataObject GetValue (long rowNumber, int columnOffset)
 Gets a single cell within the table that is located at the given column offset and row. More...
 
- Public Member Functions inherited from Deveel.Data.Sql.Tables.GeneratedTable
IEnumerator< RowGetEnumerator ()
 
virtual ColumnIndex GetIndex (int columnOffset)
 Gets an index for given column that can be used to select values from this table. More...
 
void Dispose ()
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Tables.GeneratedTable
 GeneratedTable (IContext dbContext)
 
DataObject GetColumnValue (int column, ISqlObject obj)
 

Properties

override TableInfo TableInfo [get]
 
override int RowCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.GeneratedTable
IContext Context [get, private set]
 
ObjectName IDbObject. FullName [get]
 
DbObjectType IDbObject. ObjectType [get]
 
abstract TableInfo TableInfo [get]
 
abstract int RowCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.ITable
IContext Context [get]
 
TableInfo TableInfo [get]
 Gets the metadata information of the table, used to resolve the column sources. More...
 
int RowCount [get]
 Gets the total number of rows in the table. More...
 
- Properties inherited from Deveel.Data.Sql.IDbObject
ObjectName FullName [get]
 Gets the fully qualified name of the object used to resolve it uniquely within the database. More...
 
DbObjectType ObjectType [get]
 Gets the type of database object that the implementation is for More...
 

Private Attributes

ITransaction transaction
 

Detailed Description

Definition at line 751 of file SystemSchema.cs.

Constructor & Destructor Documentation

Deveel.Data.SystemSchema.OpenSessionsTable.OpenSessionsTable ( ITransaction  transaction)
inline

Definition at line 754 of file SystemSchema.cs.

755  : base(transaction.Database.Context) {
756  this.transaction = transaction;
757  }
IDatabase Database
Gets the database this transaction belongs to.
Definition: ITransaction.cs:48
new IDatabaseContext Context
Gets the context that contains this database.
Definition: IDatabase.cs:50

Member Function Documentation

override void Deveel.Data.SystemSchema.OpenSessionsTable.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Tables.GeneratedTable.

Definition at line 790 of file SystemSchema.cs.

790  {
791  transaction = null;
792  base.Dispose(disposing);
793  }
override DataObject Deveel.Data.SystemSchema.OpenSessionsTable.GetValue ( long  rowNumber,
int  columnOffset 
)
inlinevirtual

Gets a single cell within the table that is located at the given column offset and row.

Parameters
rowNumberThe unique number of the row where the cell is located.
columnOffsetThe zero-based offset of the column of the cell to return.
Returns
Returns an instance of DataObject that is contained in the cell located by the row and column coordinates provided.
Exceptions
ArgumentOutOfRangeExceptionIf the given columnOffset is less than zero or greater or equal than the number of columns defined in the table metadata.
See also
Tables.TableInfo.IndexOfColumn(string)

Implements Deveel.Data.Sql.Tables.GeneratedTable.

Definition at line 767 of file SystemSchema.cs.

767  {
768  if (rowNumber < 0 || rowNumber >= transaction.Database.Sessions.Count)
769  throw new ArgumentOutOfRangeException("rowNumber");
770 
771  var session = transaction.Database.Sessions[(int) rowNumber];
772  var lastCommandTime = session.LastCommandTime == null
773  ? SqlDateTime.Null
774  : (SqlDateTime) session.LastCommandTime.Value;
775 
776  switch (columnOffset) {
777  case 0:
778  return GetColumnValue(0, new SqlString(session.User.Name));
779  case 1:
780  return GetColumnValue(1, SqlString.Null);
781  case 2:
782  return GetColumnValue(2, lastCommandTime);
783  case 3:
784  return GetColumnValue(3, (SqlDateTime)session.StartedOn);
785  default:
786  throw new ArgumentOutOfRangeException("columnOffset");
787  }
788  }
IDatabase Database
Gets the database this transaction belongs to.
Definition: ITransaction.cs:48
DataObject GetColumnValue(int column, ISqlObject obj)
static readonly SqlDateTime Null
Definition: SqlDateTime.cs:24
int Count
Gets the count of the open connections.
ActiveSessionList Sessions
Gets a list of all the open sessions to the database.
Definition: IDatabase.cs:65
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27

Member Data Documentation

ITransaction Deveel.Data.SystemSchema.OpenSessionsTable.transaction
private

Definition at line 752 of file SystemSchema.cs.

Property Documentation

override int Deveel.Data.SystemSchema.OpenSessionsTable.RowCount
get

Definition at line 763 of file SystemSchema.cs.

override TableInfo Deveel.Data.SystemSchema.OpenSessionsTable.TableInfo
get

Definition at line 759 of file SystemSchema.cs.


The documentation for this class was generated from the following file: