case SEARCH_REQUEST:
Cursor<Response> searchResponses = connection.search( ( SearchRequest ) request );
while ( searchResponses.next() )
{
Response searchResponse = searchResponses.get();
SearchResponseDsml searchResponseDsml = null;
int requestID = searchResponse.getMessageId();
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 ( requestID > 0 )
{
searchResponseDsml.setMessageId( requestID );
}
searchResponseDsml.addResponse( searchResultEntryDsml );
}
else if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_REFERENCE )
{
SearchResultReference searchResultReference = ( SearchResultReference ) searchResponse;
SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml(
connection.getCodecService(), searchResultReference );