de.smartics.maven.plugin.buildmetadata.scm.maven
Class ScmAccessInfo

Package class diagram package ScmAccessInfo
java.lang.Object
  extended by de.smartics.maven.plugin.buildmetadata.scm.maven.ScmAccessInfo
All Implemented Interfaces:
Serializable

public final class ScmAccessInfo
     
     
extends Object
implements Serializable

Provides access information to retrieve revision information from the SCM.

Author:
Robert Reiner
See Also:
Serialized Form

Field Summary
static int DEFAULT_RETRY_COUNT
          The number of retries to fetch the change log if the first attempt failed to return a non empty set.
 
Constructor Summary
ScmAccessInfo()
          Default constructor.
 
Method Summary
protected  ScmFileSet createFileSet()
          Creates the file set on the root directory of the checked out project.
 ChangeLogScmResult fetchChangeLog(ScmRepository repository, ScmProvider provider)
          Returns the result of the change log query.
 String getDateFormat()
          Returns the format of the dates understood by the SCM system.
 int getQueryRangeInDays()
          Returns the range of the query in days to fetch change log entries from the SCM.
 File getRootDirectory()
          Returns the root directory that contains the files under SCM control.
 boolean isFailIndicated()
          Checks whether the SCM configuration calls for a failure due to changed files.
 boolean isFailOnLocalModifications()
          Returns the flag to fail if local modifications have been found.
 boolean isIgnoreDotFilesInBaseDir()
          Returns the flag to ignore files and directories starting with a dot for checking modified files.
 void setDateFormat(String dateFormat)
          Sets the format of the dates understood by the SCM system.
 void setFailOnLocalModifications(boolean failOnLocalModifications)
          Sets the flag to fail if local modifications have been found.
 void setIgnoreDotFilesInBaseDir(boolean ignoreDotFilesInBaseDir)
          Sets the flag to ignore files and directories starting with a dot for checking modified files.
 void setQueryRangeInDays(int queryRangeInDays)
          Sets the range of the query in days to fetch change log entries from the SCM.
 void setRootDirectory(File rootDirectory)
          Sets the root directory that contains the files under SCM control.
 String toString()
          Delegates call to StringBuilder.toString().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_RETRY_COUNT

public static final int DEFAULT_RETRY_COUNT
The number of retries to fetch the change log if the first attempt failed to return a non empty set.

The value of this constant is 5.

Constant Field Value:
5
Constructor Detail

ScmAccessInfo

public ScmAccessInfo()
Default constructor.

Method Detail

getDateFormat

public String getDateFormat()
Returns the format of the dates understood by the SCM system.

Returns:
the format of the dates understood by the SCM system.

setDateFormat

public void setDateFormat(String dateFormat)
Sets the format of the dates understood by the SCM system.

Parameters:
dateFormat - the format of the dates understood by the SCM system.

getRootDirectory

public File getRootDirectory()
Returns the root directory that contains the files under SCM control.

Returns:
the root directory that contains the files under SCM control.

setRootDirectory

public void setRootDirectory(File rootDirectory)
Sets the root directory that contains the files under SCM control.

Parameters:
rootDirectory - the root directory that contains the files under SCM control.

getQueryRangeInDays

public int getQueryRangeInDays()
Returns the range of the query in days to fetch change log entries from the SCM. If no change logs have been found, the range is incremented up to 5 times. If no change log has been found after these 5 additional queries, the revision number will not be set with a valid value.

Returns:
the range of the query in days to fetch change log entries from the SCM.

setQueryRangeInDays

public void setQueryRangeInDays(int queryRangeInDays)
Sets the range of the query in days to fetch change log entries from the SCM. If no change logs have been found, the range is incremented up to 5 times. If no change log has been found after these 5 additional queries, the revision number will not be set with a valid value.

Parameters:
queryRangeInDays - the range of the query in days to fetch change log entries from the SCM.

isFailOnLocalModifications

public boolean isFailOnLocalModifications()
Returns the flag to fail if local modifications have been found. The value is true if the build should fail if there are modifications (any files not in-sync with the remote repository), false if the fact is only to be noted in the build properties.

Returns:
the flag to fail if local modifications have been found.

setFailOnLocalModifications

public void setFailOnLocalModifications(boolean failOnLocalModifications)
Sets the flag to fail if local modifications have been found. The value is true if the build should fail if there are modifications (any files not in-sync with the remote repository), false if the fact is only to be noted in the build properties.

Parameters:
failOnLocalModifications - the flag to fail if local modifications have been found.

isIgnoreDotFilesInBaseDir

public boolean isIgnoreDotFilesInBaseDir()
Returns the flag to ignore files and directories starting with a dot for checking modified files. This implicates that any files or directories, starting with a dot, are ignored when the check on changed files is run. If the value is true, dot files are ignored, if it is set to false, dot files are respected.

Returns:
the flag to ignore files and directories starting with a dot for checking modified files.

setIgnoreDotFilesInBaseDir

public void setIgnoreDotFilesInBaseDir(boolean ignoreDotFilesInBaseDir)
Sets the flag to ignore files and directories starting with a dot for checking modified files. This implicates that any files or directories, starting with a dot, are ignored when the check on changed files is run. If the value is true, dot files are ignored, if it is set to false, dot files are respected.

Parameters:
ignoreDotFilesInBaseDir - the flag to ignore files and directories starting with a dot for checking modified files.

fetchChangeLog

public ChangeLogScmResult fetchChangeLog(ScmRepository repository,
                                         ScmProvider provider)
                                  throws ScmException
Returns the result of the change log query.

Parameters:
repository - the repository to fetch the change log information from.
provider - the provider to use to access the repository.
Returns:
the change log entries that match the query, null if none have been found.
Throws:
ScmException - if the change log cannot be fetched.

createFileSet

protected ScmFileSet createFileSet()
Creates the file set on the root directory of the checked out project.

Returns:
the file set on the root directory of the checked out project.

isFailIndicated

public boolean isFailIndicated()
Checks whether the SCM configuration calls for a failure due to changed files.

Returns:
true if a fail is indicated (i.e. there are locally modified files that are to be considered for a check), false if there are none.

toString

public String toString()
Delegates call to StringBuilder.toString().

Overrides:
toString in class Object
Returns:
the result of the call to StringBuilder.toString().
See Also:
StringBuilder.toString()


Copyright © 2006-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.