public class BaseSyncOptions
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
BaseSyncOptions(io.sphere.sdk.client.SphereClient ctpClient,
java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> errorCallBack,
java.util.function.Consumer<java.lang.String> warningCallBack,
int batchSize,
boolean removeOtherLocales,
boolean removeOtherSetEntries,
boolean removeOtherCollectionEntries,
boolean removeOtherProperties,
boolean allowUuid) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyErrorCallback(java.lang.String errorMessage) |
void |
applyErrorCallback(java.lang.String errorMessage,
java.lang.Throwable exception)
Given an
errorMessage and an exception, this method calls the errorCallBack function
which is set to this instance of the BaseSyncOptions. |
void |
applyWarningCallback(java.lang.String warningMessage)
Given a
warningMessage string, this method calls the warningCallBack function which is set
to this instance of the BaseSyncOptions. |
int |
getBatchSize()
Gets the batch size used in the sync process.
|
io.sphere.sdk.client.SphereClient |
getCtpClient()
Returns the
SphereClient responsible for interaction with the target CTP project. |
java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> |
getErrorCallBack()
|
java.util.function.Consumer<java.lang.String> |
getWarningCallBack()
|
boolean |
shouldAllowUuidKeys()
The sync expects the user to pass the keys to references in the
id field of References. |
boolean |
shouldRemoveOtherCollectionEntries()
Returns a
boolean flag which enables the sync module to add collection (e.g. |
boolean |
shouldRemoveOtherLocales()
Returns a
boolean flag which enables the sync module to add additional localizations without deleting
existing ones, if set to false. |
boolean |
shouldRemoveOtherProperties()
Returns a
boolean flag which enables the sync module to add additional object properties (e.g. |
boolean |
shouldRemoveOtherSetEntries()
Returns a
boolean flag which enables the sync module to add additional Set entries without deleting
existing ones, if set to false. |
protected BaseSyncOptions(@Nonnull
io.sphere.sdk.client.SphereClient ctpClient,
java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> errorCallBack,
java.util.function.Consumer<java.lang.String> warningCallBack,
int batchSize,
boolean removeOtherLocales,
boolean removeOtherSetEntries,
boolean removeOtherCollectionEntries,
boolean removeOtherProperties,
boolean allowUuid)
public io.sphere.sdk.client.SphereClient getCtpClient()
SphereClient responsible for interaction with the target CTP project.SphereClient responsible for interaction with the target CTP project.@Nullable public java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> getErrorCallBack()
errorCallBack BiConsumer<String, Throwable> function set to
this BaseSyncOptions. It represents the callback that is called whenever an event occurs during
the sync process that represents an error.errorCallBack BiConsumer<String, Throwable> function set to
this BaseSyncOptions@Nullable public java.util.function.Consumer<java.lang.String> getWarningCallBack()
warningCallBack Consumer<String> function set to this
BaseSyncOptions. It represents the callback that is called whenever an event occurs
during the sync process that represents a warning.warningCallBack Consumer<String> function set to this
BaseSyncOptionspublic boolean shouldRemoveOtherLocales()
boolean flag which enables the sync module to add additional localizations without deleting
existing ones, if set to false. If set to true, which is the default value of the option,
it deletes the existing object properties.boolean flag which enables the sync module to add additional localizations without deleting
existing ones, if set to false. If set to true, which is the default value of the option,
it deletes the existing object properties.public boolean shouldRemoveOtherSetEntries()
boolean flag which enables the sync module to add additional Set entries without deleting
existing ones, if set to false. If set to true, which is the default value of the option,
it deletes the existing Set entries.boolean flag which enables the sync module to add additional Set entries without deleting
existing ones, if set to false. If set to true, which is the default value of the option,
it deletes the existing Set entries.public boolean shouldRemoveOtherCollectionEntries()
boolean flag which enables the sync module to add collection (e.g. Assets, Images etc.) entries
without deleting existing ones, if set to false. If set to true, which is the default value of the
option, it deletes the existing collection entries.boolean flag which enables the sync module to add collection (e.g. Assets, Images etc.) entries
without deleting existing ones, if set to false. If set to true, which is the default value of the
option, it deletes the existing collection entries.public boolean shouldRemoveOtherProperties()
boolean flag which enables the sync module to add additional object properties (e.g. custom
fields, product attributes, etc..) without deleting existing ones, if set to false. If set to true,
which is the default value of the option, it deletes the existing object properties.boolean flag which enables the sync module to add additional object properties (e.g. custom
fields, product attributes, etc..) without deleting existing ones, if set to false. If set to true,
which is the default value of the option, it deletes the existing object properties.public void applyWarningCallback(@Nonnull
java.lang.String warningMessage)
warningMessage string, this method calls the warningCallBack function which is set
to this instance of the BaseSyncOptions. If there warningCallBack is null, this
method does nothing.warningMessage - the warning message to supply to the warningCallBack function.public void applyErrorCallback(@Nonnull
java.lang.String errorMessage,
@Nullable
java.lang.Throwable exception)
errorMessage and an exception, this method calls the errorCallBack function
which is set to this instance of the BaseSyncOptions. If there errorCallBack is null,
this method does nothing.errorMessage - the error message to supply as first param to the errorCallBack function.exception - optional Throwable instance to supply to the errorCallBack function as a
second param.public void applyErrorCallback(@Nonnull
java.lang.String errorMessage)
errorMessage - the error message to supply as first param to the errorCallBack function.applyErrorCallback(String, Throwable)public boolean shouldAllowUuidKeys()
id field of References. If the key values
are in UUID format, then this flag must be set to true, otherwise the sync will fail to resolve the reference.
This flag, if set to true, enables the user to use keys with UUID format. By default, it is set to false.boolean flag, if set to true, enables the user to use keys with UUID format for references.
By default, it is set to false.public int getBatchSize()
This batch size is set to 30 by default.