Package org.apache.hop.history.local
Class LocalAuditManager
- java.lang.Object
-
- org.apache.hop.history.local.LocalAuditManager
-
- All Implemented Interfaces:
IAuditManager
public class LocalAuditManager extends Object implements IAuditManager
The local audit manager stores its history in the hop home directory (~/.hop) under the history folder So : $HOME/.hop/historyIt will be done using a new metadata. - Event groups are mapped to namespaces -
-
-
Constructor Summary
Constructors Constructor Description LocalAuditManager()LocalAuditManager(String rootFolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearEvents()Clear all events.List<AuditEvent>findEvents(String group, String type, boolean unique)Find all the events for a certain group and of a given type.AuditStateMaploadAuditStateMap(String group, String type)Load the auditing state map for the specified group and typeMap<String,String>loadMap(String group, String type)Load the auditing state map for the specified group and typeAuditListretrieveList(String group, String type)Retrieve a list of items of a certain group and typeAuditStateretrieveState(String group, String type, String name)Retrieve the state of an object with a particular namevoidsaveAuditStateMap(String group, String type, AuditStateMap auditStateMap)Save the given audit state map for a map of objects.voidsaveMap(String group, String type, Map<String,String> map)Store a Strings MapvoidstoreEvent(AuditEvent event)Add an eventvoidstoreList(String group, String type, AuditList auditList)Store a listvoidstoreState(String group, String type, AuditState auditState)Store the state of an object
-
-
-
Constructor Detail
-
LocalAuditManager
public LocalAuditManager()
-
LocalAuditManager
public LocalAuditManager(String rootFolder)
-
-
Method Detail
-
storeEvent
public void storeEvent(AuditEvent event) throws HopException
Description copied from interface:IAuditManagerAdd an event- Specified by:
storeEventin interfaceIAuditManager- Throws:
HopException
-
findEvents
public List<AuditEvent> findEvents(String group, String type, boolean unique) throws HopException
Description copied from interface:IAuditManagerFind all the events for a certain group and of a given type.- Specified by:
findEventsin interfaceIAuditManager- Parameters:
group- The event grouptype- The event typeunique- Set to true if you want to have a unique list by name- Returns:
- The matching events reverse sorted by event date (last events first).
- Throws:
HopException
-
storeList
public void storeList(String group, String type, AuditList auditList) throws HopException
Description copied from interface:IAuditManagerStore a list- Specified by:
storeListin interfaceIAuditManager- Parameters:
group- The group to which the list belongstype- The type of list you want to storeauditList- The list to be stored- Throws:
HopException
-
retrieveList
public AuditList retrieveList(String group, String type) throws HopException
Description copied from interface:IAuditManagerRetrieve a list of items of a certain group and type- Specified by:
retrieveListin interfaceIAuditManager- Parameters:
group- The group to which the list belongstype- The type of list you want retrieved- Returns:
- The list
- Throws:
HopException
-
storeState
public void storeState(String group, String type, AuditState auditState) throws HopException
Description copied from interface:IAuditManagerStore the state of an object- Specified by:
storeStatein interfaceIAuditManager- Parameters:
group- the group to which the state belongs (namespace, environment, ...)type- the type of state (shell, perspective, ...)auditState- The audit state- Throws:
HopException- In case something goes wrong
-
loadAuditStateMap
public AuditStateMap loadAuditStateMap(String group, String type)
Load the auditing state map for the specified group and type- Specified by:
loadAuditStateMapin interfaceIAuditManager- Parameters:
group-type-- Returns:
- The map. An empty one if there are any loading problems. They are simply logged and you start over.
-
saveAuditStateMap
public void saveAuditStateMap(String group, String type, AuditStateMap auditStateMap) throws HopException
Description copied from interface:IAuditManagerSave the given audit state map for a map of objects.- Specified by:
saveAuditStateMapin interfaceIAuditManager- Throws:
HopException
-
retrieveState
public AuditState retrieveState(String group, String type, String name) throws HopException
Description copied from interface:IAuditManagerRetrieve the state of an object with a particular name- Specified by:
retrieveStatein interfaceIAuditManager- Parameters:
group- The group (namespace, environment)type- The type (file, window, perspective,...)name- filename, shell name, ...- Returns:
- The state
- Throws:
HopException- in case something goes wrong
-
loadMap
public Map<String,String> loadMap(String group, String type)
Load the auditing state map for the specified group and type- Specified by:
loadMapin interfaceIAuditManager- Parameters:
group-type-- Returns:
- The map. An empty one if there are any loading problems. They are simply logged and you start over.
-
saveMap
public void saveMap(String group, String type, Map<String,String> map) throws HopException
Description copied from interface:IAuditManagerStore a Strings Map- Specified by:
saveMapin interfaceIAuditManagermap- The map to save- Throws:
HopException
-
clearEvents
public void clearEvents() throws HopExceptionDescription copied from interface:IAuditManagerClear all events.- Specified by:
clearEventsin interfaceIAuditManager- Throws:
HopException
-
-