<file_sep>/**
 * 
 */
package corp.pdb.aea.data.model.enums;

/**
 * @author waleed.k.al-jaradat
 *
 */
public enum AlertStatusEnum {
	SE("SE", "SENT", "Alert sent successfully"),
	UN("UN", "UNSENT", "Alert has not been sent"),
	RE("RE", "RETRY", "Retry sending Alert"),
	FA("FA", "FAILED", "Alert sent failed");
	
	private final String code;
	private final String name;
	private final String description;
	
	AlertStatusEnum(final String code, final String name, final String description) {
		this.code = code;
		this.name = name;
		this.description = description;
	}
	
	public String getCode() {
		return code;
	}
	
	public String getName() {
		return name;
	}
	
	public String getDescription() {
		return description;
	}
/*
	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder();
		sb.append("AlertParticipantTypeEnum");
		sb.append("{code=").append(code);
		sb.append(", name='").append(name).append('\'');
		sb.append(", description='").append(description).append('\'');
		sb.append('}');
		return sb.toString();
	}
}
 */
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.ws.endpoint;

import java.io.File;

import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.xml.bind.JAXBElement;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

import corp.pdb.aea.util.TimestampTypeFormatter;
import corp.pdb.aea.ws.exceptions.impl.app.FileNotFoundException;
import ides.ErrorMessageDetailType;
import ides.ErrorMessageIdentifierType;
import ides.msg.filedownloadmessage.FileDownloadRequestType;
import ides.msg.filedownloadmessage.FileDownloadResponseType;
import ides.msg.soapfaultmessage.SOAPFaultType;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Endpoint
public class FileDownloadStubEndpointImpl {
	private static final Logger LOGGER = LogManager.getLogger(FileDownloadStubEndpointImpl.class);
	private static final String FILE_DOWNLOAD_PACKAGE_DIRECTORY_LOCATION = "./files/outgoing/downloads/";
	
	@Autowired
	TimestampTypeFormatter timestampTypeFormatter;
	
	@PayloadRoot(namespace="urn:ides:msg:filedownloadmessage", localPart="FileDownloadRequest")
	@ResponsePayload
	public JAXBElement<FileDownloadResponseType> fileDownloadRequestOperation(@RequestPayload JAXBElement<FileDownloadRequestType> fileDownloadRequest) {
		LOGGER.debug("{}: Received request at FileDownloadService Endpoint (see TRACE logs for message details)", this.getClass().getSimpleName());
		FileDownloadRequestType fileDownloadRequestBody = fileDownloadRequest.getValue();
		LOGGER.trace("Message details: RequestSentTs=[{}], IDESTransmissionId=[{}], SendingEntity=[{}], ReceivingEntity=[{}]", fileDownloadRequestBody.getRequestSentTs(), fileDownloadRequestBody.getIDESTransmissionId(), fileDownloadRequestBody.getEntitySenderIdentifier().getCTSCountryCd(), fileDownloadRequestBody.getEntityReceiverIdentifier().getCTSCountryCd());
		
		File mtomAttachment = new File(FILE_DOWNLOAD_PACKAGE_DIRECTORY_LOCATION + fileDownloadRequestBody.getIDESTransmissionId() + ".zip");
		
		if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_32")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8503");
			errorMessageDetailType.setErrorMessageTxt("Security - Threat detected in response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_33")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8408");
			errorMessageDetailType.setErrorMessageTxt("Failed Decryption - Incorrect AES 256 Key size");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_34")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8509");
			errorMessageDetailType.setErrorMessageTxt("Security - Failed XML well formedness validation on MTOM attachment");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_35")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8400");
			errorMessageDetailType.setErrorMessageTxt("Failed Decompression - Compression tool not supported");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_36")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8401");
			errorMessageDetailType.setErrorMessageTxt("Failed Decompression - Compression algorithm not supported");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_37")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8402");
			errorMessageDetailType.setErrorMessageTxt("Failed Decompression - Decompression Failed");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_38")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8514");
			errorMessageDetailType.setErrorMessageTxt("Certificate Error  - Certificate is not authorized by an approved CA");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_39")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8405");
			errorMessageDetailType.setErrorMessageTxt("Failed Decryption - AES 256 Key is Blank or missing");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_40")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8407");
			errorMessageDetailType.setErrorMessageTxt("Failed Decryption - Unable to decrypt key file");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_41")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8500");
			errorMessageDetailType.setErrorMessageTxt("Security - Failed virus check (general)");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_42")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8512");
			errorMessageDetailType.setErrorMessageTxt("Certificate Error - Certificate expired");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_43")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8502");
			errorMessageDetailType.setErrorMessageTxt("Security - Failed virus check in response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_44")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8503");
			errorMessageDetailType.setErrorMessageTxt("Security - Threat detected in response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_45")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8511");
			errorMessageDetailType.setErrorMessageTxt("Certificate Error - General");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_46")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8519");
			errorMessageDetailType.setErrorMessageTxt("Security - XML threat detected in response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_47")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("1201");
			errorMessageDetailType.setErrorMessageTxt("Security - Failed XML well formedness validation on MTOM attachment");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_48")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8505");
			errorMessageDetailType.setErrorMessageTxt("Security - ZIP threat detected in response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_49")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("2106");
			errorMessageDetailType.setErrorMessageTxt("Security - SQL Injection threat identified in response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_50")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("1204");
			errorMessageDetailType.setErrorMessageTxt("Security - SQL Injection threat identified in MTOM attachment");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(fileDownloadRequestBody.getIDESTransmissionId().equals("FDOWNSRVCBCCLIENTIMPL_TRANSID_51")) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8507");
			errorMessageDetailType.setErrorMessageTxt("Security - Failed XML well formedness validation on response");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
			
		} else if(!mtomAttachment.exists()) {
			SOAPFaultType soapFaultType = new SOAPFaultType();
			ErrorMessageIdentifierType errorMessageIdentifierType = new ErrorMessageIdentifierType();
			errorMessageIdentifierType.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
			ErrorMessageDetailType errorMessageDetailType = new ErrorMessageDetailType();
			errorMessageDetailType.setErrorMessageCd("8301");
			errorMessageDetailType.setErrorMessageTxt("Requested File not found");
			
			soapFaultType.setErrorMessageIdentifier(errorMessageIdentifierType);
			soapFaultType.setErrorMessageTs(timestampTypeFormatter.generateTimestamp());
			soapFaultType.getErrorMessageDetail().add(errorMessageDetailType);
			
			FileNotFoundException exception = new FileNotFoundException(soapFaultType);
			//exception.setSoapFaultType(soapFaultType);
			throw exception;
		}
		
		ides.msg.filedownloadmessage.ObjectFactory factory = new ides.msg.filedownloadmessage.ObjectFactory();
		FileDownloadResponseType fileDownloadResponseBody = factory.createFileDownloadResponseType();
		
		fileDownloadResponseBody.setReceiptTs(timestampTypeFormatter.generateTimestamp());
		fileDownloadResponseBody.setIDESTransmissionId(fileDownloadRequestBody.getIDESTransmissionId());
		fileDownloadResponseBody.setIDESSendingTs(timestampTypeFormatter.generateTimestamp());
		fileDownloadResponseBody.setBulkExchangeFile(new DataHandler(new FileDataSource(mtomAttachment)));
		
		JAXBElement<FileDownloadResponseType> fileDownloadResponse = factory.createFileDownloadResponse(fileDownloadResponseBody);
		return fileDownloadResponse;
	}
}
<file_sep># Application README File

More to come... :smirk:
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.data.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import corp.pdb.aea.data.model.IncomingUpload;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Repository
public interface IncomingUploadRepository extends JpaRepository<IncomingUpload, Long>{
	public IncomingUpload findByAlertId(Long alertId);
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.service;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import corp.pdb.aea.data.model.Alert;
import corp.pdb.aea.data.model.IncomingUpload;
import corp.pdb.aea.data.model.enums.AlertStatusEnum;
import corp.pdb.aea.data.repository.AlertRepository;
import corp.pdb.aea.data.repository.IncomingUploadRepository;
import ides.EntityCommunicationTypeCdType;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Service
public class IncomingUploadAlertService {
    private Logger log = LoggerFactory.getLogger(IncomingUpload.class);
	@Autowired
	TransmitAlertService transmitAlertService;
	@Autowired
	AlertRepository alertRepository;
	@Autowired
	IncomingUploadRepository incomingUploadRepository;
	
	public String transmitReadyAlerts() {
		String landingPage = "";
		
		List<Alert> alerts = alertRepository.findAll();
		for(Alert alert : alerts) {
			try {
				if(alert.getAlertStatus().equals(AlertStatusEnum.UN) || alert.getAlertStatus().equals(AlertStatusEnum.RE)) {
					landingPage = transmitAlertService.transmit(alert);
					if(landingPage.equals("sendAlertSuccess")) {
						alert.setAlertStatus(AlertStatusEnum.SE);
						alert.setUpdatedById("INUPLDSRV");
						alert.setUpdateTs(new Date());
						alert = alertRepository.save(alert);
						if(alert.getAlertReasonCd().equals("RC001")) {
							constructAndPersistRC034Alert(alert);
						}
					}
				}
			} catch(Exception e) {
				landingPage = "500";
				log.error("Encountered exception {} returning {}, stacktrace below:\n{}", e.getMessage(), landingPage, e);
				break;
			}
		}
		
		if(landingPage.equals(""))
			landingPage = "sendAlertSuccess";
		
		return landingPage;
	}
	
	protected Alert constructAndPersistRC034Alert(Alert initialAlert) {
		Alert alert = new Alert();
		
		alert.setAlertReasonCd("RC034");
		alert.setAlertStatus(AlertStatusEnum.UN);
		alert.setCreatedById("INUPLDSRV");
		alert.setCreateTs(new Date());
		
		alert.setAlertRecipientTypeCd(initialAlert.getAlertRecipientTypeCd());
		alert.setAlertTypeCd(initialAlert.getAlertTypeCd());
		alert.setBinaryEncodingSchemeCd(initialAlert.getBinaryEncodingSchemeCd());
		alert.setCompressedFileSizeKbQty(initialAlert.getCompressedFileSizeKbQty());
		alert.setEntityCommunicationTypeCd(initialAlert.getEntityCommunicationTypeCd());
		alert.setEntityReceiverIdentifier(initialAlert.getEntityReceiverIdentifier());
		alert.setEntitySenderIdentifier(initialAlert.getEntitySenderIdentifier());
		alert.setFileCreateTs(initialAlert.getFileCreateTs());
		alert.setFileFormatCd(initialAlert.getFileFormatCd());
		alert.setFileRevisionInd(initialAlert.getFileRevisionInd() != null ? initialAlert.getFileRevisionInd() : null);
		alert.setIdesFileNm(initialAlert.getIdesFileNm());
		alert.setIdesTransmissionId(initialAlert.getIdesTransmissionId());
		alert.setOriginalIdesTransmissionId(initialAlert.getOriginalIdesTransmissionId() != null ? initialAlert.getOriginalIdesTransmissionId() : null);
		alert.setSenderContactEmailTxt(initialAlert.getSenderContactEmailTxt() != null ? initialAlert.getSenderContactEmailTxt() : null);
		alert.setSenderFileId(initialAlert.getSenderFileId());
		alert.setTaxYr(initialAlert.getTaxYr());
		alert = alertRepository.save(alert);
		log.trace("ALERT record #{} successfully generated by {} at {}\n{}",
				alert.getId(),
				alert.getCreatedById(),
				alert.getCreateTs(),
				alert.toString());
		
		IncomingUpload incomingUpload = incomingUploadRepository.findByAlertId(initialAlert.getId());
		incomingUpload.setAlertId(alert.getId());
		incomingUpload.setUpdatedById("INUPLDSRV");
		incomingUpload.setUpdateTs(new Date());
		incomingUpload = incomingUploadRepository.save(incomingUpload);
		log.trace("INCOMING_UPLOAD record #{} successfully updated by {} with alertId=[{}] at {}",
				incomingUpload.getId(),
				incomingUpload.getUpdatedById(),
				incomingUpload.getAlertId(),
				incomingUpload.getUpdateTs());
		
		return alert;
	}
	
	public String constructAndTransmitRC001Alert() {
		String landingPage = "";
		
		List<IncomingUpload> incomingUploads = incomingUploadRepository.findAll();
		for(IncomingUpload incomingUpload : incomingUploads) {
			try {
				Alert alertToSend = constructAlertFromIncomingUpload(incomingUpload, "RC001", "SA");
				landingPage = transmitAlertService.transmit(alertToSend);
				if(landingPage.equals("500"))
					break;
			} catch(Exception e) {
				landingPage = "500";
				log.error("Encountered exception {} returning {}, stacktrace below:\n{}", e.getMessage(), landingPage, e);
				break;
			}
		}
		
		return landingPage;
	}
	
	public String constructAndTransmitRC034Alert() {
		String landingPage = "";
		
		List<IncomingUpload> incomingUploads = incomingUploadRepository.findAll();
		for(IncomingUpload incomingUpload : incomingUploads) {
			try {
				Alert alertToSend = constructAlertFromIncomingUpload(incomingUpload, "RC034", "SA");
				landingPage = transmitAlertService.transmit(alertToSend);
				if(landingPage.equals("500"))
					break;
			} catch(Exception e) {
				landingPage = "500";
				log.error("Encountered exception {} returning {}, stacktrace below:\n{}", e.getMessage(), landingPage, e);
				break;
			}
		}
		
		return landingPage;
	}
	
	protected Alert constructAlertFromIncomingUpload(IncomingUpload incomingUpload, String alertReasonCd, String alertTypeCd) {
		Date createDate = new Date();
		Alert alert = new Alert();
		
		alert.setAlertStatus(AlertStatusEnum.UN);
		alert.setEntityCommunicationTypeCd(incomingUpload.getCommunicationTypeCd());
		alert.setIdesTransmissionId(generateTransmissionId());
		alert.setFileRevisionInd("N");
		alert.setAlertRecipientTypeCd("CS");
		alert.setAlertReasonCd(alertReasonCd);
		alert.setAlertTypeCd(alertTypeCd);
		
		alert.setEntitySenderIdentifier(incomingUpload.getEntitySenderIdentifier());
		alert.setEntityReceiverIdentifier(incomingUpload.getEntityReceiverIdentifier());
		alert.setSenderFileId(incomingUpload.getSenderFileId());
		alert.setIdesFileNm(incomingUpload.getIdesFileNm());
		alert.setTaxYr(Long.valueOf(2017));
		alert.setFileCreateTs(createDate);
		alert.setFileFormatCd("XML");
		alert.setBinaryEncodingSchemeCd("NONE");
		//TODO - add functionality where the file size of the incoming upload is determined, similar to what is done for outgoingDownload
		alert.setCompressedFileSizeKbQty(Long.valueOf(110));
		alert.setCreatedById("ALERTCLI");
		alert.setCreateTs(createDate);
		
		alert = alertRepository.save(alert);
		return alert;
	}
	
