本文整理汇总了Java中com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall类的典型用法代码示例。如果您正苦于以下问题:Java RegistrationFailureUpcall类的具体用法?Java RegistrationFailureUpcall怎么用?Java RegistrationFailureUpcall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistrationFailureUpcall类属于com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall包,在下文中一共展示了RegistrationFailureUpcall类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasField
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall; //导入依赖的package包/类
/** Returns whether {@code field} is present in {@code message}. */
@Override
@SuppressWarnings("unchecked")
public boolean hasField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
RegistrationFailureUpcall message = (RegistrationFailureUpcall) rawMessage;
if (field == OBJECT_ID) {
return message.hasObjectId();
}
if (field == TRANSIENT) {
return message.hasTransient();
}
if (field == MESSAGE) {
return message.hasMessage();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
示例2: getField
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall; //导入依赖的package包/类
/** Returns the {@code field} from {@code message}. */
@Override
@SuppressWarnings("unchecked")
public Object getField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
RegistrationFailureUpcall message = (RegistrationFailureUpcall) rawMessage;
if (field == OBJECT_ID) {
return message.getObjectId();
}
if (field == TRANSIENT) {
return message.getTransient();
}
if (field == MESSAGE) {
return message.getMessage();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
示例3: newRegistrationFailureIntent
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall; //导入依赖的package包/类
public static Intent newRegistrationFailureIntent(ObjectIdP object, boolean isTransient,
String message) {
Intent intent = new Intent();
RegistrationFailureUpcall regUpcall = RegistrationFailureUpcall.newBuilder()
.setObjectId(object)
.setTransient(isTransient)
.setMessage(message).build();
intent.putExtra(LISTENER_UPCALL_KEY,
newBuilder().setRegistrationFailure(regUpcall).build().toByteArray());
return intent;
}
示例4: toCompactString
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall; //导入依赖的package包/类
/** Appends a description of the given {@code failure} upcall to the given {@code builder}. */
public static TextBuilder toCompactString(TextBuilder builder,
RegistrationFailureUpcall failure) {
if (failure == null) {
return builder;
}
builder.append("registrationFailure(objectId = ");
CommonProtoStrings2.toCompactString(builder, failure.getObjectId());
return builder.append(", isTransient = ").append(failure.getTransient()).append(")");
}
示例5: handleIntent
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall; //导入依赖的package包/类
/**
* Handles a listener upcall by decoding the protocol buffer in {@code intent} and dispatching
* to the appropriate method on the {@link #listener}.
*/
public void handleIntent(Intent intent) {
// TODO: use wakelocks
// Unmarshall the arguments from the Intent and make the appropriate call on the listener.
ListenerUpcall upcall = tryParseIntent(intent);
if (upcall == null) {
return;
}
if (upcall.hasReady()) {
listener.ready(client);
} else if (upcall.hasInvalidate()) {
// Handle all invalidation-related upcalls on a common path, since they require creating
// an AckHandleP.
onInvalidateUpcall(upcall, listener);
} else if (upcall.hasRegistrationStatus()) {
RegistrationStatusUpcall regStatus = upcall.getRegistrationStatus();
listener.informRegistrationStatus(client,
ProtoConverter.convertFromObjectIdProto(regStatus.getObjectId()),
regStatus.getIsRegistered() ?
RegistrationState.REGISTERED : RegistrationState.UNREGISTERED);
} else if (upcall.hasRegistrationFailure()) {
RegistrationFailureUpcall failure = upcall.getRegistrationFailure();
listener.informRegistrationFailure(client,
ProtoConverter.convertFromObjectIdProto(failure.getObjectId()),
failure.getTransient(),
failure.getMessage());
} else if (upcall.hasReissueRegistrations()) {
ReissueRegistrationsUpcall reissueRegs = upcall.getReissueRegistrations();
listener.reissueRegistrations(client, reissueRegs.getPrefix().toByteArray(),
reissueRegs.getLength());
} else if (upcall.hasError()) {
ErrorUpcall error = upcall.getError();
ErrorInfo errorInfo = ErrorInfo.newInstance(error.getErrorCode(), error.getIsTransient(),
error.getErrorMessage(), null);
listener.informError(client, errorInfo);
} else {
logger.warning("Dropping listener Intent with unknown call: %s", upcall);
}
}