package com.cim.idm.utils;

import com.cim.idm.framework.data.EventInfo;
import com.cim.idm.framework.util.time.TimeStampUtil;

public class EventInfoUtil {
	
	public static EventInfo makeEventInfo( String eventName, String eventUser, String eventComment,
			String reasonCodeType, String reasonCode )
	{
		EventInfo eventInfo = new EventInfo();
		
		eventInfo.setBehaviorName( "" );
		eventInfo.setEventName( eventName );
		eventInfo.setEventUser( eventUser );
		eventInfo.setEventTime( TimeStampUtil.getCurrentTimestamp());
		if ( eventComment == null )
			eventComment = "";
		
		eventInfo.setEventComment( eventComment );		
		// Do Not Check TimeKey Validation
		eventInfo.setCheckTimekeyValidation(false);
		if ( reasonCodeType == null )
			reasonCodeType = "";
		
		eventInfo.setReasonCodeType( reasonCodeType );
		
		if ( reasonCode == null )
			reasonCode = "";
		
		eventInfo.setReasonCode( reasonCode );
		
		return eventInfo;
	}
	
	public static EventInfo makeEventInfo( String eventName, String eventUser, String eventComment )
	{
		EventInfo eventInfo = new EventInfo();
		
		eventInfo.setBehaviorName( "" );
		eventInfo.setEventName( eventName );
		eventInfo.setEventUser( eventUser );
		eventInfo.setEventTime( TimeStampUtil.getCurrentTimestamp());
		if ( eventComment == null )
			eventComment = "";
		
		eventInfo.setEventComment( eventComment );		
		// Do Not Check TimeKey Validation
		eventInfo.setCheckTimekeyValidation(false);

		
		return eventInfo;
	}
}