	protected Alert constructAlertForFaultCases(String idesTransmissionId) {
		Date createDate = new Date();
		Alert alert = new Alert();
		
		alert.setAlertStatus(AlertStatusEnum.SE);
		alert.setEntityCommunicationTypeCd(EntityCommunicationTypeCdType.CBC.value());
		alert.setIdesTransmissionId(idesTransmissionId);
		alert.setFileRevisionInd("N");
		alert.setAlertRecipientTypeCd("CR");
		alert.setAlertTypeCd("RD");
		alert.setAlertReasonCd("RC021");
		alert.setEntitySenderIdentifier("CA");
		alert.setEntityReceiverIdentifier("US.00");
		alert.setSenderFileId("fault case senderFileId");
		alert.setIdesFileNm("fault case idesFileNm");
		alert.setTaxYr(Long.valueOf(2017));
		alert.setFileCreateTs(createDate);
		alert.setFileFormatCd("XML");
		alert.setBinaryEncodingSchemeCd("NONE");
		alert.setCompressedFileSizeKbQty(Long.valueOf(10));
		alert.setCreatedById("ALERTCLI");
		alert.setCreateTs(createDate);
		
		alert = alertRepository.save(alert);
		return alert;
	}
	
	protected String generateTransmissionId() {
		String randomUUID = UUID.randomUUID().toString().replaceAll("-", "");
		log.info("randomUUID={}", randomUUID);
		return randomUUID;
	}
}
<file_sep>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2019.08.08 at 01:18:40 PM EDT 
//


package ides.msg.soapfaultmessage;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import ides.ErrorMessageDetailType;
import ides.ErrorMessageIdentifierType;


/**
 * 
 * <pre>
 * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Component xmlns="urn:ides:msg:soapfaultmessage" xmlns:ides="urn:ides" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;DictionaryEntryNm&gt; SOAP Fault exception Type&lt;/DictionaryEntryNm&gt;&lt;MajorVersionNum&gt;1&lt;/MajorVersionNum&gt;&lt;MinorVersionNum&gt;0&lt;/MinorVersionNum&gt;&lt;VersionEffectiveBeginDt&gt;2017-10-17&lt;/VersionEffectiveBeginDt&gt;&lt;VersionDescriptionTxt&gt;Initial version&lt;/VersionDescriptionTxt&gt;&lt;DescriptionTxt&gt;Type for message for the SOAP Fault exception&lt;/DescriptionTxt&gt;&lt;/Component&gt;
 * </pre>
 * 
 * 
 * <p>Java class for SOAPFaultType complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="SOAPFaultType"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element ref="{urn:ides}ErrorMessageIdentifier"/&gt;
 *         &lt;element ref="{urn:ides}ErrorMessageTs"/&gt;
 *         &lt;element ref="{urn:ides}ErrorMessageDetail" maxOccurs="100"/&gt;
 *       &lt;/sequence&gt;
 *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" fixed="1.0" /&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SOAPFaultType", propOrder = {
    "errorMessageIdentifier",
    "errorMessageTs",
    "errorMessageDetail"
})
public class SOAPFaultType {

    @XmlElement(name = "ErrorMessageIdentifier", namespace = "urn:ides", required = true)
    protected ErrorMessageIdentifierType errorMessageIdentifier;
    @XmlElement(name = "ErrorMessageTs", namespace = "urn:ides", required = true)
    protected String errorMessageTs;
    @XmlElement(name = "ErrorMessageDetail", namespace = "urn:ides", required = true)
    protected List<ErrorMessageDetailType> errorMessageDetail;
    @XmlAttribute(name = "version")
    protected String version;

    /**
     * Gets the value of the errorMessageIdentifier property.
     * 
     * @return
     *     possible object is
     *     {@link ErrorMessageIdentifierType }
     *     
     */
    public ErrorMessageIdentifierType getErrorMessageIdentifier() {
        return errorMessageIdentifier;
    }

    /**
     * Sets the value of the errorMessageIdentifier property.
     * 
     * @param value
     *     allowed object is
     *     {@link ErrorMessageIdentifierType }
     *     
     */
    public void setErrorMessageIdentifier(ErrorMessageIdentifierType value) {
        this.errorMessageIdentifier = value;
    }

    /**
     * Gets the value of the errorMessageTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getErrorMessageTs() {
        return errorMessageTs;
    }

    /**
     * Sets the value of the errorMessageTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setErrorMessageTs(String value) {
        this.errorMessageTs = value;
    }

    /**
     * Gets the value of the errorMessageDetail property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the errorMessageDetail property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getErrorMessageDetail().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link ErrorMessageDetailType }
     * 
     * 
     */
    public List<ErrorMessageDetailType> getErrorMessageDetail() {
        if (errorMessageDetail == null) {
            errorMessageDetail = new ArrayList<ErrorMessageDetailType>();
        }
        return this.errorMessageDetail;
    }

    /**
     * Gets the value of the version property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getVersion() {
        if (version == null) {
            return "1.0";
        } else {
            return version;
        }
    }

    /**
     * Sets the value of the version property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setVersion(String value) {
        this.version = value;
    }

}
<file_sep><project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
    </parent>

    <groupId>corp.pdb.enterprise</groupId>
    <artifactId>alawal-eap</artifactId>
    <version>0.0.1.SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Al-Awal Enterprise Application Platform</name>
    <description>
        A Spring Boot application designed to show-off implementation(s) of a variety of Spring Boot functionalities.
        
        Proprietary Software Built Off of Open-Source Software?
    </description>
    <inceptionYear>2019</inceptionYear>
    <url></url>
    <developers>
        <developer>
            <name>wkjaradat</name>
            <id>jaradat-pdb</id>
            <email><EMAIL></email>
            <organization>PDB Corp.</organization>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <commons-io.version>2.1</commons-io.version>
        <commons-fileupload.version>1.3.1</commons-fileupload.version>
        <!-- Specifying this property sets the JAVA version for Spring Boot to use -->
        <java.version>1.8</java.version>
        <!-- Tells Spring Boot the JAVA version to use with the maven-compiler-plugin -->
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven-jaxb2-plugin.version>0.13.3</maven-jaxb2-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-batch</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>${commons-fileupload.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        
        <!-- Testing Dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Spring Boot Maven plugin -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            
            <!-- Maven JAXB2 plugin -->
            <!-- Configures JAXB2 to unmarshal XML objects, defined in the schemas located
            in the directory that is specified in the <configuration> element below, into
            JAVA class files (goal=generate)  -->
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>${maven-jaxb2-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <generateDirectory>${project.basedir}/src/generated/java</generateDirectory>
                    <schemaDirectory>${project.basedir}/src/main/resources/schemas/SRV-CBC</schemaDirectory>
                    <schemaIncludes>
                        <include>*.wsdl</include>
                    </schemaIncludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.data.model;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import corp.pdb.aea.data.model.enums.AlertStatusEnum;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Entity
@Table(name="INCOMING_UPLOAD")
public class IncomingUpload {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	
	@Basic
	@Column(name="COMMUNICATION_TYPE_CD", nullable=false, length=10)
	private String communicationTypeCd;
	
	@Basic
	@Column(name="ENTITY_SENDER_ID", nullable=false, length=24)
	private String entitySenderIdentifier;
	
	@Basic
	@Column(name="ENTITY_RECEIVER_ID", nullable=false, length=24)
	private String entityReceiverIdentifier;
	
	@Basic
	@Column(name="IDES_FILE_NM", nullable=false, length=200)
	private String idesFileNm;
	
	@Basic
	@Column(name="SENDER_FILE_ID", nullable=false, length=200)
	private String senderFileId;
	
	@Basic
	@Column(name = "FILE_SIZE_KB_QTY", nullable = true, precision = 0, columnDefinition = "NUMBER")
	private Long fileSizeKbQty;
	
	@Basic
	@Column(name="ALERT_ID", nullable=true, precision=0, columnDefinition="NUMBER")
	private Long alertId;
	
	@Column(name="ALERT_STATUS", nullable = false, length = 2, columnDefinition = "CHAR(2)")
	@Enumerated(EnumType.STRING)
	private AlertStatusEnum alertStatus;
	
	@Basic
	@Column(name="ALERT_SENT_TS", nullable=true, columnDefinition="TIMESTAMP(6)")
	@Temporal(TemporalType.TIMESTAMP)
	private Date alertSentTs;
	
	@Basic
	@Column(name="CREATED_BY_ID", nullable=false, length=24)
	private String createdById;
	
	@Basic
	@Column(name="CREATE_TS", nullable=false, columnDefinition="TIMESTAMP(6)")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTs;
	
	@Basic
	@Column(name="UPDATED_BY_ID", nullable=true, length=24)
	private String updatedById;
	
	@Basic
	@Column(name="UPDATE_TS", nullable=true, columnDefinition="TIMESTAMP(6)")
	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTs;
	
	/**
	 * @return the communicationTypeCd
	 */
	public String getCommunicationTypeCd() {
		return communicationTypeCd;
	}
	
	/**
	 * @param communicationTypeCd the communicationTypeCd to set
	 */
	public void setCommunicationTypeCd(String communicationTypeCd) {
		this.communicationTypeCd = communicationTypeCd;
	}
	
	/**
	 * @return the entitySenderIdentifier
	 */
	public String getEntitySenderIdentifier() {
		return entitySenderIdentifier;
	}
	
	/**
	 * @param entitySenderIdentifier the entitySenderIdentifier to set
	 */
	public void setEntitySenderIdentifier(String entitySenderIdentifier) {
		this.entitySenderIdentifier = entitySenderIdentifier;
	}
	
	/**
	 * @return the entityReceiverIdentifier
	 */
	public String getEntityReceiverIdentifier() {
		return entityReceiverIdentifier;
	}
	
	/**
	 * @param entityReceiverIdentifier the entityReceiverIdentifier to set
	 */
	public void setEntityReceiverIdentifier(String entityReceiverIdentifier) {
		this.entityReceiverIdentifier = entityReceiverIdentifier;
	}
	
	/**
	 * @return the idesFileNm
	 */
	public String getIdesFileNm() {
		return idesFileNm;
	}
	
	/**
	 * @param idesFileNm the idesFileNm to set
	 */
	public void setIdesFileNm(String idesFileNm) {
		this.idesFileNm = idesFileNm;
	}
	
	/**
	 * @return the senderFileId
	 */
	public String getSenderFileId() {
		return senderFileId;
	}
	
	/**
	 * @param senderFileId the senderFileId to set
	 */
	public void setSenderFileId(String senderFileId) {
		this.senderFileId = senderFileId;
	}
	
	/**
	 * @return the fileSizeKbQty
	 */
	public Long getFileSizeKbQty() {
		return fileSizeKbQty;
	}
	
	/**
	 * @param fileSizeKbQty the fileSizeKbQty to set
	 */
	public void setFileSizeKbQty(Long fileSizeKbQty) {
		this.fileSizeKbQty = fileSizeKbQty;
	}
	
	/**
	 * @return the alertId
	 */
	public Long getAlertId() {
		return alertId;
	}
	
	/**
	 * @param alertId the alertId to set
	 */
	public void setAlertId(Long alertId) {
		this.alertId = alertId;
	}
	
	/**
	 * @return the alertStatus
	 */
	public AlertStatusEnum getAlertStatus() {
		return alertStatus;
	}
	
	/**
	 * @param alertStatus the alertStatus to set
	 */
	public void setAlertStatus(AlertStatusEnum alertStatus) {
		this.alertStatus = alertStatus;
	}
	
	/**
	 * @return the alertSentTs
	 */
	public Date getAlertSentTs() {
		return alertSentTs;
	}
	
	/**
	 * @param alertSentTs the alertSentTs to set
	 */
	public void setAlertSentTs(Date alertSentTs) {
		this.alertSentTs = alertSentTs;
	}
	
	/**
	 * @return the createdById
	 */
	public String getCreatedById() {
		return createdById;
	}
	
	/**
	 * @param createdById the createdById to set
	 */
	public void setCreatedById(String createdById) {
		this.createdById = createdById;
	}
	
	/**
	 * @return the createTs
	 */
	public Date getCreateTs() {
		return createTs;
	}
	
	/**
	 * @param createTs the createTs to set
	 */
	public void setCreateTs(Date createTs) {
		this.createTs = createTs;
	}
	
	/**
	 * @return the updatedById
	 */
	public String getUpdatedById() {
		return updatedById;
	}
	
	/**
	 * @param updatedById the updatedById to set
	 */
	public void setUpdatedById(String updatedById) {
		this.updatedById = updatedById;
	}
	
	/**
	 * @return the updateTs
	 */
	public Date getUpdateTs() {
		return updateTs;
	}
	
	/**
	 * @param updateTs the updateTs to set
	 */
	public void setUpdateTs(Date updateTs) {
		this.updateTs = updateTs;
	}
	
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((alertId == null) ? 0 : alertId.hashCode());
		result = prime * result + ((alertSentTs == null) ? 0 : alertSentTs.hashCode());
		result = prime * result + ((alertStatus == null) ? 0 : alertStatus.hashCode());
		result = prime * result + ((communicationTypeCd == null) ? 0 : communicationTypeCd.hashCode());
		result = prime * result + ((createTs == null) ? 0 : createTs.hashCode());
		result = prime * result + ((createdById == null) ? 0 : createdById.hashCode());
		result = prime * result + ((entityReceiverIdentifier == null) ? 0 : entityReceiverIdentifier.hashCode());
		result = prime * result + ((entitySenderIdentifier == null) ? 0 : entitySenderIdentifier.hashCode());
		result = prime * result + ((fileSizeKbQty == null) ? 0 : fileSizeKbQty.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((idesFileNm == null) ? 0 : idesFileNm.hashCode());
		result = prime * result + ((senderFileId == null) ? 0 : senderFileId.hashCode());
		result = prime * result + ((updateTs == null) ? 0 : updateTs.hashCode());
		result = prime * result + ((updatedById == null) ? 0 : updatedById.hashCode());
		return result;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		IncomingUpload other = (IncomingUpload) obj;
		if (alertId == null) {
			if (other.alertId != null)
				return false;
		} else if (!alertId.equals(other.alertId))
			return false;
		if (alertSentTs == null) {
			if (other.alertSentTs != null)
				return false;
		} else if (!alertSentTs.equals(other.alertSentTs))
			return false;
		if (alertStatus == null) {
			if (other.alertStatus != null)
				return false;
		} else if (!alertStatus.equals(other.alertStatus))
			return false;
		if (communicationTypeCd == null) {
			if (other.communicationTypeCd != null)
				return false;
		} else if (!communicationTypeCd.equals(other.communicationTypeCd))
			return false;
		if (createTs == null) {
			if (other.createTs != null)
				return false;
		} else if (!createTs.equals(other.createTs))
			return false;
		if (createdById == null) {
			if (other.createdById != null)
				return false;
		} else if (!createdById.equals(other.createdById))
			return false;
		if (entityReceiverIdentifier == null) {
			if (other.entityReceiverIdentifier != null)
				return false;
		} else if (!entityReceiverIdentifier.equals(other.entityReceiverIdentifier))
			return false;
		if (entitySenderIdentifier == null) {
			if (other.entitySenderIdentifier != null)
				return false;
		} else if (!entitySenderIdentifier.equals(other.entitySenderIdentifier))
			return false;
		if(fileSizeKbQty == null) {
			if(other.fileSizeKbQty != null)
				return false;
		} else if(!fileSizeKbQty.equals(other.fileSizeKbQty))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (idesFileNm == null) {
			if (other.idesFileNm != null)
				return false;
		} else if (!idesFileNm.equals(other.idesFileNm))
			return false;
		if (senderFileId == null) {
			if (other.senderFileId != null)
				return false;
		} else if (!senderFileId.equals(other.senderFileId))
			return false;
		if (updateTs == null) {
			if (other.updateTs != null)
				return false;
		} else if (!updateTs.equals(other.updateTs))
			return false;
		if (updatedById == null) {
			if (other.updatedById != null)
				return false;
		} else if (!updatedById.equals(other.updatedById))
			return false;
		return true;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "IncomingUpload [id=" + id + ", communicationTypeCd=" + communicationTypeCd + ", entitySenderIdentifier=" + entitySenderIdentifier
				+ ", entityReceiverIdentifier=" + entityReceiverIdentifier + ", idesFileNm=" + idesFileNm + ", senderFileId=" + senderFileId
				+ ", fileSizeKbQty=" + fileSizeKbQty + ", alertId=" + alertId + ", alertStatus=" + alertStatus + ", alertSentTs=" + alertSentTs
				+ ", createdById=" + createdById + ", createTs=" + createTs + ", updatedById=" + updatedById + ", updateTs=" + updateTs + "]";
	}
	
}
<file_sep>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2019.08.08 at 01:18:40 PM EDT 
//


