[Nmailserver-commits] SF.net SVN: nmailserver: [207] NMail/trunk
Brought to you by:
dframpton-oss,
tmyroadctfig
|
From: <tmy...@us...> - 2007-05-31 12:07:34
|
Revision: 207
http://svn.sourceforge.net/nmailserver/?rev=207&view=rev
Author: tmyroadctfig
Date: 2007-05-31 05:07:34 -0700 (Thu, 31 May 2007)
Log Message:
-----------
Added initial cut of the survey service.
Modified Paths:
--------------
NMail/trunk/NMail.sln
Added Paths:
-----------
NMail/trunk/NMail.SurveyService/
NMail/trunk/NMail.SurveyService/NMail.SurveyService.csproj
NMail/trunk/NMail.SurveyService/Properties/
NMail/trunk/NMail.SurveyService/Properties/AssemblyInfo.cs
NMail/trunk/NMail.SurveyService/SurveyEnvironment.cs
NMail/trunk/NMail.SurveyService/SurveyInformation.cs
NMail/trunk/NMail.SurveyService/SurveyService.cs
Added: NMail/trunk/NMail.SurveyService/NMail.SurveyService.csproj
===================================================================
--- NMail/trunk/NMail.SurveyService/NMail.SurveyService.csproj (rev 0)
+++ NMail/trunk/NMail.SurveyService/NMail.SurveyService.csproj 2007-05-31 12:07:34 UTC (rev 207)
@@ -0,0 +1,55 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{11BFAF65-FA51-4245-8747-F4BA39D10FA3}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>NMail.SurveyService</RootNamespace>
+ <AssemblyName>NMail.SurveyService</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="SurveyEnvironment.cs" />
+ <Compile Include="SurveyInformation.cs" />
+ <Compile Include="SurveyService.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\NMail\NMail.csproj">
+ <Project>{5A5A5012-B157-49B1-A35F-67EC9680112A}</Project>
+ <Name>NMail</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: NMail/trunk/NMail.SurveyService/Properties/AssemblyInfo.cs
===================================================================
--- NMail/trunk/NMail.SurveyService/Properties/AssemblyInfo.cs (rev 0)
+++ NMail/trunk/NMail.SurveyService/Properties/AssemblyInfo.cs 2007-05-31 12:07:34 UTC (rev 207)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("NMail.SurveyService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("NMail.SurveyService")]
+[assembly: AssemblyCopyright("Copyright © 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("242626f0-e0a3-49e6-9575-e5fb23a73ce8")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: NMail/trunk/NMail.SurveyService/SurveyEnvironment.cs
===================================================================
--- NMail/trunk/NMail.SurveyService/SurveyEnvironment.cs (rev 0)
+++ NMail/trunk/NMail.SurveyService/SurveyEnvironment.cs 2007-05-31 12:07:34 UTC (rev 207)
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NMail.SurveyService {
+ /// <summary>
+ /// The environment survey details.
+ /// </summary>
+ public class SurveyEnvironment {
+
+ private string os = System.Environment.OSVersion.ToString();
+
+ /// <summary>
+ /// The OS version.
+ /// </summary>
+ public string OS {
+ get { return os; }
+ set { os = value; }
+ }
+
+ private string environment = System.Environment.Version.ToString();
+
+ /// <summary>
+ /// The .net runtime environment version.
+ /// </summary>
+ public string Environment {
+ get { return environment; }
+ set { environment = value; }
+ }
+
+ private string currentDirectory = System.Environment.CurrentDirectory;
+
+ /// <summary>
+ /// The current directory NMail is running from.
+ /// </summary>
+ public string CurrentDirectory {
+ get { return currentDirectory; }
+ set { currentDirectory = value; }
+ }
+
+ private int processorCount = System.Environment.ProcessorCount;
+
+ /// <summary>
+ /// The number of processors in the machine.
+ /// </summary>
+ public int ProcessorCount {
+ get { return processorCount; }
+ set { processorCount = value; }
+ }
+
+ private int tickCount = System.Environment.TickCount;
+
+ /// <summary>
+ /// The number of milliseconds since the system started.
+ /// </summary>
+ public int TickCount {
+ get { return tickCount; }
+ set { tickCount = value; }
+ }
+
+ private long workingSet = System.Environment.WorkingSet;
+
+ /// <summary>
+ /// The physical memory used by the NMail process.
+ /// </summary>
+ public long WorkingSet {
+ get { return workingSet; }
+ set { workingSet = value; }
+ }
+ }
+}
Added: NMail/trunk/NMail.SurveyService/SurveyInformation.cs
===================================================================
--- NMail/trunk/NMail.SurveyService/SurveyInformation.cs (rev 0)
+++ NMail/trunk/NMail.SurveyService/SurveyInformation.cs 2007-05-31 12:07:34 UTC (rev 207)
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NMail.SurveyService {
+ /// <summary>
+ /// The survey information.
+ /// </summary>
+ public class SurveyInformation {
+
+ private SurveyEnvironment environment = new SurveyEnvironment();
+
+ /// <summary>
+ /// The environment details.
+ /// </summary>
+ public SurveyEnvironment Environment {
+ get { return environment; }
+ set { environment = value; }
+ }
+ }
+}
Added: NMail/trunk/NMail.SurveyService/SurveyService.cs
===================================================================
--- NMail/trunk/NMail.SurveyService/SurveyService.cs (rev 0)
+++ NMail/trunk/NMail.SurveyService/SurveyService.cs 2007-05-31 12:07:34 UTC (rev 207)
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Xml;
+using System.Xml.Serialization;
+
+using Microsoft.Win32;
+
+using NMail.DataTypes.Service;
+
+namespace NMail.SurveyService {
+ /// <summary>
+ /// A service for periodically surveying the server details and reporting back usage stats.
+ /// </summary>
+ public class SurveyService : IService {
+
+ /// <summary>
+ /// Creates a new instance of the service.
+ /// </summary>
+ public SurveyService() {
+ }
+
+ protected XmlDocument GatherData() {
+ //log.Debug("NMail Console Server version: [" + Assembly.GetExecutingAssembly().GetName().Version + "]");
+ // log.Debug("NMail Library version: [" + Assembly.GetAssembly(typeof(NMailConfiguration)).GetName().Version + "]");
+
+ MemoryStream ms = new MemoryStream();
+ XmlSerializer serializer = new XmlSerializer(typeof(SurveyInformation));
+ serializer.Serialize(ms, new SurveyInformation());
+
+ XmlDocument result = new XmlDocument();
+ result.LoadXml(Encoding.Unicode.GetString(ms.ToArray()));
+ return result;
+ }
+
+ #region IService Members
+
+ public void Init() {}
+
+ public void Start() {
+ XmlDocument doc = GatherData();
+
+ }
+
+ public void Stop(bool runCurrentToCompletion) {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public bool SupportsPause {
+ get { return false; }
+ }
+
+ public void Pause() {
+ throw new InvalidOperationException("The method or operation is not implemented.");
+ }
+
+ public void Continue() {
+ throw new InvalidOperationException("The method or operation is not implemented.");
+ }
+
+ public IService ReloadConfiguration() {
+ throw new InvalidOperationException("The method or operation is not implemented.");
+ }
+
+ public bool AllowsReloadConfiguration {
+ get { return false; }
+ }
+
+ public bool Running {
+ get { throw new Exception("The method or operation is not implemented."); }
+ }
+
+ public string Name {
+ get { return "Survey Service"; }
+ }
+
+ public string Description {
+ get { return "Periodically reports survey and usage information."; }
+ }
+
+ public Uri SupportUrl {
+ get { return new Uri("http://nmailserver.sf.net/support/services/survey"); }
+ }
+
+ public event EventHandler Started;
+
+ public event EventHandler Stopped;
+
+ #endregion
+ }
+}
Modified: NMail/trunk/NMail.sln
===================================================================
--- NMail/trunk/NMail.sln 2007-05-27 13:42:04 UTC (rev 206)
+++ NMail/trunk/NMail.sln 2007-05-31 12:07:34 UTC (rev 207)
@@ -50,6 +50,8 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMail.Icons", "NMail.Icons\NMail.Icons.csproj", "{D7B3712B-CD3B-4D64-8D33-92A81D6921E2}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMail.SurveyService", "NMail.SurveyService\NMail.SurveyService.csproj", "{11BFAF65-FA51-4245-8747-F4BA39D10FA3}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -258,6 +260,14 @@
{D7B3712B-CD3B-4D64-8D33-92A81D6921E2}.Release|Any CPU.Build.0 = Release|Any CPU
{D7B3712B-CD3B-4D64-8D33-92A81D6921E2}.Release2005|Any CPU.ActiveCfg = Release|Any CPU
{D7B3712B-CD3B-4D64-8D33-92A81D6921E2}.Release2005|Any CPU.Build.0 = Release|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Debug2005|Any CPU.ActiveCfg = Debug|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Debug2005|Any CPU.Build.0 = Debug|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Release2005|Any CPU.ActiveCfg = Release|Any CPU
+ {11BFAF65-FA51-4245-8747-F4BA39D10FA3}.Release2005|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|