org.apache.maven.scm.provider.git
Class AbstractGitScmProvider

java.lang.Object
  extended by org.apache.maven.scm.provider.AbstractScmProvider
      extended by org.apache.maven.scm.provider.git.AbstractGitScmProvider
All Implemented Interfaces:
ScmProvider
Direct Known Subclasses:
GitExeScmProvider

public abstract class AbstractGitScmProvider
extends AbstractScmProvider

SCM Provider for git

Version:
$Id: AbstractGitScmProvider.java 1204747 2011-11-21 23:16:01Z olamy $
Author:
Emmanuel Venisse

Field Summary
 
Fields inherited from interface org.apache.maven.scm.provider.ScmProvider
ROLE
 
Constructor Summary
AbstractGitScmProvider()
           
 
Method Summary
 AddScmResult add(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
protected  BlameScmResult blame(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
protected  BranchScmResult branch(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 ChangeLogScmResult changelog(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 CheckInScmResult checkin(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 CheckOutScmResult checkout(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 DiffScmResult diff(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
protected  ScmResult executeCommand(GitCommand command, ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
protected  ExportScmResult export(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
protected abstract  GitCommand getAddCommand()
           
protected abstract  GitCommand getBlameCommand()
           
protected abstract  GitCommand getBranchCommand()
           
protected abstract  GitCommand getChangeLogCommand()
           
protected abstract  GitCommand getCheckInCommand()
           
protected abstract  GitCommand getCheckOutCommand()
           
protected abstract  GitCommand getDiffCommand()
           
protected abstract  GitCommand getExportCommand()
           
protected abstract  GitCommand getInfoCommand()
           
protected abstract  GitCommand getListCommand()
           
protected abstract  GitCommand getRemoteInfoCommand()
           
protected abstract  GitCommand getRemoveCommand()
           
protected abstract  String getRepositoryURL(File path)
           
 String getScmSpecificFilename()
          Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'.
 String getScmType()
          
protected abstract  GitCommand getStatusCommand()
           
protected abstract  GitCommand getTagCommand()
           
protected abstract  GitCommand getUpdateCommand()
           
 InfoScmResult info(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 ListScmResult list(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          List each element (files and directories) of fileSet as they exist in the repository.
 ScmProviderRepository makeProviderScmRepository(File path)
          
 ScmProviderRepository makeProviderScmRepository(String scmSpecificUrl, char delimiter)
          
 RemoteInfoScmResult remoteInfo(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 RemoveScmResult remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 StatusScmResult status(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 TagScmResult tag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 UpdateScmResult update(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
 List<String> validateScmUrl(String scmSpecificUrl, char delimiter)
          Validate the scm url.
 
Methods inherited from class org.apache.maven.scm.provider.AbstractScmProvider
add, add, add, addListener, blame, blame, branch, branch, branch, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, checkIn, checkIn, checkIn, checkOut, checkOut, checkOut, checkOut, checkOut, checkOut, diff, diff, edit, edit, export, export, export, export, export, getLogger, list, list, login, mkdir, mkdir, remove, requiresEditMode, sanitizeTagName, status, tag, tag, tag, unedit, unedit, update, update, update, update, update, update, update, update, update, update, update, update, validateTagName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGitScmProvider

public AbstractGitScmProvider()
Method Detail

getScmSpecificFilename

public String getScmSpecificFilename()
Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'.

Specified by:
getScmSpecificFilename in interface ScmProvider
Overrides:
getScmSpecificFilename in class AbstractScmProvider
Returns:
the scm reserved file name

makeProviderScmRepository

public ScmProviderRepository makeProviderScmRepository(String scmSpecificUrl,
                                                       char delimiter)
                                                throws ScmRepositoryException

Throws:
ScmRepositoryException

makeProviderScmRepository

public ScmProviderRepository makeProviderScmRepository(File path)
                                                throws ScmRepositoryException,
                                                       UnknownRepositoryStructure

Specified by:
makeProviderScmRepository in interface ScmProvider
Overrides:
makeProviderScmRepository in class AbstractScmProvider
Throws:
ScmRepositoryException
UnknownRepositoryStructure

getRepositoryURL

protected abstract String getRepositoryURL(File path)
                                    throws ScmException
Throws:
ScmException

validateScmUrl

public List<String> validateScmUrl(String scmSpecificUrl,
                                   char delimiter)
Validate the scm url.

Specified by:
validateScmUrl in interface ScmProvider
Overrides:
validateScmUrl in class AbstractScmProvider
Parameters:
scmSpecificUrl - The SCM url
delimiter - The delimiter used in the SCM url
Returns:
Returns a list of messages if the validation failed

getScmType

public String getScmType()


getAddCommand

protected abstract GitCommand getAddCommand()

add

public AddScmResult add(ScmProviderRepository repository,
                        ScmFileSet fileSet,
                        CommandParameters parameters)
                 throws ScmException

Overrides:
add in class AbstractScmProvider
Throws:
ScmException

getBranchCommand

protected abstract GitCommand getBranchCommand()

branch

protected BranchScmResult branch(ScmProviderRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters parameters)
                          throws ScmException

Overrides:
branch in class AbstractScmProvider
Throws:
ScmException

getChangeLogCommand

protected abstract GitCommand getChangeLogCommand()

changelog

public ChangeLogScmResult changelog(ScmProviderRepository repository,
                                    ScmFileSet fileSet,
                                    CommandParameters parameters)
                             throws ScmException

Overrides:
changelog in class AbstractScmProvider
Throws:
ScmException

getCheckInCommand

protected abstract GitCommand getCheckInCommand()

checkin

public CheckInScmResult checkin(ScmProviderRepository repository,
                                ScmFileSet fileSet,
                                CommandParameters parameters)
                         throws ScmException

Overrides:
checkin in class AbstractScmProvider
Throws:
ScmException

getCheckOutCommand

protected abstract GitCommand getCheckOutCommand()

checkout

public CheckOutScmResult checkout(ScmProviderRepository repository,
                                  ScmFileSet fileSet,
                                  CommandParameters parameters)
                           throws ScmException

Overrides:
checkout in class AbstractScmProvider
Throws:
ScmException

getDiffCommand

protected abstract GitCommand getDiffCommand()

diff

public DiffScmResult diff(ScmProviderRepository repository,
                          ScmFileSet fileSet,
                          CommandParameters parameters)
                   throws ScmException

Overrides:
diff in class AbstractScmProvider
Throws:
ScmException

getExportCommand

protected abstract GitCommand getExportCommand()

export

protected ExportScmResult export(ScmProviderRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters parameters)
                          throws ScmException

Overrides:
export in class AbstractScmProvider
Throws:
ScmException

getRemoveCommand

protected abstract GitCommand getRemoveCommand()

remove

public RemoveScmResult remove(ScmProviderRepository repository,
                              ScmFileSet fileSet,
                              CommandParameters parameters)
                       throws ScmException

Overrides:
remove in class AbstractScmProvider
Throws:
ScmException

getStatusCommand

protected abstract GitCommand getStatusCommand()

status

public StatusScmResult status(ScmProviderRepository repository,
                              ScmFileSet fileSet,
                              CommandParameters parameters)
                       throws ScmException

Overrides:
status in class AbstractScmProvider
Throws:
ScmException

getTagCommand

protected abstract GitCommand getTagCommand()

tag

public TagScmResult tag(ScmProviderRepository repository,
                        ScmFileSet fileSet,
                        CommandParameters parameters)
                 throws ScmException

Overrides:
tag in class AbstractScmProvider
Throws:
ScmException

getUpdateCommand

protected abstract GitCommand getUpdateCommand()

update

public UpdateScmResult update(ScmProviderRepository repository,
                              ScmFileSet fileSet,
                              CommandParameters parameters)
                       throws ScmException

Overrides:
update in class AbstractScmProvider
Throws:
ScmException

executeCommand

protected ScmResult executeCommand(GitCommand command,
                                   ScmProviderRepository repository,
                                   ScmFileSet fileSet,
                                   CommandParameters parameters)
                            throws ScmException
Throws:
ScmException

getListCommand

protected abstract GitCommand getListCommand()

list

public ListScmResult list(ScmProviderRepository repository,
                          ScmFileSet fileSet,
                          CommandParameters parameters)
                   throws ScmException
List each element (files and directories) of fileSet as they exist in the repository.

Overrides:
list in class AbstractScmProvider
Parameters:
repository - the source control system
fileSet - the files to list
Returns:
The list of files in the repository
Throws:
NoSuchCommandScmException - unless overriden by subclass
ScmException - if any

getInfoCommand

protected abstract GitCommand getInfoCommand()

info

public InfoScmResult info(ScmProviderRepository repository,
                          ScmFileSet fileSet,
                          CommandParameters parameters)
                   throws ScmException
Specified by:
info in interface ScmProvider
Overrides:
info in class AbstractScmProvider
Parameters:
repository - the source control system
fileSet - location of your local copy
parameters - some parameters (not use currently but for future use)
Returns:
if the scm implementation doesn't support "info" result will null
Throws:
ScmException

blame

protected BlameScmResult blame(ScmProviderRepository repository,
                               ScmFileSet fileSet,
                               CommandParameters parameters)
                        throws ScmException

Overrides:
blame in class AbstractScmProvider
Throws:
ScmException

getBlameCommand

protected abstract GitCommand getBlameCommand()

remoteInfo

public RemoteInfoScmResult remoteInfo(ScmProviderRepository repository,
                                      ScmFileSet fileSet,
                                      CommandParameters parameters)
                               throws ScmException

Specified by:
remoteInfo in interface ScmProvider
Overrides:
remoteInfo in class AbstractScmProvider
Parameters:
repository - the source control system
fileSet - not use currently but for future use
parameters - some parameters (not use currently but for future use)
Returns:
if the scm implementation doesn't support "info" result will null
Throws:
ScmException

getRemoteInfoCommand

protected abstract GitCommand getRemoteInfoCommand()


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.