package ides.msg.fileuploadmessage;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import ides.EntityCommunicationTypeCdType;


/**
 * 
 * <pre>
 * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Component xmlns="urn:ides:msg:fileuploadmessage" xmlns:ides="urn:ides" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;DictionaryEntryNm&gt;File Upload Response Type&lt;/DictionaryEntryNm&gt;&lt;MajorVersionNum&gt;1&lt;/MajorVersionNum&gt;&lt;MinorVersionNum&gt;0&lt;/MinorVersionNum&gt;&lt;VersionEffectiveBeginDt&gt;2014-06-12&lt;/VersionEffectiveBeginDt&gt;&lt;VersionDescriptionTxt&gt;Initial version&lt;/VersionDescriptionTxt&gt;&lt;DescriptionTxt&gt;Type for message for the file upload response&lt;/DescriptionTxt&gt;&lt;/Component&gt;
 * </pre>
 * 
 * 
 * <p>Java class for FileUploadResponseType complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="FileUploadResponseType"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element ref="{urn:ides}ReceiptTs" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}IDESSendingTs"/&gt;
 *         &lt;element ref="{urn:ides}EntityCommunicationTypeCd"/&gt;
 *         &lt;element ref="{urn:ides}SenderFileId"/&gt;
 *         &lt;element ref="{urn:ides}IDESFileNm"/&gt;
 *       &lt;/sequence&gt;
 *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" fixed="1.0" /&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FileUploadResponseType", propOrder = {
    "receiptTs",
    "idesSendingTs",
    "entityCommunicationTypeCd",
    "senderFileId",
    "idesFileNm"
})
public class FileUploadResponseType {

    @XmlElement(name = "ReceiptTs", namespace = "urn:ides")
    protected String receiptTs;
    @XmlElement(name = "IDESSendingTs", namespace = "urn:ides", required = true)
    protected String idesSendingTs;
    @XmlElement(name = "EntityCommunicationTypeCd", namespace = "urn:ides", required = true)
    @XmlSchemaType(name = "string")
    protected EntityCommunicationTypeCdType entityCommunicationTypeCd;
    @XmlElement(name = "SenderFileId", namespace = "urn:ides", required = true)
    protected String senderFileId;
    @XmlElement(name = "IDESFileNm", namespace = "urn:ides", required = true)
    protected String idesFileNm;
    @XmlAttribute(name = "version")
    protected String version;

    /**
     * Gets the value of the receiptTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getReceiptTs() {
        return receiptTs;
    }

    /**
     * Sets the value of the receiptTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setReceiptTs(String value) {
        this.receiptTs = value;
    }

    /**
     * Gets the value of the idesSendingTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESSendingTs() {
        return idesSendingTs;
    }

    /**
     * Sets the value of the idesSendingTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESSendingTs(String value) {
        this.idesSendingTs = value;
    }

    /**
     * Gets the value of the entityCommunicationTypeCd property.
     * 
     * @return
     *     possible object is
     *     {@link EntityCommunicationTypeCdType }
     *     
     */
    public EntityCommunicationTypeCdType getEntityCommunicationTypeCd() {
        return entityCommunicationTypeCd;
    }

    /**
     * Sets the value of the entityCommunicationTypeCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link EntityCommunicationTypeCdType }
     *     
     */
    public void setEntityCommunicationTypeCd(EntityCommunicationTypeCdType value) {
        this.entityCommunicationTypeCd = value;
    }

    /**
     * Gets the value of the senderFileId property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getSenderFileId() {
        return senderFileId;
    }

    /**
     * Sets the value of the senderFileId property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setSenderFileId(String value) {
        this.senderFileId = value;
    }

    /**
     * Gets the value of the idesFileNm property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESFileNm() {
        return idesFileNm;
    }

    /**
     * Sets the value of the idesFileNm property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESFileNm(String value) {
        this.idesFileNm = value;
    }

    /**
     * Gets the value of the version property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getVersion() {
        if (version == null) {
            return "1.0";
        } else {
            return version;
        }
    }

    /**
     * Sets the value of the version property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setVersion(String value) {
        this.version = value;
    }

}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

import org.springframework.stereotype.Service;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Service
public class TimestampTypeFormatter {
	private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSX";
	
	public String generateTimestamp() {
		SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
		dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
		String timeStamp = dateFormat.format(new Date());
		
		if(!(dateFormat.getTimeZone().getID().equals("UTC")))
			timeStamp += ":00";
		
		return timeStamp;
	}
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.ws.endpoint;

import javax.xml.bind.JAXBElement;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

import corp.pdb.aea.util.TimestampTypeFormatter;
import ides.msg.downloadacknowledgementmessage.DownloadAckngRequestType;
import ides.msg.downloadacknowledgementmessage.DownloadAckngResponseType;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Endpoint
public class DownloadAcknowledgementStubEndpointImpl {
	private static final Logger LOGGER = LogManager.getLogger(DownloadAcknowledgementStubEndpointImpl.class);
	@Autowired
	TimestampTypeFormatter timestampTypeFormatter;
	
	@PayloadRoot(namespace="urn:ides:msg:downloadacknowledgementmessage", localPart="DownloadAckngRequest")
	@ResponsePayload
	public JAXBElement<DownloadAckngResponseType> downloadAckngRequestOperation(@RequestPayload JAXBElement<DownloadAckngRequestType> downloadAckngRequest) {
		LOGGER.debug("{}: Received request at DownloadAckngService Endpoint (see TRACE logs for message details)", this.getClass().getSimpleName());
		DownloadAckngRequestType downloadAckngRequestBody = downloadAckngRequest.getValue();
		LOGGER.trace("Message details: RequestSentTs=[{}], IDESTransmissionId=[{}], EntityIdentifier=[{}], AcknowledgementType=[{}]", downloadAckngRequestBody.getRequestSentTs(), downloadAckngRequestBody.getIDESTransmissionId(), downloadAckngRequestBody.getEntityIdentifier(), downloadAckngRequestBody.getAcknowledgementTypeCd());
		
		ides.msg.downloadacknowledgementmessage.ObjectFactory factory = new ides.msg.downloadacknowledgementmessage.ObjectFactory();
		DownloadAckngResponseType downloadAckngResponseBody = factory.createDownloadAckngResponseType();
		
		downloadAckngResponseBody.setReceiptTs(timestampTypeFormatter.generateTimestamp());
		downloadAckngResponseBody.setIDESSendingTs(timestampTypeFormatter.generateTimestamp());
		downloadAckngResponseBody.setIDESTransmissionId(downloadAckngRequestBody.getIDESTransmissionId());
		downloadAckngResponseBody.setEntityIdentifier(downloadAckngRequestBody.getEntityIdentifier());
		
		JAXBElement<DownloadAckngResponseType> downloadAckngResponse = factory.createDownloadAckngResponse(downloadAckngResponseBody);
		return downloadAckngResponse;
	}
}
<file_sep>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2019.08.08 at 01:18:40 PM EDT 
//


package ides.msg.idesalertmessage;

import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import ides.AlertRecipientTypeCdType;
import ides.BinaryEncodingSchemeCdType;
import ides.EntityCommunicationTypeCdType;
import ides.EntityIdentifierType;
import ides.FileFormatCdType;


/**
 * 
 * <pre>
 * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Component xmlns="urn:ides:msg:idesalertmessage" xmlns:ides="urn:ides" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;DictionaryEntryNm&gt;IDES Alert Request Type&lt;/DictionaryEntryNm&gt;&lt;MajorVersionNum&gt;1&lt;/MajorVersionNum&gt;&lt;MinorVersionNum&gt;1&lt;/MinorVersionNum&gt;&lt;VersionEffectiveBeginDt&gt;2018-10-18&lt;/VersionEffectiveBeginDt&gt;&lt;VersionDescriptionTxt&gt;1.1&lt;/VersionDescriptionTxt&gt;&lt;DescriptionTxt&gt;Type for message for the IDES alert request&lt;/DescriptionTxt&gt;&lt;/Component&gt;
 * </pre>
 * 
 * 
 * <p>Java class for IDESAlertRequestType complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="IDESAlertRequestType"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element ref="{urn:ides}RequestSentTs" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}IDESTransmissionId"/&gt;
 *         &lt;element ref="{urn:ides}IDESSendingTs"/&gt;
 *         &lt;element ref="{urn:ides}IDESReceivedTs"/&gt;
 *         &lt;element ref="{urn:ides}IDESFileNm"/&gt;
 *         &lt;element ref="{urn:ides}AlertRecipientTypeCd"/&gt;
 *         &lt;element ref="{urn:ides}EntitySenderIdentifier"/&gt;
 *         &lt;element ref="{urn:ides}EntityReceiverIdentifier"/&gt;
 *         &lt;element ref="{urn:ides}AlertTypeCd"/&gt;
 *         &lt;element ref="{urn:ides}AlertReasonCd" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}EntityCommunicationTypeCd"/&gt;
 *         &lt;element ref="{urn:ides}SenderFileId" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}FileFormatCd"/&gt;
 *         &lt;element ref="{urn:ides}BinaryEncodingSchemeCd"/&gt;
 *         &lt;element ref="{urn:ides}FileCreateTs" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}TaxYear" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}CompressedFileSizeKBQty" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}FileRevisionInd" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}OriginalIDESTransmissionId" minOccurs="0"/&gt;
 *         &lt;element ref="{urn:ides}SenderContactEmailAddressTxt" minOccurs="0"/&gt;
 *       &lt;/sequence&gt;
 *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" fixed="1.0" /&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "IDESAlertRequestType", propOrder = {
    "requestSentTs",
    "idesTransmissionId",
    "idesSendingTs",
    "idesReceivedTs",
    "idesFileNm",
    "alertRecipientTypeCd",
    "entitySenderIdentifier",
    "entityReceiverIdentifier",
    "alertTypeCd",
    "alertReasonCd",
    "entityCommunicationTypeCd",
    "senderFileId",
    "fileFormatCd",
    "binaryEncodingSchemeCd",
    "fileCreateTs",
    "taxYear",
    "compressedFileSizeKBQty",
    "fileRevisionInd",
    "originalIDESTransmissionId",
    "senderContactEmailAddressTxt"
})
public class IDESAlertRequestType {

    @XmlElement(name = "RequestSentTs", namespace = "urn:ides")
    protected String requestSentTs;
    @XmlElement(name = "IDESTransmissionId", namespace = "urn:ides", required = true)
    protected String idesTransmissionId;
    @XmlElement(name = "IDESSendingTs", namespace = "urn:ides", required = true)
    protected String idesSendingTs;
    @XmlElement(name = "IDESReceivedTs", namespace = "urn:ides", required = true)
    protected String idesReceivedTs;
    @XmlElement(name = "IDESFileNm", namespace = "urn:ides", required = true)
    protected String idesFileNm;
    @XmlElement(name = "AlertRecipientTypeCd", namespace = "urn:ides", required = true)
    @XmlSchemaType(name = "string")
    protected AlertRecipientTypeCdType alertRecipientTypeCd;
    @XmlElement(name = "EntitySenderIdentifier", namespace = "urn:ides", required = true)
    protected EntityIdentifierType entitySenderIdentifier;
    @XmlElement(name = "EntityReceiverIdentifier", namespace = "urn:ides", required = true)
    protected EntityIdentifierType entityReceiverIdentifier;
    @XmlElement(name = "AlertTypeCd", namespace = "urn:ides", required = true)
    protected String alertTypeCd;
    @XmlElement(name = "AlertReasonCd", namespace = "urn:ides")
    protected String alertReasonCd;
    @XmlElement(name = "EntityCommunicationTypeCd", namespace = "urn:ides", required = true)
    @XmlSchemaType(name = "string")
    protected EntityCommunicationTypeCdType entityCommunicationTypeCd;
    @XmlElement(name = "SenderFileId", namespace = "urn:ides")
    protected String senderFileId;
    @XmlElement(name = "FileFormatCd", namespace = "urn:ides", required = true)
    @XmlSchemaType(name = "string")
    protected FileFormatCdType fileFormatCd;
    @XmlElement(name = "BinaryEncodingSchemeCd", namespace = "urn:ides", required = true)
    @XmlSchemaType(name = "string")
    protected BinaryEncodingSchemeCdType binaryEncodingSchemeCd;
    @XmlElement(name = "FileCreateTs", namespace = "urn:ides")
    protected String fileCreateTs;
    @XmlElement(name = "TaxYear", namespace = "urn:ides")
    @XmlSchemaType(name = "gYear")
    protected XMLGregorianCalendar taxYear;
    @XmlElement(name = "CompressedFileSizeKBQty", namespace = "urn:ides")
    protected BigInteger compressedFileSizeKBQty;
    @XmlElement(name = "FileRevisionInd", namespace = "urn:ides")
    protected Boolean fileRevisionInd;
    @XmlElement(name = "OriginalIDESTransmissionId", namespace = "urn:ides")
    protected String originalIDESTransmissionId;
    @XmlElement(name = "SenderContactEmailAddressTxt", namespace = "urn:ides")
    protected String senderContactEmailAddressTxt;
    @XmlAttribute(name = "version")
    protected String version;

    /**
     * Gets the value of the requestSentTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getRequestSentTs() {
        return requestSentTs;
    }

    /**
     * Sets the value of the requestSentTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setRequestSentTs(String value) {
        this.requestSentTs = value;
    }

    /**
     * Gets the value of the idesTransmissionId property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESTransmissionId() {
        return idesTransmissionId;
    }

    /**
     * Sets the value of the idesTransmissionId property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESTransmissionId(String value) {
        this.idesTransmissionId = value;
    }

    /**
     * Gets the value of the idesSendingTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESSendingTs() {
        return idesSendingTs;
    }

    /**
     * Sets the value of the idesSendingTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESSendingTs(String value) {
        this.idesSendingTs = value;
    }

    /**
     * Gets the value of the idesReceivedTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESReceivedTs() {
        return idesReceivedTs;
    }

    /**
     * Sets the value of the idesReceivedTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESReceivedTs(String value) {
        this.idesReceivedTs = value;
    }

    /**
     * Gets the value of the idesFileNm property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESFileNm() {
        return idesFileNm;
    }

    /**
     * Sets the value of the idesFileNm property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESFileNm(String value) {
        this.idesFileNm = value;
    }

    /**
     * Gets the value of the alertRecipientTypeCd property.
     * 
     * @return
     *     possible object is
     *     {@link AlertRecipientTypeCdType }
     *     
     */
    public AlertRecipientTypeCdType getAlertRecipientTypeCd() {
        return alertRecipientTypeCd;
    }

    /**
     * Sets the value of the alertRecipientTypeCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link AlertRecipientTypeCdType }
     *     
     */
    public void setAlertRecipientTypeCd(AlertRecipientTypeCdType value) {
        this.alertRecipientTypeCd = value;
    }

    /**
     * Gets the value of the entitySenderIdentifier property.
     * 
     * @return
     *     possible object is
     *     {@link EntityIdentifierType }
     *     
     */
    public EntityIdentifierType getEntitySenderIdentifier() {
        return entitySenderIdentifier;
    }

    /**
     * Sets the value of the entitySenderIdentifier property.
     * 
     * @param value
     *     allowed object is
     *     {@link EntityIdentifierType }
     *     
     */
    public void setEntitySenderIdentifier(EntityIdentifierType value) {
        this.entitySenderIdentifier = value;
    }

    /**
     * Gets the value of the entityReceiverIdentifier property.
     * 
     * @return
     *     possible object is
     *     {@link EntityIdentifierType }
     *     
     */
    public EntityIdentifierType getEntityReceiverIdentifier() {
        return entityReceiverIdentifier;
    }

    /**
     * Sets the value of the entityReceiverIdentifier property.
     * 
     * @param value
     *     allowed object is
     *     {@link EntityIdentifierType }
     *     
     */
    public void setEntityReceiverIdentifier(EntityIdentifierType value) {
        this.entityReceiverIdentifier = value;
    }

    /**
     * Gets the value of the alertTypeCd property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getAlertTypeCd() {
        return alertTypeCd;
    }

    /**
     * Sets the value of the alertTypeCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setAlertTypeCd(String value) {
        this.alertTypeCd = value;
    }

    /**
     * Gets the value of the alertReasonCd property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getAlertReasonCd() {
        return alertReasonCd;
    }

    /**
     * Sets the value of the alertReasonCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setAlertReasonCd(String value) {
        this.alertReasonCd = value;
    }

    /**
     * Gets the value of the entityCommunicationTypeCd property.
     * 
     * @return
     *     possible object is
     *     {@link EntityCommunicationTypeCdType }
     *     
     */
    public EntityCommunicationTypeCdType getEntityCommunicationTypeCd() {
        return entityCommunicationTypeCd;
    }

    /**
     * Sets the value of the entityCommunicationTypeCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link EntityCommunicationTypeCdType }
     *     
     */
    public void setEntityCommunicationTypeCd(EntityCommunicationTypeCdType value) {
        this.entityCommunicationTypeCd = value;
    }

    /**
     * Gets the value of the senderFileId property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getSenderFileId() {
        return senderFileId;
    }

    /**
     * Sets the value of the senderFileId property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setSenderFileId(String value) {
        this.senderFileId = value;
    }

    /**
     * Gets the value of the fileFormatCd property.
     * 
     * @return
     *     possible object is
     *     {@link FileFormatCdType }
     *     
     */
    public FileFormatCdType getFileFormatCd() {
        return fileFormatCd;
    }

    /**
     * Sets the value of the fileFormatCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link FileFormatCdType }
     *     
     */
    public void setFileFormatCd(FileFormatCdType value) {
        this.fileFormatCd = value;
    }

    /**
     * Gets the value of the binaryEncodingSchemeCd property.
     * 
     * @return
     *     possible object is
     *     {@link BinaryEncodingSchemeCdType }
     *     
     */
    public BinaryEncodingSchemeCdType getBinaryEncodingSchemeCd() {
        return binaryEncodingSchemeCd;
    }

    /**
     * Sets the value of the binaryEncodingSchemeCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link BinaryEncodingSchemeCdType }
     *     
     */
    public void setBinaryEncodingSchemeCd(BinaryEncodingSchemeCdType value) {
        this.binaryEncodingSchemeCd = value;
    }

    /**
     * Gets the value of the fileCreateTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getFileCreateTs() {
        return fileCreateTs;
    }

    /**
     * Sets the value of the fileCreateTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setFileCreateTs(String value) {
        this.fileCreateTs = value;
    }

    /**
     * Gets the value of the taxYear property.
     * 
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public XMLGregorianCalendar getTaxYear() {
        return taxYear;
    }

    /**
     * Sets the value of the taxYear property.
     * 
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public void setTaxYear(XMLGregorianCalendar value) {
        this.taxYear = value;
    }

    /**
     * Gets the value of the compressedFileSizeKBQty property.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    public BigInteger getCompressedFileSizeKBQty() {
        return compressedFileSizeKBQty;
    }

    /**
     * Sets the value of the compressedFileSizeKBQty property.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setCompressedFileSizeKBQty(BigInteger value) {
        this.compressedFileSizeKBQty = value;
    }

    /**
     * Gets the value of the fileRevisionInd property.
     * 
     * @return
     *     possible object is
     *     {@link Boolean }
     *     
     */
    public Boolean isFileRevisionInd() {
        return fileRevisionInd;
    }

    /**
     * Sets the value of the fileRevisionInd property.
     * 
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *     
     */
    public void setFileRevisionInd(Boolean value) {
        this.fileRevisionInd = value;
    }

    /**
     * Gets the value of the originalIDESTransmissionId property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getOriginalIDESTransmissionId() {
        return originalIDESTransmissionId;
    }

    /**
     * Sets the value of the originalIDESTransmissionId property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setOriginalIDESTransmissionId(String value) {
        this.originalIDESTransmissionId = value;
    }

    /**
     * Gets the value of the senderContactEmailAddressTxt property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getSenderContactEmailAddressTxt() {
        return senderContactEmailAddressTxt;
    }

    /**
     * Sets the value of the senderContactEmailAddressTxt property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setSenderContactEmailAddressTxt(String value) {
        this.senderContactEmailAddressTxt = value;
    }

    /**
     * Gets the value of the version property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getVersion() {
        if (version == null) {
            return "1.0";
        } else {
            return version;
        }
    }

    /**
     * Sets the value of the version property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setVersion(String value) {
        this.version = value;
    }

}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.data.model;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import corp.pdb.aea.data.model.enums.AlertStatusEnum;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Entity
@Table(name = "ALERT")
public class Alert {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column(name="ALERT_STATUS", nullable = false, length = 2, columnDefinition = "CHAR(2)")
	@Enumerated(EnumType.STRING)
	private AlertStatusEnum alertStatus;
	
	@Basic
	@Column(name = "ENTITY_COMMUNICATION_TYPE_CD", nullable = false, length = 10)
	private String entityCommunicationTypeCd;
	
	@Basic
	@Column(name = "IDES_TRANSMISSION_ID", nullable = false, length = 32)
	private String idesTransmissionId;
	
	@Basic
	@Column(name = "FILE_REVISION_IND", nullable = true, length = 1, columnDefinition = "CHAR(1)")
	private String fileRevisionInd;
	
	@Basic
	@Column(name = "ORIGINAL_IDES_TRANSMISSION_ID", nullable = true, length = 32)
	private String originalIdesTransmissionId;
	
	@Basic
	@Column(name = "ALERT_RECIPIENT_TYPE_CD", nullable = false, length = 2, columnDefinition = "CHAR(2) NOT NULL")
	private String alertRecipientTypeCd;
	
	@Basic
	@Column(name = "ALERT_TYPE_CD", nullable = false, length = 5)
	private String alertTypeCd;
	
	@Basic
	@Column(name = "ALERT_REASON_CD", nullable = false, length = 5)
	private String alertReasonCd;
	
	@Basic
	@Column(name = "ENTITY_SENDER_ID", nullable = false, length = 24)
	private String entitySenderIdentifier;
	
	@Basic
	@Column(name = "ENTITY_RECEIVER_ID", nullable = false, length = 24)
	private String entityReceiverIdentifier;
	
	@Basic
	@Column(name = "SENDER_FILE_ID", nullable = false, length = 200)
	private String senderFileId;
	
	@Basic
	@Column(name = "IDES_FILE_NM", nullable = false, length = 200)
	private String idesFileNm;
	
	@Basic
	@Column(name = "TAX_YR", nullable = true, precision = 0, columnDefinition = "NUMBER")
	private Long taxYr;
	
	@Basic
	@Column(name = "FILE_CREATE_TS", nullable = false, columnDefinition = "TIMESTAMP(6)")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fileCreateTs;
	
	@Basic
	@Column(name = "FILE_FORMAT_CD", nullable = true, length = 10)
	private String fileFormatCd;
	
	@Basic
	@Column(name = "BINARY_ENCODING_SCHEME_CD", nullable = true, length = 10)
	private String binaryEncodingSchemeCd;
	
	@Basic
	@Column(name = "COMPRESSED_FILE_SIZE_KB_QTY", nullable = true, precision = 0, columnDefinition = "NUMBER")
	private Long compressedFileSizeKbQty;
	
	@Basic
	@Column(name = "SENDER_CONTACT_EMAIL_TXT", nullable = true, length = 200)
	private String senderContactEmailTxt;
	
	@Basic
	@Column(name="CREATED_BY_ID", nullable=false, length=24)
	private String createdById;
	
	@Basic
	@Column(name="CREATE_TS", nullable=false, columnDefinition="TIMESTAMP(6)")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTs;
	
	@Basic
	@Column(name="UPDATED_BY_ID", nullable=true, length=24)
	private String updatedById;
	
	@Basic
	@Column(name="UPDATE_TS", nullable=true, columnDefinition="TIMESTAMP(6)")
	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTs;
	
	/**
	 * @return the alertStatus
	 */
	public AlertStatusEnum getAlertStatus() {
		return alertStatus;
	}
	
	/**
	 * @param alertStatus the alertStatus to set
	 */
	public void setAlertStatus(AlertStatusEnum alertStatus) {
		this.alertStatus = alertStatus;
	}
	
	/**
	 * @return the entityCommunicationTypeCd
	 */
	public String getEntityCommunicationTypeCd() {
		return entityCommunicationTypeCd;
	}
	
	/**
	 * @param entityCommunicationTypeCd the entityCommunicationTypeCd to set
	 */
	public void setEntityCommunicationTypeCd(String entityCommunicationTypeCd) {
		this.entityCommunicationTypeCd = entityCommunicationTypeCd;
	}
	
	/**
	 * @return the idesTransmissionId
	 */
	public String getIdesTransmissionId() {
		return idesTransmissionId;
	}
	
	/**
	 * @param idesTransmissionId the idesTransmissionId to set
	 */
	public void setIdesTransmissionId(String idesTransmissionId) {
		this.idesTransmissionId = idesTransmissionId;
	}
	
	/**
	 * @return the fileRevisionInd
	 */
	public String getFileRevisionInd() {
		return fileRevisionInd;
	}
	
	/**
	 * @param fileRevisionInd the fileRevisionInd to set
	 */
	public void setFileRevisionInd(String fileRevisionInd) {
		this.fileRevisionInd = fileRevisionInd;
	}
	
	/**
	 * @return the originalIdesTransmissionId
	 */
	public String getOriginalIdesTransmissionId() {
		return originalIdesTransmissionId;
	}
	
	/**
	 * @param originalIdesTransmissionId the originalIdesTransmissionId to set
	 */
	public void setOriginalIdesTransmissionId(String originalIdesTransmissionId) {
		this.originalIdesTransmissionId = originalIdesTransmissionId;
	}
	
	/**
	 * @return the alertRecipientTypeCd
	 */
	public String getAlertRecipientTypeCd() {
		return alertRecipientTypeCd;
	}
	
	/**
	 * @param alertRecipientTypeCd the alertRecipientTypeCd to set
	 */
	public void setAlertRecipientTypeCd(String alertRecipientTypeCd) {
		this.alertRecipientTypeCd = alertRecipientTypeCd;
	}
	
	/**
	 * @return the alertTypeCd
	 */
	public String getAlertTypeCd() {
		return alertTypeCd;
	}
	
	/**
	 * @param alertTypeCd the alertTypeCd to set
	 */
	public void setAlertTypeCd(String alertTypeCd) {
		this.alertTypeCd = alertTypeCd;
	}
	
	/**
	 * @return the alertReasonCd
	 */
	public String getAlertReasonCd() {
		return alertReasonCd;
	}
	
	/**
	 * @param alertReasonCd the alertReasonCd to set
	 */
	public void setAlertReasonCd(String alertReasonCd) {
		this.alertReasonCd = alertReasonCd;
	}
	
	/**
	 * @return the entitySenderIdentifier
	 */
	public String getEntitySenderIdentifier() {
		return entitySenderIdentifier;
	}
	
	/**
	 * @param entitySenderIdentifier the entitySenderIdentifier to set
	 */
	public void setEntitySenderIdentifier(String entitySenderIdentifier) {
		this.entitySenderIdentifier = entitySenderIdentifier;
	}
	
	/**
	 * @return the entityReceiverIdentifier
	 */
	public String getEntityReceiverIdentifier() {
		return entityReceiverIdentifier;
	}
	
	/**
	 * @param entityReceiverIdentifier the entityReceiverIdentifier to set
	 */
	public void setEntityReceiverIdentifier(String entityReceiverIdentifier) {
		this.entityReceiverIdentifier = entityReceiverIdentifier;
	}
	
	/**
	 * @return the senderFileId
	 */
	public String getSenderFileId() {
		return senderFileId;
	}
	
	/**
	 * @param senderFileId the senderFileId to set
	 */
	public void setSenderFileId(String senderFileId) {
		this.senderFileId = senderFileId;
	}
	
	/**
	 * @return the idesFileNm
	 */
	public String getIdesFileNm() {
		return idesFileNm;
	}
	
	/**
	 * @param idesFileNm the idesFileNm to set
	 */
	public void setIdesFileNm(String idesFileNm) {
		this.idesFileNm = idesFileNm;
	}
	
	/**
	 * @return the taxYr
	 */
	public Long getTaxYr() {
		return taxYr;
	}
	
	/**
	 * @param taxYr the taxYr to set
	 */
	public void setTaxYr(Long taxYr) {
		this.taxYr = taxYr;
	}
	
	/**
	 * @return the fileCreateTs
	 */
	public Date getFileCreateTs() {
		return fileCreateTs;
	}
	
	/**
	 * @param fileCreateTs the fileCreateTs to set
	 */
	public void setFileCreateTs(Date fileCreateTs) {
		this.fileCreateTs = fileCreateTs;
	}
	
	/**
	 * @return the fileFormatCd
	 */
	public String getFileFormatCd() {
		return fileFormatCd;
	}
	
	/**
	 * @param fileFormatCd the fileFormatCd to set
	 */
	public void setFileFormatCd(String fileFormatCd) {
		this.fileFormatCd = fileFormatCd;
	}
	
	/**
	 * @return the binaryEncodingSchemeCd
	 */
	public String getBinaryEncodingSchemeCd() {
		return binaryEncodingSchemeCd;
	}
	
	/**
	 * @param binaryEncodingSchemeCd the binaryEncodingSchemeCd to set
	 */
	public void setBinaryEncodingSchemeCd(String binaryEncodingSchemeCd) {
		this.binaryEncodingSchemeCd = binaryEncodingSchemeCd;
	}
	
	/**
	 * @return the compressedFileSizeKbQty
	 */
	public Long getCompressedFileSizeKbQty() {
		return compressedFileSizeKbQty;
	}
	
	/**
	 * @param compressedFileSizeKbQty the compressedFileSizeKbQty to set
	 */
	public void setCompressedFileSizeKbQty(Long compressedFileSizeKbQty) {
		this.compressedFileSizeKbQty = compressedFileSizeKbQty;
	}
	
	/**
	 * @return the senderContactEmailTxt
	 */
	public String getSenderContactEmailTxt() {
		return senderContactEmailTxt;
	}
	
	/**
	 * @param senderContactEmailTxt the senderContactEmailTxt to set
	 */
	public void setSenderContactEmailTxt(String senderContactEmailTxt) {
		this.senderContactEmailTxt = senderContactEmailTxt;
	}
	
	/**
	 * @return the createdById
	 */
	public String getCreatedById() {
		return createdById;
	}
	
	/**
	 * @param createdById the createdById to set
	 */
	public void setCreatedById(String createdById) {
		this.createdById = createdById;
	}
	
	/**
	 * @return the createTs
	 */
	public Date getCreateTs() {
		return createTs;
	}
	
	/**
	 * @param createTs the createTs to set
	 */
	public void setCreateTs(Date createTs) {
		this.createTs = createTs;
	}
	
	/**
	 * @return the updatedById
	 */
	public String getUpdatedById() {
		return updatedById;
	}
	
	/**
	 * @param updatedById the updatedById to set
	 */
	public void setUpdatedById(String updatedById) {
		this.updatedById = updatedById;
	}
	
	/**
	 * @return the updateTs
	 */
	public Date getUpdateTs() {
		return updateTs;
	}
	
	/**
	 * @param updateTs the updateTs to set
	 */
	public void setUpdateTs(Date updateTs) {
		this.updateTs = updateTs;
	}
	
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((alertReasonCd == null) ? 0 : alertReasonCd.hashCode());
		result = prime * result + ((alertRecipientTypeCd == null) ? 0 : alertRecipientTypeCd.hashCode());
		result = prime * result + ((alertTypeCd == null) ? 0 : alertTypeCd.hashCode());
		result = prime * result + ((binaryEncodingSchemeCd == null) ? 0 : binaryEncodingSchemeCd.hashCode());
		result = prime * result + ((compressedFileSizeKbQty == null) ? 0 : compressedFileSizeKbQty.hashCode());
		result = prime * result + ((createTs == null) ? 0 : createTs.hashCode());
		result = prime * result + ((createdById == null) ? 0 : createdById.hashCode());
		result = prime * result + ((entityCommunicationTypeCd == null) ? 0 : entityCommunicationTypeCd.hashCode());
		result = prime * result + ((entityReceiverIdentifier == null) ? 0 : entityReceiverIdentifier.hashCode());
		result = prime * result + ((entitySenderIdentifier == null) ? 0 : entitySenderIdentifier.hashCode());
		result = prime * result + ((fileCreateTs == null) ? 0 : fileCreateTs.hashCode());
		result = prime * result + ((fileFormatCd == null) ? 0 : fileFormatCd.hashCode());
		result = prime * result + ((fileRevisionInd == null) ? 0 : fileRevisionInd.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((idesFileNm == null) ? 0 : idesFileNm.hashCode());
		result = prime * result + ((idesTransmissionId == null) ? 0 : idesTransmissionId.hashCode());
		result = prime * result + ((originalIdesTransmissionId == null) ? 0 : originalIdesTransmissionId.hashCode());
		result = prime * result + ((senderContactEmailTxt == null) ? 0 : senderContactEmailTxt.hashCode());
		result = prime * result + ((senderFileId == null) ? 0 : senderFileId.hashCode());
		result = prime * result + ((taxYr == null) ? 0 : taxYr.hashCode());
		result = prime * result + ((updateTs == null) ? 0 : updateTs.hashCode());
		result = prime * result + ((updatedById == null) ? 0 : updatedById.hashCode());
		return result;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Alert))
			return false;
		Alert other = (Alert) obj;
		if (alertReasonCd == null) {
			if (other.alertReasonCd != null)
				return false;
		} else if (!alertReasonCd.equals(other.alertReasonCd))
			return false;
		if (alertRecipientTypeCd == null) {
			if (other.alertRecipientTypeCd != null)
				return false;
		} else if (!alertRecipientTypeCd.equals(other.alertRecipientTypeCd))
			return false;
		if (alertTypeCd == null) {
			if (other.alertTypeCd != null)
				return false;
		} else if (!alertTypeCd.equals(other.alertTypeCd))
			return false;
		if (binaryEncodingSchemeCd == null) {
			if (other.binaryEncodingSchemeCd != null)
				return false;
		} else if (!binaryEncodingSchemeCd.equals(other.binaryEncodingSchemeCd))
			return false;
		if (compressedFileSizeKbQty == null) {
			if (other.compressedFileSizeKbQty != null)
				return false;
		} else if (!compressedFileSizeKbQty.equals(other.compressedFileSizeKbQty))
			return false;
		if (createTs == null) {
			if (other.createTs != null)
				return false;
		} else if (!createTs.equals(other.createTs))
			return false;
		if (createdById == null) {
			if (other.createdById != null)
				return false;
		} else if (!createdById.equals(other.createdById))
			return false;
		if (entityCommunicationTypeCd == null) {
			if (other.entityCommunicationTypeCd != null)
				return false;
		} else if (!entityCommunicationTypeCd.equals(other.entityCommunicationTypeCd))
			return false;
		if (entityReceiverIdentifier == null) {
			if (other.entityReceiverIdentifier != null)
				return false;
		} else if (!entityReceiverIdentifier.equals(other.entityReceiverIdentifier))
			return false;
		if (entitySenderIdentifier == null) {
			if (other.entitySenderIdentifier != null)
				return false;
		} else if (!entitySenderIdentifier.equals(other.entitySenderIdentifier))
			return false;
		if (fileCreateTs == null) {
			if (other.fileCreateTs != null)
				return false;
		} else if (!fileCreateTs.equals(other.fileCreateTs))
			return false;
		if (fileFormatCd == null) {
			if (other.fileFormatCd != null)
				return false;
		} else if (!fileFormatCd.equals(other.fileFormatCd))
			return false;
		if (fileRevisionInd == null) {
			if (other.fileRevisionInd != null)
				return false;
		} else if (!fileRevisionInd.equals(other.fileRevisionInd))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (idesFileNm == null) {
			if (other.idesFileNm != null)
				return false;
		} else if (!idesFileNm.equals(other.idesFileNm))
			return false;
		if (idesTransmissionId == null) {
			if (other.idesTransmissionId != null)
				return false;
		} else if (!idesTransmissionId.equals(other.idesTransmissionId))
			return false;
		if (originalIdesTransmissionId == null) {
			if (other.originalIdesTransmissionId != null)
				return false;
		} else if (!originalIdesTransmissionId.equals(other.originalIdesTransmissionId))
			return false;
		if (senderContactEmailTxt == null) {
			if (other.senderContactEmailTxt != null)
				return false;
		} else if (!senderContactEmailTxt.equals(other.senderContactEmailTxt))
			return false;
		if (senderFileId == null) {
			if (other.senderFileId != null)
				return false;
		} else if (!senderFileId.equals(other.senderFileId))
			return false;
		if (taxYr == null) {
			if (other.taxYr != null)
				return false;
		} else if (!taxYr.equals(other.taxYr))
			return false;
		if (updateTs == null) {
			if (other.updateTs != null)
				return false;
		} else if (!updateTs.equals(other.updateTs))
			return false;
		if (updatedById == null) {
			if (other.updatedById != null)
				return false;
		} else if (!updatedById.equals(other.updatedById))
			return false;
		return true;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Alert [id=" + id + ", entityCommunicationTypeCd=" + entityCommunicationTypeCd + ", idesTransmissionId="
				+ idesTransmissionId + ", fileRevisionInd=" + fileRevisionInd + ", originalIdesTransmissionId="
				+ originalIdesTransmissionId + ", alertRecipientTypeCd=" + alertRecipientTypeCd + ", alertTypeCd="
				+ alertTypeCd + ", alertReasonCd=" + alertReasonCd + ", entitySenderIdentifier="
				+ entitySenderIdentifier + ", entityReceiverIdentifier=" + entityReceiverIdentifier + ", senderFileId="
				+ senderFileId + ", idesFileNm=" + idesFileNm + ", taxYr=" + taxYr + ", fileCreateTs=" + fileCreateTs
				+ ", fileFormatCd=" + fileFormatCd + ", binaryEncodingSchemeCd=" + binaryEncodingSchemeCd
				+ ", compressedFileSizeKbQty=" + compressedFileSizeKbQty + ", senderContactEmailTxt="
				+ senderContactEmailTxt + ", createdById=" + createdById + ", createTs=" + createTs + ", updatedById="
				+ updatedById + ", updateTs=" + updateTs + "]";
	}
	
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;

