public void action( LdapMessageContainer<SearchResultReferenceDecorator> container ) throws DecoderException
{
SearchResultReference searchResultReference = container.getMessage();
// Get the Value and store it in the BindRequest
TLV tlv = container.getCurrentTLV();
// Get the referral, or create it if not existing
Referral referral = searchResultReference.getReferral();
if ( referral == null )
{
referral = new ReferralImpl();
searchResultReference.setReferral( referral );
}
// We have to handle the special case of a 0 length list of referrals
LdapURL url = LdapURL.EMPTY_URL;
if ( tlv.getLength() == 0 )
{
referral.addLdapUrl( "" );
}
else
{
String urlStr = Strings.utf8ToString(tlv.getValue().getData());
try
{
url = new LdapURL( urlStr );
referral.addLdapUrl( urlStr );