Java Code Examples for com.google.ipc.invalidation.util.TextBuilder#appendFormat()

The following examples show how to use com.google.ipc.invalidation.util.TextBuilder#appendFormat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    InfoMessage infoMessage) {
  if (infoMessage == null) {
    return builder;
  }
  builder.appendFormat("InfoMsg: Platform = %s, Is_summary_requested = %s, Perf counters: ",
      infoMessage.getClientVersion().getPlatform(),
      infoMessage.getServerRegistrationSummaryRequested());
  boolean first = true;
  for (PropertyRecord record : infoMessage.getPerformanceCounterList()) {
    if (!first) {
      builder.append(", ");
    }
    builder.appendFormat("%s = %d", record.getName(), record.getValue());
    first = false;
  }
  return builder;
}
 
Example 2
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    ConfigChangeMessage configChangeMessage) {
  if (configChangeMessage == null) {
    return builder;
  }
  builder.appendFormat("ConfigChangeMsg: %d", configChangeMessage.getNextMessageDelayMs());
  return builder;
}
 
Example 3
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    RegistrationSyncMessage syncMessage) {
  if (syncMessage == null) {
    return builder;
  }
  RegistrationSubtree subtree = syncMessage.getSubtree(0);
  builder.appendFormat("RegSyncMsg: Num regs: %d, Regs: ", subtree.getRegisteredObjectCount());
  toCompactStringForObjectIds(builder, subtree.getRegisteredObjectList());
  return builder;
}
 
Example 4
Source File: MemoryStorageImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  builder.append("Storage state: ");
  for (Map.Entry<String, byte[]> entry : ticlPersistentState.entrySet()) {
    builder.appendFormat("<%s, %s>, ", entry.getKey(), Bytes.toString(entry.getValue()));
  }
}
 
Example 5
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    InitializeMessage initializeMessage) {
  if (initializeMessage == null) {
    return builder;
  }
  builder.appendFormat("InitMsg: Client Type: %d, ", initializeMessage.getClientType());
  toCompactString(builder, initializeMessage.getApplicationClientId());
  return builder;
}
 
Example 6
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder, ClientHeader header) {
  if (header == null) {
    return builder;
  }
  builder.append("C2S: ");
  toCompactString(builder, header.getProtocolVersion());
  builder.appendFormat(", MsgId: %s, Num regs = %s, Token = ", header.getMessageId(),
      header.getRegistrationSummary().getNumRegistrations());
  toCompactString(builder, header.getClientToken());
  return builder;
}
 
Example 7
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static TextBuilder toCompactString(TextBuilder builder,
    ProtocolVersion protocolVersion) {
  if (protocolVersion == null) {
    return builder;
  }
  builder.appendFormat("%d.%d", protocolVersion.getVersion().getMajorVersion(),
      protocolVersion.getVersion().getMinorVersion());
  return builder;
}
 
Example 8
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    ErrorMessage errorMessage) {
  if (errorMessage == null) {
    return builder;
  }
  builder.appendFormat("ErrorMsg: %s, %s", errorMessage.getCode(), errorMessage.getDescription());
  return builder;
}
 
Example 9
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
private static TextBuilder toCompactString(TextBuilder builder,
    ApplicationClientIdP applicationClientId) {
  if (applicationClientId == null) {
    return builder;
  }
  builder.appendFormat("(Ceid: ");
  toCompactString(builder, applicationClientId.getClientName());
  builder.append(')');
  return builder;
}
 
Example 10
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder, RegistrationP regOp) {
  if (regOp == null) {
    return builder;
  }
  builder.appendFormat("RegOp: %s, ",
      regOp.getOpType() == RegistrationP.OpType.REGISTER ? "R" : "U");
  toCompactString(builder, regOp.getObjectId());
  return builder;
}
 
Example 11
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder, ObjectIdP objectId) {
  if (objectId == null) {
    return builder;
  }
  builder.appendFormat("(Obj: %s, ", objectId.getSource());
  toCompactString(builder, objectId.getName());
  builder.append(')');
  return builder;
}
 
Example 12
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    ConfigChangeMessage configChangeMessage) {
  if (configChangeMessage == null) {
    return builder;
  }
  builder.appendFormat("ConfigChangeMsg: %d", configChangeMessage.getNextMessageDelayMs());
  return builder;
}
 
Example 13
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** See spec in implementation notes. */
public static TextBuilder toCompactString(TextBuilder builder,
    InitializeMessage initializeMessage) {
  if (initializeMessage == null) {
    return builder;
  }
  builder.appendFormat("InitMsg: Client Type: %d, ", initializeMessage.getClientType());
  toCompactString(builder, initializeMessage.getApplicationClientId());
  return builder;
}
 
Example 14
Source File: CommonProtoStrings2.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static TextBuilder toCompactString(TextBuilder builder, ServerHeader header) {
  if (header == null) {
    return builder;
  }
  builder.append("S2C: ");
  toCompactString(builder, header.getProtocolVersion());
  builder.appendFormat(", MsgId: %s, Num regs = %s, Token = ", header.getMessageId(),
      header.getRegistrationSummary().getNumRegistrations());
  toCompactString(builder, header.getClientToken());
  return builder;
}
 
Example 15
Source File: Statistics.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  List<SimplePair<String, Integer>> nonZeroValues = new ArrayList<SimplePair<String, Integer>>();
  getNonZeroStatistics(nonZeroValues);
  builder.appendFormat("Client Statistics: %s\n", nonZeroValues);
}
 
Example 16
Source File: ProtocolHandler.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  builder.appendFormat("Token: %s, Summary: %s", CommonProtoStrings2.toLazyCompactString(token),
      registrationSummary);
}
 
Example 17
Source File: InvalidationClientCore.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  builder.appendFormat("Client: %s, %s, %s", applicationClientId,
      CommonProtoStrings2.toLazyCompactString(clientToken), ticlState);
}
 
Example 18
Source File: RegistrationManager.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  builder.appendFormat("Last known digest: %s, Requested regs: %s", lastKnownServerSummary,
      desiredRegistrations);
}
 
Example 19
Source File: ProtocolHandler.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  builder.appendFormat("Token: %s, Summary: %s", CommonProtoStrings2.toLazyCompactString(token),
      registrationSummary);
}
 
Example 20
Source File: ProtocolHandler.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void toCompactString(TextBuilder builder) {
  builder.appendFormat("Token: %s, Summary: %s", token, registrationSummary);
}