コード例 #1
0
 @Override
 public GetCountersResponse getCounters(GetCountersRequest request) throws IOException {
   hsContact = true;
   Counters counters = getMyCounters();
   GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class);
   response.setCounters(counters);
   return response;
 }
 private GetCountersResponse getCountersResponseFromHistoryServer() {
   GetCountersResponse countersResponse = Records.newRecord(GetCountersResponse.class);
   Counter counter = Records.newRecord(Counter.class);
   CounterGroup counterGroup = Records.newRecord(CounterGroup.class);
   Counters counters = Records.newRecord(Counters.class);
   counter.setDisplayName("dummyCounter");
   counter.setName("dummyCounter");
   counter.setValue(1001);
   counterGroup.setName("dummyCounters");
   counterGroup.setDisplayName("dummyCounters");
   counterGroup.setCounter("dummyCounter", counter);
   counters.setCounterGroup("dummyCounters", counterGroup);
   countersResponse.setCounters(counters);
   return countersResponse;
 }