import org.springframework.stereotype.Service;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Service
public class TaxYrTypeFormatter {
	private SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
	/*
	<code>static block</code> below further initializes the formatter object, notes about <code>static blocks</code>
		- if initialization of static variables requires some additional logic except the assignment
		- if the initialization of static variables is error-prone and requires exception handling
		- a class can have multiple static blocks
		- static fields and static blocks are resolved and executed in the same order as they are present in the class
	 
	static {
		formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
	}
	*/
	
	public TaxYrTypeFormatter() {
		formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
	}
	
	public String format(XMLGregorianCalendar xCal) {
		return xCal.toXMLFormat();
	}
	
	public XMLGregorianCalendar parse(String v) throws DatatypeConfigurationException {
		Date date;
		try {
			v += "-01-01T06:00:01Z";
			date = formatter.parse(v);
			System.out.println(date);
		} catch (Exception e) {
			date = new Date();
			//e.printStackTrace();
			System.out.println("Encountered exception parsing [" + v + "] as Date object\n" + e.getMessage());
		}
		
		GregorianCalendar gCal = new GregorianCalendar();
		//gCal.setTimeZone(TimeZone.getTimeZone("UTC"));
		gCal.setTimeInMillis(date.getTime());
		XMLGregorianCalendar xCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gCal);
		System.out.println(xCal.getYear());
		return xCal;
	}
	
}
<file_sep>drop table if exists INCOMING_UPLOAD;
create table if not exists INCOMING_UPLOAD(
	ID bigint primary key auto_increment,
	COMMUNICATION_TYPE_CD varchar(10) not null,
	ENTITY_SENDER_ID varchar(24) not null,
	ENTITY_RECEIVER_ID varchar(24) not null,
	IDES_FILE_NM varchar(200) not null,
	SENDER_FILE_ID varchar(200) not null,
	FILE_SIZE_KB_QTY bigint,
	ALERT_ID bigint,
	ALERT_STATUS char(2) not null,
	ALERT_SENT_TS timestamp(6),
	CREATED_BY_ID varchar(24) not null,
	CREATE_TS timestamp(6) not null,
	UPDATED_BY_ID varchar(24),
	UPDATE_TS timestamp(6)
);

