/**
* {@inheritDoc}
*/
public Control fromJndiControl( javax.naming.ldap.Control control ) throws DecoderException
{
@SuppressWarnings("rawtypes")
ControlFactory factory = controlFactories.get( control.getID() );
if ( factory == null )
{
OpaqueControl ourControl = new OpaqueControl( control.getID() );
ourControl.setCritical( control.isCritical() );
BasicControlDecorator<Control> decorator =
new BasicControlDecorator<Control>( this, ourControl );
decorator.setValue( control.getEncodedValue() );
return decorator;
}
@SuppressWarnings("unchecked")
CodecControl<? extends Control> ourControl = factory.newCodecControl();
ourControl.setCritical( control.isCritical() );
ourControl.setValue( control.getEncodedValue() );
ourControl.decode( control.getEncodedValue() );
return ourControl;