|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.history.TopiaHistoryServiceImpl
public class TopiaHistoryServiceImpl
Pour active l'historisation des actions utilisateur il faut mettre dans le fichier de propriete la cle suivante:
puis par defaut toutes les actions sont historis�es, mais on peut choisir dans desactiver certaines:
On peut demander a ce que l'historique soit nettoyer automatiquement avec:
Si on souhaite garder plus d'un jour, mais nettoyer tout de meme tous les jours, il faut utiliser l'option topia.history.clean.date qui donne le nombre de jour a conserver.
Si on ne veut pas conserver un nombre de jour, mais un nombre d'enregistrement il faut utiliser a la place topia.history.clean.number
Si l'on souhaite sauver l'history avant de le nettoyer il faut utiliser l'option topia.history.store.file. Le fichier indiqu� est utilis� pour ajouter l'history. Si le fichier existe, les nouveaux history lui sont ajouter, sinon le fichier est cr��. Sous Linux on peut utiliser logrotate sur ce fichier.
| Field Summary | |
|---|---|
protected int |
cleanDate
nombre de jour a garder |
protected float |
cleanFrequency
en jour |
protected int |
cleanNumber
nombre d'history a garder |
protected TopiaContextImplementor |
context
|
protected TopiaHistoryListener |
historyListener
|
protected java.io.File |
storeFile
fichier on conserver les histories |
protected java.util.concurrent.ScheduledThreadPoolExecutor |
task
Scheduler de nettoyage |
| Fields inherited from interface org.nuiton.topia.history.TopiaHistoryService |
|---|
SERVICE_NAME |
| Constructor Summary | |
|---|---|
TopiaHistoryServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
beginTransaction(TopiaTransactionEvent event)
Permet de propager le l'historisation sur l'ensemble des contextes |
void |
clear(java.util.Date toDate)
Supprime tout l'historique jusqu'a la date passé en parametre |
java.util.List<java.lang.String> |
findLastAction(int limit,
java.lang.String user,
java.lang.String type,
java.lang.Integer... actions)
Search TopiaId targeted by action and user. |
java.lang.Class<?>[] |
getPersistenceClasses()
|
java.lang.String |
getServiceName()
|
void |
keep(int number)
Ne garde dans l'historique que les number dernier elements |
boolean |
postInit(TopiaContextImplementor context)
|
boolean |
preInit(TopiaContextImplementor context)
|
void |
run()
Fait le menage de l'history |
void |
store(java.util.Date toDate,
java.io.Writer out)
Permet de stocker l'historique dans un writer (par exemple un fichier) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TopiaHistoryListener historyListener
protected TopiaContextImplementor context
protected float cleanFrequency
protected int cleanDate
protected int cleanNumber
protected java.io.File storeFile
protected java.util.concurrent.ScheduledThreadPoolExecutor task
| Constructor Detail |
|---|
public TopiaHistoryServiceImpl()
| Method Detail |
|---|
public java.lang.String getServiceName()
getServiceName in interface TopiaServicepublic java.lang.Class<?>[] getPersistenceClasses()
getPersistenceClasses in interface TopiaServicepublic boolean preInit(TopiaContextImplementor context)
preInit in interface TopiaServicepublic boolean postInit(TopiaContextImplementor context)
postInit in interface TopiaServicepublic void beginTransaction(TopiaTransactionEvent event)
beginTransaction in interface TopiaTransactionVetoableevent -
public void clear(java.util.Date toDate)
throws java.lang.Exception
TopiaHistoryService
clear in interface TopiaHistoryServicetoDate - la derniere date effacé inclue
java.lang.Exception - if any pb
public void keep(int number)
throws java.lang.Exception
TopiaHistoryService
keep in interface TopiaHistoryServicenumber - le nombre d'element a conserver dans l'historique
java.lang.Exception - if any pb
public void store(java.util.Date toDate,
java.io.Writer out)
throws java.lang.Exception
TopiaHistoryService
store in interface TopiaHistoryServicetoDate - l'historique est sauve jusqu'a cette date incluseout - le flux sur lequel il faut ecrire l'historique
java.lang.Exception - if any pb
public java.util.List<java.lang.String> findLastAction(int limit,
java.lang.String user,
java.lang.String type,
java.lang.Integer... actions)
throws java.lang.Exception
TopiaHistoryService
findLastAction in interface TopiaHistoryServicelimit - maximum number of result, -1 for alluser - TopiaId of user, can be null for all usertype - type of target search (fqn class) can be null for all objectactions - action as int that we want to search, can be an sum of
action wanted LOAD + UPDATE + DELETE + CREATE for all action
java.lang.Exception - if any pbpublic void run()
run in interface java.lang.RunnableRunnable.run()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||