/// <summary>
        /// This method is called when the configuration for this receive location is modified.
        /// The Location will be stopped while configurations are made.
        /// </summary>
        public override void Update(IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag)
        {
            TraceMessage("[SftpReceiverEndpoint] Configuration Updates ");

            lock (this)
            {
                Stop();

                _errorCount = 0;

                //  keep handles to these property bags until we are ready
                this._updatedConfig             = config;
                this._updatedBizTalkConfig      = bizTalkConfig;
                this._updatedHandlerPropertyBag = handlerPropertyBag;

                if (_updatedConfig != null)
                {
                    XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);
                    this._properties.ReadLocationConfiguration(locationConfigDom);

                    this._taskController = new TaskController(
                        new ScheduledTask(this._properties.Uri,
                                          new ScheduledTask.TaskDelegate(this.ControlledEndpointTask)),
                        this._properties.Schedule);
                    this.isInitialized = false;
                }

                //Schedule the polling event
                Start();
            }
        }
Exemplo n.º 2
0
        //  update and delete
        public override void Update(IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag)
        {
            try
            {
                Stop();

                this.properties = new TransactionalReceiveProperties(this.properties.Uri);

                //  Handler properties
                XmlDocument handlerConfigDom = ConfigProperties.IfExistsExtractConfigDom(handlerPropertyBag);
                if (null != handlerConfigDom)
                {
                    this.properties.HandlerConfiguration(handlerConfigDom);
                }

                //  Location properties - possibly override some Handler properties
                XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);
                this.properties.LocationConfiguration(locationConfigDom);

                Start();
            }
            finally
            {
            }
        }
        public override void Open(string uri, Microsoft.BizTalk.Component.Interop.IPropertyBag config, IPropertyBag bizTalkConfig, Microsoft.BizTalk.Component.Interop.IPropertyBag handlerPropertyBag, IBTTransportProxy transportProxy, string transportType, string propertyNamespace, ControlledTermination control)
        {
            try
            {
                this.properties = new SBQueueReceiveProperties(uri);

                XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);
                this.properties.LocationConfiguration(locationConfigDom, false);

                //  this is our handle back to the EPM
                this.transportProxy = transportProxy;

                //  used to control whether the EPM can unload us
                this.control = control;

                this.uri               = uri;
                this.transportType     = transportType;
                this.propertyNamespace = propertyNamespace;
                this.messageFactory    = this.transportProxy.GetMessageFactory();

                Start();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
            }
        }
        public override void Open(string uri, IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag, IBTTransportProxy transportProxy, string transportType, string propertyNamespace, ControlledTermination controlledTermination)
        {
            this.transportProxy        = transportProxy;
            this.transportType         = transportType;
            this.uri                   = uri;
            this.controlledTermination = controlledTermination;
            this.properties            = new ScheduledProperties();
            XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);

            this.properties.LocationConfiguration(locationConfigDom);
            //  create and schedule a new the task
            this.taskController = new TaskController(new ScheduledTask(this.properties.Name, new ScheduledTask.TaskDelegate(this.ControlledEndpointTask)), this.properties.Schedule);
            this.taskController.StateChanged += new StateChangedEventHandler(this.OnStateChanged);
            this.taskController.Enabled       = true;
            this.taskController.Start();
        }
        /// <summary>
        /// This method is called when a Receive Location is enabled.
        /// </summary>
        public override void Open(
            string uri,
            IPropertyBag config,
            IPropertyBag bizTalkConfig,
            IPropertyBag handlerPropertyBag,
            IBTTransportProxy transportProxy,
            string transportType,
            string propertyNamespace,
            ControlledTermination control)
        {
            this._errorCount = 0;

            this._properties = new SftpReceiveProperties();
            _properties.LocationConfiguration(config, bizTalkConfig);

            //  Location properties - possibly override some Handler properties
            XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);

            this._properties.ReadLocationConfiguration(locationConfigDom);

            //  this is our handle back to the EPM
            this._transportProxy = transportProxy;

            // used to create new messages / message parts etc.
            this._messageFactory = this._transportProxy.GetMessageFactory();

            //  used in the creation of messages
            this._transportType = transportType;

            //  used in the creation of messages
            this._propertyNamespace = propertyNamespace;

            // used to track inflight work for shutting down properly
            this._controlledTermination = control;

            //  create and schedule a new the task
            this._taskController = new TaskController(
                new ScheduledTask(this._properties.Uri,
                                  new ScheduledTask.TaskDelegate(this.ControlledEndpointTask)),
                this._properties.Schedule);

            this._taskController.StateChanged += new StateChangedEventHandler(this.OnStateChanged);

            // start the task
            Start();
        }
        //  update and delete
        public override void Update(IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag)
        {
            try
            {
                Stop();

                this.properties = new SBQueueReceiveProperties(this.properties.Uri);

                XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);
                this.properties.LocationConfiguration(locationConfigDom, true);

                Start();
            }
            finally
            {
            }
        }
 public override void Update(IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag)
 {
     lock (this)
     {
         if (this.taskController.State != State.Running)
         {
             if (config != null)
             {
                 XmlDocument updatedConfigDom = ConfigProperties.ExtractConfigDom(config);
                 lock (this)
                 {
                     this.properties.LocationConfiguration(updatedConfigDom);
                     this.taskController.Schedule = this.properties.Schedule;
                     transportProxy.SetErrorInfo(new ScheduledException("\r\n" + this.properties.Name + ":  scheduled activation changed to  " + this.properties.Schedule.GetNextActivationTime().ToString()));
                 }
             }
         }
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// This method is called when a Receive Location is enabled.
        /// </summary>
        public void Open(
            string uri,
            IPropertyBag config,
            IPropertyBag bizTalkConfig,
            IPropertyBag handlerPropertyBag,
            IBTTransportProxy transportProxy,
            string transportType,
            string propertyNamespace,
            ControlledTermination control)
        {
            _errorCount = 0;

            _properties = new SftpReceiveProperties();
            _properties.LocationConfiguration(config, bizTalkConfig);

            //  Location properties - possibly override some Handler properties
            XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);

            _properties.ReadLocationConfiguration(locationConfigDom);

            //  this is our handle back to the EPM
            _transportProxy = transportProxy;

            //  used in the creation of messages
            _transportType = transportType;

            //  used in the creation of messages
            _propertyNamespace = propertyNamespace;

            // used to track inflight work for shutting down properly
            _controlledTermination = control;

            //  create and schedule a new the task
            _taskController = new TaskController(
                new ScheduledTask(_properties.Uri,
                                  ControlledEndpointTask),
                _properties.Schedule);

            _taskController.StateChanged += OnStateChanged;

            // start the task
            Start();
        }
        /// <summary>
        /// This method is called when a Receive Location is enabled.
        /// </summary>
        public override void Open(
            string uri,
            IPropertyBag config,
            IPropertyBag bizTalkConfig,
            IPropertyBag handlerPropertyBag,
            IBTTransportProxy transportProxy,
            string transportType,
            string propertyNamespace,
            ControlledTermination control)
        {
            Trace.WriteLine("[DotNetFileReceiverEndpoint] Open called");
            this.errorCount = 0;

            this.properties = new DotNetFileReceiveProperties();

            //  Location properties - possibly override some Handler properties
            XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(config);

            this.properties.ReadLocationConfiguration(locationConfigDom);

            //  this is our handle back to the EPM
            this.transportProxy = transportProxy;

            // used to create new messages / message parts etc.
            this.messageFactory = this.transportProxy.GetMessageFactory();

            //  used in the creation of messages
            this.transportType = transportType;

            //  used in the creation of messages
            this.propertyNamespace = propertyNamespace;

            // used to track inflight work for shutting down properly
            this.controlledTermination = control;

            //start the task
            Start();
        }
        /// <summary>
        /// This method is called when the configuration for this receive location is modified.
        /// </summary>
        public override void Update(IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag)
        {
            Trace.WriteLine("[GrabCasterReceiverEndpoint] Updated called");
            lock (this)
            {
                Stop();

                errorCount = 0;

                //  keep handles to these property bags until we are ready
                this.updatedConfig             = config;
                this.updatedBizTalkConfig      = bizTalkConfig;
                this.updatedHandlerPropertyBag = handlerPropertyBag;

                if (updatedConfig != null)
                {
                    XmlDocument locationConfigDom = ConfigProperties.ExtractConfigDom(this.updatedConfig);
                    this.properties.ReadLocationConfiguration(locationConfigDom);
                }

                //Schedule the polling event
                Start();
            }
        }