Click or drag to resize
IBaseStationDatabase Interface
The interface for objects that can deal with the BaseStation database file for us.

Namespace: VirtualRadar.Interface.Database
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public interface IBaseStationDatabase : ITransactionable, 
	IDisposable

The IBaseStationDatabase type exposes the following members.

Properties
  NameDescription
Public propertyFileName
Gets or sets the full path and filename of the database. Changing the filename causes the current connection to close, the next operation on the database causes it to open a new connection as per usual.
Public propertyIsConnected
Gets a value indicating that there is an open connection to the database.
Public propertyLogFileName
Gets or sets the full path and filename of the log.
Public propertyMaxParameters
Gets the maximum number of parameters that can be passed to the underlying database engine. Note that calls that accept a variable number of parameters will automatically handle splitting the call into multiple calls on the database unless otherwise noted.
Public propertyProvider
Gets or sets the object that abstracts away the environment to help when testing.
Public propertyWriteSupportEnabled
Gets or sets a flag indicating that methods that can create or modify the database are enabled. By default this setting is disabled. Changing this setting closes the current connection, the next call to access the database will reopen it.
Top
Methods
  NameDescription
Public methodAttemptAutoFix
Takes an exception that was thrown from TestConnection and attempts to correct the error that was encountered. If it's likely to have succeeded then returns true.
Public methodCreateDatabaseIfMissing
If the database file is missing or entirely empty then this method creates the file and pre-populates the tables with roughly the same records that BaseStation prepopulates a new database with.
Public methodDeleteAircraft
Deletes an existing aircraft record.
Public methodDeleteFlight
Deletes an existing flight record. Ignores the aircraft record attached to the flight (if any).
Public methodDeleteLocation
Deletes an existing location record.
Public methodDeleteSession
Deletes the record for a session. This automatically deletes all flights associated with the session.
Public methodDeleteSystemEvent
Deletes an existing SystemEvents record.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Public methodEndTransaction
Ends a transaction. Ending a nested transaction has no effect.
(Inherited from ITransactionable.)
Public methodGetAircraftByCode
Returns the first aircraft with the ICAO24 code passed across.
Public methodGetAircraftById
Retrieves an aircraft record by its identifier.
Public methodGetAircraftByRegistration
Returns the first aircraft with the registration passed across.
Public methodGetAllAircraft
Returns every aircraft record in the database.
Public methodGetCountOfFlights
Returns the number of flights that match the criteria passed across.
Public methodGetCountOfFlightsForAircraft
Returns the number of flight records that match the criteria passed across.
Public methodGetDatabaseHistory
Returns all of the records from BaseStation's DBHistory table.
Public methodGetDatabaseVersion
Returns the single DBInfo record in BaseStation's DBInfo table. Note that this has no key.
Public methodGetFlightById
Retrieves a flight record from the database by its ID number. This does not read the associated aircraft record.
Public methodGetFlights
Returns all flights, or a subset of all flights, that match the criteria passed across.
Public methodGetFlightsForAircraft
Returns a list of every flight, or a subset of every flight, that matches the criteria passed across.
Public methodGetLocations
Returns all of the locations from BaseStation's Locations table.
Public methodGetManyAircraftAndFlightsCountByCode
Returns aircraft records and counts of flights for many ICAO24 codes simultaneously.
Public methodGetManyAircraftByCode
Returns aircraft records for many ICAO24 codes simultaneously.
Public methodGetOrInsertAircraftByCode
Fetches an aircraft by its ICAO code. If there is no record for the aircraft then the createNewAircraftFunc method is called to build a new record, and that is inserted.
Public methodGetSessions
Returns all of the sessions from BaseStation's Sessions table.
Public methodGetSystemEvents
Returns the entire content of the SystemEvents table.
Public methodInsertAircraft
Inserts a new aircraft record and fills AircraftID with the identifier of the record.
Public methodInsertFlight
Inserts a new flight record and assigns the unique identifier of the new record to the FlightID property. The AircraftID property must be filled with the identifier of an existing aircraft record.
Public methodInsertLocation
Inserts a new record in the database for the location passed across and sets the LocationID to the identifier of the new record.
Public methodInsertSession
Inserts a record in the Sessions table, setting SessionID to the identifier of the new record.
Public methodInsertSystemEvent
Inserts a new SystemEvents record and sets the SystemEventsID to the identifier of the new record.
Public methodRecordManyMissingAircraft
Does the same as RecordMissingAircraft(String) but for many ICAOs simultaneously.
Public methodRecordMissingAircraft
Records a missing aircraft record.
Public methodRollbackTransaction
Rolls back a transaction. Rolling back a nested transaction rolls back all transactions.
(Inherited from ITransactionable.)
Public methodStartTransaction
Begins a new transaction. Nesting transactions is allowed.
(Inherited from ITransactionable.)
Public methodTestConnection
Returns true if a connection could be made to FileName, false if it could not. If it could be made then the connection is left open.
Public methodUpdateAircraft
Updates an existing aircraft record.
Public methodUpdateAircraftModeSCountry
Updates the Mode-S country for an aircraft.
Public methodUpdateFlight
Updates an existing flight record. Ignores the aircraft record attached to the flight (if any).
Public methodUpdateLocation
Updates an existing location record.
Public methodUpdateSession
Updates the record for a session.
Public methodUpdateSystemEvent
Updates an existing SystemEvents record.
Public methodUpsertAircraftByCode
Creates or updates an aircraft record.
Public methodUpsertManyAircraftByCodes
Top
Events
  NameDescription
Public eventAircraftUpdated
Raised after an aircraft has been updated.
Public eventFileNameChanged
Raised after FileName has changed as the result of a configuration change.
Public eventFileNameChanging
Raised before FileName is changed as the result of a configuration change.
Top
Remarks

The BaseStation database is an SQLite file that Kinetic's BaseStation application creates and maintains. By default the object implementing the interface is in read-only mode, it will not make any changes to the database. In this mode attempts to use the insert / update or delete methods should throw an InvalidOperation exception. If the program sets WriteSupportEnabled then the insert / update and delete methods should allow writes to the database.

Virtual Radar Server never sets WriteSupportEnabled, it will never write to the database. The write methods are only there for the use of plugins.

See Also