public class BundleContextHistoryManager extends Object implements HistoryManager
| Modifier and Type | Field and Description |
|---|---|
static String |
DATA_FILE_NAME |
| Constructor and Description |
|---|
BundleContextHistoryManager(org.osgi.framework.BundleContext bundleContext,
ServiceLocator serviceLocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyHistory(String fragment,
GraphContainer container)
Restores the given history represented by
fragementId. |
void |
deleteHistory()
Deletes the history for all users.
|
SavedHistory |
getHistoryByFragment(String fragment)
Returns the history object for the provided
fragment. |
SavedHistory |
getHistoryByUserId(String userId)
Returns the history object for the provided
userId. |
String |
getHistoryFragment(String userId) |
void |
onBind(HistoryOperation operation) |
void |
onUnbind(HistoryOperation operation) |
protected void |
saveHistory(String userId,
SavedHistory hist) |
String |
saveOrUpdateHistory(String userId,
GraphContainer graphContainer)
Saves the current state of the
GraphContainer for the current userId. |
public static final String DATA_FILE_NAME
public BundleContextHistoryManager(org.osgi.framework.BundleContext bundleContext,
ServiceLocator serviceLocator)
public void onBind(HistoryOperation operation)
public void onUnbind(HistoryOperation operation)
public void applyHistory(String fragment, GraphContainer container)
HistoryManagerfragementId.
The GraphContainer represents the user's state, which does not require the userId.applyHistory in interface HistoryManagerfragment - The history fragment (history hash)container - The GraphContainer needed to actually apply the history.public String saveOrUpdateHistory(String userId, GraphContainer graphContainer)
HistoryManagerGraphContainer for the current userId.
The returned String is the history fragment (hash).saveOrUpdateHistory in interface HistoryManageruserId - The user to save the history forgraphContainer - The current GraphContainerHistoryManager.getHistoryFragment(String)protected void saveHistory(String userId, SavedHistory hist)
public SavedHistory getHistoryByFragment(String fragment)
HistoryManagerfragment.getHistoryByFragment in interface HistoryManagerpublic SavedHistory getHistoryByUserId(String userId)
HistoryManageruserId.getHistoryByUserId in interface HistoryManagerpublic String getHistoryFragment(String userId)
getHistoryFragment in interface HistoryManagerpublic void deleteHistory()
HistoryManagerdeleteHistory in interface HistoryManagerCopyright © 2020. All rights reserved.