From commits-return-32563-archive-asf-public=cust-asf.ponee.io@tinkerpop.apache.org Wed Oct 3 12:33:47 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4338B18078F for ; Wed, 3 Oct 2018 12:33:45 +0200 (CEST) Received: (qmail 42032 invoked by uid 500); 3 Oct 2018 10:33:44 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 41967 invoked by uid 99); 3 Oct 2018 10:33:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2018 10:33:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 73E99E10D4; Wed, 3 Oct 2018 10:33:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: florianhockmann@apache.org To: commits@tinkerpop.apache.org Date: Wed, 03 Oct 2018 10:33:46 -0000 Message-Id: <54229e1be27342a7ab30048fb6375b61@git.apache.org> In-Reply-To: <5f551b94daba4f22b2853cd69f5cd5e3@git.apache.org> References: <5f551b94daba4f22b2853cd69f5cd5e3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/8] tinkerpop git commit: Merge branch 'tp32' into tp33 Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8ca27786 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8ca27786 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8ca27786 Branch: refs/heads/master Commit: 8ca277863861699ca2fa7913735687f6e65b486b Parents: c10bde3 b440742 Author: Florian Hockmann Authored: Wed Oct 3 12:31:08 2018 +0200 Committer: Florian Hockmann Committed: Wed Oct 3 12:31:08 2018 +0200 ---------------------------------------------------------------------- CHANGELOG.asciidoc | 1 + .../src/Gremlin.Net/Driver/Connection.cs | 6 +++-- .../src/Gremlin.Net/Driver/ConnectionFactory.cs | 7 ++++-- .../src/Gremlin.Net/Driver/GremlinClient.cs | 11 +++++++-- .../Gremlin.Net/Driver/WebSocketConnection.cs | 9 +++++-- .../Driver/GremlinClientTests.cs | 25 ++++++++++++++++++++ 6 files changed, 51 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/CHANGELOG.asciidoc ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs ---------------------------------------------------------------------- diff --cc gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs index 279c708,f63e20b..b79f0e6 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs @@@ -36,21 -37,21 +37,22 @@@ namespace Gremlin.Net.Drive { private readonly GraphSONReader _graphSONReader; private readonly GraphSONWriter _graphSONWriter; - private readonly JsonMessageSerializer _messageSerializer = new JsonMessageSerializer(); + private readonly JsonMessageSerializer _messageSerializer; private readonly Uri _uri; - private readonly WebSocketConnection _webSocketConnection = new WebSocketConnection(); + private readonly WebSocketConnection _webSocketConnection; private readonly string _username; private readonly string _password; public Connection(Uri uri, string username, string password, GraphSONReader graphSONReader, - GraphSONWriter graphSONWriter, string mimeType) - GraphSONWriter graphSONWriter, Action webSocketConfiguration) ++ GraphSONWriter graphSONWriter, string mimeType, Action webSocketConfiguration) { _uri = uri; _username = username; _password = password; _graphSONReader = graphSONReader; _graphSONWriter = graphSONWriter; + _messageSerializer = new JsonMessageSerializer(mimeType); + _webSocketConnection = new WebSocketConnection(webSocketConfiguration); } public async Task> SubmitAsync(RequestMessage requestMessage) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs ---------------------------------------------------------------------- diff --cc gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs index e2ff5b7,8b14ed9..7a6c2d5 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs @@@ -30,22 -31,22 +31,24 @@@ namespace Gremlin.Net.Drive { private readonly GraphSONReader _graphSONReader; private readonly GraphSONWriter _graphSONWriter; + private readonly Action _webSocketConfiguration; private readonly GremlinServer _gremlinServer; + private readonly string _mimeType; public ConnectionFactory(GremlinServer gremlinServer, GraphSONReader graphSONReader, - GraphSONWriter graphSONWriter, string mimeType) - GraphSONWriter graphSONWriter, Action webSocketConfiguration) ++ GraphSONWriter graphSONWriter, string mimeType, Action webSocketConfiguration) { _gremlinServer = gremlinServer; - _graphSONReader = graphSONReader; - _graphSONWriter = graphSONWriter; + _mimeType = mimeType; + _graphSONReader = graphSONReader ?? throw new ArgumentNullException(nameof(graphSONReader)); + _graphSONWriter = graphSONWriter ?? throw new ArgumentNullException(nameof(graphSONWriter)); + _webSocketConfiguration = webSocketConfiguration; } public Connection CreateConnection() { return new Connection(_gremlinServer.Uri, _gremlinServer.Username, _gremlinServer.Password, _graphSONReader, - _graphSONWriter, _mimeType); - _graphSONWriter, _webSocketConfiguration); ++ _graphSONWriter, _mimeType, _webSocketConfiguration); } } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinClient.cs ---------------------------------------------------------------------- diff --cc gremlin-dotnet/src/Gremlin.Net/Driver/GremlinClient.cs index 2b47cbc,a5cb46c..54d7634 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinClient.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinClient.cs @@@ -52,13 -43,16 +53,19 @@@ namespace Gremlin.Net.Drive /// The the requests should be sent to. /// A instance to read received GraphSON data. /// a instance to write GraphSON data. + /// The GraphSON version mime type, defaults to latest supported by the server. + /// + /// A delegate that will be invoked with the + /// object used to configure WebSocket connections. + /// public GremlinClient(GremlinServer gremlinServer, GraphSONReader graphSONReader = null, - GraphSONWriter graphSONWriter = null, string mimeType = null) - GraphSONWriter graphSONWriter = null, Action webSocketConfiguration = null) ++ GraphSONWriter graphSONWriter = null, string mimeType = null, ++ Action webSocketConfiguration = null) { - var reader = graphSONReader ?? new GraphSONReader(); - var writer = graphSONWriter ?? new GraphSONWriter(); - var connectionFactory = new ConnectionFactory(gremlinServer, reader, writer, webSocketConfiguration); + var reader = graphSONReader ?? new GraphSON3Reader(); + var writer = graphSONWriter ?? new GraphSON3Writer(); - var connectionFactory = new ConnectionFactory(gremlinServer, reader, writer, mimeType ?? DefaultMimeType); ++ var connectionFactory = new ConnectionFactory(gremlinServer, reader, writer, mimeType ?? DefaultMimeType, ++ webSocketConfiguration); _connectionPool = new ConnectionPool(connectionFactory); }