public abstract class HistoryManager
extends java.lang.Object
| Constructor and Description |
|---|
HistoryManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
clear(java.net.URL[] urls)
Clear the history for objects located at the given URLs.
|
abstract java.lang.Object[] |
getDeletions(java.net.URL url)
Get object identifiers of all objects which have been deleted from within
the descendant tree of the given root URL.
|
static HistoryManager |
getHistoryManager()
Get the HistoryManager instance.
|
abstract LocalState |
getLastState(java.lang.Object objId)
Get the last local state for the object identified by the given ID.
|
abstract LocalState[] |
getLocalHistory(java.lang.Object objId)
Get all local history for the object identified by the given ID.
|
abstract LocalState[] |
getLocalHistory(java.net.URL url)
Get all local history for the object located at the given URL.
|
java.lang.Class |
getRegisteredHistorian(java.lang.Class objCls)
Deprecated.
not replaced; throws an
UnsupportedOperationException. |
abstract boolean |
hasLocalHistory(java.net.URL url)
Determine whether any previous history is available for the object located
at the given URL.
|
abstract boolean |
isHistoried(Element element)
Asks whether the given element is eligible for local history support.
|
abstract void |
persist(java.net.URL[] urls,
java.lang.String description)
Persist the state of the objects located at the given URLs.
|
abstract void |
persistInitialState(java.net.URL[] urls)
Persist, as needed, the initial state of the objects located at the given
URLs.
|
abstract void |
registerHistorian(java.lang.Class historianCls,
java.lang.Class objCls)
Deprecated.
replaced by declarative registration through historian-hook
or programmatic registration through
registerHistorian(MetaClass, MetaClass) |
abstract void |
registerHistorian(MetaClass<? extends Historian> historianCls,
MetaClass<? extends Node> objCls)
Register a Historian implementation for association with a given object
type.
|
abstract void |
restore(LocalState[] states,
Context context)
Restore the given states.
|
static void |
setHistoryManager(HistoryManager historyManager)
Set the HistoryManager instance.
|
public static HistoryManager getHistoryManager()
public static void setHistoryManager(HistoryManager historyManager)
historyManager - the HistoryManager to use for future reference.public abstract boolean hasLocalHistory(java.net.URL url)
url - the location of the object for which history is to be queried.public abstract LocalState[] getLocalHistory(java.net.URL url)
url - the location for which history is desired.public abstract LocalState[] getLocalHistory(java.lang.Object objId)
objId - object identifier as received from getDeletions.getDeletions(URL)public abstract LocalState getLastState(java.lang.Object objId)
objId - object identifier as received from getDeletions.getDeletions(URL)public abstract java.lang.Object[] getDeletions(java.net.URL url)
url - the root under which descendant deletions are desired.public abstract void persistInitialState(java.net.URL[] urls)
throws java.lang.Exception
urls - location of objects whose contents are to be conditionally
persisted.HistoryPersistenceException - upon failure.java.lang.Exceptionpublic abstract void persist(java.net.URL[] urls,
java.lang.String description)
throws java.lang.Exception
This method is intended for use by a history generating operation such that state information for the objects located at the given URLs can be made available for later restoration. The classic example would be a Save command.
Typically this call would be preceded by a call to persistInitialState such that an initial state is assured to exist before persisting the current state.
For example;
...
URL urls[] = ...
HistoryManager mgr = HistoryManager.getHistoryManager();
mgr.persistInitialState(urls); // Persist initial state
urls - location of objects to be persisted.description - text describing the cause of the persist (e.g. "Save").HistoryPersistenceException - upon failure.java.lang.Exceptionpublic abstract void restore(LocalState[] states, Context context) throws java.lang.Exception
states - the states to restore.context - the Context in which to restore the states.HistoryPersistenceException - upon failure.java.lang.Exceptionpublic abstract void clear(java.net.URL[] urls)
urls - location of objects whose history will be cleared.@Deprecated
public abstract void registerHistorian(java.lang.Class historianCls,
java.lang.Class objCls)
registerHistorian(MetaClass, MetaClass)historianCls - an implementation of oracle.ide.history.HistorianobjCls - an implementation for which history is supported.public abstract void registerHistorian(MetaClass<? extends Historian> historianCls, MetaClass<? extends Node> objCls)
historianCls - an implementation of oracle.ide.history.HistorianobjCls - an implementation for which history is supported.public abstract boolean isHistoried(Element element)
element - the element.@Deprecated
public final java.lang.Class getRegisteredHistorian(java.lang.Class objCls)
throws java.lang.IllegalArgumentException
UnsupportedOperationException.objCls - an implementation for which history is supported.java.lang.IllegalArgumentException - if objCls is not of the expected type.