Esempio n. 1
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
 {
                 #if TRACE
     Console.WriteLine(new System.Diagnostics.StackTrace(true).GetFrame(0));
                 #endif
     return(new StreamPairAgent(serviceAgentMode, objectBusSession, flush, true));
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
 {
     #if TRACE
     Console.WriteLine (new System.Diagnostics.StackTrace (true).GetFrame (0));
     #endif
     return new StreamPairAgent (serviceAgentMode, objectBusSession, flush, true);
 }
Esempio n. 4
0
 //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");
 }
Esempio n. 5
0
 public BD2ServiceAgent(Database database, ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
     if (database == null)
         throw new ArgumentNullException ("database");
     this.database = database;
 }
Esempio n. 6
0
 //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");
 }
Esempio n. 7
0
File: Agent.cs Progetto: vebin/BD2
 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;
 }
Esempio n. 8
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ChunkRepository repository)
 {
     if (repository == null)
     {
         throw new ArgumentNullException("repository");
     }
     return(new ChunkAgent(serviceAgentMode, objectBusSession, flush, repository));
 }
Esempio n. 9
0
 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);
 }
Esempio n. 10
0
 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);
 }
Esempio n. 11
0
 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();
     }
 }
Esempio n. 12
0
 public BD2ServiceAgent(Database database, ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
     if (database == null)
     {
         throw new ArgumentNullException("database");
     }
     this.database = database;
 }
Esempio n. 13
0
 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);
 }
Esempio n. 14
0
 //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);
 }
Esempio n. 15
0
 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 ();
 }
Esempio n. 16
0
 //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);
 }
Esempio n. 17
0
        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 ();
        }
Esempio n. 18
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
 {
     return(new ServiceAgent(serviceAgentMode, objectBusSession, flush, ServiceParameters.Deserialize(parameters)));
 }
Esempio n. 19
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, Byte[] parameters)
 {
     return(new TransparentAgent(serviceAgentMode, objectBusSession, flush, parameters));
 }
Esempio n. 20
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
 {
     return new ChatAgent (serviceAgentMode, objectBusSession, flush);
 }
Esempio n. 21
0
 ChatAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
     objectBusSession.RegisterType (typeof(ChatMessage), ChatMessageReceived);
 }
Esempio n. 22
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
 {
     return(new FileShareAgent(serviceAgentMode, objectBusSession, flush, true));
 }
Esempio n. 23
0
 FileShareAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run)
     : base(serviceAgentMode, objectBusSession, flush, run)
 {
     objectBusSession.RegisterType (typeof(FileShareMessage), FileShareMessageReceived);
 }
Esempio n. 24
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, Byte[] parameters)
 {
     return new TransparentAgent (serviceAgentMode, objectBusSession, flush, parameters);
 }
Esempio n. 25
0
 public TransparentAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
     this.parameters = parameters;
 }
Esempio n. 26
0
 public UserStorageAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, UserStorageBase userStorage, IEnumerable<byte[]> users)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
 }
Esempio n. 27
0
 public UserStorageAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run)
     : base(serviceAgentMode, objectBusSession, flush, run)
 {
 }
Esempio n. 28
0
 public TransparentAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
     this.parameters = parameters;
 }
Esempio n. 29
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters)
 {
     return new ServiceAgent (serviceAgentMode, objectBusSession, flush, ServiceParameters.Deserialize (parameters));
 }
Esempio n. 30
0
 FileShareAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run)
     : base(serviceAgentMode, objectBusSession, flush, run)
 {
     objectBusSession.RegisterType(typeof(FileShareMessage), FileShareMessageReceived);
 }
Esempio n. 31
0
 public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ChunkRepository repository)
 {
     if (repository == null)
         throw new ArgumentNullException ("repository");
     return new ChunkAgent (serviceAgentMode, objectBusSession, flush, repository);
 }
Esempio n. 32
0
 protected DatabaseConnectionAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run)
     : base(serviceAgentMode, objectBusSession, flush, run)
 {
 }
Esempio n. 33
0
 ChatAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush)
     : base(serviceAgentMode, objectBusSession, flush, false)
 {
     objectBusSession.RegisterType(typeof(ChatMessage), ChatMessageReceived);
 }
Esempio n. 34
0
 protected DatabaseConnectionAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, bool run)
     : base(serviceAgentMode, objectBusSession, flush, run)
 {
 }