Package org.netxms.client
Class MessageHandler
java.lang.Object
org.netxms.client.MessageHandler
Message handler interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
int
final boolean
Get completion flagboolean
Check if handler is expired.abstract boolean
Process message.protected final void
Set handler to complete state.protected void
Set handler as expired (also sets completion flag)protected void
setLastMessageTimestamp
(long lastMessageTimestamp) void
setMessageWaitTimeout
(int messageWaitTimeout) final void
Wait 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
-