@Beta public interface UnparsedNotificationCallback extends Serializable
Beta
Must NOT be implemented in form of an anonymous class since this would break serialization.
Should be thread-safe as several notifications might be processed at the same time. Example usage:
static class MyNotificationCallback implements UnparsedNotificationCallback {
private static final long serialVersionUID = 1L;
{@literal @}Override
public void onNotification(StoredChannel storedChannel, UnparsedNotification notification) {
String contentType = notification.getContentType();
InputStream contentStream = notification.getContentStream();
switch (notification.getResourceState()) {
case ResourceStates.SYNC:
break;
case ResourceStates.EXISTS:
break;
case ResourceStates.NOT_EXISTS:
break;
}
}
}
Modifier and Type | Method and Description |
---|---|
void |
onNotification(StoredChannel storedChannel,
UnparsedNotification notification)
Handles a received unparsed notification.
|
void onNotification(StoredChannel storedChannel, UnparsedNotification notification) throws IOException
storedChannel
- stored notification channelnotification
- unparsed notificationIOException
Copyright © 2010–2022 Google. All rights reserved.