drop table if exists OUTGOING_DOWNLOAD;
create table OUTGOING_DOWNLOAD(
	ID bigint primary key auto_increment,
	COMMUNICATION_TYPE_CD varchar(10) not null,
	ENTITY_SENDER_ID varchar(24) not null,
	ENTITY_RECEIVER_ID varchar(24) not null,
	IDES_FILE_NM varchar(200) not null,
	SENDER_FILE_ID varchar(200) not null,
	FILE_LOCATION varchar(200) not null,
	COMPRESSED_FILE_SIZE_KB_QTY bigint,
	CREATED_BY_ID varchar(24) not null,
	CREATE_TS timestamp(6) not null,
	UPDATED_BY_ID varchar(24),
	UPDATE_TS timestamp(6)
);

drop table if exists ALERT;
create table if not exists ALERT(
	ID bigint primary key auto_increment,
	ALERT_STATUS char(2) not null,
	ENTITY_COMMUNICATION_TYPE_CD varchar(10) not null,
	IDES_TRANSMISSION_ID varchar(32) not null,
	FILE_REVISION_IND char(1),
	ORIGINAL_IDES_TRANSMISSION_ID varchar(32),
	ALERT_RECIPIENT_TYPE_CD char(2) not null,
	ALERT_TYPE_CD varchar(5) not null,
	ALERT_REASON_CD varchar(5) not null,
	ENTITY_SENDER_ID varchar(24) not null,
	ENTITY_RECEIVER_ID varchar(24) not null,
	SENDER_FILE_ID varchar(200) not null,
	IDES_FILE_NM varchar(200) not null,
	TAX_YR bigint,
	FILE_CREATE_TS timestamp(6),
	FILE_FORMAT_CD varchar(10),
	BINARY_ENCODING_SCHEME_CD varchar(10),
	COMPRESSED_FILE_SIZE_KB_QTY bigint,
	SENDER_CONTACT_EMAIL_TXT varchar(200),
	CREATED_BY_ID varchar(24) not null,
	CREATE_TS timestamp(6) not null,
	UPDATED_BY_ID varchar(24),
	UPDATE_TS timestamp(6)
);<file_sep>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2019.08.08 at 01:18:40 PM EDT 
//


package ides.msg.ctsfilestatusmessage;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;


