C# Class MonkeyWrench.DB

Inheritance: IDisposable, IDB
Show file Open project: mono/monkeywrench Class Usage Examples

Public Methods

Method Description
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

Private Methods

Method Description
Connect ( ) : void

Method Details

Audit() public method

public Audit ( MonkeyWrench who, string action ) : void
who MonkeyWrench
action string
return void

BeginTransaction() public method

public BeginTransaction ( ) : IDbTransaction
return IDbTransaction

ClearAllWork() public method

public ClearAllWork ( int lane_id, int host_id ) : void
lane_id int
host_id int
return void

ClearWork() public method

public ClearWork ( int lane_id, int revision_id, int host_id ) : void
lane_id int
revision_id int
host_id int
return void

CloneLane() public method

public CloneLane ( int lane_id, string new_name, bool copy_files ) : DBLane
lane_id int
new_name string
copy_files bool
return MonkeyWrench.DataClasses.DBLane

CreateCommand() public method

Creates a command with a default timeout of 300 seconds.
public CreateCommand ( ) : IDbCommand
return IDbCommand

CreateCommand() public method

Creates a command with the specified timeout. A timeout of 0 means infinity.
public CreateCommand ( System.TimeSpan Timeout ) : IDbCommand
Timeout System.TimeSpan
return IDbCommand

CreateCommand() public method

public CreateCommand ( string query ) : IDbCommand
query string
return IDbCommand

CreateParameter() public static method

public static CreateParameter ( IDbCommand cmd, string name, object value ) : void
cmd IDbCommand
name string
value object
return void

DB() public method

public DB ( ) : System
return System

DB() public method

public DB ( bool Connect ) : System
Connect bool
return System

DeleteAllWork() public method

public DeleteAllWork ( int lane_id, int host_id ) : void
lane_id int
host_id int
return void

DeleteFiles() public method

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
return void

DeleteLinks() public method

public DeleteLinks ( int host_id, int lane_id, int revision_id ) : void
host_id int
lane_id int
revision_id int
return void

DeleteWork() public method

public DeleteWork ( int lane_id, int revision_id, int host_id ) : void
lane_id int
revision_id int
host_id int
return void

Dispose() public method

public Dispose ( ) : void
return void

Download() public method

public Download ( DBFile file ) : Stream
file MonkeyWrench.DataClasses.DBFile
return Stream

Download() public method

public Download ( MonkeyWrench.DataClasses.DBWorkFile file ) : Stream
file MonkeyWrench.DataClasses.DBWorkFile
return Stream

Download() public method

public Download ( DBWorkFileView file ) : Stream
file MonkeyWrench.DataClasses.DBWorkFileView
return Stream

ExecuteNonQuery() public method

public ExecuteNonQuery ( string sql ) : int
sql string
return int

ExecuteScalar() public method

public ExecuteScalar ( string sql ) : object
sql string
return object

GetAllHostLanes() public method

public GetAllHostLanes ( ) : List
return List

GetAllLaneFiles() public method

public GetAllLaneFiles ( ) : List
return List

GetAllLanes() public method

Returns all the lanes in the database.
public GetAllLanes ( ) : List
return List

GetCommands() public method

public GetCommands ( int lane_id ) : List
lane_id int
return List

GetDBRevisions() public method

public GetDBRevisions ( int lane_id, bool ordered ) : DBRevision>.Dictionary
lane_id int
ordered bool
return DBRevision>.Dictionary

GetDBRevisions() public method

public GetDBRevisions ( int lane_id, int limit, bool ordered = true ) : List
lane_id int
limit int
ordered bool
return List

GetDBRevisions() public method

public GetDBRevisions ( int lane_id, int limit, int offset, bool ordered = true ) : List
lane_id int
limit int
offset int
ordered bool
return List

GetHostLane() public method

public GetHostLane ( int host_id, int lane_id ) : DBHostLane
host_id int
lane_id int
return MonkeyWrench.DataClasses.DBHostLane

GetHosts() public method

public GetHosts ( ) : List
return List

GetHostsForLane() public method

public GetHostsForLane ( int lane_id ) : List
lane_id int
return List

GetLane() public method

Returns lane that matches lane_id in the database
public GetLane ( int id ) : DBLane
id int
return MonkeyWrench.DataClasses.DBLane

GetLaneHierarchy() public method

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
return List

GetLanes() public method

Returns all the lanes for which there are revisions in the database
public GetLanes ( ) : List
return List

GetLanesForHost() public method

public GetLanesForHost ( int host_id, bool only_enabled ) : List
host_id int
only_enabled bool
return List

GetLargeObjectSize() public method

public GetLargeObjectSize ( int oid ) : int
oid int
return int

GetLastRevision() public method

public GetLastRevision ( string lane ) : int
lane string
return int

GetNextStep() public method

public GetNextStep ( string lane ) : DBWork
lane string
return DBWork

GetRevision() public method

public GetRevision ( string lane, int revision ) : DBRevision
lane string
revision int
return DBRevision

GetRevisionWork() public method

Will return a locked revision work.
public GetRevisionWork ( DBLane lane, DBHost host, DBHost workhost ) : DBRevisionWork
lane DBLane
host DBHost
workhost DBHost
return DBRevisionWork

GetRevisions() public method

public GetRevisions ( string lane, int limit ) : List
lane string
limit int
return List

GetSize() public method

public GetSize ( int file_id ) : int
file_id int
return int

GetWork() public method

public GetWork ( DBRevisionWork revisionwork ) : List
revisionwork DBRevisionWork
return List

HasWork() public method

public HasWork ( int lane_id, int revision_id, int host_id ) : bool
lane_id int
revision_id int
host_id int
return bool

IgnoreWork() public method

public IgnoreWork ( int lane_id, int revision_id, int host_id ) : void
lane_id int
revision_id int
host_id int
return void

IsLatestRevisionWork() public method

Checks if the specified RevisionWork is the latest.
public IsLatestRevisionWork ( DBRevisionWork current ) : bool
current DBRevisionWork
return bool

LookupHost() public method

public LookupHost ( string host ) : DBHost
host string
return DBHost

LookupHost() public method

public LookupHost ( string host, bool throwOnError ) : DBHost
host string
throwOnError bool
return DBHost

LookupLane() public method

public LookupLane ( string lane ) : DBLane
lane string
return DBLane

LookupLane() public method

public LookupLane ( string lane, bool throwOnError ) : DBLane
lane string
throwOnError bool
return DBLane

Upload() public method

public Upload ( string filename, string extension, bool hidden, string compressed_mime ) : DBFile
filename string
extension string
hidden bool
compressed_mime string
return DBFile

Upload() public method

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
return DBFile

UploadString() public method

public UploadString ( string contents, string extension, bool hidden ) : DBFile
contents string
extension string
hidden bool
return DBFile