LrJposChannel.removeFilter
Removes a filter from the filters lists.
public static void removeFilter(ISOFilter filter, int direction)
public static void removeFilter(ISOFilter filter)
Parameters
Parameter | Description |
---|---|
filter | The filter to be removed. |
direction | Specifies the direction of the messages from which the filter is to be removed:
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
public void filterTest() throws Throwable{
//register channel
LrJposChannel.setName("MyProduct-JposChannel");
//creating filter
ChannelInfoFilter filter = new ChannelInfoFilter();
Properties props = new Properties();
props.put("channel-name","47"); //" MyProduct-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);
}