LrJposChannel.removeFilter

Removes a filter from the filters lists.

public static void removeFilter(ISOFilter filter, int direction)

public static void removeFilter(ISOFilter filter)

Parameters

ParameterDescription
filterThe filter to be removed.
direction

Specifies the direction of the messages from which the filter is to be removed:

  • 0: Removes the filter for both incoming and outgoing messages.

  • 1 - LrISOMsg.INCOMING: Removes the filter for incoming (received) messages.

  • 2 - LrISOMsg.OUTGOING: Removes the filter for outgoing (sent) messages.

Note: If direction is not specified, the filter is removed for both incoming and outgoing messages.

Return values

This function does not return any values.

Example

Copy code
public void filterTest() throws Throwable{

       //register channel
       LrJposChannel.setName("LoadRunner-JposChannel");
       
        //creating filter
        ChannelInfoFilter filter = new ChannelInfoFilter();
        Properties props = new Properties();
        props.put("channel-name","47");        //" LoadRunner-JposChannel " will be set in field 47
        props.put("socket-info", "48");        //socket info will be set in field 48
        filter.setConfiguration(new SimpleConfiguration(props));
        
        //adding filter to channel
        LrJposChannel.addFilter(filter);
        //        LrJposChannel.addIncomingFilter(filter);
        //        LrJposChannel.addOutgoingFilter(filter);
            
        LrISOMsg m = new LrISOMsg();
        m.setMTI("0100");
        m.set(2, "1234567890000000000")
        m.set(3, "523456")
        m.set(4, "123456789121")
        m.set(12, "20241605108110");

        LrJposChannel.send(m);
        
        LrISOMsg r = LrJposChannel.receive();
        
        LrJposChannel.removeFilter(filter);
        //        LrJposChannel.removeIncomingFilter(filter);
        //        LrJposChannel.removeOutgoingFilter(filter);
}