/// <summary>
        /// This function is called when BizTalk runtime gives the handler properties to adapter.
        /// </summary>
        protected override void HandlerPropertyBagLoaded()
        {
            IPropertyBag config = this.HandlerPropertyBag;

            if (null != config)
            {
                XmlDocument handlerConfigDom = ConfigProperties.IfExistsExtractConfigDom(config);
                if (null != handlerConfigDom)
                {
                    SftpReceiveProperties.ReceiveHandlerConfiguration(handlerConfigDom);
                }
            }
        }
Beispiel #2
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();
        }