Пример #1
0
 public PluginInvoker(ISettingsManager settingsManager, Func<Type, IPlugin> pluginFactory, IFileSystem fileSystem, IPaths paths)
 {
     this.settingsManager = settingsManager;
     this.pluginFactory = pluginFactory;
     this.fileSystem = fileSystem;
     this.paths = paths;
 }
		public override bool OnStart()
		{
			var fileManipulation = new FileManipulation();
			var zipping = new Zipping();
			var localResourceManager = new LocalResourceManager();
			var cloudDriveManager = new CloudDriveManager(localResourceManager);
			paths = new Paths(localResourceManager);
			//paths = new TestPaths(localResourceManager);

			neo4JManager = new Neo4jManager(fileManipulation, zipping);

			ServicePointManager.DefaultConnectionLimit = 12;

			CrashDumps.EnableCollection(true);

			var initialConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
			var directoryConfiguration = neo4JManager.GetLogDirectory(paths);
			initialConfiguration.Directories.DataSources.Add(directoryConfiguration);

			DiagnosticMonitor.Start(ConfigSettings.DiagnosticsConnectionString, initialConfiguration);

			RoleEnvironment.Changing += RoleEnvironmentChanging;
			CloudStorageAccount.SetConfigurationSettingPublisher(
					(configName, configSetter) => configSetter(RoleEnvironment.GetConfigurationSettingValue(configName))
				);

			var storageAccount = CloudStorageAccount.FromConfigurationSetting(ConfigSettings.StorageConnectionString);

			var neo4jInternalPort = paths.Neo4jPort;
			neo4JManager.Install(paths, storageAccount, neo4jInternalPort, cloudDriveManager);

			return base.OnStart();
		}
		public void Install(IPaths paths, CloudStorageAccount storageAccount, int port, ICloudDriveManager cloudDriveManager)
		{
			Trace.TraceInformation("Installing Neo4j server.");

			DownloadJava(paths, storageAccount);
            UnzipJava(paths);

			DownloadNeo4j(paths, storageAccount);
			UnzipNeo4j(paths);

            try
            {
                // try to mount cloud drive
                MountDatabase(paths, cloudDriveManager);
                SetServerDbPathConfig(paths, port);
            }
            catch (Exception ex)
            {
                Trace.TraceError("Drive Mounting Error: " + ex.Message);
            }
            
			SetServerPortAndUrlConfig(paths, port);
			SetJavaPath(paths);
			CopyConfigurationFilesToLogsDirectory(paths);

			ClearLogDirectory(paths);

			Trace.TraceInformation("Neo4j server installed.");
		}
		internal void MountDatabase(IPaths paths, ICloudDriveManager cloudDriveManager)
		{
			Trace.TraceInformation("Mounting the Neoj4 database blob drive.");

            paths.MountDrivePath = cloudDriveManager.MountDrive(ConfigSettings.StorageConnectionString, paths.Neo4jDBDriveBlobRelativePath, paths.LocalNeo4jDababaseResourceName, paths.Neo4jDBDriveSize);

			Trace.TraceInformation("Done mounting the Neoj4 database blob drive.");
		}
		internal void ClearLogDirectory(IPaths paths)
		{
			var localNeo4JLogsPath = paths.LocalNeo4jLogsPath;

			Trace.TraceInformation(string.Format("Clearing the Neoj4 log directory <{0}>.", localNeo4JLogsPath));

			var logDirectory = new DirectoryInfo(localNeo4JLogsPath);
			foreach (var fileInfo in logDirectory.GetFiles())
				fileInfo.Delete();

			Trace.TraceInformation(string.Format("Done clearing the Neoj4 log directory <{0}>.", localNeo4JLogsPath));
		}
		internal void CopyConfigurationFilesToLogsDirectory(IPaths paths)
		{
			Trace.TraceInformation("Copying Neo4j Configuration files to the log directory.");

			var logDirectory = new DirectoryInfo(paths.LocalNeo4jLogsPath);

			var neo4JServerConfigFilePath = paths.Neo4jServerConfigPath;
			File.Copy(neo4JServerConfigFilePath, Path.Combine(logDirectory.FullName, Path.GetFileName(neo4JServerConfigFilePath)));

			var neo4JWrapperConfigPath = paths.Neo4jWrapperConfigPath;
			File.Copy(neo4JWrapperConfigPath, Path.Combine(logDirectory.FullName, Path.GetFileName(neo4JWrapperConfigPath)));

			Trace.TraceInformation("Done copying Neo4j Configuration files to the log directory.");
		}
