|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jstore.StoreCleaner
public class 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
Field Summary | |
---|---|
protected String |
convLang
|
protected boolean |
doClean
|
protected String |
mainLang
|
protected boolean |
overrideId
|
static String |
REVISION
|
protected Store |
store
|
protected Set<Storable> |
toCreate
|
protected Map<Storable,Storable> |
toUpdate
|
Constructor Summary | |
---|---|
StoreCleaner(String file)
Create a Store Cleaner that will not override IDs |
|
StoreCleaner(String file,
boolean overrideId)
Create a Store Cleaner that may override IDs of objects |
|
StoreCleaner(String file,
boolean overrideId,
boolean doClean)
Create a Store Cleaner that may override IDs of objects |
|
StoreCleaner(String file,
Stamp stamp)
Create a StoreCleaner with a starting specific stamp |
|
StoreCleaner(String file,
Stamp stamp,
boolean overrideId)
Create a Store Cleaner that may override IDs of objects and with starting Stamp |
|
StoreCleaner(String file,
Stamp stamp,
boolean overrideId,
boolean doClean)
Create a Store Cleaner that may override IDs of objects and with starting Stamp |
|
StoreCleaner(String file,
Stamp stamp,
boolean overrideId,
boolean doClean,
String mainLang,
String convLang)
|
Method Summary | |
---|---|
void |
addClassTag(String tag,
Class<?> clazz)
|
boolean |
cleanUnknownLinks(Storable storable,
Field field,
Set<Storable> storableSet)
Clean all unknown Storable from the given field of the given storable |
boolean |
cleanUnknownLinks(Storable storable,
Map<Field,Set<Storable>> referencedLinkMap)
Clean all unknown Storable from the given field map of the given storable |
void |
convertLang(Storable data)
|
Set<Field> |
getFieldSet(Storable storable)
Return all the fields of a given storable |
Map<Field,Set<Storable>> |
getReferencedLinkMap(Storable storable,
Set<Field> fieldSet)
Return all storable referenced by the given storable fields |
Set<Storable> |
getReferencedLinkSet(Storable storable,
Field field)
Return all storable referenced by the given storable field |
Set<Storable> |
getReferencedLinkSet(Storable storable,
Set<Field> fieldSet)
Return all storable referenced by the given storable fields |
List<Storable> |
sortCreate(Collection<Storable> toSortCollection)
Sort a Collection by less update probability |
protected void |
sortCreate(Storable storable,
Collection<Storable> toSortCollection,
Collection<Storable> isVisitedCollection,
List<Storable> sortedList)
Recursive call to sort storables collection by less update probability. |
void |
updateStore()
Write all updates |
void |
updateStore(Collection<Storable> collection)
Write all updates for the given collection |
void |
updateStore(Collection<Storable> collection,
Stamp stamp)
Write all updates for the given collection |
void |
updateStore(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. |
void |
updateStore(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. |
void |
writeComment()
|
void |
writeComment(String str)
Write a comment in the Store. |
void |
writeStore(Collection<Storable> collection)
Write create of a collection of Storable then prepare update |
void |
writeStore(Collection<Storable> collection,
boolean sort)
Write create of a collection of Storable then prepare update |
void |
writeStore(Collection<Storable> collection,
boolean sort,
boolean overrideId)
Write create of a collection of Storable then prepare update |
void |
writeStore(Collection<Storable> collection,
Stamp stamp)
Write create of a collection of Storable then prepare update |
void |
writeStore(Collection<Storable> collection,
Stamp stamp,
boolean sort)
Write create of a collection of Storable then prepare update |
void |
writeStore(Collection<Storable> collection,
Stamp stamp,
boolean sort,
boolean overrideId)
Write create of a collection of Storable then prepare update |
void |
writeStore(Storable storable)
Write create of a Storable then prepare update |
void |
writeStore(Storable storable,
boolean overrideId)
Write create of a Storable then prepare update |
void |
writeStore(Storable storable,
Stamp stamp)
Write create of a Storable then prepare update |
void |
writeStore(Storable storable,
Stamp stamp,
boolean overrideId)
Write create of a Storable then prepare update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected Store store
protected Set<Storable> toCreate
protected Map<Storable,Storable> toUpdate
protected boolean overrideId
protected boolean doClean
protected String mainLang
protected String convLang
Constructor Detail |
---|
public StoreCleaner(String file) throws IOException, LogException
file
-
IOException
LogException
public StoreCleaner(String file, boolean overrideId) throws IOException, LogException
file
- overrideId
-
IOException
LogException
public StoreCleaner(String file, boolean overrideId, boolean doClean) throws IOException, LogException
file
- overrideId
- doClean
-
IOException
LogException
public StoreCleaner(String file, Stamp stamp) throws IOException, LogException
file
- stamp
-
IOException
LogException
public StoreCleaner(String file, Stamp stamp, boolean overrideId) throws IOException, LogException
file
- stamp
- overrideId
-
IOException
LogException
public StoreCleaner(String file, Stamp stamp, boolean overrideId, boolean doClean) throws IOException, LogException
file
- stamp
- overrideId
- doClean
-
IOException
LogException
public StoreCleaner(String file, Stamp stamp, boolean overrideId, boolean doClean, String mainLang, String convLang) throws IOException, LogException
IOException
LogException
Method Detail |
---|
public void writeComment() throws IOException
IOException
public void writeComment(String str) throws IOException
str
-
IOException
public void writeStore(Collection<Storable> collection) throws IOException
collection
-
IOException
public void writeStore(Collection<Storable> collection, boolean sort) throws IOException
collection
- sort
-
IOException
public void writeStore(Collection<Storable> collection, boolean sort, boolean overrideId) throws IOException
collection
- sort
- overrideId
-
IOException
public void writeStore(Collection<Storable> collection, Stamp stamp) throws IOException
collection
- stamp
-
IOException
public void writeStore(Collection<Storable> collection, Stamp stamp, boolean sort) throws IOException
collection
- stamp
- sort
-
IOException
public void writeStore(Collection<Storable> collection, Stamp stamp, boolean sort, boolean overrideId) throws IOException
collection
- stamp
- sort
- overrideId
-
IOException
public void writeStore(Storable storable) throws IOException
storable
-
IOException
public void writeStore(Storable storable, boolean overrideId) throws IOException
storable
- overrideId
-
IOException
public void writeStore(Storable storable, Stamp stamp) throws IOException
storable
- stamp
-
IOException
public void writeStore(Storable storable, Stamp stamp, boolean overrideId) throws IOException
storable
- stamp
- overrideId
-
IOException
public void updateStore() throws IOException
IOException
public void updateStore(Collection<Storable> collection) throws IOException
collection
-
IOException
public void updateStore(Collection<Storable> collection, Stamp stamp) throws IOException
collection
- stamp
-
IOException
public void updateStore(Storable storable, Stamp stamp) throws IOException
storable
- stamp
-
IOException
public void updateStore(Storable storable) throws IOException
storable
-
IOException
public void addClassTag(String tag, Class<?> clazz)
public List<Storable> sortCreate(Collection<Storable> toSortCollection)
toSortCollection
-
protected void sortCreate(Storable storable, Collection<Storable> toSortCollection, Collection<Storable> isVisitedCollection, List<Storable> sortedList)
storable
- toSortCollection
- isVisitedCollection
- sortedList
- public boolean cleanUnknownLinks(Storable storable, Field field, Set<Storable> storableSet)
public boolean cleanUnknownLinks(Storable storable, Map<Field,Set<Storable>> referencedLinkMap)
storable
- referencedLinkMap
-
public Map<Field,Set<Storable>> getReferencedLinkMap(Storable storable, Set<Field> fieldSet)
storable
- fieldSet
-
public Set<Storable> getReferencedLinkSet(Storable storable, Set<Field> fieldSet)
storable
- fieldSet
-
public Set<Storable> getReferencedLinkSet(Storable storable, Field field)
storable
- field
-
public Set<Field> getFieldSet(Storable storable)
public void convertLang(Storable data)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |