{
@Override
public void action( SortRequestContainer container ) throws DecoderException
{
BerValue value = container.getCurrentTLV().getValue();
String atDesc = Strings.utf8ToString( value.getData() );
if ( IS_DEBUG )
{
LOG.debug( "AttributeTypeDesc = " + atDesc );
}
SortKey sk = new SortKey( atDesc );
container.setCurrentKey( sk );
container.getControl().addSortKey( sk );
}
};
GrammarAction<SortRequestContainer> storeReverseOrder = new GrammarAction<SortRequestContainer>()
{
@Override
public void action( SortRequestContainer container ) throws DecoderException
{
BerValue value = container.getCurrentTLV().getValue();
try
{
boolean reverseOrder = BooleanDecoder.parse( value );
if ( IS_DEBUG )
{
LOG.debug( "ReverseOrder = " + reverseOrder );
}
container.getCurrentKey().setReverseOrder( reverseOrder );
container.setGrammarEndAllowed( true );
}
catch ( BooleanDecoderException e )
{
//String msg = I18n.err( I18n.ERR_04050 );
//LOG.error( msg, e );
throw new DecoderException( e.getMessage() );
}
}
};
// Create the transitions table
super.transitions = new GrammarTransition[SortRequestStates.END_STATE.ordinal()][256];
super.transitions[SortRequestStates.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
new GrammarTransition<SortRequestContainer>( SortRequestStates.START_STATE,
SortRequestStates.SEQUENCE_OF_SEQUENCE_STATE,
UniversalTag.SEQUENCE.getValue(), null );
super.transitions[SortRequestStates.SEQUENCE_OF_SEQUENCE_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
new GrammarTransition<SortRequestContainer>( SortRequestStates.SEQUENCE_OF_SEQUENCE_STATE,
SortRequestStates.SORT_KEY_SEQUENCE_STATE,
UniversalTag.SEQUENCE.getValue(), null );
super.transitions[SortRequestStates.SORT_KEY_SEQUENCE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
new GrammarTransition<SortRequestContainer>( SortRequestStates.SORT_KEY_SEQUENCE_STATE,
SortRequestStates.AT_DESC_STATE,
UniversalTag.OCTET_STRING.getValue(), addSortKey );
super.transitions[SortRequestStates.AT_DESC_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
new GrammarTransition<SortRequestContainer>( SortRequestStates.AT_DESC_STATE,
SortRequestStates.ORDER_RULE_STATE,
UniversalTag.OCTET_STRING.getValue(), new GrammarAction<SortRequestContainer>()
{
@Override
public void action( SortRequestContainer container ) throws DecoderException
{
BerValue value = container.getCurrentTLV().getValue();
String matchingRuleOid = Strings.utf8ToString( value.getData() );
if ( IS_DEBUG )
{
LOG.debug( "MatchingRuleOid = " + matchingRuleOid );
}