Example #1
0
        public SortedList<string, string> LoadScripts(string path, string pattern, bool recurse, string workingDirectory, Versioning.IParseVersions versionParser = null)
        {
            SortedList<string, string> s = ScriptRunner.ResolveScriptsFromPathAndVersion(path, pattern, recurse, workingDirectory, FromVersion,
                                                          ToVersion, versionParser);

            return s;
        }
        /// <summary>
        /// Creates a new instance of the TcpDuplexServerProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        public TcpDuplexServerProtocolSetup(Versioning versioning)
            : base((settings, clientSinkChain, serverSinkChain) => new TcpExChannel(settings, clientSinkChain, serverSinkChain))
        {
            _versioning = versioning;

            Hashtable formatterSettings = new Hashtable();
            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full });
            ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider());
        }
        /// <summary>
        /// Creates a new instance of the IpcBinaryClientProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        public IpcBinaryClientProtocolSetup(Versioning versioning)
            : base((settings, clientSinkChain, serverSinkChain) => new IpcChannel(settings, clientSinkChain, serverSinkChain))
        {
            _channelName = "IpcBinaryClientProtocol_" + Guid.NewGuid().ToString();
            _versioning = versioning;

            Hashtable formatterSettings = new Hashtable();
            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full });
        }
        /// <summary>
        /// Creates a new instance of the HttpCustomClientProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        /// <param name="webProxy">Defines HTTP proxy settings</param>
        public HttpCustomClientProtocolSetup(Versioning versioning, IWebProxy webProxy)
            : base((settings, clientSinkChain, serverSinkChain) => new HttpChannel(settings, clientSinkChain, serverSinkChain))
        {
            _channelName = "HttpCustomClientProtocolSetup" + Guid.NewGuid().ToString();
            _versioning = versioning;

            Hashtable formatterSettings = new Hashtable();
            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            WebRequest.DefaultWebProxy = webProxy;

            ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full });
        }
        /// <summary>
        /// Creates a new instance of the TcpBinaryServerProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        public TcpBinaryServerProtocolSetup(Versioning versioning)
            : base((settings, clientSinkChain, serverSinkChain) => new TcpChannel(settings, clientSinkChain, serverSinkChain))
        {
            SocketCachingEnabled = true;
            _channelName = "TcpBinaryServerProtocolSetup_" + Guid.NewGuid().ToString();
            _versioning = versioning;

            Hashtable formatterSettings = new Hashtable();
            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full });
            ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider());
        }
        public static SortedList<string, string> ResolveScriptsFromPathAndVersion(string path, string pattern, bool recurse, string workingDirectory, Versioning.Version source, Versioning.Version destination, Versioning.IParseVersions versionParser = null)
        {
            SortedList<string, string> files = new SortedList<string, string>();
            if (versionParser == null) versionParser = new Versioning.VersionDateParser();
            string usedPath = path;
            if (!System.IO.Directory.Exists(usedPath)) usedPath = System.IO.Path.Combine(workingDirectory, path);
            if (!System.IO.Directory.Exists(usedPath)) throw new ArgumentOutOfRangeException("path");
            foreach (var d in System.IO.Directory.GetDirectories(usedPath))
            {
                System.IO.DirectoryInfo dir = new DirectoryInfo(d);
                Versioning.Version dirVersion = versionParser.Parse(dir.Name);
                if (dirVersion >= source && dirVersion <= destination)
                {
                    var scripts = ResolveScriptsFromPath(dir.FullName, pattern, recurse, workingDirectory);
                    foreach (string key in scripts.Keys)
                    {
                        files.Add(key, scripts[key]);
                    }

                }
            }

            return files;
        }
 /// <summary>
 /// Creates a new instance of the TcpDuplexClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Symmetric encryption algorithm (e.G. "3DES")</param>
 /// <param name="oaep">Specifies if OAEP padding should be activated</param>
 public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, bool oaep)
     : this(versioning)
 {
     Encryption = encryption;
     Algorithm = algorithm;
     Oaep = oaep;
 }
 /// <summary>
 /// Creates a new instance of the TcpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 public TcpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm)
     : this(versioning)
 {
     Encryption = encryption;
     Algorithm = algorithm;
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param>
 /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param>
 /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param>
 public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval)
     : this(versioning)
 {
     Encryption = encryption;
     TcpKeepAliveEnabled = keepAlive;
     TcpKeepAliveTime = keepAliveTime;
     TcpKeepAliveInterval = KeepAliveInterval;
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Symmetric encryption algorithm (e.G. "3DES")</param>
 /// <param name="maxAttempts">Maximum number of connection attempts</param>
 public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts)
     : this(versioning)
 {
     Encryption = encryption;
     Algorithm = algorithm;
     MaxAttempts = maxAttempts;
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="tcpPort">TCP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 /// <param name="oaep">Specifies if OAEP padding should be activated</param>
 public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm, bool oaep)
     : this(versioning)
 {
     TcpPort = tcpPort;
     AuthenticationProvider = authProvider;
     Encryption = encryption;
     Algorithm = algorithm;
     Oaep = oaep;
 }
