Class BundleContextHistoryManager
- java.lang.Object
-
- org.opennms.features.topology.plugins.topo.BundleContextHistoryManager
-
- All Implemented Interfaces:
HistoryManager
public class BundleContextHistoryManager extends Object implements HistoryManager
-
-
Field Summary
Fields Modifier and Type Field Description static 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(String fragment, GraphContainer container)Restores the given history represented byfragementId.voiddeleteHistory()Deletes the history for all users.SavedHistorygetHistoryByFragment(String fragment)Returns the history object for the providedfragment.SavedHistorygetHistoryByUserId(String userId)Returns the history object for the provideduserId.StringgetHistoryFragment(String userId)voidonBind(HistoryOperation operation)voidonUnbind(HistoryOperation operation)protected voidsaveHistory(String userId, SavedHistory hist)StringsaveOrUpdateHistory(String userId, GraphContainer graphContainer)Saves the current state of theGraphContainerfor the currentuserId.
-
-
-
Field Detail
-
DATA_FILE_NAME
public static final String DATA_FILE_NAME
-
-
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(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 String saveOrUpdateHistory(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(String userId, SavedHistory hist)
-
getHistoryByFragment
public SavedHistory getHistoryByFragment(String fragment)
Description copied from interface:HistoryManagerReturns the history object for the providedfragment.- Specified by:
getHistoryByFragmentin interfaceHistoryManager
-
getHistoryByUserId
public SavedHistory getHistoryByUserId(String userId)
Description copied from interface:HistoryManagerReturns the history object for the provideduserId.- Specified by:
getHistoryByUserIdin interfaceHistoryManager
-
getHistoryFragment
public String getHistoryFragment(String userId)
- Specified by:
getHistoryFragmentin interfaceHistoryManager
-
deleteHistory
public void deleteHistory()
Description copied from interface:HistoryManagerDeletes the history for all users.- Specified by:
deleteHistoryin interfaceHistoryManager
-
-