diff --git a/doc/specs/thrift-uri.md b/doc/specs/thrift-uri.md new file mode 100644 index 00000000000..d18a1ae4a67 --- /dev/null +++ b/doc/specs/thrift-uri.md @@ -0,0 +1,155 @@ +Thrift URIs +==================================================================== + +Last Modified: 2024-APR-21 + + + +# Motivation and use case + +Describing the endpoint specifics for a Thrift API today is a purely textual exercise, which leaves the client end with the task to set up and stack together a proper protocol/transport stack. That sometimes even leads to headaches, e.g. if the server requires e.g. framed protocol which might not be obvious. The use of a generally accepted, machine-readable and extensible Thrift URI format to describe client bindings could streamline that process. + +# Thrift URI general format + +Lets look at the general format: + + "thrift://" "/" ["/" ]* "?" + +The *scheme* of all Thrift URIs is "thrift://". Immediately followimng parts are the protocol being used and the endpoint transport. + +Optionally, more path segments may be added, each one describing a particular layered transport, e.g. "framed". + +All query data (i.e. the part after the question mark) depend on the endpoint transport in the second segment, examples follow below. All data must be properly URL-encoded. + +# Predefined identifiers + +Each implementation shall register their implemented formats with the following keys internally: + +## Protocols +|Code|Protocol| +|-|-| +|binary|Thrift Binary protocol| +|compact|Thrift Compact protocol| +|json|Standard Thrift JSON protocol| + +TODO: cover multiplex protocol + +## Endpoint Transports +|Code|Transport| +|-|-| +|http|http(s) transport| +|namedpipes|Named Pipes Transport| +|pipes|Simple Pipes Transport (i.e. via STDIN,STDOUT)| +|socket|Socket Transport| +|tlssocket|TLS Sockets Transport| +|file|File transport| +|memory|Memory Buffer Transport| + +## Layered Transports +|Code|Transport| +|-|-| +|framed|Framed transport| +|buffered|Buffered transport| +|zlib|ZLib transport| + +## TODO: multiplex protocol +.... + + +# Extensibility + +Consistent with the open and extensible nature of Thrift, the registration mechanism outlined above is intentionally designed to be open to any user-defined protocols and transports. That way, future developments as well as proprietary developments can be covered by the same mechanism. It is also expected, that depending on the implemented set of features, different languages supported by Thrift might support a different set of Thrift URI components. + + +# Transport specific data + + +## http - http(s) transport + +The data part consists of the target URL. No other data are allowed. + +Examples: + * thrift://binary/http?https%3A%2F%2Fuser%3Apass%40example.com%2Fmyservice%3Farg%3Done%26arg%3Dtwo + +## namedpipes - Named Pipes Transport + +The data part consists of the target pipe, either name only or in full format: + +Examples: + * thrift://binary/namedpipes?mypipe + * thrift://binary/namedpipes?mypath%5Cmyname + * thrift://binary/namedpipes?%5C%5Cmyserver%5Cpipe%5Cmypath%5Cmyname + +## pipes - Simple Pipes Transport (i.e. via STDIN,STDOUT) +.... + +## socket - Socket Transport + +|key|argument| +|-|-| +|host|Host name or IP| +|port|Host port| + +Examples: + * thrift://compact/socket/framed?host=localhost&port=8080 + +## tlssocket - TLS Sockets Transport + +|key|argument| +|-|-| +|host|Host name or IP| +|port|Host port| +|cert|path to certificate file| + +Examples: + * thrift://binary/tlssocket?host=localhost&port=8080&cert=C%3A%5CTemp%5Cclient.p12 + + +## file - File transport + +|key|argument| +|-|-| +|infile|Input file name| +|outfile|Output file name| + +Examples: + * thrift://json/file?infile=this.json&outfile=that.json + + +## memory - Memory Buffer Transport + +No data expected. + + +# Q&A + +## Is this a breaking change or not? + +No, it is an extension to the Thrift ecosystem, intended to make implementation of Thrift clients easier and faster. + +## Why are server transports not covered? + +The use case is about client connections. A server end usually requires somewhat more sophisticated implementation efforts, and constructing the transport/protocol stacks is just a small part of the whole. It also highly depends on the nature of the server. A Thrift URI would not add much value at the server end. That does not mean that the spec cannot be extended in the future. + + diff --git a/lib/netstd/Tests/Thrift.Tests/UriFactory/TUriFactoryTests.cs b/lib/netstd/Tests/Thrift.Tests/UriFactory/TUriFactoryTests.cs new file mode 100644 index 00000000000..815ae39a4b6 --- /dev/null +++ b/lib/netstd/Tests/Thrift.Tests/UriFactory/TUriFactoryTests.cs @@ -0,0 +1,178 @@ +// Licensed to the Apache Software Foundation(ASF) under one +// or more contributor license agreements.See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership.The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Thrift.Transport; +using Thrift.Transport.Client; + +namespace Thrift.Tests.UriFactory +{ + [TestClass] + public class TUriFactoryTests + { + private enum BuiltinProtocols { binary, compact, json }; + private enum BuiltinTransports { http, namedpipes, socket, tlssocket, file, memory }; + private enum BuiltinLayered { framed, buffered }; + + private readonly string InputFile = Path.GetTempFileName(); + private readonly string OutputFile = Path.GetTempFileName(); + + [TestMethod] + public void TFactory_Can_Parse_And_Construct_All_Builtin_Types() + { + // thrift://protocol/transport/layer/layer?data + foreach (var proto in Enum.GetValues()) + { + foreach (var trans in Enum.GetValues()) + { + var iTest = 0; + while (InitializeTransportSpecificArgs(trans, iTest++, out var connection)) + { + + // test basic combination first + var sData = MakeQueryString(connection); + var sUri = TThriftUri.THRIFT_URI_SCHEME + proto + "/" + trans; + TestUri(sUri + sData); + + // layers can be stacked upon each other, so lets do exactly that - just to test it + foreach (var layer in Enum.GetValues()) + { + sUri += "/" + layer; + TestUri(sUri + sData); + } + } + } + } + + File.Delete(InputFile); + File.Delete(OutputFile); + } + + private bool InitializeTransportSpecificArgs(BuiltinTransports trans, int test, out Dictionary connection) + { + if (test > 64) // prevent against endless loops + throw new Exception("Internal test error"); + + connection = []; + switch (trans) + { + case BuiltinTransports.http: + connection.Add("https://user:pass@example.com/myservice?arg=one&arg=two", string.Empty); + return (test == 0); + + case BuiltinTransports.namedpipes: + switch (test) + { + case 0: // full pipe name + connection.Add(@"\\myserver\pipe\mypath\myname", string.Empty); + return true; + case 1: // pipe name w/o server part + connection.Add(@"mypath\myname", string.Empty); + return true; + case 2: // simple pipe name w/o server part + connection.Add(@"mypipe", string.Empty); + return true; + default: + return false; + }; + + case BuiltinTransports.file: + switch (test) + { + case 0: // no argument at all + return true; + case 1: // file stream + connection.Add("infile", InputFile); + return true; + case 2: // file stream + connection.Add("outfile", OutputFile); + return true; + default: + return false; + }; + + case BuiltinTransports.socket: + connection.Add("host", "localhost"); + connection.Add("port", 8080.ToString()); + return (test == 0); + + case BuiltinTransports.tlssocket: + connection.Add("host", "localhost"); + connection.Add("port", 8080.ToString()); + connection.Add("cert", Path.Combine(Path.GetTempPath(), "client.p12")); + return (test == 0); + + case BuiltinTransports.memory: + // none + return (test == 0); + + default: + throw new NotImplementedException(trans.ToString()); + }; + } + + private static string MakeQueryString(Dictionary data) + { + if ((data == null) || (data.Count == 0)) + return string.Empty; + + var kvpair = new List(); + foreach (var pair in data) + { + var sTmp = Uri.EscapeDataString(pair.Key); + if (!string.IsNullOrEmpty(pair.Value)) + sTmp += "=" + Uri.EscapeDataString(pair.Value); + kvpair.Add(sTmp); + } + return "?" + string.Join("&", kvpair); + } + + private static void TestUri(string sUri) + { + var parsed = new TThriftUri( sUri); + Assert.AreEqual(sUri, parsed.ToString()); + + try + { + var proto = TFactory.ConstructClientProtocolTransportStack(parsed, new(), out var trans); + try + { + Assert.IsNotNull(proto); + Assert.IsNotNull(trans); + } + finally + { + trans?.Dispose(); + proto?.Dispose(); + } + } + catch(System.Security.Cryptography.CryptographicException) + { + // that may happen, but is not relevant here + } + catch (TTransportException) + { + // that may happen, but is not relevant here + } + } + } +} diff --git a/lib/netstd/Thrift/TFactory.cs b/lib/netstd/Thrift/TFactory.cs new file mode 100644 index 00000000000..ff3641580c1 --- /dev/null +++ b/lib/netstd/Thrift/TFactory.cs @@ -0,0 +1,112 @@ +// Licensed to the Apache Software Foundation(ASF) under one +// or more contributor license agreements.See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership.The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +using System; +using System.Collections.Generic; +using System.Net.Sockets; +using Thrift.Protocol; +using Thrift.Transport; +using Thrift.Transport.Client; +using Thrift.Transport.Server; +using static System.Net.WebRequestMethods; + +namespace Thrift +{ + public static class TFactory + { + private static readonly Dictionary RegisteredProtocols = new Dictionary(); + private static readonly Dictionary RegisteredLayeredTransports = new Dictionary(); + private static readonly Dictionary RegisteredEndpointTransports = new Dictionary(); + + static TFactory() + { + // protocol + Register("binary", new TBinaryProtocol.Factory()); + Register("compact", new TCompactProtocol.Factory()); + Register("json", new TJsonProtocol.Factory()); + + // layered transports + Register("framed", new TFramedTransport.Factory()); + Register("buffered", new TBufferedTransport.Factory()); + + // common endpoint transports + Register("file", new TStreamTransport.Factory()); + Register("memory", new TMemoryBufferTransport.Factory()); + + // client endpoint transports + Register("socket", new TSocketTransport.Factory()); + Register("tlssocket", new TTlsSocketTransport.Factory()); + Register("http", new THttpTransport.Factory()); + Register("namedpipes", new TNamedPipeTransport.Factory()); + } + + public static void Register(string name, TProtocolFactory factory) + { + lock (RegisteredProtocols) + RegisteredProtocols.Add(name, factory); // throws intentionally if name is already used + } + + public static void Register(string name, TTransportFactory factory) + { + lock (RegisteredLayeredTransports) + RegisteredLayeredTransports.Add(name, factory); // throws intentionally if name is already used + } + + public static void Register(string name, TEndpointTransportFactory factory) + { + lock (RegisteredEndpointTransports) + RegisteredEndpointTransports.Add(name, factory); // throws intentionally if name is already used + } + + + public static TProtocol ConstructClientProtocolTransportStack(string sThriftUri, TConfiguration config, out TTransport transport) + { + var uri = new TThriftUri(sThriftUri); + return ConstructClientProtocolTransportStack(uri, config, out transport); + } + + + public static TProtocol ConstructClientProtocolTransportStack(TThriftUri uri, TConfiguration config, out TTransport transport) + { + transport = CreateEndpointTransport(uri.EndpointTransport, config, uri.QueryData); + foreach (var layer in uri.LayeredTransports) + transport = CreateLayeredTransport(layer, transport); + return CreateProtocol(uri.Protocol, transport); + } + + private static TEndpointTransport CreateEndpointTransport(string name, TConfiguration config, Dictionary args) + { + if (RegisteredEndpointTransports.TryGetValue(name, out var factory)) + return factory.GetTransport(config, args); + throw new TApplicationException(TApplicationException.ExceptionType.Unknown, "Endpoint transport '" + name + "' not registered"); + } + + private static TTransport CreateLayeredTransport(string name, TTransport transport) + { + if (RegisteredLayeredTransports.TryGetValue(name, out var factory)) + return factory.GetTransport(transport); + throw new TApplicationException(TApplicationException.ExceptionType.Unknown, "layered transport '" + name + "' not registered"); + } + + private static TProtocol CreateProtocol(string name, TTransport transport) + { + if (RegisteredProtocols.TryGetValue(name, out var factory)) + return factory.GetProtocol(transport); + throw new TApplicationException(TApplicationException.ExceptionType.Unknown, "Protocol '" + name + "' not registered"); + } + } +} diff --git a/lib/netstd/Thrift/TThriftUri.cs b/lib/netstd/Thrift/TThriftUri.cs new file mode 100644 index 00000000000..9eb3fc10ec2 --- /dev/null +++ b/lib/netstd/Thrift/TThriftUri.cs @@ -0,0 +1,121 @@ +// Licensed to the Apache Software Foundation(ASF) under one +// or more contributor license agreements.See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership.The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Thrift +{ + public class TThriftUri + { + public const string THRIFT_URI_SCHEME = "thrift://"; + + public readonly string Protocol; + public readonly string EndpointTransport; + public readonly List LayeredTransports = new List(); + public readonly Dictionary QueryData = new Dictionary(); + + public TThriftUri(string protocol, string endpointTransport, Dictionary data) + { + Protocol = (protocol ?? "").Trim(); + EndpointTransport = (endpointTransport ?? "").Trim(); + if(data!=null) + foreach (var pair in data) + QueryData.Add(pair.Key, pair.Value); + } + + public TThriftUri(string sThriftUri) + { + if (!sThriftUri.StartsWith(THRIFT_URI_SCHEME)) + throw new TApplicationException(TApplicationException.ExceptionType.ProtocolError, "Invalid URI: " + THRIFT_URI_SCHEME + " expected"); + + // split path and query + sThriftUri = sThriftUri.Remove(0, THRIFT_URI_SCHEME.Length); + var pieces = sThriftUri.Split('?'); + var sPath = pieces[0]; + var sQuery = string.Join("?", pieces.Skip(1).ToArray()); + + // analyze path + // thrift://protocol/transport/layer/layer?data + pieces = sPath.Split('/'); + if (pieces.Length < 2) + throw new TApplicationException(TApplicationException.ExceptionType.ProtocolError, "Invalid URI: not enough data"); + Protocol = pieces[0].Trim(); + EndpointTransport = pieces[1].Trim(); + for (int i = 2; i < pieces.Length; i++) + LayeredTransports.Add(pieces[i].Trim()); + + // analyze query data + if (!string.IsNullOrEmpty(sQuery)) + { + pieces = sQuery.Split('&'); + foreach (var piece in pieces) + { + var pair = piece.Split('='); + var sKey = Uri.UnescapeDataString(pair[0]); + var sValue = Uri.UnescapeDataString(string.Join("=", pair.Skip(1).ToArray())); + QueryData.Add(sKey, sValue); + } + } + + Validate(); + } + + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append(THRIFT_URI_SCHEME); + sb.Append(Protocol); + sb.Append('/'); + sb.Append(EndpointTransport); + + foreach (var layer in LayeredTransports) + { + sb.Append('/'); + sb.Append(layer.Trim()); + } + + if (QueryData.Count > 0) + { + var kvpair = new List(); + foreach (var pair in QueryData) + { + var sTmp = Uri.EscapeDataString(pair.Key); + if (!string.IsNullOrEmpty(pair.Value)) + sTmp += "=" + Uri.EscapeDataString(pair.Value); + kvpair.Add(sTmp); + } + sb.Append('?'); + sb.Append(string.Join("&", kvpair)); + } + + return sb.ToString(); + } + + + internal void Validate() + { + if (string.IsNullOrEmpty(Protocol)) + throw new TApplicationException(TApplicationException.ExceptionType.ProtocolError, "Invalid URI: Protocol missing"); + if (string.IsNullOrEmpty(EndpointTransport)) + throw new TApplicationException(TApplicationException.ExceptionType.ProtocolError, "Invalid URI: Endpoint transport missing"); + } + } + +} diff --git a/lib/netstd/Thrift/Transport/Client/THttpTransport.cs b/lib/netstd/Thrift/Transport/Client/THttpTransport.cs index 1ab1caf729c..fb474c280fe 100644 --- a/lib/netstd/Thrift/Transport/Client/THttpTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/THttpTransport.cs @@ -291,5 +291,15 @@ protected override void Dispose(bool disposing) } _isDisposed = true; } + + public class Factory : TEndpointTransportFactory + { + public override TEndpointTransport GetTransport(TConfiguration config, Dictionary connection) + { + // connection is simply the server name + var server = connection.First().Key; + return new THttpTransport(new Uri(server), config); + } + } } } diff --git a/lib/netstd/Thrift/Transport/Client/TMemoryBufferTransport.cs b/lib/netstd/Thrift/Transport/Client/TMemoryBufferTransport.cs index 5773d30cb57..e727db89319 100644 --- a/lib/netstd/Thrift/Transport/Client/TMemoryBufferTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/TMemoryBufferTransport.cs @@ -16,6 +16,7 @@ // under the License. using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading; @@ -174,5 +175,14 @@ protected override void Dispose(bool disposing) } IsDisposed = true; } + + internal class Factory : TEndpointTransportFactory + { + public override TEndpointTransport GetTransport(TConfiguration config, Dictionary connection) + { + Debug.Assert((connection?.Count ?? 0) == 0); // unused data + return new TMemoryBufferTransport(config); + } + } } } diff --git a/lib/netstd/Thrift/Transport/Client/TNamedPipeTransport.cs b/lib/netstd/Thrift/Transport/Client/TNamedPipeTransport.cs index 8e60f9f5e60..ec732b33715 100644 --- a/lib/netstd/Thrift/Transport/Client/TNamedPipeTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/TNamedPipeTransport.cs @@ -16,10 +16,14 @@ // under the License. using System; +using System.Collections.Generic; +using System.Diagnostics; using System.IO.Pipes; +using System.Linq; using System.Security.Principal; using System.Threading; using System.Threading.Tasks; +using Thrift.Protocol; namespace Thrift.Transport.Client { @@ -129,5 +133,32 @@ protected override void Dispose(bool disposing) } } } + + internal class Factory : TEndpointTransportFactory + { + public override TEndpointTransport GetTransport(TConfiguration config, Dictionary connection) + { + // connection is simply the pipe name + var server = connection.First().Key; + + // name can be '\\ServerName\pipe\PipeName' or 'PipeName' + // note that PipeName can have backslashes as well + string sServer, sPipe; + if (server.StartsWith("\\\\")) + { + var pieces = server.Substring(2).Split('\\'); + if ((pieces.Length < 3) || (pieces[1] != "pipe")) + throw new TTransportException(TTransportException.ExceptionType.Unknown, "Invalid pipe name"); + sServer = pieces[0]; + sPipe = string.Join("\\", pieces.Skip(2).ToArray()); + } + else + { + sServer = "."; + sPipe = server; + } + return new TNamedPipeTransport(sServer, sPipe, config); + } + } } } diff --git a/lib/netstd/Thrift/Transport/Client/TSocketTransport.cs b/lib/netstd/Thrift/Transport/Client/TSocketTransport.cs index f3e87d47814..0fa53b285f2 100644 --- a/lib/netstd/Thrift/Transport/Client/TSocketTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/TSocketTransport.cs @@ -16,6 +16,7 @@ // under the License. using System; +using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Threading; @@ -225,5 +226,15 @@ protected override void Dispose(bool disposing) } _isDisposed = true; } + + new internal class Factory : TEndpointTransportFactory + { + public override TEndpointTransport GetTransport(TConfiguration config, Dictionary connection) + { + var sHost = connection["host"]; + var sPort = connection["port"]; + return new TSocketTransport(sHost, int.Parse(sPort), config); + } + } } } diff --git a/lib/netstd/Thrift/Transport/Client/TStreamTransport.cs b/lib/netstd/Thrift/Transport/Client/TStreamTransport.cs index 7237b8dd27d..6bdbb136366 100644 --- a/lib/netstd/Thrift/Transport/Client/TStreamTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/TStreamTransport.cs @@ -16,9 +16,12 @@ // under the License. using System; +using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; +using Thrift.Protocol; namespace Thrift.Transport.Client { @@ -123,5 +126,26 @@ protected override void Dispose(bool disposing) } _isDisposed = true; } + + internal class Factory : TEndpointTransportFactory + { + public override TEndpointTransport GetTransport(TConfiguration config, Dictionary connection) + { + // optionally we can pass in a file name for read/write + Stream input = null; + Stream output = null; + + if (connection != null) + { + if (connection.TryGetValue("infile", out var sValue)) + input = new FileStream(sValue, FileMode.Open, FileAccess.Read); + + if (connection.TryGetValue("outfile", out sValue)) + output = new FileStream(sValue, FileMode.OpenOrCreate, FileAccess.ReadWrite); + } + + return new TStreamTransport(input, output, config); + } + } } } diff --git a/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs b/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs index 0a51c9a2378..fb0701ef33f 100644 --- a/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs @@ -16,6 +16,7 @@ // under the License. using System; +using System.Collections.Generic; using System.Diagnostics; using System.Net; using System.Net.Security; @@ -282,6 +283,17 @@ public override void Close() } } + new internal class Factory : TEndpointTransportFactory + { + public override TEndpointTransport GetTransport(TConfiguration config, Dictionary connection) + { + var sHost = connection["host"]; + var sPort = connection["port"]; + var sCert = connection["cert"]; + var certificate = new X509Certificate2(sCert); + return new TTlsSocketTransport(sHost, int.Parse(sPort), config, 0, certificate); + } + } } } diff --git a/lib/netstd/Thrift/Transport/TEndpointTransportFactory.cs b/lib/netstd/Thrift/Transport/TEndpointTransportFactory.cs new file mode 100644 index 00000000000..d443383d5b0 --- /dev/null +++ b/lib/netstd/Thrift/Transport/TEndpointTransportFactory.cs @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation(ASF) under one +// or more contributor license agreements.See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership.The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +using System.Collections.Generic; + +namespace Thrift.Transport +{ + /// + /// Factory class used to create wrapped instance of TEndpointTransports. + /// + // ReSharper disable once InconsistentNaming + public abstract class TEndpointTransportFactory + { + public abstract TEndpointTransport GetTransport(TConfiguration config, Dictionary connection); + } +}