{
JeMail mail = new JeMail(getHostID(), getSessionID());
JDBInterfaceRequest ir = new JDBInterfaceRequest(getHostID(), getSessionID());
JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
OutgoingProductionDeclarationConfirmation opdc = new OutgoingProductionDeclarationConfirmation(getHostID(), getSessionID());
OutgoingDespatchConfirmation odc = new OutgoingDespatchConfirmation(getHostID(), getSessionID());
OutgoingDespatchPreAdvice opa = new OutgoingDespatchPreAdvice(getHostID(), getSessionID());
OutgoingEquipmentTracking oet = new OutgoingEquipmentTracking(getHostID(), getSessionID());
OutgoingPalletStatusChange psc = new OutgoingPalletStatusChange(getHostID(), getSessionID());
OutgoingPalletSplit ops = new OutgoingPalletSplit(getHostID(), getSessionID());
OutgoingPalletDelete opd = new OutgoingPalletDelete(getHostID(), getSessionID());
OutgoingLabelData old = new OutgoingLabelData(getHostID(), getSessionID());
LinkedList<Long> irqList = new LinkedList<Long>();
int noOfMessages = 0;
while (true)
{
JWait.milliSec(500);
if (allDone)
{
if (dbconnected)
{
Common.hostList.getHost(hostID).disconnect(getSessionID());
}
return;
}
irqList.clear();
irqList = ir.getInterfaceRequestIDs();
noOfMessages = irqList.size();
if (noOfMessages > 0)
{
for (int x = 0; x < noOfMessages; x++)
{
JWait.milliSec(100);
ir.setInterfaceRequestID(irqList.get(x));
ir.getInterfaceRequestProperties();
if (ir.getMode().equals("Inbound File Re-Submit"))
{
if (inter.getInterfaceProperties(ir.getInterfaceType(), "Input") == true)
{
String sourceFile = Common.base_dir + java.io.File.separator + "xml" + java.io.File.separator + "interface" + java.io.File.separator + "error" + java.io.File.separator + ir.getInterfaceType() + java.io.File.separator
+ ir.getFilename();
destinationFile = inter.getRealPath() + java.io.File.separator + ir.getFilename();
renamedDestinationFile = inter.getRealPath() + java.io.File.separator + ir.getFilename().replaceAll(".xml", ".lmx");
mover.move_File(sourceFile, renamedDestinationFile);
mover.move_File(renamedDestinationFile, destinationFile);
ir.delete();
}
}
if (ir.getMode().equals("Normal"))
{
errorMessage = "Unknown Outbound Interface Type :" + ir.getInterfaceType();
messageProcessedOK = false;
if (ir.getInterfaceType().equals("Production Declaration"))
{
messageProcessedOK = opdc.processMessage(ir.getTransactionRef());
errorMessage = opdc.getErrorMessage();
GenericMessageHeader.updateStats("Output","Production Declaration", messageProcessedOK.toString());
}
if (ir.getInterfaceType().equals("Pallet Status Change"))
{