Example #1
0
  public void serializeTo(Element element) throws DocumentSerializationException {

    DocumentSerializableUtilities.addString(element, "serviceName", serviceName);
    DocumentSerializableUtilities.addString(element, "serviceParam", serviceParameter);

    if (numInboundQueued != 0) {
      DocumentSerializableUtilities.addInt(element, "numInboundQueued", numInboundQueued);
    }

    if (numInboundDropped != 0) {
      DocumentSerializableUtilities.addInt(element, "numInboundDropped", numInboundDropped);
    }

    if (timeToDropInbound != 0) {
      DocumentSerializableUtilities.addLong(element, "timeToDropInbound", timeToDropInbound);
    }

    if (numInboundDeQueued != 0) {
      DocumentSerializableUtilities.addInt(element, "numInboundDeQueued", numInboundDeQueued);
    }

    if (timeInInboundQueue != 0) {
      DocumentSerializableUtilities.addLong(element, "timeInInboundQueue", timeInInboundQueue);
    }

    if (numInboundProcessed != 0) {
      DocumentSerializableUtilities.addInt(element, "numInboundProcessed", numInboundProcessed);
    }

    if (timeToProcessInbound != 0) {
      DocumentSerializableUtilities.addLong(element, "timeToProcessInbound", timeToProcessInbound);
    }
  }
 public void serializeTo(Element element) throws DocumentSerializationException {
   if (peerID != null) {
     DocumentSerializableUtilities.addString(element, "peerID", peerID.toString());
   }
   if (state != null) {
     DocumentSerializableUtilities.addString(element, "state", state);
   }
   if (transitionTime != 0) {
     DocumentSerializableUtilities.addLong(element, "transitionTime", transitionTime);
   }
   if (lastLeaseRenewalTime != 0) {
     DocumentSerializableUtilities.addLong(element, "lastLeaseRenewalTime", lastLeaseRenewalTime);
   }
   if (lease != 0) {
     DocumentSerializableUtilities.addLong(element, "lease", lease);
   }
   if (numConnects != 0) {
     DocumentSerializableUtilities.addInt(element, "numConnects", numConnects);
   }
   if (numLeaseRenewals != 0) {
     DocumentSerializableUtilities.addInt(element, "numLeaseRenewals", numLeaseRenewals);
   }
   if (numDisconnects != 0) {
     DocumentSerializableUtilities.addInt(element, "numDisconnects", numDisconnects);
   }
   if (numConnectionsRefused != 0) {
     DocumentSerializableUtilities.addInt(element, "numConnectionsRefused", numConnectionsRefused);
   }
   if (numErrorsAddingClient != 0) {
     DocumentSerializableUtilities.addInt(element, "numErrorsAddingClient", numErrorsAddingClient);
   }
   if (numUnableToRespondToConnectRequest != 0) {
     DocumentSerializableUtilities.addInt(
         element, "numUnableToRespondToConnectRequest", numUnableToRespondToConnectRequest);
   }
   if (totalTimeConnected != 0) {
     DocumentSerializableUtilities.addLong(element, "totalTimeConnected", totalTimeConnected);
   }
 }