Package org.javlo.service.syncro
Class AbstractSynchroContext
- java.lang.Object
-
- org.javlo.service.syncro.AbstractSynchroContext
-
- Direct Known Subclasses:
BaseSynchroContext
public abstract class AbstractSynchroContext extends Object
Class storing all information to process ONE synchro process run.
This class must be expanded to choose the way to retrieve information.- Author:
- bdumont
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractSynchroContext.SynchroAction
static class
AbstractSynchroContext.SynchroSide
static class
AbstractSynchroContext.SynchroState
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,AbstractSynchroContext.SynchroAction>
actions
protected boolean
changeOccured
protected boolean
errorOccured
protected PrintWriter
report
protected StringWriter
reportBuffer
-
Constructor Summary
Constructors Constructor Description AbstractSynchroContext(AbstractSynchroService<?> parentService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
equals(String path, AbstractSynchroContext.SynchroSide side1, AbstractSynchroContext.SynchroSide side2)
AbstractSynchroContext.SynchroAction
getAction(String path)
abstract Object
getOutState()
AbstractSynchroService<?>
getParentService()
List<String>
getPathList()
abstract List<String>
getPathList(AbstractSynchroContext.SynchroSide side)
List<String>
getPathsWithAction()
List<String>
getPathsWithAction(AbstractSynchroContext.SynchroAction action)
String
getReport()
PrintWriter
getReportWriter()
abstract AbstractSynchroContext.SynchroState
getState(AbstractSynchroContext.SynchroSide side, String path)
void
initialize(Object previousState)
boolean
isChangeOccured()
boolean
isErrorOccured()
void
onChange()
void
onError()
void
onError(Throwable ex)
void
setAction(String path, AbstractSynchroContext.SynchroAction action)
void
shutdown()
-
-
-
Field Detail
-
reportBuffer
protected final StringWriter reportBuffer
-
report
protected final PrintWriter report
-
errorOccured
protected boolean errorOccured
-
changeOccured
protected boolean changeOccured
-
actions
protected final Map<String,AbstractSynchroContext.SynchroAction> actions
-
-
Constructor Detail
-
AbstractSynchroContext
public AbstractSynchroContext(AbstractSynchroService<?> parentService)
-
-
Method Detail
-
initialize
public void initialize(Object previousState) throws SynchroFatalException
- Throws:
SynchroFatalException
-
getParentService
public AbstractSynchroService<?> getParentService()
-
getPathList
public List<String> getPathList() throws SynchroFatalException
- Throws:
SynchroFatalException
-
getPathList
public abstract List<String> getPathList(AbstractSynchroContext.SynchroSide side) throws SynchroFatalException
- Throws:
SynchroFatalException
-
getState
public abstract AbstractSynchroContext.SynchroState getState(AbstractSynchroContext.SynchroSide side, String path) throws SynchroNonFatalException, SynchroFatalException
-
equals
public abstract boolean equals(String path, AbstractSynchroContext.SynchroSide side1, AbstractSynchroContext.SynchroSide side2) throws SynchroNonFatalException, SynchroFatalException
-
setAction
public void setAction(String path, AbstractSynchroContext.SynchroAction action)
-
getAction
public AbstractSynchroContext.SynchroAction getAction(String path)
-
getPathsWithAction
public List<String> getPathsWithAction(AbstractSynchroContext.SynchroAction action)
-
onError
public void onError()
-
onError
public void onError(Throwable ex)
-
onChange
public void onChange()
-
isErrorOccured
public boolean isErrorOccured()
-
isChangeOccured
public boolean isChangeOccured()
-
getReportWriter
public PrintWriter getReportWriter()
-
getReport
public String getReport()
-
getOutState
public abstract Object getOutState()
-
shutdown
public void shutdown()
-
-