org.openengsb.domain.scm
Interface ScmDomain

All Superinterfaces:
Domain, OpenEngSBService

public interface ScmDomain
extends Domain

ScmDomain is an abstraction for working with SCM tools.


Method Summary
 void addDirectory(File directory, boolean recursive)
          Adds new working directory to SCM repository.
 void addFile(File file)
          Adds new working file to SCM index.
 void checkoutDirectory(String path, CommitRef id, boolean recursive, File directory)
          Copy repository directory specified by relative path and commit-ref id into newly created working directory.
 void checkoutFile(String path, CommitRef id, File directory)
          Copy repository file specified by relative path and commit-ref id into working directory.
 CommitRef commitDirectory(File directory, String comment, boolean recursive)
          Commit changes on working directory to SCM repository.
 CommitRef commitFile(File file, String comment)
          Commit a single file to SCM repository.
 boolean exists(String path)
          Checks if file or directory specified by relative path exists in repository.
 boolean exists(String path, CommitRef id)
          Checks if file or directory specified by relative path and id (commit-ref) exists in repository.
 void export(File directory)
          Exports the current head of the repository to the specified directory.
 boolean poll()
          Polls the represented repository for updates.
 
Methods inherited from interface org.openengsb.core.common.Domain
getAliveState
 
Methods inherited from interface org.openengsb.core.common.OpenEngSBService
getInstanceId
 

Method Detail

poll

boolean poll()
Polls the represented repository for updates. Returns true if there have been changes since the last poll.


export

void export(File directory)
Exports the current head of the repository to the specified directory.

Parameters:
directory - if the directory is non-existent, it'll be created. if the directory already exists it must not contain any files.

exists

boolean exists(String path)
Checks if file or directory specified by relative path exists in repository. Returns true if item exists in repository, otherwise false.

Returns:
true if item exists in repository, otherwise false

exists

boolean exists(String path,
               CommitRef id)
Checks if file or directory specified by relative path and id (commit-ref) exists in repository. Returns true if item exists in repository, otherwise false.

Returns:
true if item exists in repository, otherwise false

addFile

void addFile(File file)
Adds new working file to SCM index.

Throws:
{@link - ScmException} if working file does not exist or is not accessible.

addDirectory

void addDirectory(File directory,
                  boolean recursive)
Adds new working directory to SCM repository. The recursive option sets if also its children will be added to index.

Throws:
{@link - ScmException} if working directory does not exist or is not accessible.

commitFile

CommitRef commitFile(File file,
                     String comment)
Commit a single file to SCM repository. The comment parameter adds message to given commit. Reference to commit in SCM is returned as instance of CommitRef.

Returns:
commit-ref, see CommitRef
Throws:
{@link - ScmException} if working file does not exist or is not accessible.

commitDirectory

CommitRef commitDirectory(File directory,
                          String comment,
                          boolean recursive)
Commit changes on working directory to SCM repository. The comment parameter adds message to given commit. The recursive option sets if also changes for its children will be committed. Reference to commit in SCM is returned as instance of CommitRef.

Returns:
commit-ref, see CommitRef
Throws:
{@link - ScmException} if working directory does not exist or is not accessible.

checkoutFile

void checkoutFile(String path,
                  CommitRef id,
                  File directory)
Copy repository file specified by relative path and commit-ref id into working directory.

Throws:
{@link - ScmException} if working directory is not accessible or can not be created.

checkoutDirectory

void checkoutDirectory(String path,
                       CommitRef id,
                       boolean recursive,
                       File directory)
Copy repository directory specified by relative path and commit-ref id into newly created working directory. To get also all children use recursive option.

Throws:
{@link - ScmException} if working directory is not accessible or can not be created.


Copyright © 2009-2010. All Rights Reserved.