/*******************************************************************************
*	 All Rights reserved,Copyright (c) K-Opticom 
********************************************************************************
*＜プログラム内容＞
*	システム名		：eo顧客基幹システム
*	モジュール名	：JSYejbKK0421ETDA
*	ソースファイル名：JSYejbKK0421ETDA.java
*	作成者			：EKek0018
*	日付			：2011年10月11日
*＜機能概要＞
*	サブオプションサービス契約<TV> ETMsgDBアクセス部品
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	ｖ1.00.00
*
********************************************************************************/

package eo.ejb.cbm.entity;

import com.fujitsu.futurity.model.base.CAANMsg;
import com.fujitsu.futurity.model.base.CAANException;
import com.fujitsu.futurity.model.base.CAANCreateException;
import com.fujitsu.futurity.model.base.CAANRuntimeException;
import com.fujitsu.futurity.model.ejb.common.StatusCodes;
import com.fujitsu.futurity.model.ejb.common.JSYejbLog;
import com.fujitsu.futurity.model.ejb.common.fw.AgentDispatchContext;
import com.fujitsu.futurity.model.ejb.common.fw.ETMsgDBAccessHandler;
import eo.ejb.common.EventIDList;

/**
 * サブオプションサービス契約<TV>ETMsgDBアクセス部品です。
 * ＜メソッド一覧＞
 * invoke
 * execIKK0421D001
 * execIKK0421D002
 * execIKK0421D003
 * execIKK0421D004
 * execIKK0421D005
 * execIKK0421D006
 * execIKK0421D007
 * execIKK0421D008
 * 
 */
public class JSYejbKK0421ETDA implements ETMsgDBAccessHandler {

	/**
	 * コンストラクタ
	 */
	public JSYejbKK0421ETDA() {
	}

	/**
	 * サブオプションサービス契約<TV>ETMsgDBアクセス部品のメイン処理です。
	 * ETMsgの振舞IDに従い、項目値設定後、LogicalEntityを呼出します。
	 * @param  inETMsg 処理を行うETMsg
	 * @exception CAANRuntimeException 例外発生時にthrowします。
	 */
	public void invoke(CAANMsg inETMsg, AgentDispatchContext inContext) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.invoke");

		// ETMsgチェック
		// 処理対象のETMsgでなければ処理をぬけます。
		if (inETMsg.equalsSchemaClass(KK0421ETMsg.class) == false) {
			return;
		}

		// 振舞ID
		String eventID;

		// 振舞ID取り出し
		eventID = inETMsg.getString(KK0421ETMsg.EVENTID);

		// イベントの振り分け
		if(eventID.equals(EventIDList.IKK0421D001)){
			// サブオプションサービス契約<TV>登録振舞内部
			execIKK0421D001(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D002)){
			// サブオプションサービス契約<TV>照査締結振舞内部
			execIKK0421D002(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D003)){
			// サブオプションサービス契約<TV>変更振舞内部
			execIKK0421D003(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D004)){
			// サブオプションサービス契約<TV>使用開始振舞内部
			execIKK0421D004(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D005)){
			// サブオプションサービス契約<TV>照査振舞内部
			execIKK0421D005(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D006)){
			// サブオプションサービス契約<TV>照査振舞内部
			execIKK0421D006(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D007)){
			// サブオプションサービス契約<TV>オーダ発行振舞内部
			execIKK0421D007(inETMsg);
		}
		else if(eventID.equals(EventIDList.IKK0421D008)){
			// サブオプションサービス契約<TV>照査取消振舞内部
			execIKK0421D008(inETMsg);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.invoke");

	}

	/**
	 * サブオプションサービス契約<TV>登録振舞内部<IKK0421D001>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D001(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D001");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D001");

	}
	/**
	 * サブオプションサービス契約<TV>照査締結振舞内部<IKK0421D002>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D002(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D002");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D002");

	}
	/**
	 * サブオプションサービス契約<TV>変更振舞内部<IKK0421D003>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D003(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D003");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D003");

	}
	/**
	 * サブオプションサービス契約<TV>使用開始振舞内部<IKK0421D004>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D004(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D004");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D004");

	}
	/**
	 * サブオプションサービス契約<TV>照査振舞内部<IKK0421D005>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D005(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D005");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D005");

	}
	/**
	 * サブオプションサービス契約<TV>照査振舞内部<IKK0421D006>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D006(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D006");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D006");

	}
	/**
	 * サブオプションサービス契約<TV>オーダ発行振舞内部<IKK0421D007>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D007(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D007");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D007");

	}
	/**
	 * サブオプションサービス契約<TV>照査取消振舞内部<IKK0421D008>です。
	 * @param inETMsg 処理を行うETMsg
	 */
	private void execIKK0421D008(CAANMsg inETMsg) {

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "call:JSYejbKK0421ETDA.IKK0421D008");

		// 項目値設定
		// 現在日時
		String nowTimestamp = inETMsg.getString(KK0421ETMsg.OPERATEDATETIME);

		// 登録日時
		inETMsg.set(KK0421ETMsg.ADD_DTM, nowTimestamp);

		// 更新日時
		inETMsg.set(KK0421ETMsg.UPD_DTM, nowTimestamp);

		// LogicalEntity呼び出し
		KK0421LE le = new KK0421LE();

		try{
			le.create(inETMsg);

		}catch(CAANCreateException cce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.CREATE_DB_ERR);
			throw new CAANRuntimeException(cce);
		}catch(CAANException ce){
			inETMsg.set(KK0421ETMsg.STATUS, StatusCodes.FATAL_ERR);
			throw new CAANRuntimeException(ce);
		}

		// ログ出力
		JSYejbLog.println(JSYejbLog.DEBUG, this.getClass(), "end:JSYejbKK0421ETDA.IKK0421D008");

	}

}
