org.apache.maven.scm.provider
Class AbstractScmProvider

java.lang.Object
  extended byorg.apache.maven.scm.provider.AbstractScmProvider
All Implemented Interfaces:
ScmProvider

public abstract class AbstractScmProvider
extends java.lang.Object
implements ScmProvider

Version:
$Id: AbstractScmProvider.java 384014 2006-03-07 21:14:27Z evenisse $
Author:
Trygve Laugstøl, Emmanuel Venisse

Field Summary
 
Fields inherited from interface org.apache.maven.scm.provider.ScmProvider
ROLE
 
Constructor Summary
AbstractScmProvider()
           
 
Method Summary
 AddScmResult add(ScmRepository repository, ScmFileSet fileSet)
          Adds the given files to the source control system
protected  AddScmResult add(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 void addListener(ScmLogger logger)
           
protected  ChangeLogScmResult changelog(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, java.util.Date startDate, java.util.Date endDate, int numDays, java.lang.String branch)
          Returns the changes that have happend in the source control system in a certain period of time.
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, java.util.Date startDate, java.util.Date endDate, int numDays, java.lang.String branch, java.lang.String datePattern)
          Returns the changes that have happend in the source control system in a certain period of time.
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, java.lang.String startTag, java.lang.String endTag)
          Returns the changes that have happend in the source control system between two tags.
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, java.lang.String startTag, java.lang.String endTag, java.lang.String datePattern)
          Returns the changes that have happend in the source control system between two tags.
protected  CheckInScmResult checkin(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag, java.lang.String message)
          Save the changes you have done into the repository.
protected  CheckOutScmResult checkout(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag)
          Create a copy of the repository on your local machine
protected  DiffScmResult diff(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 DiffScmResult diff(ScmRepository repository, ScmFileSet fileSet, java.lang.String startRevision, java.lang.String endRevision)
           
 EditScmResult edit(ScmRepository repository, ScmFileSet fileSet)
          Make a file editable.
protected  EditScmResult edit(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 ScmLogger getLogger()
           
 java.lang.String getScmSpecificFilename()
          Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'.
protected  LoginScmResult login(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 ScmProviderRepository makeProviderScmRepository(java.io.File path)
           
protected  RemoveScmResult remove(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 RemoveScmResult remove(ScmRepository repository, ScmFileSet fileSet, java.lang.String message)
          Removes the given files from the source control system
 boolean requiresEditMode()
           
 StatusScmResult status(ScmRepository repository, ScmFileSet fileSet)
          Returns the status of the files in the source control system.
protected  StatusScmResult status(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
protected  TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag)
          Tag (or label in some systems) will tag the source file with a certain tag
 UnEditScmResult unedit(ScmRepository repository, ScmFileSet fileSet)
          Make a file no longer editable.
protected  UnEditScmResult unedit(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
protected  UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)
           
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag)
          Updates the copy on the local machine with the changes in the repository
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag, java.util.Date lastUpdate)
          Updates the copy on the local machine with the changes in the repository
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag, java.util.Date lastUpdate, java.lang.String datePattern)
          Updates the copy on the local machine with the changes in the repository
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, java.lang.String tag, java.lang.String datePattern)
          Updates the copy on the local machine with the changes in the repository
 java.util.List validateScmUrl(java.lang.String scmSpecificUrl, char delimiter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.scm.provider.ScmProvider
getScmType, makeProviderScmRepository
 

Constructor Detail

AbstractScmProvider

public AbstractScmProvider()
Method Detail

getScmSpecificFilename

public java.lang.String getScmSpecificFilename()
Description copied from interface: ScmProvider
Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'.

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

validateScmUrl

public java.util.List validateScmUrl(java.lang.String scmSpecificUrl,
                                     char delimiter)
Specified by:
validateScmUrl in interface ScmProvider

requiresEditMode

public boolean requiresEditMode()
Specified by:
requiresEditMode in interface ScmProvider

add

public AddScmResult add(ScmRepository repository,
                        ScmFileSet fileSet)
                 throws ScmException
Description copied from interface: ScmProvider
Adds the given files to the source control system

Specified by:
add in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to be added
Returns:
an AddScmResult that contains the files that have been added
Throws:
ScmException
See Also:
ScmProvider.add(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)

add

protected AddScmResult add(ScmRepository repository,
                           ScmFileSet fileSet,
                           CommandParameters parameters)
                    throws ScmException
Throws:
ScmException

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    java.util.Date startDate,
                                    java.util.Date endDate,
                                    int numDays,
                                    java.lang.String branch)
                             throws ScmException
Description copied from interface: ScmProvider
Returns the changes that have happend in the source control system in a certain period of time. This can be adding, removing, updating, ... of files