Пример #7
0
 /// <summary>
 /// Get '-9999999.999' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='doublePath'>
 /// '-9999999.999'numeric value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DoubleDecimalNegativeAsync(this IPaths operations, double?doublePath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DoubleDecimalNegativeWithHttpMessagesAsync(doublePath, null, cancellationToken).ConfigureAwait(false);
 }
Пример #8
0
 /// <summary>
 /// Get true Boolean value on path
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='boolPath'>
 /// true boolean value
 /// </param>
 public static void GetBooleanTrue(this IPaths operations, bool?boolPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).GetBooleanTrueAsync(boolPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #9
0
 /// <summary>
 /// Get '-1.034E-20' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='floatPath'>
 /// '-1.034E-20'numeric value
 /// </param>
 public static void FloatScientificNegative(this IPaths operations, double?floatPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).FloatScientificNegativeAsync(floatPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #10
0
		internal void SetServerDbPathConfig(IPaths paths, int port)
		{
			Trace.TraceInformation("Setting Neo4j server database path setting.");

			var patternToFind = string.Format("{0}=", paths.Neo4jServerConfigSettings.DatabaseLocation);
			string dbPath = paths.MountDrivePath + paths.LocalNeo4jDababaseResourceName;
			var lineToInsert = string.Format("{0}{1}", patternToFind, dbPath);
			var replacement = Replacement.Create(patternToFind, lineToInsert);

			var fileName = paths.Neo4jServerConfigPath;
			fileManipulation.ReplaceConfigLine(fileName, replacement);

			Trace.TraceInformation("Finished setting Neo4j server database path settings.");
		}
Пример #11
0
 /// <summary>
 /// Get '2012-01-01T01:01:01Z' as date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dateTimePath'>
 /// '2012-01-01T01:01:01Z' as date-time
 /// </param>
 public static void DateTimeValid(this IPaths operations, DateTime?dateTimePath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).DateTimeValidAsync(dateTimePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #12
0
 /// <summary>
 /// Get a 200 to test a valid base uri
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// Account Name
 /// </param>
 public static void GetEmpty(this IPaths operations, string accountName)
 {
     operations.GetEmptyAsync(accountName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Get '1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void GetIntOneMillion(this IPaths operations)
 {
     operations.GetIntOneMillionAsync().GetAwaiter().GetResult();
 }
Пример #14
0
 /// <summary>
 /// Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bytePath'>
 /// '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </param>
 public static void ByteMultiByte(this IPaths operations, byte[] bytePath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).ByteMultiByteAsync(bytePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #15
0
 /// <summary>
 /// Get null (should throw)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='stringPath'>
 /// null string value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task StringNullAsync(this IPaths operations, string stringPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.StringNullWithHttpMessagesAsync(stringPath, null, cancellationToken).ConfigureAwait(false);
 }
Пример #16
0
		internal DirectoryConfiguration GetLogDirectory(IPaths paths)
		{
			var localNeo4JLogsPath = paths.LocalNeo4jLogsPath;
			return new DirectoryConfiguration
			{
				Container = paths.Neo4jLogsContainerName,
				DirectoryQuotaInMB = 1000,
				Path = localNeo4JLogsPath
			};
		}
Пример #17
0
		public void Start(IPaths paths)
		{
			Trace.TraceInformation("Starting the Neo4j service.");

			string neo4JRoot = paths.LocalNeo4jPath, neo4JRelativePath = paths.Neo4jExePath;

			var process = new Process
			{
				StartInfo = new ProcessStartInfo(neo4JRelativePath)
				{
					RedirectStandardInput = true, RedirectStandardOutput = true,
					RedirectStandardError = true, UseShellExecute = false,
					WindowStyle = ProcessWindowStyle.Hidden, WorkingDirectory = neo4JRoot,
				}

			};

            process.StartInfo.EnvironmentVariables["JAVA_HOME"] = paths.LocalJavaHomePath;
		    process.StartInfo.EnvironmentVariables["javaVersion"] = "1.7";
            if (process.StartInfo.EnvironmentVariables.ContainsKey("Path") && process.StartInfo.EnvironmentVariables["Path"].Length > 0)
            {
                process.StartInfo.EnvironmentVariables["Path"] += ";" + paths.LocalJavaHomePath + "\\bin";
            }
            else
            {
                process.StartInfo.EnvironmentVariables["Path"] = paths.LocalJavaHomePath + "\\bin";
            }

			process.Exited += (sender, e) => Trace.TraceInformation("Neo4j service process exited.");
			process.ErrorDataReceived += (sender, e) => Trace.TraceError(e.Data);
			process.OutputDataReceived += (sender, e) => Trace.TraceInformation(e.Data);

			try
			{
				process.Start();
				process.BeginOutputReadLine();
				process.BeginErrorReadLine();
				process.WaitForExit();
			}
			catch (Exception e)
			{
				Trace.Fail(string.Format("Error running Neo4j: type <{0}> message <{1}> stack trace <{2}>.", e.GetType().FullName, e.Message, e.StackTrace));
				throw;
			}
			Trace.TraceInformation("Neo4j service running.");
		}
Пример #18
0
		internal void UnzipJava(IPaths paths)
		{
			string localJavaZip;
			try
			{
				Trace.TraceInformation("Unzipping java.");

				localJavaZip = paths.LocalJavaZip;
				var localJavaPath = paths.LocalJavaPath;
				zipping.Extract(localJavaZip, localJavaPath);
			}
			catch (Exception e)
			{
				Trace.Fail(string.Format("Error unzipping Neo4j: type <{0}> message <{1}> stack trace <{2}>.", e.GetType().FullName, e.Message, e.StackTrace));
				throw;
			}

			//File.Delete(localJavaZip);
			Trace.TraceInformation("Java unzipped.");
		}
Пример #19
0
		public void DownloadJava(IPaths paths, CloudStorageAccount storageAccount)
		{
			try
			{
				var localJavaZipPath = paths.LocalJavaZip;

				if (File.Exists(localJavaZipPath))
				{
					File.Delete(localJavaZipPath);
					//return;
				}

				Trace.TraceInformation("Downloading Java.");

				var blobClient = new CloudBlobClient(storageAccount.BlobEndpoint, storageAccount.Credentials);

				string blobStoragePath = storageAccount.BlobEndpoint.AbsoluteUri;
				string jBlobRelativePath = RoleEnvironment.GetConfigurationSettingValue(ConfigSettings.JavaBlobNameSetting);

				string javaBlobAddress = blobStoragePath.CombineUris(jBlobRelativePath);

				var blob = blobClient.GetBlobReference(javaBlobAddress);
                
                var option = new BlobRequestOptions();
                option.Timeout = new TimeSpan(0, 15, 0);
				blob.DownloadToFile(localJavaZipPath, option);

				Trace.TraceInformation("Java downloaded.");
			}
			catch (Exception e)
			{
				Trace.Fail(string.Format("Error downloading Java: type <{0}> message <{1}> stack trace <{2}>.", e.GetType().FullName, e.Message, e.StackTrace));
				throw;
			}
		}
Пример #20
0
 /// <summary>
 /// Get null (should throw on the client before the request is sent on wire)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='enumPath'>
 /// send null should throw. Possible values for this parameter include: 'red
 /// color', 'green color', 'blue color'
 /// </param>
 public static void EnumNull(this IPaths operations, UriColor?enumPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).EnumNullAsync(enumPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #21
0
		internal void SetJavaPath(IPaths paths)
		{
			var localJavaPath = paths.LocalJavaExePath;
			var fileName = paths.Neo4jWrapperConfigPath;

			Trace.TraceInformation(string.Format("Setting path to Java in Neo4j to '{0}' in the file <{1}>.", localJavaPath, fileName));

			var wrapperJavaCommand = paths.Neo4jWrapperSettingJavaCommand;
			var patternToFind = string.Format("{0}=", wrapperJavaCommand);
			var lineToInsert = string.Format("{0}{1}", patternToFind, localJavaPath);
			var replacement = Replacement.Create(patternToFind, lineToInsert);

			fileManipulation.ReplaceConfigLine(fileName, replacement);

			Trace.TraceInformation(string.Format("Finished setting path to Java in Neo4j to '{0}'.", localJavaPath));
		}
Пример #22
0
 public Log(IFileSystem fileSystem, IPaths paths)
 {
     this.fileSystem = fileSystem;
     path = paths.GetDataPath("FreePIE.log");
 }
Пример #23
0
 public SettingsManager(IPaths paths)
 {
     this.paths = paths;
 }
 /// <summary>
 /// Get '1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetIntOneMillionAsync(this IPaths operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetIntOneMillionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #25
0
 /// <summary>
 /// Get '1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='intPath'>
 /// '1000000' integer value
 /// </param>
 public static void GetIntOneMillion(this IPaths operations, int?intPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).GetIntOneMillionAsync(intPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #26
0
 /// <summary>
 /// Get a 200 to test a valid base uri
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// Account Name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetEmptyAsync(this IPaths operations, string accountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetEmptyWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #27
0
 /// <summary>
 /// Get '-10000000000' 64 bit integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='longPath'>
 /// '-10000000000' 64 bit integer value
 /// </param>
 public static void GetNegativeTenBillion(this IPaths operations, long?longPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).GetNegativeTenBillionAsync(longPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Пример #28
0
 /// <summary>
 /// Get null as date-time, should be disallowed or throw depending on
 /// representation of date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dateTimePath'>
 /// null as date-time
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DateTimeNullAsync(this IPaths operations, DateTime?dateTimePath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DateTimeNullWithHttpMessagesAsync(dateTimePath, null, cancellationToken).ConfigureAwait(false);
 }
Пример #29
0
		internal void SetServerPortAndUrlConfig(IPaths paths, int port)
		{
			Trace.TraceInformation("Setting Neo4j server port and uri settings.");

			var neo4JServerConfigSettings = paths.Neo4jServerConfigSettings;

			var patternToFind = string.Format("{0}=", neo4JServerConfigSettings.Port);
			var lineToInsert = string.Format("{0}{1}", patternToFind, port);
			var replacement1 = Replacement.Create(patternToFind, lineToInsert);

			const string portPattern = "%%port%%";
			string portString = port.ToString();

			string neo4JAdminDataUri = paths.Neo4jAdminDataUri;
			patternToFind = string.Format("{0}=", neo4JServerConfigSettings.WebAdminDataUri);
			string webAdminDataUri = neo4JAdminDataUri.Replace(portPattern, portString);
			lineToInsert = string.Format("{0}{1}", patternToFind, webAdminDataUri);
			var replacement2 = Replacement.Create(patternToFind, lineToInsert);

			string neo4JAdminManagementUri = paths.Neo4jAdminManagementUri;
			patternToFind = string.Format("{0}=", neo4JServerConfigSettings.WebAdminManagementUri);
			string webAdminManagementUri = neo4JAdminManagementUri.Replace(portPattern, portString);
			lineToInsert = string.Format("{0}{1}", patternToFind, webAdminManagementUri);
			var replacement3 = Replacement.Create(patternToFind, lineToInsert);

		    patternToFind = "#org.neo4j.server.webserver.address=0.0.0.0";
            lineToInsert = "org.neo4j.server.webserver.address=0.0.0.0";
            var replacement4 = Replacement.Create(patternToFind, lineToInsert);

			var fileName = paths.Neo4jServerConfigPath;
            fileManipulation.ReplaceConfigLine(fileName, replacement1, replacement2, replacement3, replacement4);

			Trace.TraceInformation("Finished setting Neo4j server port and uri settings.");
		}
Пример #30
0
 /// <summary>
 /// Get '-1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='intPath'>
 /// '-1000000' integer value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetIntNegativeOneMillionAsync(this IPaths operations, int?intPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.GetIntNegativeOneMillionWithHttpMessagesAsync(intPath, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get '2012-01-01T01:01:01Z' as date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DateTimeValidAsync(this IPaths operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DateTimeValidWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #32
0
 /// <summary>
 /// Get '-10000000000' 64 bit integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='longPath'>
 /// '-10000000000' 64 bit integer value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetNegativeTenBillionAsync(this IPaths operations, long?longPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.GetNegativeTenBillionWithHttpMessagesAsync(longPath, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get null as date-time, should be disallowed or throw depending on
 /// representation of date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dateTimePath'>
 /// null as date-time
 /// </param>
 public static void DateTimeNull(this IPaths operations, System.DateTime dateTimePath)
 {
     operations.DateTimeNullAsync(dateTimePath).GetAwaiter().GetResult();
 }
Пример #34
0
 /// <summary>
 /// Get '-1.034E-20' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='floatPath'>
 /// '-1.034E-20'numeric value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task FloatScientificNegativeAsync(this IPaths operations, double?floatPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.FloatScientificNegativeWithHttpMessagesAsync(floatPath, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get 'lorem' encoded value as 'bG9yZW0' (base64url)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='base64UrlPath'>
 /// base64url encoded value
 /// </param>
 public static void Base64Url(this IPaths operations, byte[] base64UrlPath)
 {
     operations.Base64UrlAsync(base64UrlPath).GetAwaiter().GetResult();
 }
Пример #36
0
 /// <summary>
 /// Get '-9999999.999' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='doublePath'>
 /// '-9999999.999'numeric value
 /// </param>
 public static void DoubleDecimalNegative(this IPaths operations, double?doublePath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).DoubleDecimalNegativeAsync(doublePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Get 'lorem' encoded value as 'bG9yZW0' (base64url)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='base64UrlPath'>
 /// base64url encoded value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task Base64UrlAsync(this IPaths operations, byte[] base64UrlPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.Base64UrlWithHttpMessagesAsync(base64UrlPath, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #38
0
 /// <summary>
 /// Get null (should throw)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='stringPath'>
 /// null string value
 /// </param>
 public static void StringNull(this IPaths operations, string stringPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).StringNullAsync(stringPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Get an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' ,
 /// null, ''] using the csv-array format
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='arrayPath'>
 /// an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' , null,
 /// ''] using the csv-array format
 /// </param>
 public static void ArrayCsvInPath(this IPaths operations, IList <string> arrayPath)
 {
     operations.ArrayCsvInPathAsync(arrayPath).GetAwaiter().GetResult();
 }
Пример #40
0
 /// <summary>
 /// Get true Boolean value on path
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='boolPath'>
 /// true boolean value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetBooleanTrueAsync(this IPaths operations, bool?boolPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.GetBooleanTrueWithHttpMessagesAsync(boolPath, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' ,
 /// null, ''] using the csv-array format
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='arrayPath'>
 /// an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' , null,
 /// ''] using the csv-array format
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task ArrayCsvInPathAsync(this IPaths operations, IList <string> arrayPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.ArrayCsvInPathWithHttpMessagesAsync(arrayPath, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #42
0
 /// <summary>
 /// Get null (should throw on the client before the request is sent on wire)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='enumPath'>
 /// send null should throw. Possible values for this parameter include: 'red
 /// color', 'green color', 'blue color'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task EnumNullAsync(this IPaths operations, UriColor?enumPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.EnumNullWithHttpMessagesAsync(enumPath, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get the date 2016-04-13 encoded value as '1460505600' (Unix time)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='unixTimeUrlPath'>
 /// Unix time encoded value
 /// </param>
 public static void UnixTimeUrl(this IPaths operations, System.DateTime unixTimeUrlPath)
 {
     operations.UnixTimeUrlAsync(unixTimeUrlPath).GetAwaiter().GetResult();
 }
Пример #44
0
 /// <summary>
 /// Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bytePath'>
 /// '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task ByteMultiByteAsync(this IPaths operations, byte[] bytePath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.ByteMultiByteWithHttpMessagesAsync(bytePath, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get the date 2016-04-13 encoded value as '1460505600' (Unix time)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='unixTimeUrlPath'>
 /// Unix time encoded value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UnixTimeUrlAsync(this IPaths operations, System.DateTime unixTimeUrlPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.UnixTimeUrlWithHttpMessagesAsync(unixTimeUrlPath, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }