com.tibco.be.ws.scs.impl.repo

## Class AbstractRepositoryIntegration

- java.lang.Object
- - com.tibco.be.ws.scs.impl.AbstractSCSIntegration
  - - com.tibco.be.ws.scs.impl.repo.AbstractRepositoryIntegration

-     public abstract class AbstractRepositoryIntegration
      extends com.tibco.be.ws.scs.impl.AbstractSCSIntegration

  Base implementation class for integration with an Repository. Specific repositories should extend this class to provide necessary repository specific implementation details.
  Since:
    5.5.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract boolean` | `add(java.lang.String artifactPath, java.lang.String userName, java.lang.String password)` Executes repository specific 'add' command to mark a new artifact for addition to the repository.
    `protected abstract void` | `checkForAuthenticationFailure(java.lang.String commandOutput)` Check if SCS authentication went through successfully/failed.
    `protected abstract boolean` | `checkout(java.lang.String projectDirectory, java.lang.String destinationDirectory, java.lang.String projectName, java.lang.String userName, java.lang.String password)` Executes repository specific 'checkout' command to checkout the specified project.
    `protected abstract java.lang.String` | `commit(java.lang.String artifactPaths, java.lang.String commitComments, java.lang.String userName, java.lang.String password)` Executes repository specific 'commit' command to commit all the artifact changes (add/modify/delete) to the repository and returns the commit revision.
    `protected abstract java.lang.String` | `content(java.lang.String artifactPath, java.lang.String userName, java.lang.String password)` Executes the repository specific 'content' command and returns the content of the specified artifact.
    `protected abstract boolean` | `delete(java.lang.String artifactPath, java.lang.String userName, java.lang.String password)` Executes repository specific 'delete' command to mark an existing artifact for deletion from the repository.
    `protected abstract java.lang.String[]` | `list(java.lang.String repoUrl, java.lang.String userName, java.lang.String password, boolean recursive, java.lang.String projectName, java.lang.String updatePath)` Executes the Repository specific 'list' command and returns the list of projects/artifacts under the given repoUrl.
    `protected abstract boolean` | `revert(java.lang.String artifactPath, java.lang.String userName, java.lang.String password)` Executes repository specific 'revert' command to revert the local changes to the specified artifact.
    `protected abstract boolean` | `status(java.lang.String artifactPath, java.lang.String userName, java.lang.String password)` Executes repository specific 'status' command to check for the artifact status.
    `protected abstract boolean` | `update(java.lang.String projectPath, java.lang.String userName, java.lang.String password)` Executes repository specific 'update' command to reconcile the project with remote changes.

- - ### Method Detail

    - #### list

          protected abstract java.lang.String[] list(java.lang.String repoUrl,
                                                     java.lang.String userName,
                                                     java.lang.String password,
                                                     boolean recursive,
                                                     java.lang.String projectName,
                                                     java.lang.String updatePath)
                                              throws SCSException

      Executes the Repository specific 'list' command and returns the list of projects/artifacts under the given repoUrl.
      Parameters:
        `repoUrl` - URL of the repository to access
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
        `recursive` - Whether to recursively list artifacts from the folders.
        `projectName` - Name of the project, largely to list artifacts from within the project.
        `updatePath` - The sub path under repoUrl. Providing this will list artifacts only under this sub path
      Returns:
        The list of projects or artifacts under the given repoUrl
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### content

          protected abstract java.lang.String content(java.lang.String artifactPath,
                                                      java.lang.String userName,
                                                      java.lang.String password)
                                               throws SCSException

      Executes the repository specific 'content' command and returns the content of the specified artifact.
      Parameters:
        `artifactPath` - Path of the artifact whose content will be retrieved
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        Content of the specfied artifact
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### checkout

          protected abstract boolean checkout(java.lang.String projectDirectory,
                                              java.lang.String destinationDirectory,
                                              java.lang.String projectName,
                                              java.lang.String userName,
                                              java.lang.String password)
                                       throws SCSException

      Executes repository specific 'checkout' command to checkout the specified project.
      Parameters:
        `projectDirectory` - The project directory(under repoUrl) that is to be checked out. The path would be the fully qualified path till the project.
        `destinationDirectory` - Path where the project should be checked out. This path would be the local to where the server runs. Project artifacts should be checkedout within the directory, append the project name to this path if necessary.
        `projectName` - Name of the project being checked out
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        True if the checkout is successful, false otherwise
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### add

          protected abstract boolean add(java.lang.String artifactPath,
                                         java.lang.String userName,
                                         java.lang.String password)
                                  throws SCSException

      Executes repository specific 'add' command to mark a new artifact for addition to the repository. Returns true if successfully added & false if it fails.
      Parameters:
        `artifactPath` - Fully qualified path of the artifact that is to be marked for addition to the repository
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        True if add is successful, false otherwise
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### delete

          protected abstract boolean delete(java.lang.String artifactPath,
                                            java.lang.String userName,
                                            java.lang.String password)
                                     throws SCSException

      Executes repository specific 'delete' command to mark an existing artifact for deletion from the repository.
      Parameters:
        `artifactPath` - Fully qualified path of the artifact that is to be marked for deletion from the repository
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        True if delete is successful, false otherwise
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### commit

          protected abstract java.lang.String commit(java.lang.String artifactPaths,
                                                     java.lang.String commitComments,
                                                     java.lang.String userName,
                                                     java.lang.String password)
                                              throws SCSException

      Executes repository specific 'commit' command to commit all the artifact changes (add/modify/delete) to the repository and returns the commit revision. E.g. For svn commit returns an output as 'Committed revision 33432', this method should parse and return the commit revision only i.e. 33432
      Parameters:
        `artifactPaths` - List of artifactPaths that need to be committed together. Multiple paths are separated by delimiters, these delimiters are repository specific, i.e. space for svn
        `commitComments` - Comments to the associated with this commit
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        Commit revision number associated with this commit
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### revert

          protected abstract boolean revert(java.lang.String artifactPath,
                                            java.lang.String userName,
                                            java.lang.String password)
                                     throws SCSException

      Executes repository specific 'revert' command to revert the local changes to the specified artifact. Returns true if artifact is successfully reverted, false otherwise.
      Parameters:
        `artifactPath` - Fully qualified path of the artifact that is to be reverted
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        True if revert is successful, false otherwise
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### status

          protected abstract boolean status(java.lang.String artifactPath,
                                            java.lang.String userName,
                                            java.lang.String password)
                                     throws SCSException

      Executes repository specific 'status' command to check for the artifact status. Return true for versioned artifacts and false for unversioned artifacts. E.g. 'Status' command in svn will return the artifact prefixed with '?' if it is unversioned. The method should return false in those cases.
      Parameters:
        `artifactPath` - Fully qualified path of the artifact whose status needs to be checked
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        True if status is successful, false otherwise
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### update

          protected abstract boolean update(java.lang.String projectPath,
                                            java.lang.String userName,
                                            java.lang.String password)
                                     throws SCSException

      Executes repository specific 'update' command to reconcile the project with remote changes. Returns true if update is successful, false otherwise.
      Parameters:
        `projectPath` - Fully qualified path of the project that needs to be updated
        `userName` - Valid username that has permissions to access the above repository
        `password` - User password
      Returns:
        True if status is successful, false otherwise
      Throws:
        `SCSException`
      Since:
        5.5.0

    - #### checkForAuthenticationFailure

          protected abstract void checkForAuthenticationFailure(java.lang.String commandOutput)
                                                         throws SCSException

      Check if SCS authentication went through successfully/failed. This is repository specific since every repository sends out different error codes/messages associated with authentication failures. E.g. For svn, the authentication failure either return null/empty responses or error code E170001.
      Parameters:
        `commandOutput` - Output of the command executed
      Throws:
        `SCSException`
      Since:
        5.5.0