/**
* Convert a IntermediateResponseCodec to a IntermediateResponse message based on the ResponseFuture's type
*/
private void setIResponse( IntermediateResponseCodec intermediateResponseCodec, ResponseFuture responseFuture ) throws Exception
{
IntermediateResponse intermediateResponse = null;
if( responseFuture instanceof SearchFuture )
{
intermediateResponse = new SearchIntermediateResponse();
}
else if( responseFuture instanceof ExtendedFuture )
{
intermediateResponse = new ExtendedIntermediateResponse();
}
else
{
// currently we only support IR for search and extended operations
throw new UnsupportedOperationException( "Unknown ResponseFuture type " + responseFuture.getClass().getName() );
}
intermediateResponse.setResponseName( intermediateResponseCodec.getResponseName() );
intermediateResponse.setResponseValue( intermediateResponseCodec.getResponseValue() );
responseFuture.set( intermediateResponse );
}