C# Class Stumps.Server.Data.DataAccess

A class that provides an implementation of T:Stumps.Server.Data.IDataAccess that uses JSON files and directory structures to persist information about Stumps servers and Stump instances.
Inheritance: IDataAccess
Datei anzeigen Open project: Cayan-LLC/stumps Class Usage Examples

Public Methods

Method Description
DataAccess ( string storagePath ) : System

Initializes a new instance of the T:Stumps.Server.Data.DataAccess class.

ServerCreate ( ServerEntity server ) : void

Creates an entry for a new stumps server.

ServerDelete ( string serverId ) : void

Deletes an existing T:Stumps.Server.Data.ServerEntity.

ServerFind ( string serverId ) : ServerEntity

Finds the persisted T:Stumps.Server.Data.ServerEntity for a specified serverId.

ServerFindAll ( ) : IList

Finds a list of all persisted T:Stumps.Server.Data.ServerEntity.

ServerReadResource ( string serverId, string resourceName ) : byte[]

Loads the contents of a resource for a Stumps server.

A null value is returned if the resource cannot be found.

StumpCreate ( string serverId, StumpEntity entity, byte originalRequestBody, byte originalResponseBody, byte responseBody ) : StumpEntity

Creates a new T:Stumps.Server.Data.StumpEntity for an existing Stumps server.

StumpDelete ( string serverId, string stumpId ) : void

Deletes an existing stump from a Stumps server.

StumpFindAll ( string serverId ) : IList

Finds all a list of all T:Stumps.Server.Data.StumpEntity for the specified serverId.

Method Details

DataAccess() public method

Initializes a new instance of the T:Stumps.Server.Data.DataAccess class.
is null.
public DataAccess ( string storagePath ) : System
storagePath string The data path.
return System

ServerCreate() public method

Creates an entry for a new stumps server.
server
public ServerCreate ( ServerEntity server ) : void
server ServerEntity The to create.
return void

ServerDelete() public method

Deletes an existing T:Stumps.Server.Data.ServerEntity.
is null.
public ServerDelete ( string serverId ) : void
serverId string The unique identifier for the to delete.
return void

ServerFind() public method

Finds the persisted T:Stumps.Server.Data.ServerEntity for a specified serverId.
public ServerFind ( string serverId ) : ServerEntity
serverId string The unique identifier for the to find.
return ServerEntity

ServerFindAll() public method

Finds a list of all persisted T:Stumps.Server.Data.ServerEntity.
public ServerFindAll ( ) : IList
return IList

ServerReadResource() public method

Loads the contents of a resource for a Stumps server.
A null value is returned if the resource cannot be found.
/// is null. ///
public ServerReadResource ( string serverId, string resourceName ) : byte[]
serverId string The unique identifier for the Stumps server.
resourceName string Name of the file.
return byte[]

StumpCreate() public method

Creates a new T:Stumps.Server.Data.StumpEntity for an existing Stumps server.
/// is null. /// or /// is null. ///
public StumpCreate ( string serverId, StumpEntity entity, byte originalRequestBody, byte originalResponseBody, byte responseBody ) : StumpEntity
serverId string The unique identifier for the Stumps server.
entity StumpEntity The to persist.
originalRequestBody byte The array of bytes representing the original request's HTTP body.
originalResponseBody byte The array of bytes representing the original response's HTTP body.
responseBody byte The array of bytes returned as the HTTP body in response to the stump.
return StumpEntity

StumpDelete() public method

Deletes an existing stump from a Stumps server.
public StumpDelete ( string serverId, string stumpId ) : void
serverId string The unique identifier for the Stumps server the Stump is located in.
stumpId string The unique identifier for the stump to delete.
return void

StumpFindAll() public method

Finds all a list of all T:Stumps.Server.Data.StumpEntity for the specified serverId.
public StumpFindAll ( string serverId ) : IList
serverId string The unique identifier for the Stumps server.
return IList