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)
HistoryManager
fragementId
.
The GraphContainer
represents the user's state, which does not require the userId.applyHistory
in interface HistoryManager
fragment
- The history fragment (history hash)container
- The GraphContainer
needed to actually apply the history.public String saveOrUpdateHistory(String userId, GraphContainer graphContainer)
HistoryManager
GraphContainer
for the current userId
.
The returned String
is the history fragment (hash).saveOrUpdateHistory
in interface HistoryManager
userId
- The user to save the history forgraphContainer
- The current GraphContainer
HistoryManager.getHistoryFragment(String)
protected void saveHistory(String userId, SavedHistory hist)
public SavedHistory getHistoryByFragment(String fragment)
HistoryManager
fragment
.getHistoryByFragment
in interface HistoryManager
public SavedHistory getHistoryByUserId(String userId)
HistoryManager
userId
.getHistoryByUserId
in interface HistoryManager
public String getHistoryFragment(String userId)
getHistoryFragment
in interface HistoryManager
public void deleteHistory()
HistoryManager
deleteHistory
in interface HistoryManager
Copyright © 2021. All rights reserved.