SOSCheckin (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.optional.sos, class: SOSCheckin

# Class SOSCheckin

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.sos.SOS
org.apache.tools.ant.taskdefs.optional.sos.SOSCheckin

All Implemented Interfaces:
  `Cloneable, SOSCmd`

public class SOSCheckin extends SOS
Commits and unlocks files in Visual SourceSafe via a SourceOffSite server.

- ## Field Summary

  ### Fields inherited from class SOS

  `commandLine`
  Modifier and Type
  Field
  Description
  `protected Commandline`
  `commandLine`
  Commandline to be executed.

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from interface SOSCmd

  `COMMAND_CHECKIN_FILE, COMMAND_CHECKIN_PROJECT, COMMAND_CHECKOUT_FILE, COMMAND_CHECKOUT_PROJECT, COMMAND_GET_FILE, COMMAND_GET_PROJECT, COMMAND_HISTORY, COMMAND_LABEL, COMMAND_SOS_EXE, FLAG_COMMAND, FLAG_COMMENT, FLAG_FILE, FLAG_LABEL, FLAG_NO_CACHE, FLAG_NO_COMPRESSION, FLAG_PASSWORD, FLAG_PROJECT, FLAG_RECURSION, FLAG_SOS_HOME, FLAG_SOS_SERVER, FLAG_USERNAME, FLAG_VERBOSE, FLAG_VERSION, FLAG_VSS_SERVER, FLAG_WORKING_DIR, PROJECT_PREFIX`
  Modifier and Type
  Field
  Description
  `static final String`
  `COMMAND_CHECKIN_FILE`
  The checkin file command
  `static final String`
  `COMMAND_CHECKIN_PROJECT`
  The checkin project command
  `static final String`
  `COMMAND_CHECKOUT_FILE`
  The checkout file command
  `static final String`
  `COMMAND_CHECKOUT_PROJECT`
  The checkout project command
  `static final String`
  `COMMAND_GET_FILE`
  The get file command
  `static final String`
  `COMMAND_GET_PROJECT`
  The get project command
  `static final String`
  `COMMAND_HISTORY`
  The get history command
  `static final String`
  `COMMAND_LABEL`
  The add label command
  `static final String`
  `COMMAND_SOS_EXE`
  The sos executable
  `static final String`
  `FLAG_COMMAND`
  The command option
  `static final String`
  `FLAG_COMMENT`
  The log option
  `static final String`
  `FLAG_FILE`
  The file option
  `static final String`
  `FLAG_LABEL`
  The label option
  `static final String`
  `FLAG_NO_CACHE`
  The no cache option
  `static final String`
  `FLAG_NO_COMPRESSION`
  The no compression option
  `static final String`
  `FLAG_PASSWORD`
  The password option
  `static final String`
  `FLAG_PROJECT`
  The project option
  `static final String`
  `FLAG_RECURSION`
  The recursive option
  `static final String`
  `FLAG_SOS_HOME`
  The sos home option
  `static final String`
  `FLAG_SOS_SERVER`
  The server option
  `static final String`
  `FLAG_USERNAME`
  The username option
  `static final String`
  `FLAG_VERBOSE`
  The verbose option
  `static final String`
  `FLAG_VERSION`
  The revision option
  `static final String`
  `FLAG_VSS_SERVER`
  The database (vss server) option
  `static final String`
  `FLAG_WORKING_DIR`
  The workdir option
  `static final String`
  `PROJECT_PREFIX`
  The project prefix

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SOSCheckin()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Commandline`
  `buildCmdLine()`
  Build the command line.
  `void`
  `setComment(String comment)`
  The comment to apply to all files being labelled.
  `final void`
  `setFile(String filename)`
  The filename to act upon.
  `void`
  `setRecursive(boolean recursive)`
  Flag to recursively apply the action.

  ### Methods inherited from class SOS

  `execute, getComment, getFilename, getLabel, getLocalPath, getNoCache, getNoCompress, getOptionalAttributes, getPassword, getProjectPath, getRecursive, getRequiredAttributes, getSosCommand, getSosHome, getSosServerPath, getUsername, getVerbose, getVersion, getVssServerPath, run, setInternalComment, setInternalFilename, setInternalLabel, setInternalRecursive, setInternalVersion, setLocalPath, setNoCache, setNoCompress, setPassword, setProjectPath, setSosCmd, setSosHome, setSosServerPath, setUsername, setVerbose, setVssServerPath`
  Modifier and Type
  Method
  Description
  `void`
  `execute()`
  Execute the created command line.
  `protected String`
  `getComment()`
  Get the comment
  `protected String`
  `getFilename()`
  Get the filename to be acted upon.
  `protected String`
  `getLabel()`
  Get the label
  `protected String`
  `getLocalPath()`
  Builds and returns the working directory.
  `protected String`
  `getNoCache()`
  Get the NoCache flag.
  `protected String`
  `getNoCompress()`
  Get the NoCompress flag.
  `protected void`
  `getOptionalAttributes()`
  Adds the optional attributes to the command line.
  `protected String`
  `getPassword()`
  Get the password
  `protected String`
  `getProjectPath()`
  Get the project path
  `protected String`
  `getRecursive()`
  Get the 'recursive' Flag.
  `protected void`
  `getRequiredAttributes()`
  Sets the executable and add the required attributes to the command line.
  `protected String`
  `getSosCommand()`
  Get the executable to run.
  `protected String`
  `getSosHome()`
  Get the SOS home directory.
  `protected String`
  `getSosServerPath()`
  Get the SOS serve path.
  `protected String`
  `getUsername()`
  Get the username
  `protected String`
  `getVerbose()`
  Get the 'verbose' Flag.
  `protected String`
  `getVersion()`
  Get the version
  `protected String`
  `getVssServerPath()`
  Get the VSS server path
  `protected int`
  `run(Commandline cmd)`
  Execute the created command line.
  `protected void`
  `setInternalComment(String text)`
  Set the comment text.
  `protected void`
  `setInternalFilename(String file)`
  Set the file name.
  `protected void`
  `setInternalLabel(String text)`
  Set the label.
  `protected void`
  `setInternalRecursive(boolean recurse)`
  Set the recursive flag.
  `protected void`
  `setInternalVersion(String text)`
  Set the version.
  `final void`
  `setLocalPath(Path path)`
  Override the working directory and get to the specified path.
  `final void`
  `setNoCache(boolean nocache)`
  Flag to disable the cache when set.
  `final void`
  `setNoCompress(boolean nocompress)`
  Flag to disable compression when set.
  `final void`
  `setPassword(String password)`
  The SourceSafe password.
  `final void`
  `setProjectPath(String projectpath)`
  The SourceSafe project path.
  `final void`
  `setSosCmd(String dir)`
  The directory where soscmd(.exe) is located.
  `final void`
  `setSosHome(String sosHome)`
  Path to the SourceOffSite home directory.
  `final void`
  `setSosServerPath(String sosServerPath)`
  The address and port of SourceOffSite Server, for example 192.168.0.1:8888.
  `final void`
  `setUsername(String username)`
  The SourceSafe username.
  `void`
  `setVerbose(boolean verbose)`
  Enable verbose output.
  `final void`
  `setVssServerPath(String vssServerPath)`
  The path to the location of the ss.ini file.

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SOSCheckin

    public SOSCheckin()

- ## Method Details

  - ### setFile

    public final void setFile(String filename)
    The filename to act upon. If no file is specified then the task acts upon the project.
    Parameters:
      `filename` - The new file value

  - ### setRecursive

    public void setRecursive(boolean recursive)
    Flag to recursively apply the action. Defaults to false.
    Parameters:
      `recursive` - True for recursive operation.

  - ### setComment

    public void setComment(String comment)
    The comment to apply to all files being labelled.
    Parameters:
      `comment` - The new comment value

  - ### buildCmdLine

    protected Commandline buildCmdLine()
    Build the command line.

    CheckInFile required parameters: -server -name -password -database -project -file
    CheckInFile optional parameters: -workdir -log -verbose -nocache -nocompression -soshome
    CheckInProject required parameters: -server -name -password -database -project
    CheckInProject optional parameters: workdir -recursive -log -verbose -nocache -nocompression -soshome

    Returns:
      Commandline the generated command to be executed