Specified by:
changeLog in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to know the changes about. Implementations can also give the changes from the ScmFileSet.getBasedir() downwards.
startDate - the start date of the period
endDate - the end date of the period
numDays -
branch -
Returns:
Throws:
ScmException
See Also:
ScmProvider.changeLog(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.util.Date, java.util.Date, int, java.lang.String)

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    java.util.Date startDate,
                                    java.util.Date endDate,
                                    int numDays,
                                    java.lang.String branch,
                                    java.lang.String datePattern)
                             throws ScmException
Description copied from interface: ScmProvider
Returns the changes that have happend in the source control system in a certain period of time. This can be adding, removing, updating, ... of files

Specified by:
changeLog in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to know the changes about. Implementations can also give the changes from the ScmFileSet.getBasedir() downwards.
startDate - the start date of the period
endDate - the end date of the period
numDays -
branch -
datePattern - the date pattern use in changelog output returned by scm tool
Returns:
Throws:
ScmException
See Also:
ScmProvider.changeLog(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.util.Date, java.util.Date, int, java.lang.String, java.lang.String)

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    java.lang.String startTag,
                                    java.lang.String endTag)
                             throws ScmException
Description copied from interface: ScmProvider
Returns the changes that have happend in the source control system between two tags. This can be adding, removing, updating, ... of files

Specified by:
changeLog in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to know the changes about. Implementations can also give the changes from the ScmFileSet.getBasedir() downwards.
startTag - the start tag
endTag - the end tag
Returns:
Throws:
ScmException
See Also:
ScmProvider.changeLog(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.lang.String)

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    java.lang.String startTag,
                                    java.lang.String endTag,
                                    java.lang.String datePattern)
                             throws ScmException
Description copied from interface: ScmProvider
Returns the changes that have happend in the source control system between two tags. This can be adding, removing, updating, ... of files

Specified by:
changeLog in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to know the changes about. Implementations can also give the changes from the ScmFileSet.getBasedir() downwards.
startTag - the start tag
endTag - the end tag
datePattern - the date pattern use in changelog output returned by scm tool
Returns:
Throws:
ScmException
See Also:
ScmProvider.changeLog(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.lang.String, java.lang.String)

changelog

protected ChangeLogScmResult changelog(ScmRepository repository,
                                       ScmFileSet fileSet,
                                       CommandParameters parameters)
                                throws ScmException
Throws:
ScmException

checkIn

public CheckInScmResult checkIn(ScmRepository repository,
                                ScmFileSet fileSet,
                                java.lang.String tag,
                                java.lang.String message)
                         throws ScmException
Description copied from interface: ScmProvider
Save the changes you have done into the repository. This will create a new version of the file or directory in the repository.

Specified by:
checkIn in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to check in (sometimes called commit)
tag -
message - a string that is a comment on the changes that where done
Returns:
Throws:
ScmException
See Also:
ScmProvider.checkIn(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.lang.String)

checkin

protected CheckInScmResult checkin(ScmRepository repository,
                                   ScmFileSet fileSet,
                                   CommandParameters parameters)
                            throws ScmException
Throws:
ScmException

checkOut

public CheckOutScmResult checkOut(ScmRepository repository,
                                  ScmFileSet fileSet,
                                  java.lang.String tag)
                           throws ScmException
Description copied from interface: ScmProvider
Create a copy of the repository on your local machine

Specified by:
checkOut in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files are copied to the ScmFileSet.getBasedir() location
tag - get the version defined by the tag
Returns:
Throws:
ScmException
See Also:
ScmProvider.checkOut(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String)

checkout

protected CheckOutScmResult checkout(ScmRepository repository,
                                     ScmFileSet fileSet,
                                     CommandParameters parameters)
                              throws ScmException
Throws:
ScmException

diff

public DiffScmResult diff(ScmRepository repository,
                          ScmFileSet fileSet,
                          java.lang.String startRevision,
                          java.lang.String endRevision)
                   throws ScmException
Specified by:
diff in interface ScmProvider
Throws:
ScmException
See Also:
ScmProvider.diff(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.lang.String)

diff

protected DiffScmResult diff(ScmRepository repository,
                             ScmFileSet fileSet,
                             CommandParameters parameters)
                      throws ScmException
Throws:
ScmException

login

protected LoginScmResult login(ScmRepository repository,
                               ScmFileSet fileSet,
                               CommandParameters parameters)
                        throws ScmException
Throws:
ScmException

remove

public RemoveScmResult remove(ScmRepository repository,
                              ScmFileSet fileSet,
                              java.lang.String message)
                       throws ScmException
Description copied from interface: ScmProvider
Removes the given files from the source control system

Specified by:
remove in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to be removed
message -
Returns:
Throws:
ScmException
See Also:
ScmProvider.remove(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String)

remove

protected RemoveScmResult remove(ScmRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters parameters)
                          throws ScmException
Throws:
ScmException

status

public StatusScmResult status(ScmRepository repository,
                              ScmFileSet fileSet)
                       throws ScmException
