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 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) |
Map<String,String>[] |
getAllSynchronizationRules(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 List<String> |
getConfiguredReferenceTypes(TypedObject typedObject)
Returns configured reference types.
|
Long |
getLastTargetProductSyncTimestamp(Item product)
Retrieves a time of last executed synchronization on the given product
|
int |
getPullSyncStatus(TypedObject product) |
protected List<TypedObject> |
getRelatedReferences(TypedObject typedObject)
Retrieves all related references according to current configuration.
|
protected int |
getRelatedReferencesMaxDepth() |
protected Map<String,List<String>> |
getRelatedReferencesTypesMap() |
SynchronizationService.SyncContext |
getSyncContext(TypedObject product) |
SynchronizationService.SyncContext |
getSyncContext(TypedObject product,
boolean pullSync) |
List<String> |
getSynchronizationStatuses(List<SyncItemJobModel> rules,
TypedObject sourceObject)
Retrieves synchronization statuses for given item
|
List<String> |
getSynchronizationStatusesSimple(List<SyncItemJobModel> rules,
TypedObject sourceObject) |
protected SynchronizationServiceImpl.SyncInfo |
getSyncInfo(TypedObject object) |
protected SynchronizationServiceImpl.SyncInfo |
getSyncInfoSimple(TypedObject object) |
List<SyncItemJobModel>[] |
getSyncJobs(ItemModel source,
ObjectType objectType)
Methods retrieves all matching catalog version (at first position - all accessible, at second position - all
forbidden)
|
Collection<TypedObject> |
getSyncSources(TypedObject object)
Gets the all sync source objects.
|
Collection<TypedObject> |
getSyncSourcesAndTargets(TypedObject object) |
Collection<TypedObject> |
getSyncTargets(TypedObject object)
Gets the all sync targets.
|
SystemService |
getSystemService() |
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(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 Boolean |
isSearchRestrictionDisabled()
Checks if the restrictions should be disabled for the internal search operations of the service.
|
boolean |
isVersionSynchronizedAtLeastOnce(List list)
Checks whether particular product version was synchronized at least once!
|
void |
performCatalogVersionSynchronization(Collection<CatalogVersionModel> data,
List<String> syncRulePkList,
CatalogVersionModel targetCatalogVersion,
String qualifier)
Responsible for catalog version synchronization //TODO should be refactor
|
void |
performPullSynchronization(List<TypedObject> targetItems) |
Collection<TypedObject> |
performSynchronization(Collection<? extends Object> items,
List<String> syncJobPkList,
CatalogVersionModel targetCatalogVersion,
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(Map<String,List<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 String DISABLE_RESTRICTION
public void setRelatedReferencesTypesMap(Map<String,List<String>> relatedReferencesTypesMap)
protected int getRelatedReferencesMaxDepth()
public void setRelatedReferencesMaxDepth(int relatedReferencesMaxDepth)
public TypeManager getTypeManager()
public CatalogManager getCatalogManager()
public Collection<TypedObject> getSyncSources(TypedObject object)
SynchronizationServicegetSyncSources in interface SynchronizationServiceobject - the objectpublic Collection<TypedObject> getSyncTargets(TypedObject object)
SynchronizationServicegetSyncTargets in interface SynchronizationServiceobject - the objectpublic Collection<TypedObject> getSyncSourcesAndTargets(TypedObject object)
getSyncSourcesAndTargets in interface SynchronizationServicepublic void performPullSynchronization(List<TypedObject> targetItems)
performPullSynchronization in interface SynchronizationServicepublic Collection<TypedObject> performSynchronization(Collection<? extends Object> items, List<String> syncJobPkList, CatalogVersionModel targetCatalogVersion, 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(List list)
isVersionSynchronizedAtLeastOnce in interface SynchronizationServicepublic Long getLastTargetProductSyncTimestamp(Item product)
product - - passed productprotected Boolean isSearchRestrictionDisabled()
TRUE. You can change this behavior by setting false value using
setSearchRestrictionsDisabled(boolean) injection.protected boolean checkRootOrSubType(TypedObject item, SyncItemJob syncJob)
public List<SyncItemJobModel>[] getTargetCatalogVersions(TypedObject item)
SynchronizationServicegetTargetCatalogVersions in interface SynchronizationServicepublic List<SyncItemJobModel>[] getSyncJobs(ItemModel source, ObjectType objectType)
SynchronizationServicegetSyncJobs in interface SynchronizationServicepublic CatalogVersionModel getCatalogVersionForItem(TypedObject item)
SynchronizationServicegetCatalogVersionForItem in interface SynchronizationServiceitem - - passed itempublic Map<String,String>[] getAllSynchronizationRules(Collection items)
SynchronizationServicegetAllSynchronizationRules in interface SynchronizationServiceSynchronizationService.getAllSynchronizationRules(java.util.Collection)public List<String> getSynchronizationStatuses(List<SyncItemJobModel> rules, TypedObject sourceObject)
SynchronizationServicegetSynchronizationStatuses in interface SynchronizationServicerules - - accessible synch rulessourceObject - - current checked objectpublic List<String> getSynchronizationStatusesSimple(List<SyncItemJobModel> rules, TypedObject sourceObject)
public void performCatalogVersionSynchronization(Collection<CatalogVersionModel> data, List<String> syncRulePkList, CatalogVersionModel targetCatalogVersion, String qualifier)
performCatalogVersionSynchronization in interface SynchronizationServicepublic boolean hasMultipleRules(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 List<TypedObject> getRelatedReferences(TypedObject typedObject)
typedObject - given objectprotected List<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 © 2017 SAP SE. All Rights Reserved.