GetStatsControl extends AbstractControl implements RequestControl, ResponseControl { @Override public void decode(final DERBuffer encoded) { final DERParser parser = new DERParser(); parser.registerHandler(THREAD_COUNT_PATH, new IntegerHandler(this, "threadCount")); parser.registerHandler(CALL_TIME_PATH, new IntegerHandler(this, "callTime")); parser.registerHandler(ENTRIES_RETURNED_PATH, new IntegerHandler(this, "entriesReturned")); parser.registerHandler(ENTRIES_VISITED_PATH, new IntegerHandler(this, "entriesVisited")); parser.registerHandler(FILTER_PATH, new StringHandler(this, "filter")); parser.registerHandler(INDEX_PATH, new StringHandler(this, "index")); parser.registerHandler(PAGES_REFERENCED_PATH, new IntegerHandler(this, "pagesReferenced")); parser.registerHandler(PAGES_READ_PATH, new IntegerHandler(this, "pagesRead")); parser.registerHandler(PAGES_PREREAD_PATH, new IntegerHandler(this, "pagesPreread")); parser.registerHandler(PAGES_DIRTIED_PATH, new IntegerHandler(this, "pagesDirtied")); parser.registerHandler(PAGES_REDIRTIED_PATH, new IntegerHandler(this, "pagesRedirtied")); parser.registerHandler(LOG_RECORD_COUNT_PATH, new IntegerHandler(this, "logRecordCount")); parser.registerHandler(LOG_RECORD_BYTES_PATH, new IntegerHandler(this, "logRecordBytes")); parser.parse(encoded); } GetStatsControl();  GetStatsControl(final boolean critical); @Override boolean hasValue(); Map<String, Object> getStatistics(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override byte[] encode(); @Override void decode(final DERBuffer encoded); static final String OID; }
@Test(groups = "control", dataProvider = "response") public void decode(final DERBuffer berValue, final GetStatsControl expected) throws Exception { final GetStatsControl actual = new GetStatsControl(expected.getCriticality()); actual.decode(berValue); Assert.assertEquals(actual, expected); }