/*
 * Copyright (c) 2007 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.
 */

package jp.terasoluna.rich.functionsample.controllermapping.controller;


import jp.terasoluna.fw.web.rich.springmvc.controller.TerasolunaController;
import jp.terasoluna.rich.functionsample.controllermapping.bean.ControllerMappingInputData;
import jp.terasoluna.rich.functionsample.controllermapping.bean.ControllerMappingResultData;
import jp.terasoluna.rich.functionsample.controllermapping.service.ControllerMappingService;

/**
 * リクエスト・コントローラマッピング コントローラ
 *
 */
public class ControllerMappingController extends 
TerasolunaController<ControllerMappingInputData, ControllerMappingResultData> {

    /**
     * 足し算 インタフェースを変数に宣言
     */
    protected ControllerMappingService controllerMappingService = null;
    
    /**
     * サービスクラス設定する。
     *
     * @param controllerMappingService サービスクラス 
     */
    public void setControllerMappingService(
            ControllerMappingService controllerMappingService) {
        this.controllerMappingService = controllerMappingService;
    }


    /**
     * 足し算の結果値を実行させるメソッド
     *
     * @param command 入力された引数クラス
     * @return 足し算の結果値
     * @throws Exception 例外発生時
     */
    @Override
    protected ControllerMappingResultData executeService(
            ControllerMappingInputData command) throws Exception {
        return controllerMappingService.sum(command);
    }
}
