Package org.netxms.client
Class MessageHandler
java.lang.Object
org.netxms.client.MessageHandler
Message handler interface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longintfinal booleanGet completion flagbooleanCheck if handler is expired.abstract booleanProcess message.protected final voidSet handler to complete state.protected voidSet handler as expired (also sets completion flag)protected voidsetLastMessageTimestamp(long lastMessageTimestamp) voidsetMessageWaitTimeout(int messageWaitTimeout) final voidWait for handler completion
-
Constructor Details
-
MessageHandler
public MessageHandler()
-
-
Method Details
-
setComplete
protected final void setComplete()Set handler to complete state. This will signal all waiters and remove subscription. -
isComplete
public final boolean isComplete()Get completion flag- Returns:
- returns if message is complete
-
waitForCompletion
public final void waitForCompletion()Wait for handler completion -
getLastMessageTimestamp
protected long getLastMessageTimestamp()- Returns:
- the lastMessageTimestamp
-
setLastMessageTimestamp
protected void setLastMessageTimestamp(long lastMessageTimestamp) - Parameters:
lastMessageTimestamp- the lastMessageTimestamp to set
-
isExpired
public boolean isExpired()Check if handler is expired.- Returns:
- true if handler is expired
-
setExpired
protected void setExpired()Set handler as expired (also sets completion flag) -
getMessageWaitTimeout
public int getMessageWaitTimeout()- Returns:
- the messageWaitTimeout
-
setMessageWaitTimeout
public void setMessageWaitTimeout(int messageWaitTimeout) - Parameters:
messageWaitTimeout- the messageWaitTimeout to set
-
processMessage
Process message. If handler returns true message will not be placed into waiting queue.- Parameters:
msg- NXCP message to process- Returns:
- true if message is processed
-