C# Класс MonkeyWrench.DB

Наследование: IDisposable, IDB
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Audit ( MonkeyWrench who, string action ) : void
BeginTransaction ( ) : IDbTransaction
ClearAllWork ( int lane_id, int host_id ) : void
ClearWork ( int lane_id, int revision_id, int host_id ) : void
CloneLane ( int lane_id, string new_name, bool copy_files ) : DBLane
CreateCommand ( ) : IDbCommand

Creates a command with a default timeout of 300 seconds.

CreateCommand ( System.TimeSpan Timeout ) : IDbCommand

Creates a command with the specified timeout. A timeout of 0 means infinity.

CreateCommand ( string query ) : IDbCommand
CreateParameter ( IDbCommand cmd, string name, object value ) : void
DB ( ) : System
DB ( bool Connect ) : System
DeleteAllWork ( int lane_id, int host_id ) : void
DeleteFiles ( int host_id, int lane_id, int revision_id ) : void

Deletes all the files related to the work in the revision 'revision_id' of lane 'lane' on the host 'host'.

DeleteLinks ( int host_id, int lane_id, int revision_id ) : void
DeleteWork ( int lane_id, int revision_id, int host_id ) : void
Dispose ( ) : void
Download ( DBFile file ) : Stream
Download ( MonkeyWrench.DataClasses.DBWorkFile file ) : Stream
Download ( DBWorkFileView file ) : Stream
ExecuteNonQuery ( string sql ) : int
ExecuteScalar ( string sql ) : object
GetAllHostLanes ( ) : List
GetAllLaneFiles ( ) : List
GetAllLanes ( ) : List

Returns all the lanes in the database.

GetCommands ( int lane_id ) : List
GetDBRevisions ( int lane_id, bool ordered ) : DBRevision>.Dictionary
GetDBRevisions ( int lane_id, int limit, bool ordered = true ) : List
GetDBRevisions ( int lane_id, int limit, int offset, bool ordered = true ) : List
GetHostLane ( int host_id, int lane_id ) : DBHostLane
GetHosts ( ) : List
GetHostsForLane ( int lane_id ) : List
GetLane ( int id ) : DBLane

Returns lane that matches lane_id in the database

GetLaneHierarchy ( int lane_id ) : List

This will return a list of lane ids: [0]: input lane_id [1]: [0]'s parent lane id [2]: [1]'s parent lane id etc

GetLanes ( ) : List

Returns all the lanes for which there are revisions in the database

GetLanesForHost ( int host_id, bool only_enabled ) : List
GetLargeObjectSize ( int oid ) : int
GetLastRevision ( string lane ) : int
GetNextStep ( string lane ) : DBWork
GetRevision ( string lane, int revision ) : DBRevision
GetRevisionWork ( DBLane lane, DBHost host, DBHost workhost ) : DBRevisionWork

Will return a locked revision work.

GetRevisions ( string lane, int limit ) : List
GetSize ( int file_id ) : int
GetWork ( DBRevisionWork revisionwork ) : List
HasWork ( int lane_id, int revision_id, int host_id ) : bool
IgnoreWork ( int lane_id, int revision_id, int host_id ) : void
IsLatestRevisionWork ( DBRevisionWork current ) : bool

Checks if the specified RevisionWork is the latest.

LookupHost ( string host ) : DBHost
LookupHost ( string host, bool throwOnError ) : DBHost
LookupLane ( string lane ) : DBLane
LookupLane ( string lane, bool throwOnError ) : DBLane
Upload ( string filename, string extension, bool hidden, string compressed_mime ) : DBFile

Upload ( string md5, string path_to_contents, string filename, string extension, bool hidden, string compressed_mime ) : DBFile
UploadString ( string contents, string extension, bool hidden ) : DBFile

Приватные методы

Метод Описание
Connect ( ) : void

Описание методов

Audit() публичный Метод

public Audit ( MonkeyWrench who, string action ) : void
who MonkeyWrench
action string
Результат void

