コード例 #1
0
ファイル: AmqpSecurity.cs プロジェクト: ncdc/qpid
        internal AmqpSecurity(AmqpTransportSecurity tsec)
        {
            if (tsec == null)
            {
                throw new ArgumentNullException("AmqpTransportSecurity");
            }

            this.mode = AmqpSecurityMode.Transport;
            this.transportSecurity = tsec;
        }
コード例 #2
0
        internal AmqpSecurity(AmqpTransportSecurity tsec)
        {
            if (tsec == null)
            {
                throw new ArgumentNullException("AmqpTransportSecurity");
            }

            this.mode = AmqpSecurityMode.Transport;
            this.transportSecurity = tsec;
        }
コード例 #3
0
        protected override void OnApplyConfiguration(Binding binding)
        {
            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }

            if (!(binding is AmqpBinding))
            {
                throw new ArgumentException(string.Format("Invalid type for configuring an AMQP binding. Expected type: {0}. Type passed in: {1}.",
                                                          typeof(AmqpBinding).AssemblyQualifiedName,
                                                          binding.GetType().AssemblyQualifiedName));
            }

            AmqpBinding amqpBinding = (AmqpBinding)binding;

            amqpBinding.BrokerHost    = this.BrokerHost;
            amqpBinding.BrokerPort    = this.BrokerPort;
            amqpBinding.TransferMode  = this.TransferMode;
            amqpBinding.Shared        = this.Shared;
            amqpBinding.PrefetchLimit = this.PrefetchLimit;

            AmqpSecurityMode mode = AmqpSecurityMode.None;

            if (this.Security != null)
            {
                mode = this.Security.Mode;
            }

            if (mode == AmqpSecurityMode.None)
            {
                if (amqpBinding.SecurityEnabled)
                {
                    amqpBinding.Security.Mode = AmqpSecurityMode.None;
                }
            }
            else
            {
                amqpBinding.Security.Mode = AmqpSecurityMode.Transport;
                amqpBinding.Security.Transport.CredentialType = this.Security.Transport.CredentialType;
                amqpBinding.Security.Transport.IgnoreEndpointClientCredentials = this.Security.Transport.IgnoreEndpointCredentials;
                amqpBinding.Security.Transport.UseSSL = this.Security.Transport.UseSSL;
                if (this.Security.Transport.DefaultCredential != null)
                {
                    amqpBinding.Security.Transport.DefaultCredential = new AmqpCredential(
                        this.Security.Transport.DefaultCredential.UserName,
                        this.Security.Transport.DefaultCredential.Password);
                }
                else
                {
                    amqpBinding.Security.Transport.DefaultCredential = null;
                }
            }
        }
コード例 #4
0
ファイル: AmqpChannelHelpers.cs プロジェクト: ncdc/qpid
 internal AmqpChannelProperties()
 {
     this.brokerHost = AmqpDefaults.BrokerHost;
     this.brokerPort = AmqpDefaults.BrokerPort;
     this.transferMode = AmqpDefaults.TransferMode;
     this.defaultMessageProperties = null;
     this.amqpSecurityMode = AmqpSecurityMode.None;
     this.amqpTransportSecurity = null;
     this.amqpCredential = null;
     this.maxBufferPoolSize = AmqpDefaults.MaxBufferPoolSize;
     this.maxReceivedMessageSize = AmqpDefaults.MaxReceivedMessageSize;
 }
コード例 #5
0
 internal AmqpChannelProperties()
 {
     this.brokerHost               = AmqpDefaults.BrokerHost;
     this.brokerPort               = AmqpDefaults.BrokerPort;
     this.transferMode             = AmqpDefaults.TransferMode;
     this.defaultMessageProperties = null;
     this.amqpSecurityMode         = AmqpSecurityMode.None;
     this.amqpTransportSecurity    = null;
     this.amqpCredential           = null;
     this.maxBufferPoolSize        = AmqpDefaults.MaxBufferPoolSize;
     this.maxReceivedMessageSize   = AmqpDefaults.MaxReceivedMessageSize;
 }
コード例 #6
0
        protected override void OnOpen(TimeSpan timeout)
        {
            // check and freeze security properties now
            AmqpSecurityMode mode = AmqpSecurityMode.None;

            if (this.bindingElement.BindingSecurity != null)
            {
                mode = bindingElement.BindingSecurity.Mode;
            }

            this.channelProperties.AmqpSecurityMode = mode;
            if (mode == AmqpSecurityMode.None)
            {
                return;
            }

            AmqpChannelHelpers.FindAuthenticationCredentials(this.channelProperties, this.bindingContext);
        }
コード例 #7
0
 internal AmqpSecurity()
 {
     this.mode = AmqpSecurityMode.None;
 }
コード例 #8
0
ファイル: AmqpSecurity.cs プロジェクト: ncdc/qpid
 internal AmqpSecurity()
 {
     this.mode = AmqpSecurityMode.None;
 }