// Copyright (c) 2008, NTT DATA Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using TERASOLUNA.Fw.Client.BLogic;
using TERASOLUNA.Fw.Client.Communication;
using TERASOLUNA.Fw.Common;
using TERASOLUNA.Fw.Common.BLogic;

namespace TERASOLUNA.Fw.ClientUT.BLogic.DataSetXmlCommunicateBLogicData
{
    public class DataSetXmlCommunicateBLogicStub03 : DataSetXmlCommunicateBLogic<DataSet>
    {
        /// <summary>
        /// Communicateメソッド実行時の引数 communicateBlogicParam を保持するフィールド。
        /// </summary>
        public BLogicParam _communicateBLogicParam = null;

        /// <summary>
        /// Communicateメソッド実行時の引数 requestHeaders を保持するフィールド。
        /// </summary>
        public IDictionary<string, string> _requestHeaders = null;
        
        /// <summary>
        /// 必ず TerasolunaException をスローします。
        /// </summary>
        /// <param name="communicateBlogicParam"></param>
        /// <param name="requestHeaders"></param>
        /// <returns></returns>
        protected override CommunicationResult Communicate(BLogicParam communicateBlogicParam, IDictionary<string, string> requestHeaders)
        {
            _communicateBLogicParam = communicateBlogicParam;
            _requestHeaders = requestHeaders;

            Cancelled = true;

            throw new TerasolunaException();
        }
    }
}
