Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
2007-09-14 Atsushi Enomoto <atsushi@ximian.com>
* MsmqIntegrationBindingElement.cs : implemented some parts.
2007-09-14 Atsushi Enomoto <atsushi@ximian.com>
* MsmqIntegrationMessageProperty.cs, MsmqMessage.cs:
cleanup couple of warnings.
2007-07-05 Atsushi Enomoto <atsushi@ximian.com>
* MsmqIntegrationMessageProperty.cs MsmqIntegrationBinding.cs
MsmqMessage.cs MsmqIntegrationBindingElement.cs
MsmqIntegrationSecurity.cs : new stubs.

View File

@@ -0,0 +1,73 @@
//
// MsmqIntegrationBinding.cs
//
// Author: Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.Xml;
namespace System.ServiceModel.MsmqIntegration
{
public class MsmqIntegrationBinding : MsmqBindingBase
{
MsmqIntegrationSecurity security;
MsmqMessageSerializationFormat format;
public MsmqIntegrationBinding ()
: this (MsmqIntegrationSecurityMode.None)
{
}
public MsmqIntegrationBinding (MsmqIntegrationSecurityMode securityMode)
{
security = new MsmqIntegrationSecurity ();
security.Mode = securityMode;
}
[MonoTODO]
public MsmqIntegrationBinding (string configurationName)
{
throw new NotImplementedException ();
}
public MsmqIntegrationSecurity Security {
get { return security; }
}
public MsmqMessageSerializationFormat SerializationFormat {
get { return format; }
set { format = value; }
}
[MonoTODO]
public override BindingElementCollection CreateBindingElements ()
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,104 @@
//
// MsmqIntegrationBindingElement.cs
//
// Author: Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace System.ServiceModel.MsmqIntegration
{
public sealed class MsmqIntegrationBindingElement : MsmqBindingElementBase
{
MsmqMessageSerializationFormat format;
Type [] target_types;
public MsmqIntegrationBindingElement ()
{
}
public MsmqMessageSerializationFormat SerializationFormat {
get { return format; }
set { format = value; }
}
public override string Scheme {
get { return "net.msmq"; }
}
public Type[] TargetSerializationTypes {
get { return target_types; }
set { target_types = value; }
}
public override BindingElement Clone ()
{
return (MsmqIntegrationBindingElement) MemberwiseClone ();
}
public override bool CanBuildChannelFactory<TChannel> (BindingContext context)
{
if (typeof (TChannel) == typeof (IOutputChannel))
return true;
else
return false;
}
[MonoTODO]
public override IChannelFactory<TChannel> BuildChannelFactory<TChannel> (BindingContext context)
{
if (!CanBuildChannelFactory<TChannel> (context))
throw new InvalidOperationException ("MSMQ integration binding element only supports IOutputChannel");
throw new NotImplementedException ();
}
public override bool CanBuildChannelListener<TChannel> (BindingContext context)
{
if (typeof (TChannel) == typeof (IInputChannel))
return true;
else
return false;
}
[MonoTODO]
public override IChannelListener<TChannel> BuildChannelListener<TChannel> (BindingContext context)
{
if (!CanBuildChannelListener<TChannel> (context))
throw new InvalidOperationException ("MSMQ integration binding element only supports IOutputChannel");
throw new NotImplementedException ();
}
public override T GetProperty<T> (BindingContext context)
{
// http://blogs.msdn.com/drnick/archive/2007/04/10/interfaces-for-getproperty-part-1.aspx
if (typeof (T) == typeof (MessageVersion))
return (T) (object) MessageVersion.None;
return base.GetProperty<T> (context);
}
}
}

View File

@@ -0,0 +1,138 @@
//
// MsmqIntegrationMessageProperty.cs
//
// Author: Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Messaging;
using System.ServiceModel;
using System.ServiceModel.Channels;
using SMessage = System.ServiceModel.Channels.Message;
using MQMessage = System.Messaging.Message;
using MQMessageType = System.Messaging.MessageType;
namespace System.ServiceModel.MsmqIntegration
{
public sealed class MsmqIntegrationMessageProperty
{
public const string Name = "MsmqIntegrationMessageProperty";
public MsmqIntegrationMessageProperty ()
{
}
[MonoTODO]
public static MsmqIntegrationMessageProperty Get (SMessage message)
{
throw new NotImplementedException ();
}
// not verified / consider queue property filter
internal static MsmqIntegrationMessageProperty Get (MQMessage message)
{
if (message == null)
throw new ArgumentNullException ("message");
var p = new MsmqIntegrationMessageProperty ();
p.Id = message.Id;
p.Label = message.Label;
p.CorrelationId = message.CorrelationId;
p.Body = message.Body;
p.Extension = message.Extension;
p.SenderId = message.SenderId;
p.DestinationQueue = CreateUriFromQueue (message.DestinationQueue);
if (message.AdministrationQueue != null)
p.AdministrationQueue = CreateUriFromQueue (message.AdministrationQueue);
if (message.ResponseQueue != null)
p.ResponseQueue = CreateUriFromQueue (message.ResponseQueue);
// FIXME: check property filter in the queue
p.AppSpecific = message.AppSpecific;
p.ArrivedTime = message.ArrivedTime;
p.Authenticated = message.Authenticated;
p.Priority = message.Priority;
p.SentTime = message.SentTime;
p.TimeToReachQueue = message.TimeToReachQueue;
switch (message.MessageType) {
case MQMessageType.Acknowledgment:
p.AcknowledgeType = message.AcknowledgeType;
p.Acknowledgment = message.Acknowledgment;
break;
case MQMessageType.Normal:
case MQMessageType.Report:
// anything to do?
break;
}
return p;
}
static Uri CreateUriFromQueue (MessageQueue queue)
{
// FIXME: implement
throw new NotImplementedException ();
}
public AcknowledgeTypes? AcknowledgeType { get; set; }
public Acknowledgment? Acknowledgment { get; private set; }
public Uri AdministrationQueue { get; set; }
public int? AppSpecific { get; set; }
public DateTime? ArrivedTime { get; private set; }
public bool? Authenticated { get; private set; }
public object Body { get; set; }
public int? BodyType { get; set; }
public string CorrelationId { get; set; }
public Uri DestinationQueue { get; private set; }
public byte [] Extension { get; set; }
public string Id { get; private set; }
public string Label { get; set; }
public MessageType? MessageType { get; private set; }
public MessagePriority? Priority { get; set; }
public Uri ResponseQueue { get; set; }
public byte [] SenderId { get; private set; }
public DateTime? SentTime { get; private set; }
public TimeSpan? TimeToReachQueue { get; set; }
}
}

View File

@@ -0,0 +1,48 @@
//
// MsmqIntegrationSecurity.cs
//
// Author: Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ServiceModel;
using System.ServiceModel.Security;
namespace System.ServiceModel.MsmqIntegration
{
public sealed class MsmqIntegrationSecurity
{
MsmqIntegrationSecurityMode mode;
MsmqTransportSecurity transport = new MsmqTransportSecurity ();
public MsmqIntegrationSecurityMode Mode {
get { return mode; }
set { mode = value; }
}
public MsmqTransportSecurity Transport {
get { return transport; }
}
}
}

View File

@@ -0,0 +1,132 @@
//
// MsmqMessage.cs
//
// Author: Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Messaging;
using System.ServiceModel;
namespace System.ServiceModel.MsmqIntegration
{
[MessageContract]
public sealed class MsmqMessage<T>
{
MsmqIntegrationMessageProperty prop;
public MsmqMessage (T body)
{
prop = new MsmqIntegrationMessageProperty ();
Body = body;
}
public AcknowledgeTypes? AcknowledgeType {
get { return prop.AcknowledgeType; }
set { prop.AcknowledgeType = value; }
}
public Acknowledgment? Acknowledgment {
get { return prop.Acknowledgment; }
}
public Uri AdministrationQueue {
get { return prop.AdministrationQueue; }
set { prop.AdministrationQueue = value; }
}
public int? AppSpecific {
get { return prop.AppSpecific; }
set { prop.AppSpecific = value; }
}
public DateTime? ArrivedTime {
get { return prop.ArrivedTime; }
}
public bool? Authenticated {
get { return prop.Authenticated; }
}
public T Body {
get { return (T) prop.Body; }
set { prop.Body = value; }
}
public int? BodyType {
get { return prop.BodyType; }
set { prop.BodyType = value; }
}
public string CorrelationId {
get { return prop.CorrelationId; }
set { prop.CorrelationId = value; }
}
public Uri DestinationQueue {
get { return prop.DestinationQueue; }
}
public byte [] Extension {
get { return prop.Extension; }
set { prop.Extension = value; }
}
public string Id {
get { return prop.Id; }
}
public string Label {
get { return prop.Label; }
set { prop.Label = value; }
}
public MessageType? MessageType {
get { return prop.MessageType; }
}
public MessagePriority? Priority {
get { return prop.Priority; }
set { prop.Priority = value; }
}
public Uri ResponseQueue {
get { return prop.ResponseQueue; }
set { prop.ResponseQueue = value; }
}
public byte [] SenderId {
get { return prop.SenderId; }
}
public DateTime? SentTime {
get { return prop.SentTime; }
}
public TimeSpan? TimeToReachQueue {
get { return prop.TimeToReachQueue; }
set { prop.TimeToReachQueue = value; }
}
}
}