Description copied from interface: ScmProvider
Returns the status of the files in the source control system. The state of each file can be one of the ScmFileStatus flags.

Specified by:
status in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to know the status about. Implementations can also give the changes from the ScmFileSet.getBasedir() downwards.
Returns:
Throws:
ScmException
See Also:
ScmProvider.status(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)

status

protected StatusScmResult status(ScmRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters parameters)
                          throws ScmException
Throws:
ScmException

tag

public TagScmResult tag(ScmRepository repository,
                        ScmFileSet fileSet,
                        java.lang.String tag)
                 throws ScmException
Description copied from interface: ScmProvider
Tag (or label in some systems) will tag the source file with a certain tag

Specified by:
tag in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to tag. Implementations can also give the changes from the ScmFileSet.getBasedir() downwards.
tag - the tag to apply to the files
Returns:
Throws:
ScmException
See Also:
ScmProvider.tag(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String)

tag

protected TagScmResult tag(ScmRepository repository,
                           ScmFileSet fileSet,
                           CommandParameters parameters)
                    throws ScmException
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              java.lang.String tag)
                       throws ScmException
Description copied from interface: ScmProvider
Updates the copy on the local machine with the changes in the repository

Specified by:
update in interface ScmProvider
Parameters:
repository - the source control system
fileSet - location of your local copy
tag - use the version defined by the tag
Returns:
Throws:
ScmException
See Also:
ScmProvider.update(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String)

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              java.lang.String tag,
                              java.lang.String datePattern)
                       throws ScmException
Description copied from interface: ScmProvider
Updates the copy on the local machine with the changes in the repository

Specified by:
update in interface ScmProvider
Parameters:
repository - the source control system
fileSet - location of your local copy
tag - use the version defined by the tag
datePattern - the date pattern use in changelog output returned by scm tool
Returns:
Throws:
ScmException
See Also:
ScmProvider.update(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.lang.String)

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              java.lang.String tag,
                              java.util.Date lastUpdate)
                       throws ScmException
Description copied from interface: ScmProvider
Updates the copy on the local machine with the changes in the repository

Specified by:
update in interface ScmProvider
Parameters:
repository - the source control system
fileSet - location of your local copy
tag - use the version defined by the tag
lastUpdate -
Returns:
Throws:
ScmException
See Also:
ScmProvider.update(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.util.Date)

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              java.lang.String tag,
                              java.util.Date lastUpdate,
                              java.lang.String datePattern)
                       throws ScmException
Description copied from interface: ScmProvider
Updates the copy on the local machine with the changes in the repository

Specified by:
update in interface ScmProvider
Parameters:
repository - the source control system
fileSet - location of your local copy
tag - use the version defined by the tag
lastUpdate - Date of last update
datePattern - the date pattern use in changelog output returned by scm tool
Returns:
Throws:
ScmException
See Also:
ScmProvider.update(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.util.Date, java.lang.String)

update

protected UpdateScmResult update(ScmRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters parameters)
                          throws ScmException
Throws:
ScmException

edit

public EditScmResult edit(ScmRepository repository,
                          ScmFileSet fileSet)
                   throws ScmException
Description copied from interface: ScmProvider
Make a file editable. This is used in source control systems where you look at read-only files and you need to make them not read-only anymore before you can edit them. This can also mean that no other user in the system can make the file not read-only anymore.

Specified by:
edit in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to make editable
Returns:
Throws:
ScmException

edit

protected EditScmResult edit(ScmRepository repository,
                             ScmFileSet fileSet,
                             CommandParameters parameters)
                      throws ScmException
Throws:
ScmException

unedit

public UnEditScmResult unedit(ScmRepository repository,
                              ScmFileSet fileSet)
                       throws ScmException
Description copied from interface: ScmProvider
Make a file no longer editable. This is the conterpart of ScmProvider.edit(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet). It makes the file read-only again.

Specified by:
unedit in interface ScmProvider
Parameters:
repository - the source control system
fileSet - the files to make uneditable
Returns:
Throws:
ScmException

unedit

protected UnEditScmResult unedit(ScmRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters parameters)
                          throws ScmException
Throws:
ScmException

addListener

public void addListener(ScmLogger logger)
Specified by:
addListener in interface ScmProvider
See Also:
ScmProvider.addListener(org.apache.maven.scm.log.ScmLogger)

getLogger

public ScmLogger getLogger()

makeProviderScmRepository

public ScmProviderRepository makeProviderScmRepository(java.io.File path)
                                                throws ScmRepositoryException,
                                                       UnknownRepositoryStructure
Specified by:
makeProviderScmRepository in interface ScmProvider
Throws:
ScmRepositoryException
UnknownRepositoryStructure
See Also:
ScmProvider.makeProviderScmRepository(java.io.File)


Copyright © 2003-2006 Apache Software Foundation. All Rights Reserved.