Package com.jalios.jstore
Class StoreCleaner
java.lang.Object
com.jalios.jstore.StoreCleaner
Write clean line of Store.
- Use a file as a new Store (do not load it)
- Write Create Operation of Collection Storable or single Storable to the new Store
- Write Update Operation needed of Collection Storable or single Storable to the new Store
- Can Optimize Collection
- Can Override Id
- Can Override Stamp
- Use a file as a new Store (do not load it)
- Write Create Operation of Collection Storable or single Storable to the new Store
- Write Update Operation needed of Collection Storable or single Storable to the new Store
- Can Optimize Collection
- Can Override Id
- Can Override Stamp
- Author:
- Jean-Philippe Encausse
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStoreCleaner(String file) Create a Store Cleaner that will not override IDsStoreCleaner(String file, boolean overrideId) Create a Store Cleaner that may override IDs of objectsStoreCleaner(String file, boolean overrideId, boolean doClean) Create a Store Cleaner that may override IDs of objectsStoreCleaner(String file, Stamp stamp) Create a StoreCleaner with a starting specific stampStoreCleaner(String file, Stamp stamp, boolean overrideId) Create a Store Cleaner that may override IDs of objects and with starting StampStoreCleaner(String file, Stamp stamp, boolean overrideId, boolean doClean) Create a Store Cleaner that may override IDs of objects and with starting StampStoreCleaner(String file, Stamp stamp, boolean overrideId, boolean doClean, String mainLang, String convLang) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassTag(String tag, Class<?> clazz) booleancleanUnknownLinks(Storable storable, Field field, Set<Storable> storableSet) Clean all unknown Storable from the given field of the given storablebooleanClean all unknown Storable from the given field map of the given storablevoidconvertLang(Storable data) getFieldSet(Storable storable) Return all the fields of a given storablegetReferencedLinkMap(Storable storable, Set<Field> fieldSet) Return all storable referenced by the given storable fieldsgetReferencedLinkSet(Storable storable, Field field) Return all storable referenced by the given storable fieldgetReferencedLinkSet(Storable storable, Set<Field> fieldSet) Return all storable referenced by the given storable fieldsprotected voidsortCreate(Storable storable, Collection<Storable> toSortCollection, Collection<Storable> isVisitedCollection, List<Storable> sortedList) Recursive call to sort storables collection by less update probability.sortCreate(Collection<Storable> toSortCollection) Sort a Collection by less update probabilityvoidWrite all updatesvoidupdateStore(Storable storable) Write an update of a given Storable already created
If the Storable need an Update then doUpdate and remove it from the Update Table
If the Storable doesn't need an update but exist in the Store (warning retrieve it by it's Id) then do an update.voidupdateStore(Storable storable, Stamp stamp) Write an update of a given Storable already created
If the Storable need an Update then doUpdate and remove it from the Update Table
If the Storable doesn't need an update but exist in the Store (warning retrieve it by it's Id) then do an update.voidupdateStore(Collection<Storable> collection) Write all updates for the given collectionvoidupdateStore(Collection<Storable> collection, Stamp stamp) Write all updates for the given collectionvoidvoidwriteComment(String str) Write a comment in the Store.voidwriteStore(Storable storable) Write create of a Storable then prepare updatevoidwriteStore(Storable storable, boolean overrideId) Write create of a Storable then prepare updatevoidwriteStore(Storable storable, Stamp stamp) Write create of a Storable then prepare updatevoidwriteStore(Storable storable, Stamp stamp, boolean overrideId) Write create of a Storable then prepare updatevoidwriteStore(Collection<Storable> collection) Write create of a collection of Storable then prepare updatevoidwriteStore(Collection<Storable> collection, boolean sort) Write create of a collection of Storable then prepare updatevoidwriteStore(Collection<Storable> collection, boolean sort, boolean overrideId) Write create of a collection of Storable then prepare updatevoidwriteStore(Collection<Storable> collection, Stamp stamp) Write create of a collection of Storable then prepare updatevoidwriteStore(Collection<Storable> collection, Stamp stamp, boolean sort) Write create of a collection of Storable then prepare updatevoidwriteStore(Collection<Storable> collection, Stamp stamp, boolean sort, boolean overrideId) Write create of a collection of Storable then prepare update
-
Field Details
-
store
-
toCreate
-
toUpdate
-
overrideId
protected boolean overrideId -
doClean
protected boolean doClean -
mainLang
-
convLang
-
-
Constructor Details
-
StoreCleaner
Create a Store Cleaner that will not override IDs- Parameters:
file-- Throws:
IOExceptionLogException
-
StoreCleaner
Create a Store Cleaner that may override IDs of objects- Parameters:
file-overrideId-- Throws:
IOExceptionLogException
-
StoreCleaner
public StoreCleaner(String file, boolean overrideId, boolean doClean) throws IOException, LogException Create a Store Cleaner that may override IDs of objects- Parameters:
file-overrideId-doClean-- Throws:
IOExceptionLogException
-
StoreCleaner
Create a StoreCleaner with a starting specific stamp- Parameters:
file-stamp-- Throws:
IOExceptionLogException
-
StoreCleaner
Create a Store Cleaner that may override IDs of objects and with starting Stamp- Parameters:
file-stamp-overrideId-- Throws:
IOExceptionLogException
-
StoreCleaner
public StoreCleaner(String file, Stamp stamp, boolean overrideId, boolean doClean) throws IOException, LogException Create a Store Cleaner that may override IDs of objects and with starting Stamp- Parameters:
file-stamp-overrideId-doClean-- Throws:
IOExceptionLogException
-
StoreCleaner
public StoreCleaner(String file, Stamp stamp, boolean overrideId, boolean doClean, String mainLang, String convLang) throws IOException, LogException - Throws:
IOExceptionLogException
-
-
Method Details
-
writeComment
- Throws:
IOException
-
writeComment
Write a comment in the Store.- Parameters:
str-- Throws:
IOException
-
writeStore
Write create of a collection of Storable then prepare update- Parameters:
collection-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
Write create of a collection of Storable then prepare update- Parameters:
collection-sort-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
public void writeStore(Collection<Storable> collection, boolean sort, boolean overrideId) throws IOException Write create of a collection of Storable then prepare update- Parameters:
collection-sort-overrideId-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
Write create of a collection of Storable then prepare update- Parameters:
collection-stamp-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
public void writeStore(Collection<Storable> collection, Stamp stamp, boolean sort) throws IOException Write create of a collection of Storable then prepare update- Parameters:
collection-stamp-sort-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
public void writeStore(Collection<Storable> collection, Stamp stamp, boolean sort, boolean overrideId) throws IOException Write create of a collection of Storable then prepare update- Parameters:
collection-stamp-sort-overrideId-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
Write create of a Storable then prepare update- Parameters:
storable-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
Write create of a Storable then prepare update- Parameters:
storable-overrideId-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
Write create of a Storable then prepare update- Parameters:
storable-stamp-- Throws:
IOException- Since:
- jcms-4.0
-
writeStore
Write create of a Storable then prepare update- Parameters:
storable-stamp-overrideId-- Throws:
IOException- Since:
- jcms-4.0
-
updateStore
Write all updates- Throws:
IOException- Since:
- jcms-4.0
-
updateStore
Write all updates for the given collection- Parameters:
collection-- Throws:
IOException- Since:
- jcms-4.0
-
updateStore
Write all updates for the given collection- Parameters:
collection-stamp-- Throws:
IOException- Since:
- jcms-4.0
-
updateStore
Write an update of a given Storable already created
If the Storable need an Update then doUpdate and remove it from the Update Table
If the Storable doesn't need an update but exist in the Store (warning retrieve it by it's Id) then do an update. Write all updates for the given collection- Parameters:
storable-stamp-- Throws:
IOException- Since:
- jcms-4.0
-
updateStore
Write an update of a given Storable already created
If the Storable need an Update then doUpdate and remove it from the Update Table
If the Storable doesn't need an update but exist in the Store (warning retrieve it by it's Id) then do an update. Write all updates for the given collection- Parameters:
storable-- Throws:
IOException- Since:
- jcms-4.0
-
addClassTag
-
sortCreate
Sort a Collection by less update probability- Parameters:
toSortCollection-- Returns:
- a sorted collection
- Since:
- jcms-4.0
-
sortCreate
protected void sortCreate(Storable storable, Collection<Storable> toSortCollection, Collection<Storable> isVisitedCollection, List<Storable> sortedList) Recursive call to sort storables collection by less update probability.- Parameters:
storable-toSortCollection-isVisitedCollection-sortedList-- Since:
- jcms-4.0
-
cleanUnknownLinks
Clean all unknown Storable from the given field of the given storable- Returns:
- true if a clean has be done
- Since:
- jcms-4.0
-
cleanUnknownLinks
Clean all unknown Storable from the given field map of the given storable- Parameters:
storable-referencedLinkMap-- Returns:
- true if a clean has be done
- Since:
- jcms-4.0
-
getReferencedLinkMap
Return all storable referenced by the given storable fields- Parameters:
storable-fieldSet-- Returns:
- Map Fields / Set of Storable
- Since:
- jcms-4.0
-
getReferencedLinkSet
Return all storable referenced by the given storable fields- Parameters:
storable-fieldSet-- Returns:
- Set of Storable
- Since:
- jcms-4.0
-
getReferencedLinkSet
Return all storable referenced by the given storable field- Parameters:
storable-field-- Returns:
- Set of Storable
- Since:
- jcms-4.0
-
getFieldSet
Return all the fields of a given storable- Returns:
- Set of Field
- Since:
- jcms-4.0
-
convertLang
-