public final class SynergyUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SEPARATOR
Separator used with formatted result
|
Modifier and Type | Method and Description |
---|---|
static void |
checkinDefaultTask(ScmLogger logger,
String comment,
String ccmAddr)
Checkin the default task.
|
static void |
checkinFiles(ScmLogger logger,
List<File> files,
String comment,
String ccmAddr)
Checkin a file set.
|
static void |
checkinProject(ScmLogger logger,
String projectSpec,
String comment,
String ccmAddr)
Checkin a given project.
|
static void |
checkinTask(ScmLogger logger,
int taskNumber,
String comment,
String ccmAddr)
Checkin a task.
|
static void |
checkoutFiles(ScmLogger logger,
List<File> files,
String ccmAddr)
Checkout given files or directory.
|
static void |
checkoutProject(ScmLogger logger,
File directory,
String projectSpec,
ScmVersion version,
String purpose,
String release,
String ccmAddr)
Checkout a given project.
|
static void |
create(ScmLogger logger,
File file,
String message,
String ccmAddr)
Add new file to Synergy database.
|
static void |
createBaseline(ScmLogger logger,
String projectSpec,
String name,
String release,
String purpose,
String ccmAddr)
Create a baseline.
|
static int |
createTask(ScmLogger logger,
String synopsis,
String release,
boolean defaultTask,
String ccmAddr)
Create new task.
|
static void |
delete(ScmLogger logger,
File file,
String ccmAddr,
boolean replace)
Delete file from Synergy database.
|
static String |
delimiter(ScmLogger logger,
String ccmAddr)
Get Database delimiter
|
protected static int |
executeSynergyCommand(ScmLogger logger,
Commandline cl,
CommandLineUtils.StringStreamConsumer stderr,
StreamConsumer stdout,
boolean failOnError)
Execute a command line for Synergy.
|
static List<SynergyTask> |
getCompletedTasks(ScmLogger logger,
String projectSpec,
Date startDate,
Date endDate,
String ccmAddr)
Get a list of all tasks which are contained in all folders in the
reconfigure properties of the specified project and were completed after
startDate and before endDate.
|
static int |
getDefaultTask(ScmLogger logger,
String ccmAddr)
Get the number of the current (ie default) task.
|
static List<ChangeFile> |
getModifiedObjects(ScmLogger logger,
int numTask,
String ccmAddr)
Populate the object list of a Modification by querying for objects
associated with the task.
|
static File |
getWorkArea(ScmLogger logger,
String projectSpec,
String ccmAddr)
Get the work area of a given project.
|
static List<String> |
getWorkingFiles(ScmLogger logger,
String projectSpec,
String release,
String ccmAddr)
Get working file(s) in a given project.
|
static String |
getWorkingProject(ScmLogger logger,
String projectSpec,
String username,
String ccmAddr)
Get a working project whose predecessor is given.
|
static void |
reconcileUdb(ScmLogger logger,
String projectSpec,
String ccmAddr)
Reconcile a project with -udb option.
|
static void |
reconcileUwa(ScmLogger logger,
String projectSpec,
String ccmAddr)
Reconcile a project with -uwa option.
|
static void |
reconfigure(ScmLogger logger,
String projectSpec,
String ccmAddr)
Reconfigure a project.
|
static void |
reconfigureProperties(ScmLogger logger,
String projectSpec,
String ccmAddr)
Reconfigure properties of a project.
|
static String |
removePrefix(File prefix,
File file)
Remove prefix path from a path.
|
static void |
setDefaultTask(ScmLogger logger,
int task,
String ccmAddr)
Set the current (ie default) task.
|
static String |
start(ScmLogger logger,
String username,
String password,
SynergyRole role)
Start a session Synergy
|
static void |
stop(ScmLogger logger,
String ccmAddr)
Stop a ccm session.
|
static void |
synchronize(ScmLogger logger,
String projectSpec,
String ccmAddr)
Synchronize a given project.
|
public static final String SEPARATOR
public static String removePrefix(File prefix, File file) throws ScmException
prefix
- parent path (prefix).file
- file path.ScmException
- if parent is not a prefix of filepublic static String getWorkingProject(ScmLogger logger, String projectSpec, String username, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- predecessor (prep project)username
- owner of working projectccmAddr
- Synergy session ID.ScmException
public static List<String> getWorkingFiles(ScmLogger logger, String projectSpec, String release, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- (project)release
- releaseccmAddr
- Synergy session ID.ScmException
public static List<ChangeFile> getModifiedObjects(ScmLogger logger, int numTask, String ccmAddr) throws ScmException
logger
- a logger.numTask
- task number.ccmAddr
- Synergy session ID.ScmException
public static List<SynergyTask> getCompletedTasks(ScmLogger logger, String projectSpec, Date startDate, Date endDate, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec.startDate
- start date.endDate
- end date.ccmAddr
- Synergy session ID.SynergyTask
ScmException
public static void createBaseline(ScmLogger logger, String projectSpec, String name, String release, String purpose, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- the projectSpec.name
- name of the baseline.release
- the release.purpose
- the purpose.ccmAddr
- used to run in multi-session.ScmException
public static void create(ScmLogger logger, File file, String message, String ccmAddr) throws ScmException
logger
- a logger.file
- file to be added.message
- log message for Synergy.ccmAddr
- used to run in multi-session.ScmException
public static int createTask(ScmLogger logger, String synopsis, String release, boolean defaultTask, String ccmAddr) throws ScmException
logger
- a logger.synopsis
- short description of task.release
- release.defaultTask
- should this task become the default task?ccmAddr
- used to run in multi-session.ScmException
public static void checkinDefaultTask(ScmLogger logger, String comment, String ccmAddr) throws ScmException
logger
- a logger.comment
- a comment.ccmAddr
- Synergy session ID.ScmException
public static void checkinTask(ScmLogger logger, int taskNumber, String comment, String ccmAddr) throws ScmException
logger
- a logger.taskNumber
- task number.comment
- a comment.ccmAddr
- Synergy session ID.ScmException
public static void delete(ScmLogger logger, File file, String ccmAddr, boolean replace) throws ScmException
logger
- a logger.file
- file to be deleted.ccmAddr
- used to run in multi-session.ScmException
public static void reconfigure(ScmLogger logger, String projectSpec, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static void reconfigureProperties(ScmLogger logger, String projectSpec, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static void reconcileUwa(ScmLogger logger, String projectSpec, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static void reconcileUdb(ScmLogger logger, String projectSpec, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static void checkoutFiles(ScmLogger logger, List<File> files, String ccmAddr) throws ScmException
logger
- a logger.files
- files to add.ccmAddr
- Synergy session ID.ScmException
public static void checkoutProject(ScmLogger logger, File directory, String projectSpec, ScmVersion version, String purpose, String release, String ccmAddr) throws ScmException
logger
- a logger.directory
- new project work area, or null if you want to use default wa.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static void checkinProject(ScmLogger logger, String projectSpec, String comment, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).comment
- message.ccmAddr
- used to run in multi-session.ScmException
public static void checkinFiles(ScmLogger logger, List<File> files, String comment, String ccmAddr) throws ScmException
logger
- a logger.ccmAddr
- used to run in multi-session.ScmException
public static int getDefaultTask(ScmLogger logger, String ccmAddr) throws ScmException
logger
- a logger.ccmAddr
- current Synergy session id.ScmException
public static void setDefaultTask(ScmLogger logger, int task, String ccmAddr) throws ScmException
logger
- a logger.task
- the number of the task to set as current task.ccmAddr
- current Synergy session id.ScmException
public static void synchronize(ScmLogger logger, String projectSpec, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static File getWorkArea(ScmLogger logger, String projectSpec, String ccmAddr) throws ScmException
logger
- a logger.projectSpec
- projectSpec (i.e. myProject~1).ccmAddr
- used to run in multi-session.ScmException
public static void stop(ScmLogger logger, String ccmAddr) throws ScmException
logger
- a logger.ccmAddr
- used to run in multi-session.ScmException
public static String start(ScmLogger logger, String username, String password, SynergyRole role) throws ScmException
logger
- a logger.username
- username.password
- password.role
- role or null if none.ScmException
public static String delimiter(ScmLogger logger, String ccmAddr) throws ScmException
logger
- a logger.ccmAddr
- Synergy session ID.ScmException
protected static int executeSynergyCommand(ScmLogger logger, Commandline cl, CommandLineUtils.StringStreamConsumer stderr, StreamConsumer stdout, boolean failOnError) throws ScmException
logger
- a logger.cl
- command line.stderr
- stderr.stdout
- stdout.failOnError
- should we raise an exception when exit code != 0ScmException
- on error or if exit code != 0 and failOnError = trueCopyright © 2003–2015 The Apache Software Foundation. All rights reserved.