本文整理汇总了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);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:19,代码来源:AndroidServiceAccessor.java
示例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);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:19,代码来源:AndroidServiceAccessor.java
示例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;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:12,代码来源:ProtocolIntents.java
示例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(")");
}
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:AndroidStrings.java
示例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);
}
}
开发者ID:morristech,项目名称:android-chromium,代码行数:45,代码来源:AndroidInvalidationListenerIntentMapper.java
注:本文中的com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.RegistrationFailureUpcall类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论