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.String
DATA_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 void
applyHistory(java.lang.String fragment, GraphContainer container)
Restores the given history represented byfragementId
.void
deleteHistory()
Deletes the history for all users.SavedHistory
getHistoryByFragment(java.lang.String fragment)
Returns the history object for the providedfragment
.SavedHistory
getHistoryByUserId(java.lang.String userId)
Returns the history object for the provideduserId
.java.lang.String
getHistoryFragment(java.lang.String userId)
void
onBind(HistoryOperation operation)
void
onUnbind(HistoryOperation operation)
protected void
saveHistory(java.lang.String userId, SavedHistory hist)
java.lang.String
saveOrUpdateHistory(java.lang.String userId, GraphContainer graphContainer)
Saves the current state of theGraphContainer
for 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:HistoryManager
Restores the given history represented byfragementId
. TheGraphContainer
represents the user's state, which does not require the userId.- Specified by:
applyHistory
in interfaceHistoryManager
- Parameters:
fragment
- The history fragment (history hash)container
- TheGraphContainer
needed to actually apply the history.
-
saveOrUpdateHistory
public java.lang.String saveOrUpdateHistory(java.lang.String userId, GraphContainer graphContainer)
Description copied from interface:HistoryManager
Saves the current state of theGraphContainer
for the currentuserId
. The returnedString
is the history fragment (hash).- Specified by:
saveOrUpdateHistory
in 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:HistoryManager
Returns the history object for the providedfragment
.- Specified by:
getHistoryByFragment
in interfaceHistoryManager
-
getHistoryByUserId
public SavedHistory getHistoryByUserId(java.lang.String userId)
Description copied from interface:HistoryManager
Returns the history object for the provideduserId
.- Specified by:
getHistoryByUserId
in interfaceHistoryManager
-
getHistoryFragment
public java.lang.String getHistoryFragment(java.lang.String userId)
- Specified by:
getHistoryFragment
in interfaceHistoryManager
-
deleteHistory
public void deleteHistory()
Description copied from interface:HistoryManager
Deletes the history for all users.- Specified by:
deleteHistory
in interfaceHistoryManager
-
-