aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
committerAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
commit6c208c90bc45aff4a7fa214356a42fe7757c5e6f (patch)
tree0d77bc6a0ecfbb53cf42c5462ee19212197ee1bd /Software/Visual_Studio/Web/Tango.MachineService
parentb0823127f152fe97a6e8fce29e427c7f3db9cf5a (diff)
parent1a573aaa346ec4b8bd58a0e35ab9df571a09b855 (diff)
downloadTango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.tar.gz
Tango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.zip
MERGE
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.dbbin602112 -> 274432 bytes
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs5
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs44
3 files changed, 49 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db
index 12c88039d..82b936014 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db
+++ b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db
Binary files differ
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs
index 8b5bee7ae..fb937f52e 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs
@@ -18,6 +18,11 @@ namespace Tango.MachineService.Controllers
{
public class SynchronizationController : ApiController
{
+ /// <summary>
+ /// Expects a DB synchronization request from a remote machine and returns the synchronized version of the machine database.
+ /// </summary>
+ /// <param name="request">The request.</param>
+ /// <returns></returns>
[HttpPost]
public SynchronizeDBResponse Synchronize(SynchronizeDBRequest request)
{
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs b/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs
index 1edf01acf..8078f1d8f 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs
@@ -10,30 +10,65 @@ using Tango.PMR.Stubs;
namespace Tango.MachineService
{
+ /// <summary>
+ /// Represents a protobuf web request/response formatter capable of formatting messages using protobuf.
+ /// </summary>
+ /// <seealso cref="System.Net.Http.Formatting.MediaTypeFormatter" />
public class ProtoBufFormatter : MediaTypeFormatter
{
private static readonly MediaTypeHeaderValue mediaType = new MediaTypeHeaderValue("application/x-protobuf");
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ProtoBufFormatter"/> class.
+ /// </summary>
public ProtoBufFormatter()
{
SupportedMediaTypes.Add(mediaType);
}
+ /// <summary>
+ /// Gets the default type of the media.
+ /// </summary>
+ /// <value>
+ /// The default type of the media.
+ /// </value>
public static MediaTypeHeaderValue DefaultMediaType
{
get { return mediaType; }
}
+ /// <summary>
+ /// Queries whether this <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can deserializean object of the specified type.
+ /// </summary>
+ /// <param name="type">The type to deserialize.</param>
+ /// <returns>
+ /// true if the <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can deserialize the type; otherwise, false.
+ /// </returns>
public override bool CanReadType(Type type)
{
return true;
}
+ /// <summary>
+ /// Queries whether this <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can serializean object of the specified type.
+ /// </summary>
+ /// <param name="type">The type to serialize.</param>
+ /// <returns>
+ /// true if the <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can serialize the type; otherwise, false.
+ /// </returns>
public override bool CanWriteType(Type type)
{
return true;
}
+ /// <summary>
+ /// Reads from stream asynchronous.
+ /// </summary>
+ /// <param name="type">The type.</param>
+ /// <param name="stream">The stream.</param>
+ /// <param name="content">The content.</param>
+ /// <param name="formatterLogger">The formatter logger.</param>
+ /// <returns></returns>
public override Task<object> ReadFromStreamAsync(Type type, Stream stream, HttpContent content, IFormatterLogger formatterLogger)
{
var tcs = new TaskCompletionSource<object>();
@@ -52,6 +87,15 @@ namespace Tango.MachineService
return tcs.Task;
}
+ /// <summary>
+ /// Writes to stream asynchronous.
+ /// </summary>
+ /// <param name="type">The type.</param>
+ /// <param name="value">The value.</param>
+ /// <param name="stream">The stream.</param>
+ /// <param name="content">The content.</param>
+ /// <param name="transportContext">The transport context.</param>
+ /// <returns></returns>
public override Task WriteToStreamAsync(Type type, object value, Stream stream, HttpContent content, TransportContext transportContext)
{
var tcs = new TaskCompletionSource<object>();