public class DefaultPersistentContext extends Object implements PersistentContextServices
PersistentContextServices.ObjectReference
Constructor and Description |
---|
DefaultPersistentContext(PersistenceManager manager) |
Modifier and Type | Method and Description |
---|---|
PersistentContextServices.ObjectReference |
add(PersistentIdentifier id)
Add a new reference associated to the identifier passed as
parameter.
|
PersistentContextServices.ObjectReference |
add(PersistentState state,
Object obj)
Add a reference to the object associated to the state.
|
void |
addError(Throwable cause)
Add a error to the list of errors of the context.
|
void |
clear()
Clear the instances of references previously recreated
|
PersistentContextServices.ObjectReference |
get(Object obj)
Return the object reference associated to the object
passed as parameter.
|
PersistentContextServices.ObjectReference |
get(PersistentIdentifier id)
Return the object reference associated to the id indicated
as parameter.
|
PersistentContextServices.ObjectReference |
get(PersistentState state)
Return the object reference associated to the state passed as parameter.
|
boolean |
getCollectErrors()
Get information about if collect errors or launch it
when produce.
|
PersistenceException |
getErrors()
Get all errors collected to the moment in this context.
|
PersistentIdentifier |
getId(Object obj)
Return the id associated to the object passed as parameter.
|
PersistentIdentifier |
getIdentifier(String id)
Create a new identifier based on the string passed as parameter
and return this.
|
PersistentIdentifier |
getNewIdentifier()
Get a valid new persistent identifier.
|
Object |
getObject(Integer id) |
PersistentContextServices.ObjectReference |
getRoot() |
PersistentState |
getState(Integer id) |
PersistentState |
getState(Object obj) |
Iterator |
iterator()
Return an iterator over the states stored in this
context.
|
void |
setCollectErrors(boolean collectErrors)
Set flag to collect errors.
|
void |
setRootId(PersistentIdentifier id) |
void |
update(PersistentContextServices.ObjectReference ref)
Update the object referenced by ref, recreating it with this
state,
|
void |
validate(int mode)
Validate al statetes en the context.
|
public DefaultPersistentContext(PersistenceManager manager)
public PersistentIdentifier getNewIdentifier()
PersistentContextServices
getNewIdentifier
in interface PersistentContextServices
public PersistentIdentifier getIdentifier(String id) throws PersistenceException
PersistentContextServices
getIdentifier
in interface PersistentContextServices
PersistenceException
public PersistentContextServices.ObjectReference add(PersistentIdentifier id) throws PersistenceException
PersistentContextServices
add
in interface PersistentContextServices
PersistenceException
public PersistentContextServices.ObjectReference add(PersistentState state, Object obj) throws PersistenceException
PersistentContextServices
add
in interface PersistentContextServices
PersistenceException
public PersistentContextServices.ObjectReference get(PersistentState state) throws PersistenceException
PersistentContextServices
get
in interface PersistentContextServices
PersistenceException
public PersistentContextServices.ObjectReference get(PersistentIdentifier id)
PersistentContextServices
get
in interface PersistentContextServices
public PersistentContextServices.ObjectReference get(Object obj)
PersistentContextServices
get
in interface PersistentContextServices
public void update(PersistentContextServices.ObjectReference ref) throws PersistenceException
PersistentContextServices
update
in interface PersistentContextServices
PersistenceException
public void clear()
PersistentContextServices
clear
in interface PersistentContextServices
public Iterator iterator()
PersistentContext
iterator
in interface PersistentContext
public PersistentState getState(Integer id) throws PersistenceException
getState
in interface PersistentContextServices
PersistenceException
public PersistentState getState(Object obj) throws PersistenceException
getState
in interface PersistentContextServices
PersistenceException
public Object getObject(Integer id) throws PersistenceException
getObject
in interface PersistentContextServices
PersistenceException
public PersistentIdentifier getId(Object obj) throws PersistenceException
PersistentContextServices
getId
in interface PersistentContextServices
PersistenceException
public void setRootId(PersistentIdentifier id)
setRootId
in interface PersistentContextServices
public PersistentContextServices.ObjectReference getRoot() throws PersistenceException
getRoot
in interface PersistentContextServices
PersistenceException
public void setCollectErrors(boolean collectErrors)
PersistentContext
setCollectErrors
in interface PersistentContext
public boolean getCollectErrors()
PersistentContext
getCollectErrors
in interface PersistentContext
public void addError(Throwable cause)
PersistentContext
addError
in interface PersistentContext
public PersistenceException getErrors()
PersistentContext
getErrors
in interface PersistentContext
public void validate(int mode) throws PersistenceValidateExceptions
PersistentContextServices
validate
in interface PersistentContextServices
PersistenceValidateExceptions