Class VISABApi
Class for initializing transmission sessions and making requests independant of sessions to the VISAB WebApi.
Inherited Members
Namespace: VISABConnector
Assembly: VISABConnector.dll
Syntax
public class VISABApi
Constructors
| Improve this Doc View SourceVISABApi(String, Int32, Int32)
Declaration
public VISABApi(string hostAdress = "http://localhost", int port = 2673, int requestTimeout = 5)
Parameters
Type | Name | Description |
---|---|---|
String | hostAdress | The hostadress of the VISAB WebAPi |
Int32 | port | The port of the VISAB WebApi |
Int32 | requestTimeout | The time in seconds before a request is timeouted |
Properties
| Improve this Doc View SourceBaseAdress
The full base adress of the VISAB WebApi.
Declaration
public string BaseAdress { get; }
Property Value
Type | Description |
---|---|
String |
ConnectorVersion
The current assembly version of the VISABConnector dll.
Declaration
public static Version ConnectorVersion { get; }
Property Value
Type | Description |
---|---|
Version |
HostAdress
The host adress on which the VISAB WebApi is running.
Declaration
public string HostAdress { get; }
Property Value
Type | Description |
---|---|
String |
Port
The port on which the VISAB WebApi is running.
Declaration
public int Port { get; }
Property Value
Type | Description |
---|---|
Int32 |
RequestTimeout
The time in seconds until a request is timeouted.
Declaration
public int RequestTimeout { get; }
Property Value
Type | Description |
---|---|
Int32 |
SessionIndependantRequestHandler
Request handler used for making Http requests that are independant of sessions.
Declaration
public IVISABRequestHandler SessionIndependantRequestHandler { get; }
Property Value
Type | Description |
---|---|
IVISABRequestHandler |
Methods
| Improve this Doc View SourceGameIsSupportedAsync(String)
Checks if the VISAB WebApi can receive data for the given game.
Declaration
public async Task<ApiResponse<bool>> GameIsSupportedAsync(string game)
Parameters
Type | Name | Description |
---|---|---|
String | game | The game to check |
Returns
Type | Description |
---|---|
Task<ApiResponse<Boolean>> | An ApiResponse object with Content set to true if game is supported |
GetActiveSessionsAsync()
Returns a list of all the sessionIds for all active sessions.
Declaration
public async Task<ApiResponse<IList<Guid>>> GetActiveSessionsAsync()
Returns
Type | Description |
---|---|
Task<ApiResponse<IList<Guid>>> | An ApiResponse object whose content contains a list of the sessionIds for all active sessions if successful |
GetSessionStatus(Guid)
Gets the session status of for a given sessionId.
Declaration
public async Task<ApiResponse<SessionStatus>> GetSessionStatus(Guid sessionId)
Parameters
Type | Name | Description |
---|---|---|
Guid | sessionId | The sessionId to get the status for |
Returns
Type | Description |
---|---|
Task<ApiResponse<SessionStatus>> | An ApiResponse object containing a SessionStatus object as Content if succesful |
InitiateSessionAsync(IMetaInformation)
Creates a IVISABSession object by opening a transmission session at the VISAB WebApi.
Declaration
public async Task<ApiResponse<IVISABSession>> InitiateSessionAsync(IMetaInformation metaInformation)
Parameters
Type | Name | Description |
---|---|---|
IMetaInformation | metaInformation | The meta information for the session to open |
Returns
Type | Description |
---|---|
Task<ApiResponse<IVISABSession>> | An ApiResponse object containing a IVISABSession if session was created |
PingApiAsync()
Indicates if the VISAB WebApi is running. If the request was successful, it is running.
Declaration
public async Task<ApiResponse<string>> PingApiAsync()
Returns
Type | Description |
---|---|
Task<ApiResponse<String>> | An ApiResponse object whose content contains the response message if request was successful |