Package org.medcare.igtl.network
Class MessageHandler
java.lang.Object
org.medcare.igtl.network.MessageHandler
- Direct Known Subclasses:
GenericServerResponseHandler
Perform request corresponding to the message received performRequest methods
must be adapted corresponding to the need of each use
User must adapt Capability list, to be able to send the right capability list
and to have a correct error management for incorrect capability request
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMessageHandler
(Header header, byte[] body, ServerThread serverThread) Default MessageQueueManager constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBody()
** Gets the ArrayList of Types implemented in this Handlerabstract void
manageError
(String message, Exception exception, int errorCode) manage error this method must be adapted for each useabstract boolean
Perform the request job this method must be adapted for each useboolean
Perform the request job on the message performRequest methods must be corresponding to the need of each usevoid
setBody
(byte[] body) void
-
Field Details
-
serverThread
-
capabilityList
-
-
Constructor Details
-
MessageHandler
Default MessageQueueManager constructor.- Parameters:
header
- of the messagebody
- of the messageserverThread
- serverThread object
-
-
Method Details
-
performRequest
Perform the request job on the message performRequest methods must be corresponding to the need of each use- Returns:
- True if response job performed successfully
- Throws:
Exception
- received by perform method
-
perform
Perform the request job this method must be adapted for each use- Parameters:
messageType
- The messageType- Returns:
- True if response job performed successfully
- Throws:
Exception
- CrcException will be thrown at crc check during message unpacking Other exceptions can be thrown
-
manageError
manage error this method must be adapted for each use- Parameters:
message
- The message for error datailexception
- The exception for errorerrorCode
- The error Code
-
getCapability
** Gets the ArrayList of Types implemented in this Handler -
setHeader
-
getHeader
-
setBody
public void setBody(byte[] body) -
getBody
public byte[] getBody()
-