ObjectUpdater

public class ObjectUpdater
extends Object

java.lang.Object
   ↳ com.google.android.tradefed.result.teststorage.ObjectUpdater


Helper class to manage updates to AnTS objects.

When updating an AnTS object first we need to make sure that we are updating the correct version. The helper class will automatically fetch the latest version of the object and will automatically update it retrying in case there are errors and/or versions conflicts.

Summary

Nested classes

interface ObjectUpdater.InvocationUpdate

Perform an update of the provided invocation. 

class ObjectUpdater.TestArtifactUpdate

Perform an update on the returned BuildArtifact. 

interface ObjectUpdater.WorkUnitUpdate

Interface to encapsulte an update. 

Public methods

static ObjectUpdater create(Androidbuildinternal apiClient)
static ObjectUpdater create(ITestStorageClient client)
BuildArtifactMetadata runUpdate(String invocationId, String resourceId, long legacyId, ObjectUpdater.TestArtifactUpdate update)
Invocation runUpdate(String id, ObjectUpdater.InvocationUpdate update)

Executes the provided update operation.

WorkUnit runUpdate(String id, ObjectUpdater.WorkUnitUpdate update)

Executes the provided update operation.

Public methods

create

public static ObjectUpdater create (Androidbuildinternal apiClient)

Parameters
apiClient Androidbuildinternal

Returns
ObjectUpdater

create

public static ObjectUpdater create (ITestStorageClient client)

Parameters
client ITestStorageClient

Returns
ObjectUpdater

runUpdate

public BuildArtifactMetadata runUpdate (String invocationId, 
                String resourceId, 
                long legacyId, 
                ObjectUpdater.TestArtifactUpdate update)

Parameters
invocationId String

resourceId String

legacyId long

update ObjectUpdater.TestArtifactUpdate

Returns
BuildArtifactMetadata

runUpdate

public Invocation runUpdate (String id, 
                ObjectUpdater.InvocationUpdate update)

Executes the provided update operation. Takes an id of the invocation that needs to be updated. Will fetch the latest version and will retry the update operation if there are any errors.

Parameters
id String

update ObjectUpdater.InvocationUpdate

Returns
Invocation

runUpdate

public WorkUnit runUpdate (String id, 
                ObjectUpdater.WorkUnitUpdate update)

Executes the provided update operation. Takes an id of the work unit that needs to be updated. Will fetch the latest version and will retry the update operation if there are any errors.

Parameters
id String

update ObjectUpdater.WorkUnitUpdate

Returns
WorkUnit