adding some interfaces and added alert class

This commit is contained in:
Tommy Parnell
2014-05-07 12:55:29 -07:00
parent 02f4a8d233
commit 2ab96369b5
9 changed files with 63 additions and 23 deletions

View File

@@ -2,25 +2,9 @@
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="src/NOCQ/Plugins/Email/ImapInput.cs"> <MonoDevelop.Ide.Workbench ActiveDocument="src/NOCQ/Plugins/Email/ImapInput.cs">
<Files> <Files>
<File FileName="src/NOCQ/Plugins/Email/EmailSettings.cs" Line="15" Column="16" /> <File FileName="src/NOCQ/DB/RedisDataase.cs" Line="10" Column="6" />
<File FileName="src/NOCQ/Plugins/Email/ImapInput.cs" Line="68" Column="31" /> <File FileName="src/NOCQ/Plugins/Email/ImapInput.cs" Line="9" Column="24" />
</Files> </Files>
<Pads>
<Pad Id="ProjectPad">
<State expanded="True">
<Node name="NOCQ" expanded="True">
<Node name="Extensability" expanded="True" />
<Node name="Imports" expanded="True" />
<Node name="Plugins" expanded="True">
<Node name="Email" expanded="True" />
</Node>
</Node>
<Node name="NOCQ.Application" expanded="True" selected="True">
<Node name="References" expanded="True" />
</Node>
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench> </MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints> <MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore /> <BreakpointStore />

18
src/NOCQ/Model/Alert.cs Normal file
View File

@@ -0,0 +1,18 @@
using System;
namespace NOCQ
{
public class Alert : IAlert
{
public DateTime TimeStamp {get; set;}
public string Source {get;set;}
public string System {get;set;}
public string Service {get;set;}
public string Data {get;set;}
public string Runbook {get; set;}
public string Severity {get;set;}
}
}

16
src/NOCQ/Model/IAlert.cs Normal file
View File

@@ -0,0 +1,16 @@
using System;
namespace NOCQ
{
public interface IAlert
{
DateTime TimeStamp {get; set;}
string Source {get;set;}
string System {get;set;}
string Service {get;set;}
string Data {get;set;}
string Runbook {get; set;}
string Severity {get;set;}
}
}

View File

@@ -68,6 +68,9 @@
<Compile Include="DB\RedisDataase.cs" /> <Compile Include="DB\RedisDataase.cs" />
<Compile Include="Plugins\Email\ParseRule.cs" /> <Compile Include="Plugins\Email\ParseRule.cs" />
<Compile Include="Plugins\Email\IEmailSetting.cs" /> <Compile Include="Plugins\Email\IEmailSetting.cs" />
<Compile Include="Model\Alert.cs" />
<Compile Include="Plugins\Email\IParseRule.cs" />
<Compile Include="Model\IAlert.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
@@ -79,5 +82,6 @@
<Folder Include="DB\" /> <Folder Include="DB\" />
<Folder Include="Plugins\" /> <Folder Include="Plugins\" />
<Folder Include="Plugins\Email\" /> <Folder Include="Plugins\Email\" />
<Folder Include="Model\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -12,7 +12,7 @@ namespace NOCQ.Plugins.Email
public string Folder {get;set;} public string Folder {get;set;}
public bool IsSsl {get;set;} public bool IsSsl {get;set;}
public int Frequency { get; set; } public int Frequency { get; set; }
public IEnumerable<ParseRule> ParseRules {get;set;} public IEnumerable<IParseRule> ParseRules {get;set;}
} }
} }

View File

@@ -11,7 +11,7 @@ namespace NOCQ.Plugins.Email
string Folder {get;set;} string Folder {get;set;}
bool IsSsl {get;set;} bool IsSsl {get;set;}
int Frequency { get; set; } int Frequency { get; set; }
IEnumerable<ParseRule> ParseRules {get;set;} IEnumerable<IParseRule> ParseRules {get;set;}
} }
} }

View File

@@ -0,0 +1,18 @@
using System;
namespace NOCQ.Plugins.Email
{
public interface IParseRule
{
string Name { get; set; }
bool Enabled { get; set; }
string From {get;set;}
string Source {get;set;}
string System {get;set;}
string Service {get;set;}
string Data {get;set;}
string Runbook { get; set;}
string Severity {get;set;}
}
}

View File

@@ -16,7 +16,7 @@ namespace NOCQ.Plugins.Email
int port { get; set; } int port { get; set; }
bool ssl { get; set; } bool ssl { get; set; }
DateTime lastRun { get; set; } DateTime lastRun { get; set; }
List<ParseRule> parseRules{ get; set; } List<IParseRule> parseRules{ get; set; }
public ImapInput (dynamic settings) public ImapInput (dynamic settings)
{ {

View File

@@ -2,7 +2,7 @@ using System;
namespace NOCQ.Plugins.Email namespace NOCQ.Plugins.Email
{ {
public class ParseRule public class ParseRule : IParseRule
{ {
public string Name { get; set; } public string Name { get; set; }
public bool Enabled { get; set; } public bool Enabled { get; set; }