Example #12
0
        public override Task<JObject> GetPackageMetadata(string id, Versioning.NuGetVersion version)
        {
            return Task.Factory.StartNew(() =>
            {
                NuGetTraceSources.V2SourceRepository.Verbose("getpackage", "Getting metadata for {0} {1}", id, version);
                var semver = CoreConverters.SafeToSemanticVersion(version);
                var package = _repository.FindPackage(id, semver);

                // Sometimes, V2 APIs seem to fail to return a value for Packages(Id=,Version=) requests...
                if (package == null)
                {
                    var packages = _repository.FindPackagesById(id);
                    package = packages.FirstOrDefault(p => Equals(p.Version, semver));
                }

                // If still null, fail
                if (package == null)
                {
                    return null;
                }

                string repoRoot = null;
                IPackagePathResolver resolver = null;
                if (_lprepo != null)
                {
                    repoRoot = _lprepo.Source;
                    resolver = _lprepo.PathResolver;
                }

                return PackageJsonLd.CreatePackage(package, repoRoot, resolver);
            });
        }
 public override async Task<Newtonsoft.Json.Linq.JObject> GetPackageMetadata(string id, Versioning.NuGetVersion version)
 {
     await DetectVersionWhenNeccessary();
     return await _repo.GetPackageMetadata(id, version);
 }
 /// <summary>
 /// Creates a new instance of the HttpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 /// <param name="maxAttempts">Maximum number of connection attempts</param>
 /// <param name="webProxy">Defines HTTP proxy settings</param>
 public HttpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts, IWebProxy webProxy)
     : this(versioning, webProxy)
 {
     Encryption = encryption;
     Algorithm = algorithm;
     MaxAttempts = maxAttempts;
 }
 /// <summary>
 /// Creates a new instance of the HttpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="webProxy">Defines HTTP proxy settings</param>
 public HttpCustomClientProtocolSetup(Versioning versioning, bool encryption, IWebProxy webProxy)
     : this(versioning, webProxy)
 {
     Encryption = encryption;
 }
 /// <summary>
 /// Creates a new instance of the TcpCustomServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="tcpPort">TCP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 public TcpCustomServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm)
     : this(versioning)
 {
     TcpPort = tcpPort;
     AuthenticationProvider = authProvider;
     Encryption = encryption;
     Algorithm = algorithm;
 }
 public bool ParseAndValidate(string version, Versioning.Version testVersion, Versioning.IParseVersions parser = null)
 {
     if (parser == null) parser = new Versioning.JustVersionParser();
     Versioning.Version v = parser.Parse(version);
     return (v.Major == testVersion.Major && v.Minor == testVersion.Minor && v.Build == testVersion.Build &&
             v.Description == testVersion.Description);
 }
 /// <summary>
 /// Creates a new instance of the HttpCustomServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="httpPort">HTTP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 public HttpCustomServerProtocolSetup(Versioning versioning, int httpPort, IAuthenticationProvider authProvider)
     : this(versioning)
 {
     HttpPort = httpPort;
     AuthenticationProvider = authProvider;
 }
 /// <summary>
 /// Creates a new instance of the HttpCustomServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="httpPort">HTTP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 /// <param name="oaep">Specifies if OAEP padding should be activated</param>
 public HttpCustomServerProtocolSetup(Versioning versioning, int httpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm, bool oaep)
     : this(versioning)
 {
     HttpPort = httpPort;
     AuthenticationProvider = authProvider;
     Encryption = encryption;
     Algorithm = algorithm;
     Oaep = oaep;
 }
 /// <summary>
 /// Creates a new instance of the TcpBinaryServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="tcpPort">TCP port number</param>
 public TcpBinaryServerProtocolSetup(Versioning versioning, int tcpPort)
     : this(versioning)
 {
     TcpPort = tcpPort;
 }
 /// <summary>
 /// Creates a new instance of the HttpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 /// <param name="oaep">Specifies if OAEP padding should be activated</param>
 /// <param name="webProxy">Defines HTTP proxy settings</param>
 public HttpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, bool oaep, IWebProxy webProxy)
     : this(versioning, webProxy)
 {
     Encryption = encryption;
     Algorithm = algorithm;
     Oaep = oaep;
 }
        public override async Task<Newtonsoft.Json.Linq.JObject> GetPackageMetadata(string id, Versioning.NuGetVersion version)
        {
            foreach (var source in _sources)
            {
                var result = await source.GetPackageMetadata(id, version);
                if (result != null)
                {
                    return result;
                }
            }

            return null;
        }
 /// <summary>
 /// Creates a new instance of the HttpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 public HttpCustomClientProtocolSetup(Versioning versioning)
     : this(versioning, WebRequest.DefaultWebProxy)
 {
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="tcpPort">TCP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param>
 /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param>
 /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param>
 public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval)
     : this(versioning)
 {
     TcpPort = tcpPort;
     AuthenticationProvider = authProvider;
     TcpKeepAliveEnabled = keepAlive;
     TcpKeepAliveTime = keepAliveTime;
     TcpKeepAliveInterval = KeepAliveInterval;
 }
 /// <summary>
 /// Creates a new instance of the TcpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 /// <param name="maxAttempts">Maximum number of connection attempts</param>
 /// <param name="oaep">Specifies if OAEP padding should be used</param>
 public TcpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts, bool oaep)
     : this(versioning)
 {
     Encryption = encryption;
     Algorithm = algorithm;
     MaxAttempts = maxAttempts;
     Oaep = oaep;
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="tcpPort">TCP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param>
 /// <param name="oaep">Specifies if OAEP padding should be activated</param>
 /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param>
 /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param>
 /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param>
 public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm, bool oaep, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval)
     : this(versioning)
 {
     TcpPort = tcpPort;
     AuthenticationProvider = authProvider;
     Encryption = encryption;
     Algorithm = algorithm;
     Oaep = oaep;
     TcpKeepAliveEnabled = keepAlive;
     TcpKeepAliveTime = keepAliveTime;
     TcpKeepAliveInterval = KeepAliveInterval;
 }
 /// <summary>
 /// Creates a new instance of the TcpCustomClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 public TcpCustomClientProtocolSetup(Versioning versioning, bool encryption)
     : this(versioning)
 {
     Encryption = encryption;
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexServerProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="tcpPort">TCP port number</param>
 /// <param name="authProvider">Authentication provider</param>
 public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider)
     : this(versioning)
 {
     TcpPort = tcpPort;
     AuthenticationProvider = authProvider;
 }
 /// <summary>
 /// Creates a new instance of the TcpDuplexClientProtocolSetup class.
 /// </summary>
 /// <param name="versioning">Versioning behavior</param>
 /// <param name="encryption">Specifies if the communication sould be encrypted</param>
 /// <param name="algorithm">Symmetric encryption algorithm (e.G. "3DES")</param>
 /// <param name="maxAttempts">Maximum number of connection attempts</param>
 /// <param name="oaep">Specifies if OAEP padding should be activated</param>
 /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param>
 /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param>
 /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param>
 public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts, bool oaep, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval)
     : this(versioning)
 {
     Encryption = encryption;
     Algorithm = algorithm;
     MaxAttempts = maxAttempts;
     Oaep = oaep;
     TcpKeepAliveEnabled = keepAlive;
     TcpKeepAliveTime = keepAliveTime;
     TcpKeepAliveInterval = KeepAliveInterval;
 }