Class SynergyTaskManager
- java.lang.Object
-
- org.apache.maven.scm.provider.synergy.util.SynergyTaskManager
-
public class SynergyTaskManager extends java.lang.Object
In some Synergy versions (ie. 6.5) closing a session results in de-selecting the current (default) task. Therefore, the maven release-plugin fails, as the Synergy commands, as implemented in the Synergy-SCM-Provider, always close their session after being executed.
This manager circumvents this problem by storing the last created task which causes all check outs to be associated with it. Then, when this task gets checked in, all associated files get checked in as well.- Since:
- 1.5
-
-
Field Summary
Fields Modifier and Type Field Description private int
currentTaskNumber
The number of the current Synergy-Task.private short
currentTaskState
The state of the current Synergy-Task.private static SynergyTaskManager
INSTANCE
singleton instance.private static short
TASK_STATE_COMPLETED
The current Synergy-Task is completed.private static short
TASK_STATE_CREATED
The current Synergy-Task is created but not yet completed.private static short
TASK_STATE_NONE
No Synergy-Task was created yet.
-
Constructor Summary
Constructors Constructor Description SynergyTaskManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkinDefaultTask(ScmLogger logger, java.lang.String comment, java.lang.String ccmAddr)
Check in (that is: complete) the default task.int
createTask(ScmLogger logger, java.lang.String synopsis, java.lang.String release, boolean defaultTask, java.lang.String ccmAddr)
If necessary create a new task.static SynergyTaskManager
getInstance()
-
-
-
Field Detail
-
TASK_STATE_NONE
private static final short TASK_STATE_NONE
No Synergy-Task was created yet.- See Also:
- Constant Field Values
-
TASK_STATE_CREATED
private static final short TASK_STATE_CREATED
The current Synergy-Task is created but not yet completed.- See Also:
- Constant Field Values
-
TASK_STATE_COMPLETED
private static final short TASK_STATE_COMPLETED
The current Synergy-Task is completed.- See Also:
- Constant Field Values
-
INSTANCE
private static final SynergyTaskManager INSTANCE
singleton instance.
-
currentTaskNumber
private int currentTaskNumber
The number of the current Synergy-Task.
-
currentTaskState
private short currentTaskState
The state of the current Synergy-Task.
-
-
Method Detail
-
getInstance
public static SynergyTaskManager getInstance()
- Returns:
- singleton instance.
-
createTask
public int createTask(ScmLogger logger, java.lang.String synopsis, java.lang.String release, boolean defaultTask, java.lang.String ccmAddr) throws ScmException
If necessary create a new task. Otherwise return the current task.- Parameters:
logger
- a logger.synopsis
- short description of task.release
- release.defaultTask
- should this task become the default task?ccmAddr
- current Synergy session ID. Used to run in multi-session.- Returns:
- Task number
- Throws:
ScmException
-
checkinDefaultTask
public void checkinDefaultTask(ScmLogger logger, java.lang.String comment, java.lang.String ccmAddr) throws ScmException
Check in (that is: complete) the default task. This is either the current task managed bySynergyTaskManager
or, if none is managed, the default task.
In case no task has yet been created bySynergyTaskManager
AND no default task is set, then this is an error.
However, if the task that was created bySynergyTaskManager
has already been checked in AND no default task is set, then it is assumed that all files that were checked out are already checked in because checking in a task checks in all files associated with it.- Parameters:
logger
- a logger.comment
- a comment for checkin.ccmAddr
- current Synergy session ID. Used to run in multi-session.- Throws:
ScmException
-
-