com.amazonaws.mobileconnectors.cognito
Class SyncConflict

java.lang.Object
  extended by com.amazonaws.mobileconnectors.cognito.SyncConflict

public class SyncConflict
extends java.lang.Object

This consists of the conflicting record from the remote storage and the local storage.


Constructor Summary
SyncConflict(Record remoteRecord, Record localRecord)
          Constructs a SyncConflict object.
 
Method Summary
 java.lang.String getKey()
          Gets the key of the record that is in conflict.
 Record getLocalRecord()
          Gets the local record that is in conflict.
 Record getRemoteRecord()
          Gets the remote record that is in conflict.
 Record resolveWithLastWriterWins()
          Resolves conflict with last writer wins.
 Record resolveWithLocalRecord()
          Resolves conflict with local record
 Record resolveWithRemoteRecord()
          Resolves conflict with remote record
 Record resolveWithValue(java.lang.String newValue)
          Resolves conflict with a new value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncConflict

public SyncConflict(Record remoteRecord,
                    Record localRecord)
Constructs a SyncConflict object.

Parameters:
remoteRecord - record from remote storage
localRecord - record from local storage
Method Detail

getKey

public java.lang.String getKey()
Gets the key of the record that is in conflict.

Returns:
key of the record

getRemoteRecord

public Record getRemoteRecord()
Gets the remote record that is in conflict.

Returns:
record from remote storage

getLocalRecord

public Record getLocalRecord()
Gets the local record that is in conflict.

Returns:
record from local storage

resolveWithRemoteRecord

public Record resolveWithRemoteRecord()
Resolves conflict with remote record

Returns:
resolved record

resolveWithLocalRecord

public Record resolveWithLocalRecord()
Resolves conflict with local record

Returns:
resolved record

resolveWithValue

public Record resolveWithValue(java.lang.String newValue)
Resolves conflict with a new value.

Parameters:
newValue - new value of the record
Returns:
resolved record

resolveWithLastWriterWins

public Record resolveWithLastWriterWins()
Resolves conflict with last writer wins. The record with a later last modified date wins the conflict.

Returns:
the record that has a later last modified date.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.