UniversalTag.INTEGER.getValue(),
new GrammarAction<PersistentSearchContainer>( "Set PSearchControl changeTypes" )
{
public void action( PersistentSearchContainer container ) throws DecoderException
{
Value value = container.getCurrentTLV().getValue();
try
{
// Check that the value is into the allowed interval
int changeTypes = IntegerDecoder.parse( value,
PersistentSearch.CHANGE_TYPES_MIN,
PersistentSearch.CHANGE_TYPES_MAX );
if ( IS_DEBUG )
{
LOG.debug( "changeTypes = " + changeTypes );
}
container.getPersistentSearchDecorator().setChangeTypes( changeTypes );
}
catch ( IntegerDecoderException e )
{
String msg = I18n.err( I18n.ERR_04051 );
LOG.error( msg, e );
throw new DecoderException( msg );
}
}
} );
/**
* Transition from Change types to Changes only
* PSearch ::= SEQUENCE OF {
* ...
* changeOnly BOOLEAN,
* ...
*
* Stores the change only flag
*/
super.transitions[PersistentSearchStates.CHANGE_TYPES_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
new GrammarTransition<PersistentSearchContainer>( PersistentSearchStates.CHANGE_TYPES_STATE,
PersistentSearchStates.CHANGES_ONLY_STATE, UniversalTag.BOOLEAN.getValue(),
new GrammarAction<PersistentSearchContainer>( "Set PSearchControl changesOnly" )
{
public void action( PersistentSearchContainer container ) throws DecoderException
{
Value value = container.getCurrentTLV().getValue();
try
{
boolean changesOnly = BooleanDecoder.parse( value );
if ( IS_DEBUG )
{
LOG.debug( "changesOnly = " + changesOnly );
}
container.getPersistentSearchDecorator().setChangesOnly( changesOnly );
}
catch ( BooleanDecoderException e )
{
String msg = I18n.err( I18n.ERR_04052 );
LOG.error( msg, e );
throw new DecoderException( msg );
}
}
} );
/**
* Transition from Change types to Changes only
* PSearch ::= SEQUENCE OF {
* ...
* returnECs BOOLEAN
* }
*
* Stores the return ECs flag
*/
super.transitions[PersistentSearchStates.CHANGES_ONLY_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
new GrammarTransition<PersistentSearchContainer>( PersistentSearchStates.CHANGES_ONLY_STATE,
PersistentSearchStates.RETURN_ECS_STATE, UniversalTag.BOOLEAN.getValue(),
new GrammarAction<PersistentSearchContainer>( "Set PSearchControl returnECs" )
{
public void action( PersistentSearchContainer container ) throws DecoderException
{
Value value = container.getCurrentTLV().getValue();
try
{
boolean returnECs = BooleanDecoder.parse( value );