AI-generated Key Takeaways
-
The Snapshots.OpenSnapshotResult interface is deprecated and SnapshotsClient.DataOrConflict is returned instead.
-
This interface represents the result when a snapshot has been opened, and provides details about the operation's status, including various error codes.
-
It includes methods to retrieve conflict information such as the conflict ID, the conflicting snapshot version, and SnapshotContents for resolving conflicts.
-
You can retrieve the opened snapshot using getSnapshot(), which provides the device's current view of the data.
This interface is deprecated.
SnapshotsClient.DataOrConflict is returned instead in the SnapshotsClient.
Result delivered when a snapshot has been opened.
Possible status codes include:
GamesStatusCodes.STATUS_OKif data was successfully loaded and is up-to-date.GamesStatusCodes.STATUS_SNAPSHOT_NOT_FOUNDif the snapshot could not be found on the server.GamesStatusCodes.STATUS_SNAPSHOT_CREATION_FAILEDif an error occurred while creating the snapshot.GamesStatusCodes.STATUS_SNAPSHOT_CONFLICTif a conflict was detected during the open operation.GamesStatusCodes.STATUS_SNAPSHOT_CONTENTS_UNAVAILABLEif the content for this snapshot could not be loaded. The metadata will still be valid for the returned snapshot, but it must be re-opened to be modified.GamesStatusCodes.STATUS_SNAPSHOT_FOLDER_UNAVAILABLEif the root snapshot folder for this game could not be found or created.GamesStatusCodes.STATUS_SNAPSHOT_CONFLICT_MISSINGif a conflict was being resolved and the ID was not found.GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATAif the device was unable to retrieve any data from the network and has no data cached locally.GamesStatusCodes.STATUS_CLIENT_RECONNECT_REQUIREDif the client needs to reconnect to the service to access this data.GamesStatusCodes.STATUS_LICENSE_CHECK_FAILEDif the game is not licensed to the user.GamesStatusCodes.STATUS_INTERNAL_ERRORif an unexpected error occurred in the service.
Public Method Summary
| abstract String |
getConflictId()
Retrieves the ID of the conflict to resolve, if any.
|
| abstract Snapshot |
getConflictingSnapshot()
Retrieves the modified version of this snapshot in the case of a conflict.
|
| abstract SnapshotContents |
getResolutionSnapshotContents()
Retrieve the
SnapshotContents object used to update the data in case of a
conflict.
|
| abstract Snapshot |
getSnapshot()
Retrieves the snapshot that was opened.
|
Inherited Method Summary
Public Methods
public abstract String getConflictId ()
Retrieves the ID of the conflict to resolve, if any. Pass this to
Snapshots.resolveConflict(GoogleApiClient, String, Snapshot) when resolving
the conflict. Will return null if the status of this operation is not
GamesStatusCodes.STATUS_SNAPSHOT_CONFLICT.
Returns
- The ID of the conflict to resolve, or null if there was no conflict.
public abstract Snapshot getConflictingSnapshot ()
Retrieves the modified version of this snapshot in the case of a conflict. This
version may differ from the values returned in
getSnapshot(), and may need to be merged. Will return null if the status of
this operation is not
GamesStatusCodes.STATUS_SNAPSHOT_CONFLICT.
Returns
- The modified snapshot data, or null if there was no conflict.
public abstract SnapshotContents getResolutionSnapshotContents ()
Retrieve the
SnapshotContents object used to update the data in case of a conflict. Pass
this to
Snapshots.resolveConflict(GoogleApiClient, String, String, SnapshotMetadataChange,
SnapshotContents) to resolve this conflict.
Will return null if the status of this operation is not
GamesStatusCodes.STATUS_SNAPSHOT_CONFLICT.
Returns
- A
SnapshotContentsobject to use to write resolved snapshot data, or null if there was no conflict.
public abstract Snapshot getSnapshot ()
Retrieves the snapshot that was opened. This is always the device's most up-to-date
view of the snapshot data. If Result.getStatus()
is
GamesStatusCodes.STATUS_SNAPSHOT_CONFLICT, the return value here represents
the state of the snapshot on the server.
Returns
- The snapshot that was opened, if any. This will be null if the open operation did not succeed.