/**
 * 
 * <pre>
 * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Component xmlns="urn:ides:msg:ctsfilestatusmessage" xmlns:ides="urn:ides" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;DictionaryEntryNm&gt;CTS File Status Response Type&lt;/DictionaryEntryNm&gt;&lt;MajorVersionNum&gt;1&lt;/MajorVersionNum&gt;&lt;MinorVersionNum&gt;0&lt;/MinorVersionNum&gt;&lt;VersionEffectiveBeginDt&gt;2018-02-07&lt;/VersionEffectiveBeginDt&gt;&lt;VersionDescriptionTxt&gt;Initial version&lt;/VersionDescriptionTxt&gt;&lt;DescriptionTxt&gt;Type for message for the CTS File Status response&lt;/DescriptionTxt&gt;&lt;/Component&gt;
 * </pre>
 * 
 * 
 * <p>Java class for CTSFileStatusResponseType complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="CTSFileStatusResponseType"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element ref="{urn:ides}ReceiptTs"/&gt;
 *         &lt;element ref="{urn:ides}IDESSendingTs"/&gt;
 *         &lt;element ref="{urn:ides}SenderFileId"/&gt;
 *         &lt;element ref="{urn:ides}CTSTransmissionId"/&gt;
 *         &lt;element ref="{urn:ides}CTSStatusCd"/&gt;
 *       &lt;/sequence&gt;
 *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" fixed="1.0" /&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CTSFileStatusResponseType", propOrder = {
    "receiptTs",
    "idesSendingTs",
    "senderFileId",
    "ctsTransmissionId",
    "ctsStatusCd"
})
public class CTSFileStatusResponseType {

    @XmlElement(name = "ReceiptTs", namespace = "urn:ides", required = true)
    protected String receiptTs;
    @XmlElement(name = "IDESSendingTs", namespace = "urn:ides", required = true)
    protected String idesSendingTs;
    @XmlElement(name = "SenderFileId", namespace = "urn:ides", required = true)
    protected String senderFileId;
    @XmlElement(name = "CTSTransmissionId", namespace = "urn:ides", required = true)
    protected String ctsTransmissionId;
    @XmlElement(name = "CTSStatusCd", namespace = "urn:ides", required = true)
    protected String ctsStatusCd;
    @XmlAttribute(name = "version")
    protected String version;

    /**
     * Gets the value of the receiptTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getReceiptTs() {
        return receiptTs;
    }

    /**
     * Sets the value of the receiptTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setReceiptTs(String value) {
        this.receiptTs = value;
    }

    /**
     * Gets the value of the idesSendingTs property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIDESSendingTs() {
        return idesSendingTs;
    }

    /**
     * Sets the value of the idesSendingTs property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIDESSendingTs(String value) {
        this.idesSendingTs = value;
    }

    /**
     * Gets the value of the senderFileId property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getSenderFileId() {
        return senderFileId;
    }

    /**
     * Sets the value of the senderFileId property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setSenderFileId(String value) {
        this.senderFileId = value;
    }

    /**
     * Gets the value of the ctsTransmissionId property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCTSTransmissionId() {
        return ctsTransmissionId;
    }

    /**
     * Sets the value of the ctsTransmissionId property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCTSTransmissionId(String value) {
        this.ctsTransmissionId = value;
    }

    /**
     * Gets the value of the ctsStatusCd property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCTSStatusCd() {
        return ctsStatusCd;
    }

    /**
     * Sets the value of the ctsStatusCd property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCTSStatusCd(String value) {
        this.ctsStatusCd = value;
    }

    /**
     * Gets the value of the version property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getVersion() {
        if (version == null) {
            return "1.0";
        } else {
            return version;
        }
    }

    /**
     * Sets the value of the version property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setVersion(String value) {
        this.version = value;
    }

}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.service;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import corp.pdb.aea.data.model.Alert;
import corp.pdb.aea.data.model.OutgoingDownload;
import corp.pdb.aea.data.model.enums.AlertStatusEnum;
import corp.pdb.aea.data.repository.AlertRepository;
import corp.pdb.aea.data.repository.OutgoingDownloadRepository;
import ides.EntityCommunicationTypeCdType;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Service
public class OutgoingDownloadAlertService {
	@Autowired
	TransmitAlertService transmitAlertService;
	@Autowired
	AlertRepository alertRepository;
	@Autowired
	OutgoingDownloadRepository outgoingDownloadRepository;
	
	String[] errorTransmissionIds = {"FDOWNSRVCBCCLIENTIMPL_TRANSID_32", "FDOWNSRVCBCCLIENTIMPL_TRANSID_33",
			"FDOWNSRVCBCCLIENTIMPL_TRANSID_34", "FDOWNSRVCBCCLIENTIMPL_TRANSID_35", "FDOWNSRVCBCCLIENTIMPL_TRANSID_36",
			"FDOWNSRVCBCCLIENTIMPL_TRANSID_37", "FDOWNSRVCBCCLIENTIMPL_TRANSID_38", "FDOWNSRVCBCCLIENTIMPL_TRANSID_39",
			"FDOWNSRVCBCCLIENTIMPL_TRANSID_40", "FDOWNSRVCBCCLIENTIMPL_TRANSID_41", "FDOWNSRVCBCCLIENTIMPL_TRANSID_42",
			"FDOWNSRVCBCCLIENTIMPL_TRANSID_43", "FDOWNSRVCBCCLIENTIMPL_TRANSID_44", "FDOWNSRVCBCCLIENTIMPL_TRANSID_45",
			"FDOWNSRVCBCCLIENTIMPL_TRANSID_46", "FDOWNSRVCBCCLIENTIMPL_TRANSID_47", "FDOWNSRVCBCCLIENTIMPL_TRANSID_48",
			"FDOWNSRVCBCCLIENTIMPL_TRANSID_49", "FDOWNSRVCBCCLIENTIMPL_TRANSID_50", "FDOWNSRVCBCCLIENTIMPL_TRANSID_51"};
	
	public String constructAndTransmit() {
		String landingPage = "";
		
		List<OutgoingDownload> outgoingDownloads = outgoingDownloadRepository.findAll();
		for(OutgoingDownload outgoingDownload : outgoingDownloads) {
			try {
				Alert alertToSend = constructAlertFromOutgoingDownload(outgoingDownload);
				landingPage = transmitAlertService.transmit(alertToSend);
				if(landingPage.equals("500"))
					break;
			} catch(Exception e) {
				landingPage = "500";
				break;
			}
		}
		
		return landingPage;
	}
	
	public String constructAndTransmitFaultCase() {
		String landingPage = "";
		
		for(String errorTransmissionId : errorTransmissionIds) {
			try {
				Alert alertToSend = constructAlertForFaultCases(errorTransmissionId);
				landingPage = transmitAlertService.transmit(alertToSend);
				if(landingPage.equals("500"))
					break;
			} catch(Exception e) {
				landingPage = "500";
				break;
			}
		}
		
		return landingPage;
	}
	
	protected Alert constructAlertFromOutgoingDownload(OutgoingDownload outgoingDownload) {
		Date createDate = new Date();
		Alert alert = new Alert();
		
		alert.setAlertStatus(AlertStatusEnum.SE);
		alert.setEntityCommunicationTypeCd(outgoingDownload.getCommunicationTypeCd());
		alert.setIdesTransmissionId(outgoingDownload.getIdesFileNm());
		alert.setFileRevisionInd("N");
		alert.setAlertRecipientTypeCd("CR");
		alert.setAlertTypeCd("RD");
		alert.setAlertReasonCd("RC021");
		alert.setEntitySenderIdentifier(outgoingDownload.getEntitySenderIdentifier());
		alert.setEntityReceiverIdentifier(outgoingDownload.getEntityReceiverIdentifier());
		alert.setSenderFileId(outgoingDownload.getSenderFileId());
		alert.setIdesFileNm(outgoingDownload.getIdesFileNm());
		alert.setTaxYr(Long.valueOf(2017));
		alert.setFileCreateTs(createDate);
		alert.setFileFormatCd("XML");
		alert.setBinaryEncodingSchemeCd("NONE");
		alert.setCompressedFileSizeKbQty(outgoingDownload.getCompressedFileSizeKbQty());
		alert.setCreatedById("ALERTCLI");
		alert.setCreateTs(createDate);
		
		alert = alertRepository.save(alert);
		return alert;
	}
	
	protected Alert constructAlertForFaultCases(String idesTransmissionId) {
		Date createDate = new Date();
		Alert alert = new Alert();
		
		alert.setAlertStatus(AlertStatusEnum.SE);
		alert.setEntityCommunicationTypeCd(EntityCommunicationTypeCdType.CBC.name());
		alert.setIdesTransmissionId(idesTransmissionId);
		alert.setFileRevisionInd("N");
		alert.setAlertRecipientTypeCd("CR");
		alert.setAlertTypeCd("RD");
		alert.setAlertReasonCd("RC021");
		alert.setEntitySenderIdentifier("CA");
		alert.setEntityReceiverIdentifier("US.00");
		alert.setSenderFileId("fault case senderFileId");
		alert.setIdesFileNm("fault case idesFileNm");
		alert.setTaxYr(Long.valueOf(2017));
		alert.setFileCreateTs(createDate);
		alert.setFileFormatCd("XML");
		alert.setBinaryEncodingSchemeCd("NONE");
		alert.setCompressedFileSizeKbQty(Long.valueOf(10));
		alert.setCreatedById("ALERTCLI");
		alert.setCreateTs(createDate);
		
		alert = alertRepository.save(alert);
		return alert;
	}
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.ws.client;

/*import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;*/

import javax.xml.bind.JAXBElement;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.ws.client.core.WebServiceTemplate;

import corp.pdb.aea.util.TimestampTypeFormatter;
/*import ides.AlertRecipientTypeCdType;
import ides.BinaryEncodingSchemeCdType;
import ides.EntityCommunicationTypeCdType;
import ides.EntityIdentifierType;
import ides.FileFormatCdType;*/
import ides.msg.idesalertmessage.IDESAlertRequestType;
import ides.msg.idesalertmessage.IDESAlertResponseType;
import ides.msg.idesalertmessage.ObjectFactory;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Component
public class IDESAlertServiceClientImpl implements InitializingBean {
	private static final Logger LOGGER = LogManager.getLogger(IDESAlertServiceClientImpl.class);
	//private Map<Integer, String[]> valuesMap;
	@Autowired
	private WebServiceTemplate idesAlertServiceTemplate;
	@Autowired
	TimestampTypeFormatter timestampTypeFormatter;
	
	public IDESAlertResponseType idesAlertRequestOperation(IDESAlertRequestType alertRequestBody) {
		LOGGER.debug("Entering idesAlertRequestOperation method");
		/*ObjectFactory factory = new ObjectFactory();
		IDESAlertRequestType requestBody = factory.createIDESAlertRequestType();
		requestBody.setRequestSentTs(timestampTypeFormatter.generateTimestamp());
		//requestBody.setIDESTransmissionId("A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6");
		requestBody.setIDESSendingTs(timestampTypeFormatter.generateTimestamp());
		requestBody.setIDESReceivedTs(timestampTypeFormatter.generateTimestamp());
		//requestBody.setIDESFileNm("A200CharacterStringWhichSpecifiesThe.FileName");
		requestBody.setAlertRecipientTypeCd(AlertRecipientTypeCdType.CS);
		
		EntityIdentifierType senderEntityType = new EntityIdentifierType();
		senderEntityType.setCTSCountryCd("US.00");
		requestBody.setEntitySenderIdentifier(senderEntityType);
		
		
		
		requestBody.setAlertTypeCd("SA");
		requestBody.setAlertReasonCd("RC034");
		
		
		//requestBody.setSenderFileId("A200CharacterStringWithFormat=[CountryCdSender_CountryCdReceiver_CommunicationType_MessageRefID]");
		requestBody.setFileFormatCd(FileFormatCdType.XML);
		requestBody.setBinaryEncodingSchemeCd(BinaryEncodingSchemeCdType.NONE);
		requestBody.setFileCreateTs(timestampTypeFormatter.generateTimestamp());*/

		/*try {
			XMLGregorianCalendar taxYear = DatatypeFactory.newInstance().newXMLGregorianCalendar();
			requestBody.setTaxYear(taxYear);
			LOGGER.trace("taxYear=[{}]", taxYear.getYear());
		} catch (DatatypeConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		//Need to provide this as parameter
		/*EntityIdentifierType receiverEntityType = new EntityIdentifierType();
		receiverEntityType.setCTSCountryCd("CA");
		requestBody.setEntityReceiverIdentifier(receiverEntityType);
		requestBody.setEntityCommunicationTypeCd(EntityCommunicationTypeCdType.CBC);
		
		requestBody.setCompressedFileSizeKBQty(new BigInteger("25"));
		requestBody.setFileRevisionInd(false);
		
		JAXBElement<IDESAlertRequestType> request;
		JAXBElement<IDESAlertResponseType> response;
		if((!this.valuesMap.isEmpty()) && (this.valuesMap != null)) {
			for(int i=0; i<valuesMap.size(); i++) {
				String[] valueMap = valuesMap.get(Integer.valueOf(i));
				requestBody.setIDESTransmissionId(valueMap[0]);
				requestBody.setIDESFileNm(valueMap[1]);
				requestBody.setSenderFileId(valueMap[2]);
				request = factory.createIDESAlertRequest(requestBody);
				response = (JAXBElement<IDESAlertResponseType>) idesAlertServiceTemplate.marshalSendAndReceive(request);
				LOGGER.trace("Received response: IDESTransmissionId=[{}], ReceiptTs=[{}]", response.getValue().getIDESTransmissionId(), response.getValue().getReceiptTs());
			}
		} else {
			requestBody.setIDESTransmissionId("ALERTSRVCBCCLIENTIMPL_TRANSID_99");
			requestBody.setIDESFileNm("ALERTSRVCBCCLIENTIMPL_TRANSID_99.tar.gz");
			requestBody.setSenderFileId("ALERTSRVCBCCLIENTIMPL_TRANSID_99_SF_SEnderFileId");
			requestBody.setAlertReasonCd("RC001");
			request = factory.createIDESAlertRequest(requestBody);
			response = (JAXBElement<IDESAlertResponseType>) idesAlertServiceTemplate.marshalSendAndReceive(request);
			LOGGER.trace("Received response: IDESTransmissionId=[{}], ReceiptTs=[{}]", response.getValue().getIDESTransmissionId(), response.getValue().getReceiptTs());
		}*/
		ObjectFactory factory = new ObjectFactory();
		JAXBElement<IDESAlertRequestType> alertRequest = factory.createIDESAlertRequest(alertRequestBody);
		@SuppressWarnings("unchecked")
		JAXBElement<IDESAlertResponseType> alertResponse = (JAXBElement<IDESAlertResponseType>) idesAlertServiceTemplate.marshalSendAndReceive(alertRequest);
		return alertResponse.getValue();
		/*IDESAlertResponseType alertResponseBody = alertResponse.getValue();
		return alertResponseBody;*/
		
		/*IDESAlertResponseType responseBody = response.getValue();
		
		return (responseBody.getIDESTransmissionId() + ": " + responseBody.getAlertTypeCd());*/
	}
	
