mergeconflics and removing a userfile
This commit is contained in:
@@ -1,31 +0,0 @@
|
|||||||
<Properties>
|
|
||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="src/NOCQ.Application/Program.cs">
|
|
||||||
<Files>
|
|
||||||
<File FileName="src/NOCQ.Application/Program.cs" Line="3" Column="21" />
|
|
||||||
<File FileName="src/NOCQ/Settings/SettingsFIle.cs" Line="15" Column="3" />
|
|
||||||
<File FileName="src/NOCQ.Application/settings.json" Line="10" Column="2" />
|
|
||||||
<File FileName="src/NOCQ/Plugins/Email/ImapInput.cs" Line="98" Column="5" />
|
|
||||||
<File FileName="src/NOCQ/Settings/RedisSettings.cs" Line="7" Column="3" />
|
|
||||||
</Files>
|
|
||||||
<Pads>
|
|
||||||
<Pad Id="ProjectPad">
|
|
||||||
<State expanded="True">
|
|
||||||
<Node name="NOCQ" expanded="True">
|
|
||||||
<Node name="Plugins" expanded="True">
|
|
||||||
<Node name="Email" expanded="True" />
|
|
||||||
</Node>
|
|
||||||
<Node name="Settings" expanded="True" />
|
|
||||||
</Node>
|
|
||||||
<Node name="NOCQ.Application" expanded="True" selected="True">
|
|
||||||
<Node name="References" expanded="True" />
|
|
||||||
</Node>
|
|
||||||
</State>
|
|
||||||
</Pad>
|
|
||||||
</Pads>
|
|
||||||
</MonoDevelop.Ide.Workbench>
|
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
|
||||||
<BreakpointStore />
|
|
||||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
|
||||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
|
||||||
</Properties>
|
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
|
<<<<<<< HEAD
|
||||||
using NOCQ.Settings;
|
using NOCQ.Settings;
|
||||||
|
=======
|
||||||
|
using System.Linq;
|
||||||
|
>>>>>>> e5ed166572b47afde75d47f888768ae5b8d528f2
|
||||||
using NOCQ.Plugins.Email;
|
using NOCQ.Plugins.Email;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NOCQ.Application
|
namespace NOCQ.Application
|
||||||
{
|
{
|
||||||
@@ -24,6 +30,29 @@ namespace NOCQ.Application
|
|||||||
emailPlugin.Execute(null,null);
|
emailPlugin.Execute(null,null);
|
||||||
|
|
||||||
Console.ReadKey ();
|
Console.ReadKey ();
|
||||||
|
/*
|
||||||
|
var list = new List<Alert>();
|
||||||
|
for (var i = 0; i < 3000; i++)
|
||||||
|
{
|
||||||
|
var al = new Alert()
|
||||||
|
{Data = "data" + Guid.NewGuid(), Runbook = "runbook", Service = "service",
|
||||||
|
Severity = "sev",
|
||||||
|
Source = "Source",
|
||||||
|
System = "System",
|
||||||
|
TimeStamp = new DateTime(2011,1,1)
|
||||||
|
};
|
||||||
|
list.Add(al);
|
||||||
|
}
|
||||||
|
list.ForEach(al => RedisDatabase.SaveAlert(al, "127.0.0.1", RedisQueues.Input, 6379, 3000));
|
||||||
|
for (var i = 0; i < 3000; i++)
|
||||||
|
{
|
||||||
|
var s = RedisDatabase.GetNextAlert("127.0.0.1", RedisQueues.Input, 6379, 3000);
|
||||||
|
Console.WriteLine(s.Data);
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.ReadLine();
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
using System;
|
|
||||||
using ctstone.Redis;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Configuration;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
namespace NOCQ
|
|
||||||
{
|
|
||||||
public class RedisDataase
|
|
||||||
{
|
|
||||||
public RedisDataase(){}
|
|
||||||
|
|
||||||
public static async Task SaveAlert(Alert alert, string q)
|
|
||||||
{
|
|
||||||
using (var redis = new RedisClientAsync(q,
|
|
||||||
Convert.ToInt32(ConfigurationManager.AppSettings["Port"]),
|
|
||||||
Convert.ToInt32(ConfigurationManager.AppSettings["Timeout"])
|
|
||||||
))
|
|
||||||
{
|
|
||||||
await redis.LPush(q, alert);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async Task<Alert> GetNextAlert(string q)
|
|
||||||
{
|
|
||||||
|
|
||||||
using (var redis = new RedisClientAsync(q,
|
|
||||||
Convert.ToInt32(ConfigurationManager.AppSettings["Port"]),
|
|
||||||
Convert.ToInt32(ConfigurationManager.AppSettings["Timeout"])
|
|
||||||
))
|
|
||||||
{
|
|
||||||
var ts = await redis.RPop(q);
|
|
||||||
|
|
||||||
return await JsonConvert.DeserializeObjectAsync<Alert>(ts);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
44
src/NOCQ/DB/RedisDatabase.cs
Normal file
44
src/NOCQ/DB/RedisDatabase.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using ctstone.Redis;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Configuration;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
namespace NOCQ
|
||||||
|
{
|
||||||
|
public class RedisDatabase
|
||||||
|
{
|
||||||
|
public RedisDatabase(){}
|
||||||
|
|
||||||
|
public static void SaveAlert(Alert alert, string host, string q, int port, int timeout)
|
||||||
|
{
|
||||||
|
using (var redis = new RedisClient(host,
|
||||||
|
port,
|
||||||
|
timeout
|
||||||
|
))
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
redis.LPush(q, JsonConvert.SerializeObject(alert));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Alert GetNextAlert(string host, string q, int port, int timeout )
|
||||||
|
{
|
||||||
|
|
||||||
|
using (var redis = new RedisClient(host,
|
||||||
|
port,
|
||||||
|
timeout
|
||||||
|
))
|
||||||
|
{
|
||||||
|
var ts = redis.RPop(q);
|
||||||
|
|
||||||
|
return JsonConvert.DeserializeObject<Alert>(ts);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -5,8 +5,8 @@ namespace NOCQ
|
|||||||
{
|
{
|
||||||
public struct RedisQueues
|
public struct RedisQueues
|
||||||
{
|
{
|
||||||
public static string Input = ConfigurationManager.AppSettings["DBQueueInput"];
|
public static string Input = "DBQueueInput";
|
||||||
public static string Output = ConfigurationManager.AppSettings["DBQueueOutput"];
|
public static string Output = "DBQueueOutput";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,16 +67,17 @@
|
|||||||
<Compile Include="Plugins\Email\EmailSettings.cs" />
|
<Compile Include="Plugins\Email\EmailSettings.cs" />
|
||||||
<Compile Include="Imports\IDataImportHook.cs" />
|
<Compile Include="Imports\IDataImportHook.cs" />
|
||||||
<Compile Include="Imports\DataImports.cs" />
|
<Compile Include="Imports\DataImports.cs" />
|
||||||
<Compile Include="DB\RedisDataase.cs" />
|
|
||||||
<Compile Include="Plugins\Email\ParseRule.cs" />
|
<Compile Include="Plugins\Email\ParseRule.cs" />
|
||||||
<Compile Include="Plugins\Email\ImapInput.cs" />
|
<Compile Include="Plugins\Email\ImapInput.cs">
|
||||||
<Compile Include="Plugins\Email\IEmailSetting.cs" />
|
<DependentUpon>EmailSettings.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Model\Alert.cs" />
|
<Compile Include="Model\Alert.cs" />
|
||||||
<Compile Include="DB\RedisQueues.cs" />
|
<Compile Include="DB\RedisQueues.cs" />
|
||||||
<Compile Include="Settings\SettingsFIle.cs" />
|
<Compile Include="Settings\SettingsFIle.cs" />
|
||||||
<Compile Include="Settings\RedisSettings.cs" />
|
<Compile Include="Settings\RedisSettings.cs" />
|
||||||
<Compile Include="Settings\SettingsParser.cs" />
|
<Compile Include="Settings\SettingsParser.cs" />
|
||||||
<Compile Include="Settings\PluginSettings.cs" />
|
<Compile Include="Settings\PluginSettings.cs" />
|
||||||
|
<Compile Include="DB\RedisDatabase.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
namespace NOCQ.Plugins.Email
|
|
||||||
{
|
|
||||||
public interface IEmailSetting
|
|
||||||
{
|
|
||||||
string Username {get;set;}
|
|
||||||
string Password {get;set;}
|
|
||||||
string Host {get;set;}
|
|
||||||
int Port {get;set;}
|
|
||||||
string Folder {get;set;}
|
|
||||||
bool IsSsl {get;set;}
|
|
||||||
int Frequency { get; set; }
|
|
||||||
IEnumerable<ParseRule> ParseRules {get;set;}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Security.Permissions;
|
||||||
// Information about this assembly is defined by the following attributes.
|
// Information about this assembly is defined by the following attributes.
|
||||||
// Change them to the values specific to your project.
|
// Change them to the values specific to your project.
|
||||||
[assembly: AssemblyTitle("NOCQ")]
|
[assembly: AssemblyTitle("NOCQ")]
|
||||||
@@ -15,6 +15,7 @@ using System.Runtime.CompilerServices;
|
|||||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||||
[assembly: AssemblyVersion("1.0.*")]
|
[assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
// The following attributes are used to specify the signing key for the assembly,
|
// The following attributes are used to specify the signing key for the assembly,
|
||||||
// if desired. See the Mono documentation for more information about signing.
|
// if desired. See the Mono documentation for more information about signing.
|
||||||
//[assembly: AssemblyDelaySign(false)]
|
//[assembly: AssemblyDelaySign(false)]
|
||||||
|
|||||||
Reference in New Issue
Block a user