public class StoreCleaner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
convLang |
protected boolean |
doClean |
protected java.lang.String |
mainLang |
protected boolean |
overrideId |
static java.lang.String |
REVISION |
protected Store |
store |
protected java.util.Set<Storable> |
toCreate |
protected java.util.Map<Storable,Storable> |
toUpdate |
Constructor and Description |
---|
StoreCleaner(java.lang.String file)
Create a Store Cleaner that will not override IDs
|
StoreCleaner(java.lang.String file,
boolean overrideId)
Create a Store Cleaner that may override IDs of objects
|
StoreCleaner(java.lang.String file,
boolean overrideId,
boolean doClean)
Create a Store Cleaner that may override IDs of objects
|
StoreCleaner(java.lang.String file,
Stamp stamp)
Create a StoreCleaner with a starting specific stamp
|
StoreCleaner(java.lang.String file,
Stamp stamp,
boolean overrideId)
Create a Store Cleaner that may override IDs of objects and with starting Stamp
|
StoreCleaner(java.lang.String file,
Stamp stamp,
boolean overrideId,
boolean doClean)
Create a Store Cleaner that may override IDs of objects and with starting Stamp
|
StoreCleaner(java.lang.String file,
Stamp stamp,
boolean overrideId,
boolean doClean,
java.lang.String mainLang,
java.lang.String convLang) |
Modifier and Type | Method and Description |
---|---|
void |
addClassTag(java.lang.String tag,
java.lang.Class<?> clazz) |
boolean |
cleanUnknownLinks(Storable storable,
java.lang.reflect.Field field,
java.util.Set<Storable> storableSet)
Clean all unknown Storable from the given field of the given storable
|
boolean |
cleanUnknownLinks(Storable storable,
java.util.Map<java.lang.reflect.Field,java.util.Set<Storable>> referencedLinkMap)
Clean all unknown Storable from the given field map of the given storable
|
void |
convertLang(Storable data) |
java.util.Set<java.lang.reflect.Field> |
getFieldSet(Storable storable)
Return all the fields of a given storable
|
java.util.Map<java.lang.reflect.Field,java.util.Set<Storable>> |
getReferencedLinkMap(Storable storable,
java.util.Set<java.lang.reflect.Field> fieldSet)
Return all storable referenced by the given storable fields
|
java.util.Set<Storable> |
getReferencedLinkSet(Storable storable,
java.lang.reflect.Field field)
Return all storable referenced by the given storable field
|
java.util.Set<Storable> |
getReferencedLinkSet(Storable storable,
java.util.Set<java.lang.reflect.Field> fieldSet)
Return all storable referenced by the given storable fields
|
java.util.List<Storable> |
sortCreate(java.util.Collection<Storable> toSortCollection)
Sort a Collection by less update probability
|
protected void |
sortCreate(Storable storable,
java.util.Collection<Storable> toSortCollection,
java.util.Collection<Storable> isVisitedCollection,
java.util.List<Storable> sortedList)
Recursive call to sort storables collection by less update probability.
|
void |
updateStore()
Write all updates
|
void |
updateStore(java.util.Collection<Storable> collection)
Write all updates for the given collection
|
void |
updateStore(java.util.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(java.lang.String str)
Write a comment in the Store.
|
void |
writeStore(java.util.Collection<Storable> collection)
Write create of a collection of Storable then prepare update
|
void |
writeStore(java.util.Collection<Storable> collection,
boolean sort)
Write create of a collection of Storable then prepare update
|
void |
writeStore(java.util.Collection<Storable> collection,
boolean sort,
boolean overrideId)
Write create of a collection of Storable then prepare update
|
void |
writeStore(java.util.Collection<Storable> collection,
Stamp stamp)
Write create of a collection of Storable then prepare update
|
void |
writeStore(java.util.Collection<Storable> collection,
Stamp stamp,
boolean sort)
Write create of a collection of Storable then prepare update
|
void |
writeStore(java.util.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
|
public static final java.lang.String REVISION
protected Store store
protected java.util.Set<Storable> toCreate
protected boolean overrideId
protected boolean doClean
protected java.lang.String mainLang
protected java.lang.String convLang
public StoreCleaner(java.lang.String file) throws java.io.IOException, LogException
file
- java.io.IOException
LogException
public StoreCleaner(java.lang.String file, boolean overrideId) throws java.io.IOException, LogException
file
- overrideId
- java.io.IOException
LogException
public StoreCleaner(java.lang.String file, boolean overrideId, boolean doClean) throws java.io.IOException, LogException
file
- overrideId
- doClean
- java.io.IOException
LogException
public StoreCleaner(java.lang.String file, Stamp stamp) throws java.io.IOException, LogException
file
- stamp
- java.io.IOException
LogException
public StoreCleaner(java.lang.String file, Stamp stamp, boolean overrideId) throws java.io.IOException, LogException
file
- stamp
- overrideId
- java.io.IOException
LogException
public StoreCleaner(java.lang.String file, Stamp stamp, boolean overrideId, boolean doClean) throws java.io.IOException, LogException
file
- stamp
- overrideId
- doClean
- java.io.IOException
LogException
public StoreCleaner(java.lang.String file, Stamp stamp, boolean overrideId, boolean doClean, java.lang.String mainLang, java.lang.String convLang) throws java.io.IOException, LogException
java.io.IOException
LogException
public void writeComment() throws java.io.IOException
java.io.IOException
public void writeComment(java.lang.String str) throws java.io.IOException
str
- java.io.IOException
public void writeStore(java.util.Collection<Storable> collection) throws java.io.IOException
collection
- java.io.IOException
public void writeStore(java.util.Collection<Storable> collection, boolean sort) throws java.io.IOException
collection
- sort
- java.io.IOException
public void writeStore(java.util.Collection<Storable> collection, boolean sort, boolean overrideId) throws java.io.IOException
collection
- sort
- overrideId
- java.io.IOException
public void writeStore(java.util.Collection<Storable> collection, Stamp stamp) throws java.io.IOException
collection
- stamp
- java.io.IOException
public void writeStore(java.util.Collection<Storable> collection, Stamp stamp, boolean sort) throws java.io.IOException
collection
- stamp
- sort
- java.io.IOException
public void writeStore(java.util.Collection<Storable> collection, Stamp stamp, boolean sort, boolean overrideId) throws java.io.IOException
collection
- stamp
- sort
- overrideId
- java.io.IOException
public void writeStore(Storable storable) throws java.io.IOException
storable
- java.io.IOException
public void writeStore(Storable storable, boolean overrideId) throws java.io.IOException
storable
- overrideId
- java.io.IOException
public void writeStore(Storable storable, Stamp stamp) throws java.io.IOException
storable
- stamp
- java.io.IOException
public void writeStore(Storable storable, Stamp stamp, boolean overrideId) throws java.io.IOException
storable
- stamp
- overrideId
- java.io.IOException
public void updateStore() throws java.io.IOException
java.io.IOException
public void updateStore(java.util.Collection<Storable> collection) throws java.io.IOException
collection
- java.io.IOException
public void updateStore(java.util.Collection<Storable> collection, Stamp stamp) throws java.io.IOException
collection
- stamp
- java.io.IOException
public void updateStore(Storable storable, Stamp stamp) throws java.io.IOException
storable
- stamp
- java.io.IOException
public void updateStore(Storable storable) throws java.io.IOException
storable
- java.io.IOException
public void addClassTag(java.lang.String tag, java.lang.Class<?> clazz)
public java.util.List<Storable> sortCreate(java.util.Collection<Storable> toSortCollection)
toSortCollection
- protected void sortCreate(Storable storable, java.util.Collection<Storable> toSortCollection, java.util.Collection<Storable> isVisitedCollection, java.util.List<Storable> sortedList)
storable
- toSortCollection
- isVisitedCollection
- sortedList
- public boolean cleanUnknownLinks(Storable storable, java.lang.reflect.Field field, java.util.Set<Storable> storableSet)
public boolean cleanUnknownLinks(Storable storable, java.util.Map<java.lang.reflect.Field,java.util.Set<Storable>> referencedLinkMap)
storable
- referencedLinkMap
- public java.util.Map<java.lang.reflect.Field,java.util.Set<Storable>> getReferencedLinkMap(Storable storable, java.util.Set<java.lang.reflect.Field> fieldSet)
storable
- fieldSet
- public java.util.Set<Storable> getReferencedLinkSet(Storable storable, java.util.Set<java.lang.reflect.Field> fieldSet)
storable
- fieldSet
- public java.util.Set<Storable> getReferencedLinkSet(Storable storable, java.lang.reflect.Field field)
storable
- field
- public java.util.Set<java.lang.reflect.Field> getFieldSet(Storable storable)
public void convertLang(Storable data)
Copyright © 2001-2017 Jalios SA. All Rights Reserved.