	@Override
	public void afterPropertiesSet() throws Exception {
		/*this.valuesMap = new HashMap<Integer, String[]>();
		valuesMap.put(Integer.valueOf(0), new String[]{"OUTUPSRVCBCCLIENTIMPL_TRANSID_01", "US.00_CA_CBC_US2023-595d10b0ca1540d3a14fe8b594b350de.zip", "US.00_CA_CBC_US2023-595d10b0ca1540d3a14fe8b594b350de"});
		valuesMap.put(Integer.valueOf(1), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_02", "US.00_DE_CBCStatus_StatusUS2018DEc8b839e5de4b42bab1b08d068bf5acad.zip", "US.00_DE_CBCStatus_StatusUS2018DEc8b839e5de4b42bab1b08d068bf5acad"});
		valuesMap.put(Integer.valueOf(2), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_03", "US.00_NL_CBCStatus_StatusUS2023NLb57d1c836b6f4edaa94f40408531222a.zip", "US.00_NL_CBCStatus_StatusUS2023NLb57d1c836b6f4edaa94f40408531222a"});
		valuesMap.put(Integer.valueOf(3), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_04", "US.00_NL_CBCStatus_StatusUS2023NL86f80ced1bfc47939ffb1941fd12da64.zip", "US.00_NL_CBCStatus_StatusUS2023NL86f80ced1bfc47939ffb1941fd12da64"});
		valuesMap.put(Integer.valueOf(4), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_05", "US.00_DE_CBCStatus_StatusUS2018DEb525af0d34294319a05bbb58c29d683b.zip", "US.00_DE_CBCStatus_StatusUS2018DEb525af0d34294319a05bbb58c29d683b"});
		valuesMap.put(Integer.valueOf(5), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_06", "US.00_DE_CBCStatus_StatusUS2018DE501813414f2d4e14871c03660683d102.zip", "US.00_DE_CBCStatus_StatusUS2018DE501813414f2d4e14871c03660683d102"});
		valuesMap.put(Integer.valueOf(6), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_07", "US.00_NL_CBCStatus_StatusUS2023NLf0c9d1d42e4a4053ab56d2a9e0157335.zip", "US.00_NL_CBCStatus_StatusUS2023NLf0c9d1d42e4a4053ab56d2a9e0157335"});
		valuesMap.put(Integer.valueOf(7), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_08", "US.00_DE_CBCStatus_StatusUS2018DE0d4ceb9857324b0c9649507315087069.zip", "US.00_DE_CBCStatus_StatusUS2018DE0d4ceb9857324b0c9649507315087069"});
		valuesMap.put(Integer.valueOf(8), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_09", "US.00_NL_CBCStatus_StatusUS2023NL2a1e84d7175247f09f1000b5bfa8727a.zip", "US.00_NL_CBCStatus_StatusUS2023NL2a1e84d7175247f09f1000b5bfa8727a"});
		valuesMap.put(Integer.valueOf(9), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_10", "US.00_DE_CBCStatus_StatusUS2018DE365da38e8b9f4347bc3b1f946c0d8e09.zip", "US.00_DE_CBCStatus_StatusUS2018DE365da38e8b9f4347bc3b1f946c0d8e09"});
		valuesMap.put(Integer.valueOf(10), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_11", "US.00_NL_CBCStatus_StatusUS2023NL88c349e84a0a4f8980bf3d3c61e9305b.zip", "US.00_NL_CBCStatus_StatusUS2023NL88c349e84a0a4f8980bf3d3c61e9305b"});
		valuesMap.put(Integer.valueOf(11), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_12", "US.00_NL_CBCStatus_StatusUS2023NLafe77cb293044da38d0c2eb1c9f4fbdc.zip", "US.00_NL_CBCStatus_StatusUS2023NLafe77cb293044da38d0c2eb1c9f4fbdc"});
		valuesMap.put(Integer.valueOf(12), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_13", "US.00_DE_CBCStatus_StatusUS2018DEde774a7fc65a4fed9c5809d6cac475b1.zip", "US.00_DE_CBCStatus_StatusUS2018DEde774a7fc65a4fed9c5809d6cac475b1"});
		valuesMap.put(Integer.valueOf(13), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_14", "US.00_DE_CBCStatus_StatusUS2018DEe0aba382af6b45f18cf474ded84b2ca3.zip", "US.00_DE_CBCStatus_StatusUS2018DEe0aba382af6b45f18cf474ded84b2ca3"});
		valuesMap.put(Integer.valueOf(14), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_15", "US.00_DE_CBCStatus_StatusUS2018DE0ca53bab2e4347fdbc230849d5da2219.zip", "US.00_DE_CBCStatus_StatusUS2018DE0ca53bab2e4347fdbc230849d5da2219"});
		valuesMap.put(Integer.valueOf(15), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_16", "US.00_DE_CBCStatus_StatusUS2018DE069661ec1233406b9dbd41838517d7fe.zip", "US.00_DE_CBCStatus_StatusUS2018DE069661ec1233406b9dbd41838517d7fe"});
		valuesMap.put(Integer.valueOf(16), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_17", "US.00_DE_CBCStatus_StatusUS2018DE64e88d0c74d54373a0eb92b8a0469f87.zip", "US.00_DE_CBCStatus_StatusUS2018DE64e88d0c74d54373a0eb92b8a0469f87"});
		valuesMap.put(Integer.valueOf(17), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_18", "US.00_DE_CBCStatus_StatusUS2018DE81e539699b064ed7a0ba5fd10ca0339b.zip", "US.00_DE_CBCStatus_StatusUS2018DE81e539699b064ed7a0ba5fd10ca0339b"});
		valuesMap.put(Integer.valueOf(18), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_19", "US.00_DE_CBCStatus_StatusUS2018DEf0fac7ed646a4908a53176c4ab978cd1.zip", "US.00_DE_CBCStatus_StatusUS2018DEf0fac7ed646a4908a53176c4ab978cd1"});
		valuesMap.put(Integer.valueOf(19), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_20", "US.00_DE_CBCStatus_StatusUS2018DE485adc306ce749148df971377e336f82.zip", "US.00_DE_CBCStatus_StatusUS2018DE485adc306ce749148df971377e336f82"});
		valuesMap.put(Integer.valueOf(20), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_21", "US.00_DE_CBCStatus_StatusUS2018DE2acf0939fa894a4dac86139bc136e670.zip", "US.00_DE_CBCStatus_StatusUS2018DE2acf0939fa894a4dac86139bc136e670"});
		valuesMap.put(Integer.valueOf(21), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_22", "US.00_DE_CBCStatus_StatusUS2018DE0f9c711ce9b94777b376206c9967ea46.zip", "US.00_DE_CBCStatus_StatusUS2018DE0f9c711ce9b94777b376206c9967ea46"});
		valuesMap.put(Integer.valueOf(22), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_23", "US.00_DE_CBCStatus_StatusUS2018DE98ccd3e4c22a481bb57499e67a964926.zip", "US.00_DE_CBCStatus_StatusUS2018DE98ccd3e4c22a481bb57499e67a964926"});
		valuesMap.put(Integer.valueOf(23), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_24", "US.00_DE_CBCStatus_StatusUS2018DE3f7965e224964e768c7b008d7cc11352.zip", "US.00_DE_CBCStatus_StatusUS2018DE3f7965e224964e768c7b008d7cc11352"});
		valuesMap.put(Integer.valueOf(24), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_25", "US.00_DE_CBCStatus_StatusUS2018DEadce94d812874949a735a0377a3dccb9.zip", "US.00_DE_CBCStatus_StatusUS2018DEadce94d812874949a735a0377a3dccb9"});
		valuesMap.put(Integer.valueOf(25), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_26", "US.00_DE_CBCStatus_StatusUS2018DEc7d9ee04a32c4a5ea62179e7c12ab792.zip", "US.00_DE_CBCStatus_StatusUS2018DEc7d9ee04a32c4a5ea62179e7c12ab792"});
		valuesMap.put(Integer.valueOf(26), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_27", "US.00_DE_CBCStatus_StatusUS2018DE4b261bec0d704926b2310667e425aa12.zip", "US.00_DE_CBCStatus_StatusUS2018DE4b261bec0d704926b2310667e425aa12"});
		valuesMap.put(Integer.valueOf(27), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_28", "US.00_DE_CBCStatus_StatusUS2018DE726cd7c9e61b450c855723d70a9270da.zip", "US.00_DE_CBCStatus_StatusUS2018DE726cd7c9e61b450c855723d70a9270da"});
		valuesMap.put(Integer.valueOf(28), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_29", "US.00_DE_CBCStatus_StatusUS2018DE3fae67d6fa07489e930f9df9eba2f2aa.zip", "US.00_DE_CBCStatus_StatusUS2018DE3fae67d6fa07489e930f9df9eba2f2aa"});
		valuesMap.put(Integer.valueOf(29), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_30", "US.00_DE_CBCStatus_StatusUS2018DE185ea7cd3fc14045bdaa636cc88de9a7.zip", "US.00_DE_CBCStatus_StatusUS2018DE185ea7cd3fc14045bdaa636cc88de9a7"});
		valuesMap.put(Integer.valueOf(30), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_31", "US.00_DE_CBCStatus_StatusUS2018DEaff727463e794feeb58941fbfc421657.zip", "US.00_DE_CBCStatus_StatusUS2018DEaff727463e794feeb58941fbfc421657"});
		valuesMap.put(Integer.valueOf(31), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_32", "US.00_DE_CBCStatus_StatusUS2018DEab44279939b54ded94ab118f388cb38c.zip", "US.00_DE_CBCStatus_StatusUS2018DEab44279939b54ded94ab118f388cb38c"});
		valuesMap.put(Integer.valueOf(32), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_33", "US.00_DE_CBCStatus_StatusUS2018DE0ee81c2468a7420eb43a09092b9862eb.zip", "US.00_DE_CBCStatus_StatusUS2018DE0ee81c2468a7420eb43a09092b9862eb"});
		valuesMap.put(Integer.valueOf(33), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_34", "US.00_DE_CBCStatus_StatusUS2018DE13df8eaf4cc34d0191eb833ae3c1ae52.zip", "US.00_DE_CBCStatus_StatusUS2018DE13df8eaf4cc34d0191eb833ae3c1ae52"});
		valuesMap.put(Integer.valueOf(34), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_35", "US.00_DE_CBCStatus_StatusUS2018DEa418fed6d9024426a7e275358d8e1420.zip", "US.00_DE_CBCStatus_StatusUS2018DEa418fed6d9024426a7e275358d8e1420"});
		valuesMap.put(Integer.valueOf(35), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_36", "US.00_DE_CBCStatus_StatusUS2018DE5c94f71fbf274e82ba637c61dac21ada.zip", "US.00_DE_CBCStatus_StatusUS2018DE5c94f71fbf274e82ba637c61dac21ada"});
		valuesMap.put(Integer.valueOf(36), new String[]{"SMOUTSRVCBCCLIENTIMPL_TRANSID_37", "US.00_DE_CBCStatus_StatusUS2018DE79eb70f383824c4b9fdd9b8c3d5709b9.zip", "US.00_DE_CBCStatus_StatusUS2018DE79eb70f383824c4b9fdd9b8c3d5709b9"});*/
	}
	
	/**
	 * @return the valuesMap
	 */
	/*public Map<Integer, String[]> getValuesMap() {
		return valuesMap;
	}*/
	
	/**
	 * @param valuesMap the valuesMap to set
	 */
	/*public void setValuesMap(Map<Integer, String[]> valuesMap) {
		this.valuesMap = valuesMap;
	}*/
	
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.ws.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import javax.xml.bind.Marshaller;

import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.ws.config.annotation.EnableWs;
import org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter;
import org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor;
import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver;
import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
import org.springframework.ws.soap.server.endpoint.SoapFaultDefinition;
import org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver;
import org.springframework.ws.config.annotation.WsConfigurationSupport;
import org.springframework.ws.transport.http.MessageDispatcherServlet;
import org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition;
import org.springframework.ws.wsdl.wsdl11.Wsdl11Definition;
import org.springframework.xml.xsd.SimpleXsdSchema;

import corp.pdb.aea.ws.exceptions.impl.app.FileNotFoundException;
import corp.pdb.aea.ws.exceptions.impl.fault.DetailSoapFaultDefinitionExceptionResolver;

/**
 * @author waleed.k.al-jaradat
 *
 */
@EnableWs
@Configuration
public class WsServiceEndpointsConfig extends WsConfigurationSupport {
	/*
	 * Configuring servlet type and mapping for handling incoming web traffic
	 */
	@Bean
	public ServletRegistrationBean<MessageDispatcherServlet> messageDispatcherServlet(ApplicationContext applicationContext) {
		MessageDispatcherServlet mdServlet = new MessageDispatcherServlet();
		mdServlet.setApplicationContext(applicationContext);
		
		return new ServletRegistrationBean<MessageDispatcherServlet>(mdServlet, "/icmm/idt/cbc/services/*");
	}
	
	@Bean
	public SoapFaultMappingExceptionResolver exceptionResolver() {
		SoapFaultMappingExceptionResolver exceptionResolver = new DetailSoapFaultDefinitionExceptionResolver();
		SoapFaultDefinition faultDefinition = new SoapFaultDefinition();
		faultDefinition.setFaultCode(SoapFaultDefinition.SERVER);
		exceptionResolver.setDefaultFault(faultDefinition);
		
		Properties errorMappings = new Properties();
		errorMappings.put(FileNotFoundException.class, SoapFaultDefinition.SERVER.toString());
		exceptionResolver.setExceptionMappings(errorMappings);
		exceptionResolver.setOrder(1);
		return exceptionResolver;
	}
	
	@Bean(name="AccessCtsFileStatusRequestPortService")
	public Wsdl11Definition ctsFileStatusServiceWsdlDefinition() {
		SimpleWsdl11Definition ctsFileStatusServiceWsdl = new SimpleWsdl11Definition();
		ctsFileStatusServiceWsdl.setWsdl(new ClassPathResource("/schemas/SRV-CBC/CBC-CTSFileStatusService.wsdl"));
		
		return ctsFileStatusServiceWsdl;
	}
	
	@Bean(name="AccessDownloadAcknowledgementRequestPortService")
	public Wsdl11Definition downloadAckngServiceWsdlDefinition() {
		SimpleWsdl11Definition downloadAckngServiceWsdl = new SimpleWsdl11Definition();
		downloadAckngServiceWsdl.setWsdl(new ClassPathResource("/schemas/SRV-CBC/CBC-DownloadAcknowledgementService.wsdl"));
		
		return downloadAckngServiceWsdl;
	}
	
	@Bean(name="AccessFileDownloadRequestPortService")
	public Wsdl11Definition fileDownloadServiceWsdlDefinition() {
		SimpleWsdl11Definition fileDownloadServiceWsdl = new SimpleWsdl11Definition();
		fileDownloadServiceWsdl.setWsdl(new ClassPathResource("/schemas/SRV-CBC/CBC-FileDownloadService.wsdl"));
		
		return fileDownloadServiceWsdl;
	}
	
	@Bean(name="AccessFileUploadRequestPortService")
	public Wsdl11Definition fileUploadServiceWsdlDefinition() {
		SimpleWsdl11Definition fileUploadServiceWsdl = new SimpleWsdl11Definition();
		fileUploadServiceWsdl.setWsdl(new ClassPathResource("/schemas/SRV-CBC/CBC-FileUploadService.wsdl"));
		
		return fileUploadServiceWsdl;
	}
	
