Class SyncHelper


  • public class SyncHelper
    extends Object
    Author:
    Maxim.Manuylov Date: 21.11.2014
    • Method Detail

      • tryToClaimOwnership

        public boolean tryToClaimOwnership​(@NotNull
                                           SPropertyHolder item)
      • preparePropertyUpdate

        @Nullable
        public String preparePropertyUpdate​(@NotNull
                                            SPropertyHolder item,
                                            @Nullable
                                            String currentLocalValue,
                                            @Nullable
                                            String currentRemoteValue,
                                            @NotNull
                                            String propertyKey,
                                            boolean forceUpdateIfNeverSyncedBefore)
        Decides whether to update a value for a user/group and updates previous remote value if needed.
        Parameters:
        item - the user or user group
        currentLocalValue - current value
        currentRemoteValue - remote value
        propertyKey - the key
        forceUpdateIfNeverSyncedBefore - if property value never synced before, force its update with remote value (useful for newly created objects)
        Returns:
        null if no property update is necessary or the new value to update the property to
      • addError

        public void addError​(@NotNull
                             String message)
      • addError

        public void addError​(@Nullable
                             String message,
                             @Nullable
                             Throwable e)