LrJposChannel.getConfiguration

Gets the configuration associated with the channel.

public static Configuration getConfiguration() throws ConfigurationException

Return values

This function returns a string that represents the configuration of the channel.

It returns null if the configuration is not set.

Example

Copy code
public void simpleISOtest_config() throws Throwable{
        
        GenericPackager packager = new GenericPackager(PACKAGERCONFIGFILE);
        LrJposChannel.initChannel(LrJposChannel.ChannelType.ASCIIChannel);
        LrJposChannel.setPackager(packager);
        
        Properties props = new Properties();
        props.put("host","localhost");        
        props.put("port", "8000");        
        
        LrJposChannel.setConfiguration(new SimpleConfiguration(props));
        
        LrJposChannel.connect();
        
        LrISOMsg m = new LrISOMsg();
        m.setMTI("0100");
        m.set(ISO87Fields.PAN_PRIMARY_ACCOUNT_NUMBER, "1234567890000000000")
        m.set(3, "523456")
        m.set(4, "123456789121")
        m.set(12, "20241605108110"); //Date and time - n-14, CCYYMMDDhhmmss
        m.set(47, "32432")

        LrJposChannel.send(m);
        
        LrISOMsg r = LrJposChannel.receive();
        if (r!=null) {
            lr.output_message(r.getMTI());
        }
        
        Configuration cfg = LrJposChannel.getConfiguration();
        
        LrJposChannel.disconnect();
        LrJposChannel.closeChannel();
}