respWriter.write( sb.toString() );
}
while ( searchResponses.next() )
{
Response searchResponse = searchResponses.get();
if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_ENTRY )
{
SearchResultEntry searchResultEntry = ( SearchResultEntry ) searchResponse;
SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml(
connection.getCodecService(), searchResultEntry );
searchResponseDsml = new SearchResponseDsml( connection.getCodecService(),
searchResultEntryDsml );
if ( respWriter != null )
{
writeResponse( respWriter, searchResultEntryDsml );
}
else
{
searchResponseDsml.addResponse( searchResultEntryDsml );
}
}
else if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_REFERENCE )
{
SearchResultReference searchResultReference = ( SearchResultReference ) searchResponse;
SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml(
connection.getCodecService(), searchResultReference );