protected ServiceBusWriteClient(ServiceBusConfiguration configuration,
                                 ClientSerializer <T> serializer, IServiceBusMessageHandler messageHandler)
 {
     Serializer     = serializer ?? new JsonSerializer <T>();
     Configuration  = configuration;
     MessageHandler = messageHandler;
 }
 public AdminService(IMongoClient client, IMongoDatabase db, StoreSettings settings)
 {
     _client           = client;
     _db               = db;
     _settings         = settings;
     _clientSerializer = new ClientSerializer();
 }
 public AdminService(IMongoClient client, IMongoDatabase db, StoreSettings settings)
 {
     _client = client;
     _db = db;
     _settings = settings;
     _clientSerializer = new ClientSerializer();
 }
Example #4
0
        public List <BaseObject> ClientSerialize(ApplicationDataContext applicationDataContext)
        {
            ClientFactory    factory    = new ClientFactory("Клиентская");
            ClientSerializer serializer = (ClientSerializer)factory.CreateSerializer();
            string           ClientSerealizedObjects = serializer.Serialize(applicationDataContext.Objects);

            return(serializer.Deserialize(ClientSerealizedObjects));
        }
Example #5
0
 public ConnectionHandler(GameManager gameManager, Connection conn, string id)
 {
     _connection       = conn;
     _gameManager      = gameManager;
     _id               = id;
     _deserializer     = new ServerDeserializer(this);
     _clientSerializer = new ClientSerializer(_connection);
 }
        public Message BuildRequestSecurityTokenResponseMessage(RequestSecurityTokenResponse RSTR)
        {
            ClientSerializer RSTRSerializer = new ClientSerializer(typeof(Client.WsTrust.RequestSecurityTokenResponse));

            MessageVersion mv = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.WSAddressing10);

            Message request = Message.CreateMessage(mv, Constants.WsTrust.RequestSecurityTokenResponseIssueAction, RSTR, RSTRSerializer);

            request.Headers.ReplyTo = new EndpointAddress("http://www.w3.org/2005/08/addressing/anonymous");
            return(request);
        }
 protected async Task SaveAsync(Client client)
 {
     BsonDocument doc = new ClientSerializer().Serialize(client);
     IMongoCollection<BsonDocument> collection = _data.Database.GetCollection<BsonDocument>(Settings.ClientCollection);
     var result = await collection.ReplaceOneAsync(
         Filter.ById(client.ClientId),
         doc,
         PerformUpsert
         ).ConfigureAwait(false);
     Debug.WriteLine(result);
 }
        protected async Task SaveAsync(Client client)
        {
            BsonDocument doc = new ClientSerializer().Serialize(client);
            IMongoCollection <BsonDocument> collection = _data.Database.GetCollection <BsonDocument>(Settings.ClientCollection);
            var result = await collection.ReplaceOneAsync(
                Filter.ById(client.ClientId),
                doc,
                PerformUpsert
                ).ConfigureAwait(false);

            Debug.WriteLine(result);
        }
        protected HttpWriteClient(IHttpClientFactory httpClientFactory,
                                  HttpConfiguration configuration,
                                  ClientSerializer <T> serializer)
        {
            _serializer = serializer ?? new JsonSerializer <T>();

            HttpClient             = httpClientFactory.CreateClient();
            HttpClient.BaseAddress = new Uri(configuration.BaseUrl);

            AddUrl    = configuration.AddUrl;
            UpdateUrl = configuration.UpdateUrl;
            DeleteUrl = configuration.DeleteUrl;
            BaseUrl   = configuration.BaseUrl;
        }
Example #10
0
        public JjKellerHttpWriteClient(IHttpClientFactory httpClientFactory, HttpConfiguration configuration, ClientSerializer <T> serializer = null)
            : base(httpClientFactory, configuration, serializer)
        {
            var t = configuration as HttpConfigurationWrapper;

            if (t == null || t.Configuration.GetType() != typeof(JjKellerHttpConfiguration))
            {
                throw new ArgumentException("Invalid configuration. Must use a valid JJ Keller HTTP Configuration.", nameof(configuration));
            }
        }
Example #11
0
        public KeepTruckinHttpWriteClient(IHttpClientFactory httpClientFactory, HttpConfiguration configuration, ClientSerializer <T> serializer = null)
            : base(httpClientFactory, configuration, serializer)
        {
            var t = configuration as HttpConfigurationWrapper;

            if (t == null || t.Configuration.GetType() != typeof(KeepTruckinHttpConfiguration))
            {
                throw new ArgumentException("Invalid configuration. Must use a valid KeepTruckin HTTP Configuration.", nameof(configuration));
            }

            if (serializer != null && serializer.GetType() != typeof(JsonSerializer <T>))
            {
                throw new ArgumentException("KeepTruckin uses json serialization.");
            }
        }
        public KeepTruckinServiceBusWriteClient(ServiceBusConfiguration configuration, ClientSerializer <T> serializer,
                                                IServiceBusMessageHandler serviceBusMessageHandler) : base(configuration, serializer, serviceBusMessageHandler)
        {
            var t = configuration as ServiceBusConfigurationWrapper;

            if (t == null || t.Configuration.GetType() != typeof(KeepTruckinServiceBusConfiguration))
            {
                throw new ArgumentException("Invalid configuration. Must use a valid KeepTruckin Service Bus Configuration.", nameof(configuration));
            }

            if (serializer.GetType() != typeof(ApplicationXmlSerializer <T>))
            {
                throw new ArgumentException("KeepTruckin uses Application XML serialization.");
            }
        }
Example #13
0
 public EmployeeHttpWriteClientImplementation(IHttpClientFactory httpClientFactory, HttpConfiguration configuration, ClientSerializer <Employee> serializer = null)
     : base(httpClientFactory, configuration, serializer)
 {
 }
 public ClientStore(IMongoDatabase db, StoreSettings settings, ClientSerializer serializer) :
     base(db, settings.ClientCollection)
 {
     _serializer = serializer;
 }