C# Class stubby.Stubby

The main stubby class whose instances host stubbed endpoints.
Inheritance: IDisposable
Exibir arquivo Open project: mrak/stubby4net

Public Methods

Method Description
Add ( stubby.Domain.Endpoint endpoint, uint &id ) : bool

Add a new endpoint configuration

Add ( IEnumerable endpoints, IList &ids ) : bool

Add many new endpoint configurations

Delete ( uint id ) : bool

Remove an endpoint by id

DeleteAll ( ) : void

Remove all configured endpoints from stubby

Dispose ( ) : void
Find ( stubby.Domain.Request request ) : stubby.Domain.Response

Find an endpoint by it's matching Request

Get ( uint id ) : stubby.Domain.Endpoint

Get an endpoint back by id

GetAll ( ) : IList

Get a listing of all of stubby's configured endpoints

Replace ( Endpoint>.IEnumerable endpoints ) : bool

Swap out the configuration of several endpoints

Replace ( uint id, stubby.Domain.Endpoint endpoint ) : bool

Swap out the configuration of one of the endpoints

Start ( ) : void

Start stubby's services

Stop ( ) : void

Stop stubby's services

Stubby ( ) : System

Construct stubby with default parameters.

Stubby ( IArguments arguments ) : System

Costruct with specific options.

Private Methods

Method Description
LoadEndpoints ( ) : void
OnDatafileChange ( object sender, FileSystemEventArgs e ) : void
StartPortals ( ) : void

Method Details

Add() public method

Add a new endpoint configuration
public Add ( stubby.Domain.Endpoint endpoint, uint &id ) : bool
endpoint stubby.Domain.Endpoint The new endpoint data
id uint The new generated id, for use with Replace/Delete
return bool

Add() public method

Add many new endpoint configurations
public Add ( IEnumerable endpoints, IList &ids ) : bool
endpoints IEnumerable The new endpoints data
ids IList The new generated ids of the inserted endpoints
return bool

Delete() public method

Remove an endpoint by id
public Delete ( uint id ) : bool
id uint The id as returned by Add(..) or the Admin portal listing.
return bool

DeleteAll() public method

Remove all configured endpoints from stubby
public DeleteAll ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Find() public method

Find an endpoint by it's matching Request
public Find ( stubby.Domain.Request request ) : stubby.Domain.Response
request stubby.Domain.Request The signature of the request to find by
return stubby.Domain.Response

Get() public method

Get an endpoint back by id
public Get ( uint id ) : stubby.Domain.Endpoint
id uint The id of the endpoint to retrieve
return stubby.Domain.Endpoint

GetAll() public method

Get a listing of all of stubby's configured endpoints
public GetAll ( ) : IList
return IList

Replace() public method

Swap out the configuration of several endpoints
public Replace ( Endpoint>.IEnumerable endpoints ) : bool
endpoints Endpoint>.IEnumerable An <id, endpoint> Map of endpoints to swap out
return bool

Replace() public method

Swap out the configuration of one of the endpoints
public Replace ( uint id, stubby.Domain.Endpoint endpoint ) : bool
id uint The id of the endpoint to replace
endpoint stubby.Domain.Endpoint The new endpoint data
return bool

Start() public method

Start stubby's services
public Start ( ) : void
return void

Stop() public method

Stop stubby's services
public Stop ( ) : void
return void

Stubby() public method

Construct stubby with default parameters.
public Stubby ( ) : System
return System

Stubby() public method

Costruct with specific options.
public Stubby ( IArguments arguments ) : System
arguments IArguments The collection of options used by stubby.
return System