public boolean receiveMessage(Message message) throws DropoffMailBoxException
{
boolean isMessageInsertedWithoutError = false;
QueueMessage queueMessage = new QueueMessageImpl();
Queue queue = null;
DropoffMailBoxException de = null;
String messageID = message.getMessageID();
try {
queue = QueueService.getQueue(provider.getInboundQueueName(message.getFolderSource()));
queueMessage.setObject(message.getIncomingMessageXML());
queueMessage.setMessageID(messageID);
queueMessage.setBody("Inserting processed message with id "+message.getMessageID()+ " from folder "+message.getFolderSource() );
queueMessage.setErrorMessage(false);
isMessageInsertedWithoutError = true;
getProcessesExecuted(message);
}
catch (SSAFAuthenticationException authentication)
{
queueMessage.setBody("Error message with id "+message.getMessageID()+ " from folder "+message.getFolderSource() );
queueMessage.setErrorMessage(true);
isMessageInsertedWithoutError = false;
de = new DropoffMailBoxException();
de.setMessageID(messageID);
de.initCause(authentication);
}
catch (SSAFAuthorizationException authorization)
{
queueMessage.setBody("Error message with id "+message.getMessageID()+ " from folder "+message.getFolderSource() );
queueMessage.setErrorMessage(true);
isMessageInsertedWithoutError = false;
de = new DropoffMailBoxException();
de.setMessageID(messageID);
de.initCause(authorization);
}
catch (SSAFValidationException validation)
{
queueMessage.setBody("Error message with id "+message.getMessageID()+ " from folder "+message.getFolderSource() );
queueMessage.setErrorMessage(true);
isMessageInsertedWithoutError = false;
de = new DropoffMailBoxException();
de.setMessageID(messageID);
de.initCause(validation);
}
catch (Exception exception)
{
queueMessage.setBody("Error message with id "+message.getMessageID()+ " from folder "+message.getFolderSource() );
queueMessage.setErrorMessage(true);
isMessageInsertedWithoutError = false;
de = new DropoffMailBoxException();
de.setMessageID(messageID);
de.initCause(exception);
}