@Test public void testSetConfiguration() throws Throwable { StatefulFilter statefulFilter = new StatefulFilter(); int[] ignoredFields = new int[0]; statefulFilter.setIgnoredFields(ignoredFields); statefulFilter.setConfiguration(new SimpleConfiguration()); assertTrue(statefulFilter.isOverwriteOriginalFields(), "m_statefulFilter.isOverwriteOriginalFields()"); assertEquals(0, statefulFilter.getSavedFields().length, "m_statefulFilter.getSavedFields().length"); assertEquals(0, statefulFilter.getIgnoredFields().length, "m_statefulFilter.getIgnoredFields().length"); assertEquals(2, statefulFilter.getKey().length, "m_statefulFilter.getKey().length"); assertFalse(statefulFilter.isVetoUnmatched(), "m_statefulFilter.isVetoUnmatched()"); assertEquals(1, statefulFilter.getMatchDirection(), "m_statefulFilter.getMatchDirection()"); assertEquals(60000L, statefulFilter.getTimeout(), "m_statefulFilter.getTimeout()"); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { setVetoUnmatched(cfg.getBoolean("veto-unmatched")); setSpace(cfg.get("space","")); setKeyPrefix(cfg.get("key-prefix", ""+hashCode())); setTimeout(cfg.getLong("timeout", TIMEOUT)); setOverwriteOriginalFields(cfg.getBoolean("overwrite-original-fields", true)); int dir = cfg.get("direction","incoming").equals("incoming") ? ISOMsg.INCOMING : ISOMsg.OUTGOING; setMatchDirection(dir); setKey(ISOUtil.toIntArray(cfg.get("key", "11 41"))); setSavedFields(ISOUtil.toIntArray(cfg.get("saved-fields", ""))); setIgnoredFields(ISOUtil.toIntArray(cfg.get("ignored-fields", ""))); }
StatefulFilter implements ISOFilter, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { setVetoUnmatched(cfg.getBoolean("veto-unmatched")); setSpace(cfg.get("space","")); setKeyPrefix(cfg.get("key-prefix", ""+hashCode())); setTimeout(cfg.getLong("timeout", TIMEOUT)); setOverwriteOriginalFields(cfg.getBoolean("overwrite-original-fields", true)); int dir = cfg.get("direction","incoming").equals("incoming") ? ISOMsg.INCOMING : ISOMsg.OUTGOING; setMatchDirection(dir); setKey(ISOUtil.toIntArray(cfg.get("key", "11 41"))); setSavedFields(ISOUtil.toIntArray(cfg.get("saved-fields", ""))); setIgnoredFields(ISOUtil.toIntArray(cfg.get("ignored-fields", ""))); } }
StatefulFilter implements ISOFilter, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { setVetoUnmatched(cfg.getBoolean("veto-unmatched")); setSpace(cfg.get("space","")); setKeyPrefix(cfg.get("key-prefix", ""+hashCode())); setTimeout(cfg.getLong("timeout", TIMEOUT)); setOverwriteOriginalFields(cfg.getBoolean("overwrite-original-fields", true)); int dir = cfg.get("direction","incoming").equals("incoming") ? ISOMsg.INCOMING : ISOMsg.OUTGOING; setMatchDirection(dir); setKey(ISOUtil.toIntArray(cfg.get("key", "11 41"))); setSavedFields(ISOUtil.toIntArray(cfg.get("saved-fields", ""))); setIgnoredFields(ISOUtil.toIntArray(cfg.get("ignored-fields", ""))); } StatefulFilter(); }
StatefulFilter implements ISOFilter, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { setVetoUnmatched(cfg.getBoolean("veto-unmatched")); setSpace(cfg.get("space","")); setKeyPrefix(cfg.get("key-prefix", ""+hashCode())); setTimeout(cfg.getLong("timeout", TIMEOUT)); setOverwriteOriginalFields(cfg.getBoolean("overwrite-original-fields", true)); int dir = cfg.get("direction","incoming").equals("incoming") ? ISOMsg.INCOMING : ISOMsg.OUTGOING; setMatchDirection(dir); setKey(ISOUtil.toIntArray(cfg.get("key", "11 41"))); setSavedFields(ISOUtil.toIntArray(cfg.get("saved-fields", ""))); setIgnoredFields(ISOUtil.toIntArray(cfg.get("ignored-fields", ""))); } StatefulFilter(); String getKeyPrefix(); void setKeyPrefix(String keyPrefix); void setConfiguration(Configuration cfg); void setSpace(String uri); ISOMsg filter(ISOChannel iSOChannel, ISOMsg m, LogEvent evt); boolean isVetoUnmatched(); void setVetoUnmatched(boolean vetoUnmatched); int getMatchDirection(); void setMatchDirection(int matchDirection); int getIgnoredField(int index); int[] getIgnoredFields(); void setIgnoredField(int index, int ignoredFields); void setIgnoredFields(int[] ignoredFields); int getSavedField(int index); int[] getSavedFields(); void setSavedField(int index, int savedFields); void setSavedFields(int[] savedFields); int getKey(int index); int[] getKey(); void setKey(int index, int key); void setKey(int[] key); long getTimeout(); void setTimeout(long timeout); boolean isOverwriteOriginalFields(); void setOverwriteOriginalFields(boolean overwriteOriginalFields); }
StatefulFilter implements ISOFilter, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { setVetoUnmatched(cfg.getBoolean("veto-unmatched")); setSpace(cfg.get("space","")); setKeyPrefix(cfg.get("key-prefix", ""+hashCode())); setTimeout(cfg.getLong("timeout", TIMEOUT)); setOverwriteOriginalFields(cfg.getBoolean("overwrite-original-fields", true)); int dir = cfg.get("direction","incoming").equals("incoming") ? ISOMsg.INCOMING : ISOMsg.OUTGOING; setMatchDirection(dir); setKey(ISOUtil.toIntArray(cfg.get("key", "11 41"))); setSavedFields(ISOUtil.toIntArray(cfg.get("saved-fields", ""))); setIgnoredFields(ISOUtil.toIntArray(cfg.get("ignored-fields", ""))); } StatefulFilter(); String getKeyPrefix(); void setKeyPrefix(String keyPrefix); void setConfiguration(Configuration cfg); void setSpace(String uri); ISOMsg filter(ISOChannel iSOChannel, ISOMsg m, LogEvent evt); boolean isVetoUnmatched(); void setVetoUnmatched(boolean vetoUnmatched); int getMatchDirection(); void setMatchDirection(int matchDirection); int getIgnoredField(int index); int[] getIgnoredFields(); void setIgnoredField(int index, int ignoredFields); void setIgnoredFields(int[] ignoredFields); int getSavedField(int index); int[] getSavedFields(); void setSavedField(int index, int savedFields); void setSavedFields(int[] savedFields); int getKey(int index); int[] getKey(); void setKey(int index, int key); void setKey(int[] key); long getTimeout(); void setTimeout(long timeout); boolean isOverwriteOriginalFields(); void setOverwriteOriginalFields(boolean overwriteOriginalFields);  }