BeginTransaction() публичный Метод

public BeginTransaction ( ) : IDbTransaction
Результат IDbTransaction

ClearAllWork() публичный Метод

public ClearAllWork ( int lane_id, int host_id ) : void
lane_id int
host_id int
Результат void

ClearWork() публичный Метод

public ClearWork ( int lane_id, int revision_id, int host_id ) : void
lane_id int
revision_id int
host_id int
Результат void

CloneLane() публичный Метод

public CloneLane ( int lane_id, string new_name, bool copy_files ) : DBLane
lane_id int
new_name string
copy_files bool
Результат MonkeyWrench.DataClasses.DBLane

CreateCommand() публичный Метод

Creates a command with a default timeout of 300 seconds.
public CreateCommand ( ) : IDbCommand
Результат IDbCommand

CreateCommand() публичный Метод

Creates a command with the specified timeout. A timeout of 0 means infinity.
public CreateCommand ( System.TimeSpan Timeout ) : IDbCommand
Timeout System.TimeSpan
Результат IDbCommand

CreateCommand() публичный Метод

public CreateCommand ( string query ) : IDbCommand
query string
Результат IDbCommand

CreateParameter() публичный статический Метод

public static CreateParameter ( IDbCommand cmd, string name, object value ) : void
cmd IDbCommand
name string
value object
Результат void

DB() публичный Метод

public DB ( ) : System
Результат System

DB() публичный Метод

public DB ( bool Connect ) : System
Connect bool
Результат System

DeleteAllWork() публичный Метод

public DeleteAllWork ( int lane_id, int host_id ) : void
lane_id int
host_id int
Результат void

DeleteFiles() публичный Метод

Deletes all the files related to the work in the revision 'revision_id' of lane 'lane' on the host 'host'.
public DeleteFiles ( int host_id, int lane_id, int revision_id ) : void
host_id int
lane_id int
revision_id int
Результат void

DeleteLinks() публичный Метод

public DeleteLinks ( int host_id, int lane_id, int revision_id ) : void
host_id int
lane_id int
revision_id int
Результат void

DeleteWork() публичный Метод

public DeleteWork ( int lane_id, int revision_id, int host_id ) : void
lane_id int
revision_id int
host_id int
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Download() публичный Метод

public Download ( DBFile file ) : Stream
file MonkeyWrench.DataClasses.DBFile
Результат Stream

Download() публичный Метод

public Download ( MonkeyWrench.DataClasses.DBWorkFile file ) : Stream
file MonkeyWrench.DataClasses.DBWorkFile
Результат Stream

Download() публичный Метод

public Download ( DBWorkFileView file ) : Stream
file MonkeyWrench.DataClasses.DBWorkFileView
Результат Stream

ExecuteNonQuery() публичный Метод

public ExecuteNonQuery ( string sql ) : int
sql string
Результат int

ExecuteScalar() публичный Метод

public ExecuteScalar ( string sql ) : object
sql string
Результат object

GetAllHostLanes() публичный Метод

public GetAllHostLanes ( ) : List
Результат List

GetAllLaneFiles() публичный Метод

public GetAllLaneFiles ( ) : List
Результат List

GetAllLanes() публичный Метод

Returns all the lanes in the database.
public GetAllLanes ( ) : List
Результат List

GetCommands() публичный Метод

public GetCommands ( int lane_id ) : List
lane_id int
Результат List

GetDBRevisions() публичный Метод

public GetDBRevisions ( int lane_id, bool ordered ) : DBRevision>.Dictionary
lane_id int
ordered bool
Результат DBRevision>.Dictionary

GetDBRevisions() публичный Метод

public GetDBRevisions ( int lane_id, int limit, bool ordered = true ) : List
lane_id int
limit int
ordered bool
Результат List

GetDBRevisions() публичный Метод

public GetDBRevisions ( int lane_id, int limit, int offset, bool ordered = true ) : List
lane_id int
limit int
offset int
ordered bool
Результат List

