Class BundleContextHistoryManager
- java.lang.Object
-
- org.opennms.features.topology.plugins.topo.BundleContextHistoryManager
-
- All Implemented Interfaces:
HistoryManager
public class BundleContextHistoryManager extends java.lang.Object implements HistoryManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDATA_FILE_NAME
-
Constructor Summary
Constructors Constructor Description BundleContextHistoryManager(org.osgi.framework.BundleContext bundleContext, ServiceLocator serviceLocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyHistory(java.lang.String fragment, GraphContainer container)Restores the given history represented byfragementId.voiddeleteHistory()Deletes the history for all users.SavedHistorygetHistoryByFragment(java.lang.String fragment)Returns the history object for the providedfragment.SavedHistorygetHistoryByUserId(java.lang.String userId)Returns the history object for the provideduserId.java.lang.StringgetHistoryFragment(java.lang.String userId)voidonBind(HistoryOperation operation)voidonUnbind(HistoryOperation operation)protected voidsaveHistory(java.lang.String userId, SavedHistory hist)java.lang.StringsaveOrUpdateHistory(java.lang.String userId, GraphContainer graphContainer)Saves the current state of theGraphContainerfor the currentuserId.
-
-
-
Constructor Detail
-
BundleContextHistoryManager
public BundleContextHistoryManager(org.osgi.framework.BundleContext bundleContext, ServiceLocator serviceLocator)
-
-
Method Detail
-
onBind
public void onBind(HistoryOperation operation)
-
onUnbind
public void onUnbind(HistoryOperation operation)
-
applyHistory
public void applyHistory(java.lang.String fragment, GraphContainer container)Description copied from interface:HistoryManagerRestores the given history represented byfragementId. TheGraphContainerrepresents the user's state, which does not require the userId.- Specified by:
applyHistoryin interfaceHistoryManager- Parameters:
fragment- The history fragment (history hash)container- TheGraphContainerneeded to actually apply the history.
-
saveOrUpdateHistory
public java.lang.String saveOrUpdateHistory(java.lang.String userId, GraphContainer graphContainer)Description copied from interface:HistoryManagerSaves the current state of theGraphContainerfor the currentuserId. The returnedStringis the history fragment (hash).- Specified by:
saveOrUpdateHistoryin interfaceHistoryManager- Parameters:
userId- The user to save the history forgraphContainer- The currentGraphContainer- Returns:
- the history fragment (hash) of the saved history
- See Also:
HistoryManager.getHistoryFragment(String)
-
saveHistory
protected void saveHistory(java.lang.String userId, SavedHistory hist)
-
getHistoryByFragment
public SavedHistory getHistoryByFragment(java.lang.String fragment)
Description copied from interface:HistoryManagerReturns the history object for the providedfragment.- Specified by:
getHistoryByFragmentin interfaceHistoryManager
-
getHistoryByUserId
public SavedHistory getHistoryByUserId(java.lang.String userId)
Description copied from interface:HistoryManagerReturns the history object for the provideduserId.- Specified by:
getHistoryByUserIdin interfaceHistoryManager
-
getHistoryFragment
public java.lang.String getHistoryFragment(java.lang.String userId)
- Specified by:
getHistoryFragmentin interfaceHistoryManager
-
deleteHistory
public void deleteHistory()
Description copied from interface:HistoryManagerDeletes the history for all users.- Specified by:
deleteHistoryin interfaceHistoryManager
-
-