	@Bean(name="MSG-CTSFileStatusMessage-1.6")
	public SimpleXsdSchema ctsFileStatusMessageXsdDefinition() {
		SimpleXsdSchema ctsFileStatusMessageXsd = new SimpleXsdSchema();
		ctsFileStatusMessageXsd.setXsd(new ClassPathResource("/schemas/SRV-CBC/MSG/MSG-CTSFileStatusMessage-1.7.xsd"));
		
		return ctsFileStatusMessageXsd;
	}
	
	@Bean(name="MSG-DownloadAcknowledgementMessage-1.6")
	public SimpleXsdSchema downloadAckngMessageXsdDefinition() {
		SimpleXsdSchema downloadAckngMessageXsd = new SimpleXsdSchema();
		downloadAckngMessageXsd.setXsd(new ClassPathResource("/schemas/SRV-CBC/MSG/MSG-DownloadAcknowledgementMessage-1.7.xsd"));
		
		return downloadAckngMessageXsd;
	}
	
	@Bean(name="MSG-FileDownloadMessage-1.6")
	public SimpleXsdSchema fileDownloadMessageXsdDefinition() {
		SimpleXsdSchema fileDownloadMessageXsd = new SimpleXsdSchema();
		fileDownloadMessageXsd.setXsd(new ClassPathResource("/schemas/SRV-CBC/MSG/MSG-FileDownloadMessage-1.7.xsd"));
		
		return fileDownloadMessageXsd;
	}
	
	@Bean(name="MSG-FileUploadMessage-1.6")
	public SimpleXsdSchema fileUploadMessageXsdDefinition() {
		SimpleXsdSchema fileUploadMessageXsd = new SimpleXsdSchema();
		fileUploadMessageXsd.setXsd(new ClassPathResource("/schemas/SRV-CBC/MSG/MSG-FileUploadMessage-1.7.xsd"));
		
		return fileUploadMessageXsd;
	}
	
	@Bean(name="MSG-SOAPFaultMessage-1.6")
	public SimpleXsdSchema soapFaultMessageXsdDefinition() {
		SimpleXsdSchema soapFaultMessageXsd = new SimpleXsdSchema();
		soapFaultMessageXsd.setXsd(new ClassPathResource("/schemas/SRV-CBC/MSG/MSG-SOAPFaultMessage-1.7.xsd"));
		
		return soapFaultMessageXsd;
	}
	
	@Bean(name="IDES-SOAP-MSG-BASE-1.6")
	public SimpleXsdSchema idesSoapBaseMessageXsdDefinition() {
		SimpleXsdSchema idesSoapBaseMessageXsd = new SimpleXsdSchema();
		idesSoapBaseMessageXsd.setXsd(new ClassPathResource("/schemas/SRV-CBC/MSG/IDES-SOAP-MSG-BASE-1.7.xsd"));
		
		return idesSoapBaseMessageXsd;
	}
	
	/*@Bean
	public PayloadRootAnnotationMethodEndpointMapping endpointMapping() {
		return new PayloadRootAnnotationMethodEndpointMapping();
	}*/
	
	/*
	 * Needed for MTOM processing (i.e. MIME/XOP processing and handling)
	 */
	@Bean
	@Override
	public DefaultMethodEndpointAdapter defaultMethodEndpointAdapter() {
		List<MethodArgumentResolver> argumentResolvers = new ArrayList<MethodArgumentResolver>();
		argumentResolvers.add(ctsFileStatusServiceEndpointMethodProcessor());
		argumentResolvers.add(downloadAckngServiceEndpointMethodProcessor());
		argumentResolvers.add(fileDownloadServiceEndpointMethodProcessor());
		argumentResolvers.add(fileUploadServiceEndpointMethodProcessor());
		
		List<MethodReturnValueHandler> returnValueHandlers = new ArrayList<MethodReturnValueHandler>();
		returnValueHandlers.add(ctsFileStatusServiceEndpointMethodProcessor());
		returnValueHandlers.add(downloadAckngServiceEndpointMethodProcessor());
		returnValueHandlers.add(fileDownloadServiceEndpointMethodProcessor());
		returnValueHandlers.add(fileUploadServiceEndpointMethodProcessor());
		
		DefaultMethodEndpointAdapter endpointAdapter = new DefaultMethodEndpointAdapter();
		endpointAdapter.setMethodArgumentResolvers(argumentResolvers);
		endpointAdapter.setMethodReturnValueHandlers(returnValueHandlers);
		
		return endpointAdapter;
	}
	
	@Bean
	public MarshallingPayloadMethodProcessor ctsFileStatusServiceEndpointMethodProcessor() {
		return new MarshallingPayloadMethodProcessor(ctsFileStatusServiceEndpointMarshaller());
	}
	
	@Bean
	public MarshallingPayloadMethodProcessor downloadAckngServiceEndpointMethodProcessor() {
		return new MarshallingPayloadMethodProcessor(downloadAckngServiceEndpointMarshaller());
	}
	
	@Bean
	public MarshallingPayloadMethodProcessor fileDownloadServiceEndpointMethodProcessor() {
		return new MarshallingPayloadMethodProcessor(fileDownloadServiceEndpointMarshaller());
	}
	
	@Bean
	public MarshallingPayloadMethodProcessor fileUploadServiceEndpointMethodProcessor() {
		return new MarshallingPayloadMethodProcessor(fileUploadServiceEndpointMarshaller());
	}
	
	@Bean
	public Jaxb2Marshaller soapFaultTypeMarshaller() {
		Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
		marshaller.setContextPath("ides.msg.soapfaultmessage");
		
		Map<String, Object> properties = new HashMap<>();
        properties.put(Marshaller.JAXB_FRAGMENT, true);
        marshaller.setMarshallerProperties(properties);
		return marshaller;
	}
	
	@Bean
	public Jaxb2Marshaller ctsFileStatusServiceEndpointMarshaller() {
		Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
		marshaller.setContextPath("ides.msg.ctsfilestatusmessage");
		
		return marshaller;
	}
	
	@Bean
	public Jaxb2Marshaller downloadAckngServiceEndpointMarshaller() {
		Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
		marshaller.setContextPath("ides.msg.downloadacknowledgementmessage");
		
		return marshaller;
	}
	
	@Bean
	public Jaxb2Marshaller fileDownloadServiceEndpointMarshaller() {
		Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
		marshaller.setContextPath("ides.msg.filedownloadmessage");
		marshaller.setMtomEnabled(true);
		
		return marshaller;
	}
	
	@Bean
	public Jaxb2Marshaller fileUploadServiceEndpointMarshaller() {
		Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
		marshaller.setContextPath("ides.msg.fileuploadmessage");
		marshaller.setMtomEnabled(true);
		
		return marshaller;
	}
	
	@Bean
	public CommonsMultipartResolver multipartResolver() {
		return new CommonsMultipartResolver();
	}
	
	@Bean
	public CommonsMultipartResolver filterMultipartResolver() {
		final CommonsMultipartResolver resolver = new CommonsMultipartResolver();
		return resolver;
	}
}
<file_sep>/**
 * Proprietary Software Built Off of Open-Source Software?
 */
package corp.pdb.aea.ws.endpoint;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.UUID;

import javax.activation.DataHandler;
import javax.xml.bind.JAXBElement;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

import corp.pdb.aea.data.model.Alert;
import corp.pdb.aea.data.model.IncomingUpload;
import corp.pdb.aea.data.model.enums.AlertStatusEnum;
import corp.pdb.aea.data.repository.AlertRepository;
import corp.pdb.aea.data.repository.IncomingUploadRepository;
import corp.pdb.aea.util.TimestampTypeFormatter;
import ides.msg.fileuploadmessage.FileUploadRequestType;
import ides.msg.fileuploadmessage.FileUploadResponseType;

/**
 * @author waleed.k.al-jaradat
 *
 */
@Endpoint
public class FileUploadStubEndpointImpl {
	private final Logger log = LoggerFactory.getLogger(FileUploadStubEndpointImpl.class);
	private static final String FILE_UPLOAD_PACKAGE_DIRECTORY_LOCATION = "files/incoming/uploads/";
	@Autowired
	AlertRepository alertRepository;
	@Autowired
	IncomingUploadRepository incomingUploadRepository;
	@Autowired
	TimestampTypeFormatter timestampTypeFormatter;
	
	@PayloadRoot(namespace="urn:ides:msg:fileuploadmessage", localPart="FileUploadRequest")
	@ResponsePayload
	public JAXBElement<FileUploadResponseType> fileUploadRequestOperation(@RequestPayload JAXBElement<FileUploadRequestType> fileUploadRequest) {
		log.debug("{}: Received request at FileUploadService Endpoint (see TRACE logs for message details)", this.getClass().getName());
		FileUploadRequestType fileUploadRequestBody = fileUploadRequest.getValue();
		log.trace("Message details: RequestSentTs=[{}], SenderFileId=[{}], SendingEntity=[{}], ReceivingEntity=[{}], CommunicationTypeCd=[{}]", fileUploadRequestBody.getRequestSentTs(), fileUploadRequestBody.getSenderFileId(), fileUploadRequestBody.getEntitySenderIdentifier().getCTSCountryCd(), fileUploadRequestBody.getEntityReceiverIdentifier().getCTSCountryCd(), fileUploadRequestBody.getEntityCommunicationTypeCd().value());
		
		String fileUploadPackageLocation = FILE_UPLOAD_PACKAGE_DIRECTORY_LOCATION + "" + fileUploadRequestBody.getSenderFileId() + ".zip";
		log.trace("Saving upload transmission at: [{}]", fileUploadPackageLocation);
		Long fileSize = saveBulkExchangeFile(fileUploadRequestBody.getBulkExchangeFile(), fileUploadPackageLocation);
		log.trace("Saved upload transmission at: [{}]", fileUploadPackageLocation);
		
		ides.msg.fileuploadmessage.ObjectFactory factory = new ides.msg.fileuploadmessage.ObjectFactory();
		FileUploadResponseType fileUploadResponseBody = factory.createFileUploadResponseType();
		fileUploadResponseBody.setReceiptTs(timestampTypeFormatter.generateTimestamp());
		fileUploadResponseBody.setIDESSendingTs(fileUploadRequestBody.getRequestSentTs());
		fileUploadResponseBody.setEntityCommunicationTypeCd(fileUploadRequestBody.getEntityCommunicationTypeCd());
		fileUploadResponseBody.setSenderFileId(fileUploadRequestBody.getSenderFileId());
		fileUploadResponseBody.setIDESFileNm(fileUploadRequestBody.getSenderFileId() + ".zip");
		
		generateAndPersistIncomingUpload(fileUploadRequestBody, fileUploadResponseBody, fileSize);
		JAXBElement<FileUploadResponseType> fileUploadResponse = factory.createFileUploadResponse(fileUploadResponseBody);
		return fileUploadResponse;
	}
	
	protected IncomingUpload generateAndPersistIncomingUpload(
			FileUploadRequestType fileUploadRequestBody, FileUploadResponseType fileUploadResponseBody, Long fileSizeKbQty) {
		IncomingUpload rcrd = new IncomingUpload();
		Date createDate = new Date();
		
		rcrd.setCommunicationTypeCd(fileUploadResponseBody.getEntityCommunicationTypeCd().value());
		rcrd.setEntitySenderIdentifier(fileUploadRequestBody.getEntitySenderIdentifier().getCTSCountryCd());
		rcrd.setEntityReceiverIdentifier(fileUploadRequestBody.getEntityReceiverIdentifier().getCTSCountryCd());
		rcrd.setIdesFileNm(fileUploadResponseBody.getIDESFileNm());
		rcrd.setSenderFileId(fileUploadResponseBody.getSenderFileId());
		rcrd.setFileSizeKbQty(fileSizeKbQty);
		rcrd.setCreatedById("FUPLDEND");
		rcrd.setCreateTs(createDate);
		rcrd = generateAndPersistRC001Alert(rcrd);
		rcrd = incomingUploadRepository.saveAndFlush(rcrd);
		return rcrd;
	}
	
	protected IncomingUpload generateAndPersistRC001Alert(IncomingUpload incomingUpload) {
		Alert rcrd = new Alert();
		rcrd.setAlertStatus(AlertStatusEnum.UN);
		rcrd.setAlertReasonCd("RC001");
		rcrd.setAlertRecipientTypeCd("CS");
		rcrd.setAlertTypeCd("SA");
		rcrd.setFileFormatCd("XML");
		rcrd.setBinaryEncodingSchemeCd("NONE");
		rcrd.setCreatedById("FUPLDENDP");
		rcrd.setFileRevisionInd("N");
		rcrd.setFileCreateTs(new Date());
		rcrd.setTaxYr(Long.valueOf(2019));
		rcrd.setIdesTransmissionId(generateTransmissionId());
		
		rcrd.setEntityCommunicationTypeCd(incomingUpload.getCommunicationTypeCd());
		rcrd.setEntityReceiverIdentifier(incomingUpload.getEntityReceiverIdentifier());
		rcrd.setEntitySenderIdentifier(incomingUpload.getEntitySenderIdentifier());
		rcrd.setIdesFileNm(incomingUpload.getIdesFileNm());
		rcrd.setSenderFileId(incomingUpload.getSenderFileId());
		rcrd.setCompressedFileSizeKbQty(incomingUpload.getFileSizeKbQty());
		rcrd.setCreateTs(incomingUpload.getCreateTs());
		rcrd = alertRepository.saveAndFlush(rcrd);
		
		incomingUpload.setAlertId(rcrd.getId());
		incomingUpload.setAlertStatus(rcrd.getAlertStatus());
		return incomingUpload;
	}
	
	protected String generateTransmissionId() {
		String randomUUID = UUID.randomUUID().toString().replaceAll("-", "");
		log.info("randomUUID={}", randomUUID);
		return randomUUID;
	}
	
	protected Long saveBulkExchangeFile(DataHandler bulkExchangeFile, String locationToSaveFile) {
		File file = new File(locationToSaveFile);
		int i = 0;
		byte[] buffer = new byte[1024];
		
		try (InputStream inputStream = bulkExchangeFile.getInputStream()) {
			try (OutputStream outputStream = new FileOutputStream(file)) {
				while((i = inputStream.read(buffer, 0, buffer.length)) > 0) {
					System.out.println("Writing data from BulkExchangeFile DataHandler to FileOutputStream");
					outputStream.write(buffer, 0, i);
				}
			}
			
		} catch (FileNotFoundException e) {
			log.error("{}\n{}", e.getMessage(), e);
		} catch (IOException e) {
			log.error("{}\n{}", e.getMessage(), e);
		} catch (Exception e) {
			log.error("{}\n{}", e.getMessage(), e);
		}
		
		Long fileSizeKbQty = Long.valueOf((file.length()/1000));
		log.trace("BulkExchangeFile size=[{} kb]", fileSizeKbQty);
		return fileSizeKbQty;
	}
}
