Esempio n. 1
0
 private static int getNumServerResponses(Collection<PingData> rsps) {
   int cnt = 0;
   for (PingData rsp : rsps) {
     if (rsp.isServer()) cnt++;
   }
   return cnt;
 }
Esempio n. 2
0
 /**
  * Creates a byte[] representation of the PingData, but DISCARDING the view it contains.
  *
  * @param data the PingData instance to serialize.
  * @return
  */
 protected byte[] serializeWithoutView(PingData data) {
   final PingData clone =
       new PingData(
               data.getAddress(), data.isServer(), data.getLogicalName(), data.getPhysicalAddr())
           .coord(data.isCoord());
   try {
     return Util.streamableToByteBuffer(clone);
   } catch (Exception e) {
     log.error(Util.getMessage("ErrorSerializingPingData"), e);
     return null;
   }
 }