GetHostLane() публичный Метод

public GetHostLane ( int host_id, int lane_id ) : DBHostLane
host_id int
lane_id int
Результат MonkeyWrench.DataClasses.DBHostLane

GetHosts() публичный Метод

public GetHosts ( ) : List
Результат List

GetHostsForLane() публичный Метод

public GetHostsForLane ( int lane_id ) : List
lane_id int
Результат List

GetLane() публичный Метод

Returns lane that matches lane_id in the database
public GetLane ( int id ) : DBLane
id int
Результат MonkeyWrench.DataClasses.DBLane

GetLaneHierarchy() публичный Метод

This will return a list of lane ids: [0]: input lane_id [1]: [0]'s parent lane id [2]: [1]'s parent lane id etc
public GetLaneHierarchy ( int lane_id ) : List
lane_id int
Результат List

GetLanes() публичный Метод

Returns all the lanes for which there are revisions in the database
public GetLanes ( ) : List
Результат List

GetLanesForHost() публичный Метод

public GetLanesForHost ( int host_id, bool only_enabled ) : List
host_id int
only_enabled bool
Результат List

GetLargeObjectSize() публичный Метод

public GetLargeObjectSize ( int oid ) : int
oid int
Результат int

GetLastRevision() публичный Метод

public GetLastRevision ( string lane ) : int
lane string
Результат int

GetNextStep() публичный Метод

public GetNextStep ( string lane ) : DBWork
lane string
Результат DBWork

GetRevision() публичный Метод

public GetRevision ( string lane, int revision ) : DBRevision
lane string
revision int
Результат DBRevision

GetRevisionWork() публичный Метод

Will return a locked revision work.
public GetRevisionWork ( DBLane lane, DBHost host, DBHost workhost ) : DBRevisionWork
lane DBLane
host DBHost
workhost DBHost
Результат DBRevisionWork

GetRevisions() публичный Метод

public GetRevisions ( string lane, int limit ) : List
lane string
limit int
Результат List

GetSize() публичный Метод

public GetSize ( int file_id ) : int
file_id int
Результат int

GetWork() публичный Метод

public GetWork ( DBRevisionWork revisionwork ) : List
revisionwork DBRevisionWork
Результат List

HasWork() публичный Метод

public HasWork ( int lane_id, int revision_id, int host_id ) : bool
lane_id int
revision_id int
host_id int
Результат bool

IgnoreWork() публичный Метод

public IgnoreWork ( int lane_id, int revision_id, int host_id ) : void
lane_id int
revision_id int
host_id int
Результат void

IsLatestRevisionWork() публичный Метод

Checks if the specified RevisionWork is the latest.
public IsLatestRevisionWork ( DBRevisionWork current ) : bool
current DBRevisionWork
Результат bool

LookupHost() публичный Метод

public LookupHost ( string host ) : DBHost
host string
Результат DBHost

LookupHost() публичный Метод

public LookupHost ( string host, bool throwOnError ) : DBHost
host string
throwOnError bool
Результат DBHost

LookupLane() публичный Метод

public LookupLane ( string lane ) : DBLane
lane string
Результат DBLane

LookupLane() публичный Метод

public LookupLane ( string lane, bool throwOnError ) : DBLane
lane string
throwOnError bool
Результат DBLane

Upload() публичный Метод

public Upload ( string filename, string extension, bool hidden, string compressed_mime ) : DBFile
filename string
extension string
hidden bool
compressed_mime string
Результат DBFile

Upload() публичный Метод

public Upload ( string md5, string path_to_contents, string filename, string extension, bool hidden, string compressed_mime ) : DBFile
md5 string
path_to_contents string
filename string
extension string
hidden bool
compressed_mime string
Результат DBFile

UploadString() публичный Метод

public UploadString ( string contents, string extension, bool hidden ) : DBFile
contents string
extension string
hidden bool
Результат DBFile