C# Class Persistence.TrackRepository

Repository specialization used to store track file informations. This repository is used by the transport layer to get file path using the file hash as key.
Inheritance: IDisposable
Show file Open project: zencoders/sambatyon

Public Methods

Method Description
Count ( ) : int

Returns the number of tracks contained in the repository

Delete ( string key ) : RepositoryResponse

Deletes track from repository

Dispose ( ) : void

Disposes the repository

Get ( string key ) : TrackModel

Gets information of the track identified by a given key (file hash)

GetAll ( ) : ICollection

Gets all tracks from repository

InsertTrack ( TrackModel mdl ) : RepositoryResponse

Inserts the track file information into the repository

InsertTrack ( string filename ) : RepositoryResponse

Inserts the track file information into the repository reading it directly from the file.

TrackRepository ( string repType, RepositoryConfiguration conf ) : System

Repository Constructor that initializes the repository of the given type.

Update ( TrackModel mdl ) : RepositoryResponse

Updates Track information

Method Details

Count() public method

Returns the number of tracks contained in the repository
public Count ( ) : int
return int

Delete() public method

Deletes track from repository
public Delete ( string key ) : RepositoryResponse
key string Identifier of the track that has to be deleted
return RepositoryResponse

Dispose() public method

Disposes the repository
public Dispose ( ) : void
return void

Get() public method

Gets information of the track identified by a given key (file hash)
public Get ( string key ) : TrackModel
key string Identifier of the track (file hash)
return TrackModel

GetAll() public method

Gets all tracks from repository
public GetAll ( ) : ICollection
return ICollection

InsertTrack() public method

Inserts the track file information into the repository
public InsertTrack ( TrackModel mdl ) : RepositoryResponse
mdl TrackModel Track to insert
return RepositoryResponse

InsertTrack() public method

Inserts the track file information into the repository reading it directly from the file.
public InsertTrack ( string filename ) : RepositoryResponse
filename string Filename where the information can be read
return RepositoryResponse

TrackRepository() public method

Repository Constructor that initializes the repository of the given type.
public TrackRepository ( string repType, RepositoryConfiguration conf ) : System
repType string Name of the repository Type
conf RepositoryConfiguration Configuration for the repository
return System

Update() public method

Updates Track information
public Update ( TrackModel mdl ) : RepositoryResponse
mdl TrackModel New value of the Track
return RepositoryResponse