DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
|
This processes _queries from a client and dispatches the _queries to the database. More...
Public Member Functions | |
abstract void | Close () |
Closes the connection with the client. More... | |
void | Dispose () |
Protected Member Functions | |
Processor (DbController controller, string hostString) | |
byte[] | ProcessCommand (byte[] command) |
Processes a single Query from the client. More... | |
void | Dispose (bool disposing) |
Disposes of this processor. More... | |
abstract void | SendEvent (byte[] eventMsg) |
Sends an event to the client. More... | |
Properties | |
ClientConnectionState | ClientState [get] |
Returns the state of the connection. More... | |
abstract bool | IsClosed [get] |
Returns true if the connection to the client is closed. More... | |
IDatabase | Database [get, private set] |
Private Member Functions | |
void | OnDatabaseEvent (int eventType, String eventMessage) |
bool | ChangeDatabaseInterface (IDbConfig config, string databaseName) |
byte[] | ProcessQuery (byte[] command) |
Processes a query on the byte[] array and returns the result. More... | |
byte[] | ChangeDatabase (int dispatchId, byte[] command) |
byte[] | QueryCommand (int dispatchId, byte[] command) |
Executes a query and returns the header for the result in the response. More... | |
byte[] | PushStreamableObjectPart (int dispatchId, byte[] command) |
Pushes a part of a streamable object onto the server. More... | |
byte[] | ResultSection (int dispatchId, byte[] command) |
Responds with a part of the result set of a query made via the ProtocolConstants.Query Query. More... | |
byte[] | StreamableObjectSection (int dispatchId, byte[] command) |
Returns a section of a streamable object. More... | |
byte[] | DisposeStreamableObject (int dispatchId, byte[] command) |
Disposes of a streamable object. More... | |
byte[] | DisposeResult (int dispatchId, byte[] command) |
Disposes of a result set we queries via the ProtocolConstants.Query Query. More... | |
~Processor () | |
Static Private Member Functions | |
static byte[] | Single (int val) |
Returns a single 4 byte array with the given int encoded into it. More... | |
static byte[] | Exception (int dispatchId, DataException e) |
Creates a response that represents a data exception failure. More... | |
static byte[] | SimpleSuccess (int dispatchId) |
Creates a response that indicates a simple success of an operation with the given dispatch id. More... | |
Private Attributes | |
const int | ServerVersion = 1 |
The version of the server protocol. More... | |
ClientConnectionState | state |
The current state we are in. More... | |
int | authenticationTries |
Number of authentications tried. More... | |
readonly string | hostString |
readonly DbController | controller |
readonly Dictionary< string, DatabaseInterface > | dbInterfaces |
DatabaseInterface | dbInterface |
readonly DatabaseEventCallback | dbCallback |
The database call back method that sends database events back to the client. More... | |
This processes _queries from a client and dispatches the _queries to the database.
This is a state based class. There is a single processor for each client connected. This class is designed to be flexible enough to handle packet based protocols as well as stream based protocols.
Definition at line 41 of file Processor.cs.
|
inlineprotected |
Definition at line 63 of file Processor.cs.
|
inlineprivate |
Definition at line 554 of file Processor.cs.
|
inlineprivate |
Definition at line 319 of file Processor.cs.
|
inlineprivate |
Definition at line 92 of file Processor.cs.
|
pure virtual |
Closes the connection with the client.
|
inlineprotected |
Disposes of this processor.
Definition at line 301 of file Processor.cs.
|
inline |
Definition at line 558 of file Processor.cs.
|
inlineprivate |
Disposes of a result set we queries via the ProtocolConstants.Query Query.
dispatchId | |
command |
Definition at line 507 of file Processor.cs.
|
inlineprivate |
Disposes of a streamable object.
dispatchId | |
command |
Definition at line 486 of file Processor.cs.
|
inlinestaticprivate |
Creates a response that represents a data exception failure.
dispatchId | |
e |
Definition at line 214 of file Processor.cs.
|
inlineprivate |
Definition at line 72 of file Processor.cs.
|
inlineprotected |
Processes a single Query from the client.
command |
Definition at line 115 of file Processor.cs.
|
inlineprivate |
Processes a query on the byte[] array and returns the result.
command |
Definition at line 260 of file Processor.cs.
|
inlineprivate |
Pushes a part of a streamable object onto the server.
dispatchId | The number we need to respond with. |
command |
Definition at line 389 of file Processor.cs.
|
inlineprivate |
Executes a query and returns the header for the result in the response.
dispatchId | The number we need to respond with. |
command |
This keeps track of all result sets because sections of the result are later queries via the ProtocolConstants.ResultSection Query.
Definition at line 346 of file Processor.cs.
|
inlineprivate |
Responds with a part of the result set of a query made via the ProtocolConstants.Query Query.
dispatchId | The number we need to respond with. |
command |
Definition at line 417 of file Processor.cs.
|
protectedpure virtual |
Sends an event to the client.
eventMsg |
This is used to notify the client of trigger events, etc.
Security Issue: This is always invoked by the DatabaseDispatcher. We have to be careful that this method isn't allowed to block. Otherwise the DatabaseDispatcher thread will be out of operation. Unfortunately assuring this may not be possible until non-blocking IO, or we use datagrams for transmission. I know for sure that the TCP implementation is vunrable. If the client doesn't 'read' what we are sending then this'll block when the buffers become full.
|
inlinestaticprivate |
Creates a response that indicates a simple success of an operation with the given dispatch id.
dispatchId |
Definition at line 248 of file Processor.cs.
|
inlinestaticprivate |
Returns a single 4 byte array with the given int encoded into it.
val |
Definition at line 202 of file Processor.cs.
|
inlineprivate |
Returns a section of a streamable object.
dispatchId | The number we need to respond with. |
command |
Definition at line 455 of file Processor.cs.
|
private |
Number of authentications tried.
Definition at line 55 of file Processor.cs.
|
private |
Definition at line 59 of file Processor.cs.
|
private |
The database call back method that sends database events back to the client.
Definition at line 90 of file Processor.cs.
|
private |
Definition at line 61 of file Processor.cs.
|
private |
Definition at line 60 of file Processor.cs.
|
private |
Definition at line 57 of file Processor.cs.
|
private |
The version of the server protocol.
Definition at line 45 of file Processor.cs.
|
private |
The current state we are in.
Definition at line 50 of file Processor.cs.
|
getprotected |
Returns the state of the connection.
0 = not logged in yet. 1 = logged in.
Definition at line 192 of file Processor.cs.
|
getprivate set |
Definition at line 551 of file Processor.cs.
|
get |
Returns true if the connection to the client is closed.
Definition at line 549 of file Processor.cs.