public class MessageErrorHandler
extends java.lang.Object
| Constructor and Description |
|---|
MessageErrorHandler(java.lang.String queue)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
canProcess(java.util.Map properties)
Select status and deleteflag to process message
|
int |
canProcess(java.util.Map properties,
java.lang.String status,
int deleteFlag,
int tryCount)
Select status and deleteflag to process message
|
protected void |
deleteErrorTable(java.lang.String messageID,
java.sql.Connection conn)
Delete data from error message tables
|
void |
emailError(java.lang.Throwable t,
java.lang.String uniqueId)
Email the incoming error having error file name info in the email.
|
boolean |
emailToBeSent(java.util.Map msgProperties)
Check if email needs to go out or it's already been sent depending upon
if error record exists for a given queue or not
|
JMSData |
getCorrectedFile(JMSData data)
Return the appropriate data for the given incoming data.
|
JMSData |
getErrorMsgForSeqQueue(java.lang.String queueName) |
JMSData |
getJMSData(java.util.Map msgProperties)
Take in incoming file name and return back it's relevant JMS Data object
for further processing.
|
boolean |
handleError(java.lang.Throwable t,
java.util.Map msgProperties)
Do whatever is needed to handle the error occure while processing the
message.
|
void |
initializeEmailInfo()
Initialize the email information for a given queue.
|
protected boolean |
insertErrorTable(java.util.Map msgProperties,
java.lang.String errorMessage,
java.lang.String msgId,
java.sql.Connection conn,
java.lang.String personId,
java.sql.Timestamp currDate,
byte[] extErrorData,
byte[] intErrorData)
Insert data to error message tables
|
void |
setMaxTryCount(int newMaxTryCount)
Called on refresh of MaxQueueCache to reset try count
|
void |
success(JMSData data)
Perform necessary actions upon successful processing of the message.
|
protected boolean |
updateToJMSError(java.lang.String messageId,
java.sql.Connection conn,
java.lang.String personId,
java.sql.Timestamp currDate)
Update data in error message tables
|
public MessageErrorHandler(java.lang.String queue)
queue - Name of the queue that is the handler is associate withpublic void initializeEmailInfo()
public JMSData getErrorMsgForSeqQueue(java.lang.String queueName) throws MXException
MXExceptionpublic int canProcess(java.util.Map properties)
throws MXException
proprties - map of all message propertiesMXException - MAXIMO exceptionpublic int canProcess(java.util.Map properties,
java.lang.String status,
int deleteFlag,
int tryCount)
throws MXException,
java.rmi.RemoteException
proprties - map of all message propertiesMXException - MAXIMO exceptionjava.rmi.RemoteExceptionpublic boolean handleError(java.lang.Throwable t,
java.util.Map msgProperties)
t - exceptionproperties - map of all message propertiespublic JMSData getCorrectedFile(JMSData data)
data - data from the queuepublic void success(JMSData data)
data - data from the queuepublic JMSData getJMSData(java.util.Map msgProperties) throws MXException
properties - map of all message propertiesfilename - name of the fileMXException - MAXIMO exceptionpublic void emailError(java.lang.Throwable t,
java.lang.String uniqueId)
t - exception from the processingerrorFileName - error file namepublic boolean emailToBeSent(java.util.Map msgProperties)
throws MXException,
java.rmi.RemoteException
msgProperties - map of all message propertiesjava.rmi.RemoteException - Remote exceptionMXExceptionprotected boolean insertErrorTable(java.util.Map msgProperties,
java.lang.String errorMessage,
java.lang.String msgId,
java.sql.Connection conn,
java.lang.String personId,
java.sql.Timestamp currDate,
byte[] extErrorData,
byte[] intErrorData)
throws MXException
msgProperties - message propertieserrorMessage - error messageconn - database connection to execute statementpersonId - id of a person who initiated transactioncurrDate - current data and timeMXException - MAXIMO exceptionprotected void deleteErrorTable(java.lang.String messageID,
java.sql.Connection conn)
throws MXException
messagID - unique ID of the messageconn - database connection to excute statementMXException - MAXIMO exceptionpublic void setMaxTryCount(int newMaxTryCount)
newMaxTryCount - new try count configured for the queueprotected boolean updateToJMSError(java.lang.String messageId,
java.sql.Connection conn,
java.lang.String personId,
java.sql.Timestamp currDate)
throws MXException
msgProperties - message propertieserrorMessage - error messageconn - database connection to execute statementpersonId - id of a person who initiated transactioncurrDate - current data and timeMXException - MAXIMO exception