public class SynchronizationServiceImpl extends AbstractServiceImpl implements SynchronizationService
| Modifier and Type | Class and Description |
|---|---|
protected class |
SynchronizationServiceImpl.CockpitDummySyncConfigurator |
protected class |
SynchronizationServiceImpl.SyncContextImpl |
protected class |
SynchronizationServiceImpl.SyncInfo |
SynchronizationService.SyncContext| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DISABLE_RESTRICTION |
modelService, typeServiceINITIAL_SYNC_IS_NEEDED, SYNCHRONIZATION_NOT_AVAILABLE, SYNCHRONIZATION_NOT_OK, SYNCHRONIZATION_OK| Constructor and Description |
|---|
SynchronizationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkRootOrSubType(TypedObject item,
SyncItemJob syncJob) |
java.util.Map<java.lang.String,java.lang.String>[] |
getAllSynchronizationRules(java.util.Collection items)
Retrieves all matching synchronization rules (at first position - all accessible, at second position - all
forbidden)
|
CatalogManager |
getCatalogManager() |
CatalogVersionModel |
getCatalogVersionForItem(TypedObject item)
Retrieves source catalog version for given item
|
protected java.util.List<java.lang.String> |
getConfiguredReferenceTypes(TypedObject typedObject)
Returns configured reference types.
|
java.lang.Long |
getLastTargetProductSyncTimestamp(Item product)
Retrieves a time of last executed synchronization on the given product
|
int |
getPullSyncStatus(TypedObject product) |
protected java.util.List<TypedObject> |
getRelatedReferences(TypedObject typedObject)
Retrieves all related references according to current configuration.
|
protected int |
getRelatedReferencesMaxDepth() |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getRelatedReferencesTypesMap() |
SynchronizationService.SyncContext |
getSyncContext(TypedObject product) |
SynchronizationService.SyncContext |
getSyncContext(TypedObject product,
boolean pullSync) |
java.util.List<java.lang.String> |
getSynchronizationStatuses(java.util.List<SyncItemJobModel> rules,
TypedObject sourceObject)
Retrieves synchronization statuses for given item
|
java.util.List<java.lang.String> |
getSynchronizationStatusesSimple(java.util.List<SyncItemJobModel> rules,
TypedObject sourceObject) |
protected SynchronizationServiceImpl.SyncInfo |
getSyncInfo(TypedObject object) |
protected SynchronizationServiceImpl.SyncInfo |
getSyncInfoSimple(TypedObject object) |
java.util.List<SyncItemJobModel>[] |
getSyncJobs(ItemModel source,
ObjectType objectType)
Methods retrieves all matching catalog version (at first position - all accessible, at second position - all
forbidden)
|
java.util.Collection<TypedObject> |
getSyncSources(TypedObject object)
Gets the all sync source objects.
|
java.util.Collection<TypedObject> |
getSyncSourcesAndTargets(TypedObject object) |
java.util.Collection<TypedObject> |
getSyncTargets(TypedObject object)
Gets the all sync targets.
|
SystemService |
getSystemService() |
java.util.List<SyncItemJobModel>[] |
getTargetCatalogVersions(TypedObject item)
Methods retrieves all matching catalog version (at first position - all accessible, at second position - all
forbidden)
|
TypeManager |
getTypeManager() |
boolean |
hasMultipleRules(java.util.Collection items)
Check whether some of passed items has ambigous synchronization rule
|
int |
isObjectSynchronized(TypedObject object)
TODO FIXME - Find way to get appropriate synchronization status, condition that is used below is not correct.
|
protected java.lang.Boolean |
isSearchRestrictionDisabled()
Checks if the restrictions should be disabled for the internal search operations of the service.
|
boolean |
isVersionSynchronizedAtLeastOnce(java.util.List list)
Checks whether particular product version was synchronized at least once!
|
void |
performCatalogVersionSynchronization(java.util.Collection<CatalogVersionModel> data,
java.util.List<java.lang.String> syncRulePkList,
CatalogVersionModel targetCatalogVersion,
java.lang.String qualifier)
Responsible for catalog version synchronization //TODO should be refactor
|
void |
performPullSynchronization(java.util.List<TypedObject> targetItems) |
java.util.Collection<TypedObject> |
performSynchronization(java.util.Collection<? extends java.lang.Object> items,
java.util.List<java.lang.String> syncJobPkList,
CatalogVersionModel targetCatalogVersion,
java.lang.String qualifier)
Method that runs particular synchronization
|
<E extends TypedObject> |
retrieveCatalogVersion(E item)
Retrieves source catalog version for given product
|
void |
setItemSyncTimestampDao(ItemSyncTimestampDao itemSyncTimestampDao) |
void |
setRelatedReferencesMaxDepth(int relatedReferencesMaxDepth) |
void |
setRelatedReferencesTypesMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> relatedReferencesTypesMap) |
void |
setSearchRestrictionsDisabled(boolean disabled) |
void |
setSynchronizationServiceDao(SynchronizationServiceDao synchronizationServiceDao)
Sets the synchronization service DAO.
|
void |
setSystemService(SystemService systemService) |
void |
setValueHandlerRegistry(ObjectValueHandlerRegistry valueHandlerRegistry) |
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelServicepublic static final java.lang.String DISABLE_RESTRICTION
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRelatedReferencesTypesMap()
public void setRelatedReferencesTypesMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> relatedReferencesTypesMap)
protected int getRelatedReferencesMaxDepth()
public void setRelatedReferencesMaxDepth(int relatedReferencesMaxDepth)
public TypeManager getTypeManager()
public CatalogManager getCatalogManager()
public java.util.Collection<TypedObject> getSyncSources(TypedObject object)
SynchronizationServicegetSyncSources in interface SynchronizationServiceobject - the objectpublic java.util.Collection<TypedObject> getSyncTargets(TypedObject object)
SynchronizationServicegetSyncTargets in interface SynchronizationServiceobject - the objectpublic java.util.Collection<TypedObject> getSyncSourcesAndTargets(TypedObject object)
getSyncSourcesAndTargets in interface SynchronizationServicepublic void performPullSynchronization(java.util.List<TypedObject> targetItems)
performPullSynchronization in interface SynchronizationServicepublic java.util.Collection<TypedObject> performSynchronization(java.util.Collection<? extends java.lang.Object> items, java.util.List<java.lang.String> syncJobPkList, CatalogVersionModel targetCatalogVersion, java.lang.String qualifier)
SynchronizationServiceperformSynchronization in interface SynchronizationServiceitems - - products passed for synchronizationspublic <E extends TypedObject> CatalogVersion retrieveCatalogVersion(E item)
item - - passed itempublic int getPullSyncStatus(TypedObject product)
getPullSyncStatus in interface SynchronizationServicepublic final int isObjectSynchronized(TypedObject object)
isObjectSynchronized in interface SynchronizationServiceobject - - passed itemprotected SynchronizationServiceImpl.SyncInfo getSyncInfo(TypedObject object)
protected SynchronizationServiceImpl.SyncInfo getSyncInfoSimple(TypedObject object)
public boolean isVersionSynchronizedAtLeastOnce(java.util.List list)
isVersionSynchronizedAtLeastOnce in interface SynchronizationServicepublic java.lang.Long getLastTargetProductSyncTimestamp(Item product)
product - - passed productprotected java.lang.Boolean isSearchRestrictionDisabled()
TRUE. You can change this behavior by setting false value using
setSearchRestrictionsDisabled(boolean) injection.protected boolean checkRootOrSubType(TypedObject item, SyncItemJob syncJob)
public java.util.List<SyncItemJobModel>[] getTargetCatalogVersions(TypedObject item)
SynchronizationServicegetTargetCatalogVersions in interface SynchronizationServicepublic java.util.List<SyncItemJobModel>[] getSyncJobs(ItemModel source, ObjectType objectType)
SynchronizationServicegetSyncJobs in interface SynchronizationServicepublic CatalogVersionModel getCatalogVersionForItem(TypedObject item)
SynchronizationServicegetCatalogVersionForItem in interface SynchronizationServiceitem - - passed itempublic java.util.Map<java.lang.String,java.lang.String>[] getAllSynchronizationRules(java.util.Collection items)
SynchronizationServicegetAllSynchronizationRules in interface SynchronizationServiceSynchronizationService.getAllSynchronizationRules(java.util.Collection)public java.util.List<java.lang.String> getSynchronizationStatuses(java.util.List<SyncItemJobModel> rules, TypedObject sourceObject)
SynchronizationServicegetSynchronizationStatuses in interface SynchronizationServicerules - - accessible synch rulessourceObject - - current checked objectpublic java.util.List<java.lang.String> getSynchronizationStatusesSimple(java.util.List<SyncItemJobModel> rules, TypedObject sourceObject)
public void performCatalogVersionSynchronization(java.util.Collection<CatalogVersionModel> data, java.util.List<java.lang.String> syncRulePkList, CatalogVersionModel targetCatalogVersion, java.lang.String qualifier)
performCatalogVersionSynchronization in interface SynchronizationServicepublic boolean hasMultipleRules(java.util.Collection items)
SynchronizationServicehasMultipleRules in interface SynchronizationServiceitems - - passed itemsSynchronizationService.hasMultipleRules(java.util.Collection)public SynchronizationService.SyncContext getSyncContext(TypedObject product)
getSyncContext in interface SynchronizationServicepublic SynchronizationService.SyncContext getSyncContext(TypedObject product, boolean pullSync)
getSyncContext in interface SynchronizationServicepublic void setSynchronizationServiceDao(SynchronizationServiceDao synchronizationServiceDao)
synchronizationServiceDao - the synchronizationServiceDao to setprotected java.util.List<TypedObject> getRelatedReferences(TypedObject typedObject)
typedObject - given objectprotected java.util.List<java.lang.String> getConfiguredReferenceTypes(TypedObject typedObject)
typedObject - given objectpublic void setSearchRestrictionsDisabled(boolean disabled)
public void setItemSyncTimestampDao(ItemSyncTimestampDao itemSyncTimestampDao)
public SystemService getSystemService()
public void setSystemService(SystemService systemService)
public void setValueHandlerRegistry(ObjectValueHandlerRegistry valueHandlerRegistry)
Copyright © 2018 SAP SE. All Rights Reserved.