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 classAbstractSynchroContext.SynchroActionstatic classAbstractSynchroContext.SynchroSidestatic classAbstractSynchroContext.SynchroState
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,AbstractSynchroContext.SynchroAction>actionsprotected booleanchangeOccuredprotected booleanerrorOccuredprotected PrintWriterreportprotected StringWriterreportBuffer
-
Constructor Summary
Constructors Constructor Description AbstractSynchroContext(AbstractSynchroService<?> parentService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanequals(String path, AbstractSynchroContext.SynchroSide side1, AbstractSynchroContext.SynchroSide side2)AbstractSynchroContext.SynchroActiongetAction(String path)abstract ObjectgetOutState()AbstractSynchroService<?>getParentService()List<String>getPathList()abstract List<String>getPathList(AbstractSynchroContext.SynchroSide side)List<String>getPathsWithAction()List<String>getPathsWithAction(AbstractSynchroContext.SynchroAction action)StringgetReport()PrintWritergetReportWriter()abstract AbstractSynchroContext.SynchroStategetState(AbstractSynchroContext.SynchroSide side, String path)voidinitialize(Object previousState)booleanisChangeOccured()booleanisErrorOccured()voidonChange()voidonError()voidonError(Throwable ex)voidsetAction(String path, AbstractSynchroContext.SynchroAction action)voidshutdown()
-
-
-
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()
-
-