ExecutionOptions.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Constructors
public ExecutionOptions.Builder ()
Public Methods
Sets whether the client should be notified when the action associated with these
ExecutionOptions
is applied on the server.
When clients set notify
to true, they must also implement a
DriveEventService
to receive the completion event. See DriveEventService
for more details on how the service should be implemented and added to the
manifest.
Parameters
notify |
true if the API should deliver notifications about the completion of this event
to the client's DriveEventService ,
false otherwise |
Sets a client-defined string that will be returned to the client through a
completion notification on DriveEventService
after this particular action either succeeds or fails when applied on the server. A
notification will only be delivered if
setNotifyOnCompletion(boolean)
is called. This tag may contain any
information that will be helpful to the caller in the event of a conflict or a failure
to apply an action on the server, for example, a commit identifier or a delta
representing the changes made in the commit.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eExecutionOptions.Builder\u003c/code\u003e helps create \u003ccode\u003eExecutionOptions\u003c/code\u003e for controlling how Drive actions are performed.\u003c/p\u003e\n"],["\u003cp\u003eIt allows setting a conflict resolution strategy, either overwriting or keeping the remote version.\u003c/p\u003e\n"],["\u003cp\u003eYou can request completion notifications to be delivered to a \u003ccode\u003eDriveEventService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA tracking tag can be included in the notification to help identify the action upon completion.\u003c/p\u003e\n"]]],["The `ExecutionOptions.Builder` class creates `ExecutionOptions` for actions. Key actions include using the `build()` method to finalize options, and configuring settings with `setConflictStrategy()`, to define conflict resolution. `setNotifyOnCompletion()` allows enabling client notifications via `DriveEventService`. Additionally, `setTrackingTag()` sets a client-defined string, returned through `DriveEventService`, aiding in tracking action status. The class is constructed with the method `ExecutionOptions.Builder()`.\n"],null,["# ExecutionOptions.Builder\n\npublic static class **ExecutionOptions.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA builder for creating a new [ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions). \n\n### Public Constructor Summary\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------|\n| | [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#ExecutionOptions.Builder())() |\n\n### Public Method Summary\n\n|------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions) | [build](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#build())() |\n| [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder) | [setConflictStrategy](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#setConflictStrategy(int))(int strategy) Sets a conflict resolution strategy for this action. |\n| [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder) | [setNotifyOnCompletion](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#setNotifyOnCompletion(boolean))(boolean notify) Sets whether the client should be notified when the action associated with these [ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions) is applied on the server. |\n| [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder) | [setTrackingTag](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#setTrackingTag(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) trackingTag) Sets a client-defined string that will be returned to the client through a completion notification on [DriveEventService](/android/reference/com/google/android/gms/drive/events/DriveEventService) after this particular action either succeeds or fails when applied on the server. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **ExecutionOptions.Builder** ()\n\nPublic Methods\n--------------\n\n#### public [ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions)\n**build** ()\n\n#### public [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder)\n**setConflictStrategy** (int strategy)\n\nSets a conflict resolution strategy for this action.\n\nThe resulting behavior depends on the strategy selected. Check documentation on\naccepted values ([CONFLICT_STRATEGY_OVERWRITE_REMOTE](/android/reference/com/google/android/gms/drive/ExecutionOptions#CONFLICT_STRATEGY_OVERWRITE_REMOTE)\nand [CONFLICT_STRATEGY_KEEP_REMOTE](/android/reference/com/google/android/gms/drive/ExecutionOptions#CONFLICT_STRATEGY_KEEP_REMOTE)) for more details. \n\n##### Parameters\n\n| strategy | one of [CONFLICT_STRATEGY_OVERWRITE_REMOTE](/android/reference/com/google/android/gms/drive/ExecutionOptions#CONFLICT_STRATEGY_OVERWRITE_REMOTE) and [CONFLICT_STRATEGY_KEEP_REMOTE](/android/reference/com/google/android/gms/drive/ExecutionOptions#CONFLICT_STRATEGY_KEEP_REMOTE) |\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- this builder \n\n#### public [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder)\n**setNotifyOnCompletion** (boolean notify)\n\nSets whether the client should be notified when the action associated with these\n[ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions)\nis applied on the server.\n\nWhen clients set `notify` to true, they must also implement a\n[DriveEventService](/android/reference/com/google/android/gms/drive/events/DriveEventService)\nto receive the completion event. See [DriveEventService](/android/reference/com/google/android/gms/drive/events/DriveEventService)\nfor more details on how the service should be implemented and added to the\nmanifest. \n\n##### Parameters\n\n| notify | true if the API should deliver notifications about the completion of this event to the client's [DriveEventService](/android/reference/com/google/android/gms/drive/events/DriveEventService), false otherwise |\n|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- this builder \n\n#### public [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder)\n**setTrackingTag** ([String](//developer.android.com/reference/java/lang/String.html) trackingTag)\n\nSets a client-defined string that will be returned to the client through a\ncompletion notification on [DriveEventService](/android/reference/com/google/android/gms/drive/events/DriveEventService)\nafter this particular action either succeeds or fails when applied on the server. A\nnotification will only be delivered if [setNotifyOnCompletion(boolean)](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#setNotifyOnCompletion(boolean)) is called. This tag may contain any\ninformation that will be helpful to the caller in the event of a conflict or a failure\nto apply an action on the server, for example, a commit identifier or a delta\nrepresenting the changes made in the commit. \n\n##### Parameters\n\n| trackingTag | the tag that will be returned when a completion event is delivered through [DriveEventService](/android/reference/com/google/android/gms/drive/events/DriveEventService). Must not be null, and the length can never exceed [MAX_TRACKING_TAG_STRING_LENGTH](/android/reference/com/google/android/gms/drive/ExecutionOptions#MAX_TRACKING_TAG_STRING_LENGTH) |\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- this builder"]]