DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor Class Reference
Inheritance diagram for Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor:
Deveel.Data.Protocol.IMessageProcessor

Public Member Functions

 ClientProcessor (NetworkClientConnector connector)
 
IMessageEnvelope ProcessMessage (IMessageEnvelope envelope)
 

Private Member Functions

IMessage Ping (IMessageEnvelope envelope)
 
IMessage RequestRollback (IMessageEnvelope envelope)
 
IMessage RequestCommit (IMessageEnvelope envelope)
 
IMessage RequestBegin (IMessageEnvelope envelope)
 
IMessage RequestCreateTrigger (IMessageEnvelope envelope)
 
IMessage RequestDisposeLargeObject (IMessageEnvelope envelope)
 
IMessage RequestCreateLargeObject (IMessageEnvelope envelope)
 
IMessage RequestDisposeResult (IMessageEnvelope envelope)
 
IMessage RequestQueryResultPart (IMessageEnvelope envelope)
 
IMessage RequestQueryExecute (IMessageEnvelope envelope)
 
IMessage RequestAuthenticate (IMessageEnvelope envelope)
 
IMessage RequestClose (IMessageEnvelope envelope)
 
IMessage Request (IMessageEnvelope envelope)
 
IMessageEnvelope CreateResponse (IDictionary< string, object > senderMetadata, IMessage response)
 
IMessage RequestConnect (IMessageEnvelope envelope)
 

Private Attributes

readonly NetworkClientConnector connector
 

Detailed Description

Definition at line 422 of file NetworkClientConnector.cs.

Constructor & Destructor Documentation

Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.ClientProcessor ( NetworkClientConnector  connector)
inline

Definition at line 425 of file NetworkClientConnector.cs.

425  {
426  this.connector = connector;
427  }

Member Function Documentation

IMessageEnvelope Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.CreateResponse ( IDictionary< string, object >  senderMetadata,
IMessage  response 
)
inlineprivate

Definition at line 545 of file NetworkClientConnector.cs.

545  {
546  return connector.CreateEnvelope(senderMetadata, response);
547  }
virtual IMessageEnvelope CreateEnvelope(IDictionary< string, object > metadata, IMessage message)
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.Ping ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 466 of file NetworkClientConnector.cs.

466  {
467  return Request(envelope);
468  }
IMessageEnvelope Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.ProcessMessage ( IMessageEnvelope  envelope)
inline

Implements Deveel.Data.Protocol.IMessageProcessor.

Definition at line 429 of file NetworkClientConnector.cs.

429  {
430  var message = envelope.Message;
431  IMessage response = null;
432 
433  if (message is ConnectRequest)
434  response = RequestConnect(envelope);
435  else if (message is AuthenticateRequest)
436  response = RequestAuthenticate(envelope);
437  else if (message is QueryExecuteRequest)
438  response = RequestQueryExecute(envelope);
439  else if (message is QueryResultPartRequest)
440  response = RequestQueryResultPart(envelope);
441  else if (message is DisposeResultRequest)
442  response = RequestDisposeResult(envelope);
443  else if (message is LargeObjectCreateRequest)
444  response = RequestCreateLargeObject(envelope);
445  else if (message is LargeObjectDisposeRequest)
446  response = RequestDisposeLargeObject(envelope);
447  else if (message is TriggerCreateRequest)
448  response = RequestCreateTrigger(envelope);
449  else if (message is BeginRequest)
450  response = RequestBegin(envelope);
451  else if (message is CommitRequest)
452  response = RequestCommit(envelope);
453  else if (message is RollbackRequest)
454  response = RequestRollback(envelope);
455  else if (message is PingRequest)
456  response = Ping(envelope);
457  else if (message is CloseRequest)
458  response = RequestClose(envelope);
459 
460  if (response == null)
461  throw new NotSupportedException();
462 
463  return CreateResponse(envelope.Metadata, response);
464  }
IMessageEnvelope CreateResponse(IDictionary< string, object > senderMetadata, IMessage response)
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.Request ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 539 of file NetworkClientConnector.cs.

539  {
540  connector.SendEnvelope(envelope);
541  var response = connector.ReceiveResponse(connector.Timeout, envelope.Metadata);
542  return connector.OnProcessServerResponse(response);
543  }
virtual IMessage OnProcessServerResponse(IMessageEnvelope envelope)
IMessageEnvelope ReceiveResponse(int timeout, IDictionary< string, object > senderMetadata)
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestAuthenticate ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 506 of file NetworkClientConnector.cs.

506  {
507  try {
509 
510  var response = Request(envelope);
511  var responseMessage = (AuthenticateResponse) response;
512  if (!responseMessage.Authenticated)
513  throw new InvalidOperationException();
514 
515  connector.OnAuthenticated(((AuthenticateRequest)envelope.Message).UserName, responseMessage.TimeStamp);
516  return response;
517  } catch (Exception) {
518 
519  throw;
520  }
521  }
virtual void OnAuthenticated(string username, long timeStamp)
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestBegin ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 478 of file NetworkClientConnector.cs.

478  {
479  throw new NotImplementedException();
480  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestClose ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 523 of file NetworkClientConnector.cs.

523  {
524  try {
525  var response = Request(envelope);
526  var responseMessage = (AcknowledgeResponse) response;
527  if (!responseMessage.State)
528  throw new InvalidOperationException();
529 
530  connector.Close();
531 
532  return response;
533  } catch (Exception) {
534 
535  throw;
536  }
537  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestCommit ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 474 of file NetworkClientConnector.cs.

474  {
475  throw new NotImplementedException();
476  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestConnect ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 549 of file NetworkClientConnector.cs.

549  {
550  try {
551  var request = (ConnectRequest) envelope.Message;
552  connector.Timeout = request.Timeout;
553  connector.OpenConnector(request.RemoteEndPoint);
554 
555  var response = Request(envelope);
556  var responseMessage = (ConnectResponse) response;
557  if (!responseMessage.Opened) {
558  connector.Close();
559  throw new InvalidOperationException();
560  }
561 
562  return response;
563  } catch (Exception) {
564  //TODO:
565  throw;
566  }
567  }
void OpenConnector(ConnectionEndPoint remoteEndPoint)
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestCreateLargeObject ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 490 of file NetworkClientConnector.cs.

490  {
491  throw new NotImplementedException();
492  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestCreateTrigger ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 482 of file NetworkClientConnector.cs.

482  {
483  throw new NotImplementedException();
484  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestDisposeLargeObject ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 486 of file NetworkClientConnector.cs.

486  {
487  throw new NotImplementedException();
488  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestDisposeResult ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 494 of file NetworkClientConnector.cs.

494  {
495  throw new NotImplementedException();
496  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestQueryExecute ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 502 of file NetworkClientConnector.cs.

502  {
503  throw new NotImplementedException();
504  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestQueryResultPart ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 498 of file NetworkClientConnector.cs.

498  {
499  throw new NotImplementedException();
500  }
IMessage Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.RequestRollback ( IMessageEnvelope  envelope)
inlineprivate

Definition at line 470 of file NetworkClientConnector.cs.

470  {
471  throw new NotImplementedException();
472  }

Member Data Documentation

readonly NetworkClientConnector Deveel.Data.Protocol.NetworkClientConnector.ClientProcessor.connector
private

Definition at line 423 of file NetworkClientConnector.cs.


The documentation for this class was generated from the following file: