//SortedDictionary<Guid, Column> columns = new SortedDictionary<Guid, Column> (); //SortedDictionary<int, SortedDictionary<string,Column>> tableColumns = new SortedDictionary<int, SortedDictionary<string, Column>> (); ServiceAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ServiceParameters parameters) : base(serviceAgentMode, objectBusSession, flush, false) { if (serviceAgentMode != ServiceAgentMode.Server) { throw new Exception("This service agent can only be run in server mode."); } connectionString = parameters.ConnectionString; objectBusSession.RegisterType(typeof(GetTablesRequestMessage), GetTablesRequestMessageReceived); objectBusSession.RegisterType(typeof(GetColumnsRequestMessage), GetColumnsRequestMessageReceived); objectBusSession.RegisterType(typeof(GetRowsRequestMessage), GetRowsRequestMessageReceived); objectBusSession.RegisterType(typeof(GetForeignKeyRelationsRequestMessage), GetForeignKeyRelationsRequestMessageReceived); tfqns.Add(48, "System.Byte"); tfqns.Add(173, "System.Byte[]"); tfqns.Add(165, "System.Byte[]"); tfqns.Add(52, "System.Int16"); tfqns.Add(56, "System.Int32"); tfqns.Add(127, "System.Int64"); tfqns.Add(62, "System.Double"); tfqns.Add(106, "System.Double"); tfqns.Add(108, "System.Double"); tfqns.Add(231, "System.String"); tfqns.Add(239, "System.String"); tfqns.Add(175, "System.String"); tfqns.Add(104, "System.Boolean"); tfqns.Add(34, "System.Byte[]"); tfqns.Add(36, "System.Guid"); tfqns.Add(41, "System.DateTime"); tfqns.Add(42, "System.DateTime"); tfqns.Add(43, "System.DateTime"); tfqns.Add(61, "System.DateTime"); }
public Agent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ChannelControl channelControl) : base(serviceAgentMode, objectBusSession, flush, false) { objectBusSession.RegisterType(typeof(GetPublicKeyRequestMessage), GetPublicKeyRequestMessageReceived); objectBusSession.RegisterType(typeof(CreateChannelRequestMessage), CreateChannelRequestMessageReceived); this.channelControl = channelControl; }
//SortedDictionary<Guid, Column> columns = new SortedDictionary<Guid, Column> (); ServiceAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ServiceParameters parameters) : base(serviceAgentMode, objectBusSession, flush, false) { if (serviceAgentMode != ServiceAgentMode.Server) throw new Exception ("This service agent can only be run in server mode."); conn = new SqliteConnection (parameters.ConnectionString); objectBusSession.RegisterType (typeof(GetTablesRequestMessage), GetTablesRequestMessageReceived); objectBusSession.RegisterType (typeof(GetColumnsRequestMessage), GetColumnsRequestMessageReceived); objectBusSession.RegisterType (typeof(GetRowsRequestMessage), GetRowsRequestMessageReceived); objectBusSession.RegisterType (typeof(GetForeignKeyRelationsRequestMessage), GetForeignKeyRelationsRequestMessageReceived); }
//SortedDictionary<Guid, Column> columns = new SortedDictionary<Guid, Column> (); ServiceAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ServiceParameters parameters) : base(serviceAgentMode, objectBusSession, flush, false) { if (serviceAgentMode != ServiceAgentMode.Server) { throw new Exception("This service agent can only be run in server mode."); } conn = new SqliteConnection(parameters.ConnectionString); objectBusSession.RegisterType(typeof(GetTablesRequestMessage), GetTablesRequestMessageReceived); objectBusSession.RegisterType(typeof(GetColumnsRequestMessage), GetColumnsRequestMessageReceived); objectBusSession.RegisterType(typeof(GetRowsRequestMessage), GetRowsRequestMessageReceived); objectBusSession.RegisterType(typeof(GetForeignKeyRelationsRequestMessage), GetForeignKeyRelationsRequestMessageReceived); }
StreamPairAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run) : base(serviceAgentMode, objectBusSession, flush, run) { #if TRACE Console.WriteLine(new System.Diagnostics.StackTrace(true).GetFrame(0)); #endif objectBusSession.RegisterType(typeof(StreamPairMessage), StreamPairMessageReceived); }
public BD2ServiceAgent(KeyValueStorage <byte[]> keyValueStorage, ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush) : base(serviceAgentMode, objectBusSession, flush, false) { if (keyValueStorage == null) { throw new ArgumentNullException("keyValueStorage"); } this.keyValueStorage = keyValueStorage; objectBusSession.RegisterType(typeof(GetAllRequestMessage), GetAllRequestMessageReceived); }
public ChunkAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ChunkRepository repository) : base(serviceAgentMode, objectBusSession, flush, false) { if (repository == null) { throw new ArgumentNullException("repository"); } this.repository = repository; objectBusSession.RegisterType(typeof(TopLevelChunksRequestMessage), RequestTopLevelChunkDeltaMessageReceived); // objectBusSession.RegisterType (typeof(BD2.Chunk.Daemon.Common.PollChunksRequestMessage), ); // objectBusSession.RegisterType (typeof(BD2.Chunk.Daemon.Common.PollNewChunksRequestMessage), ); // objectBusSession.RegisterType (typeof(BD2.Chunk.Daemon.Common.PushChunksRequestMessage), ); //this.repository.Enumerate (); }
FileShareAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run) : base(serviceAgentMode, objectBusSession, flush, run) { objectBusSession.RegisterType(typeof(FileShareMessage), FileShareMessageReceived); }
public override void Initialize() { session.RegisterType(typeof(GetValuesResponseMessage), GetValuesResponseMessageReceived); }
ChatAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush) : base(serviceAgentMode, objectBusSession, flush, false) { objectBusSession.RegisterType(typeof(ChatMessage), ChatMessageReceived); }
protected ServiceAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run) { if (!Enum.IsDefined(typeof(ServiceAgentMode), serviceAgentMode)) { throw new ArgumentException("Invalid value for argument 'serviceAgentMode'", "serviceAgentMode"); } if (objectBusSession == null) { throw new ArgumentNullException("objectBusSession"); } if (flush == null) { throw new ArgumentNullException("flush"); } this.serviceAgentMode = serviceAgentMode; this.objectBusSession = objectBusSession; this.flush = flush; objectBusSession.RegisterType(typeof(TransparentStreamCanReadRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanReadResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanSeekRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanSeekResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanTimeoutRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanTimeoutResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanWriteRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCanWriteResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCloseRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamCloseResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamFlushRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamFlushResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetLengthRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetLengthResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetPositionRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetPositionResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetReadTimeoutRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetReadTimeoutResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetWriteTimeoutRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamGetWriteTimeoutResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamReadRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamReadResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSeekRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSeekResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetLengthRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetLengthResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetPositionRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetPositionResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetReadTimeoutRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetReadTimeoutResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetWriteTimeoutRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamSetWriteTimeoutResponseMessage), TransparentStreamMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamWriteRequestMessage), TransparentStreamServerMessageReceived); objectBusSession.RegisterType(typeof(TransparentStreamWriteResponseMessage), TransparentStreamMessageReceived); if (run) { thread = new System.Threading.Thread(Run); thread.Start(); } }
public void RegisterType(Type type, Action <ObjectBusMessage> action) { ObjectBusSession.RegisterType(type, action); }