Package org.medcare.igtl.network
Class ResponseHandler
java.lang.Object
org.medcare.igtl.network.ResponseHandler
- Direct Known Subclasses:
GenericClientResponseHandler
Perform response data corresponding to the message received performResponse
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
User must use SetStatus method so it value correspond to the real status of the client.
User must use GetStatus method to set
-
Constructor Summary
ConstructorDescriptionResponseHandler
(Header header, byte[] body, OpenIGTClient openIGTClient) Default ResponseHandler constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBody()
** Gets the ArrayList of Types implemented in this Handler** To set client status **abstract void
manageError
(String message, Exception exception, int errorCode) manage error this method must be adapted for each useabstract boolean
Perform the response job this method must be adapted for each useboolean
Perform the response job performResponse methods must be adapted corresponding to the need of each usevoid
setBody
(byte[] body) void
setCapabilityList
(ArrayList<String> capabilityList) void
void
setOpenIGTClient
(OpenIGTClient openIGTClient) void
** To set client status
-
Constructor Details
-
ResponseHandler
Default ResponseHandler constructor.- Parameters:
header
- of the responsebody
- of the responseopenIGTClient
- openIGTClient object
-
-
Method Details
-
performResponse
Perform the response job performResponse methods must be adapted corresponding to the need of each use- Returns:
- True if response job performed successfully
- Throws:
Exception
- received by perform method
-
perform
Perform the response 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 -
setStatus
** To set client status- Parameters:
status
- **
-
getStatus
** To set client status **- Returns:
- the status status
-
getBody
public byte[] getBody() -
setBody
public void setBody(byte[] body) -
getHeader
-
setHeader
-
getOpenIGTClient
-
setOpenIGTClient
-
getCapabilityList
-
setCapabilityList
-