Class JazzListChangesetConsumer
- java.lang.Object
-
- org.apache.maven.scm.util.AbstractConsumer
-
- org.apache.maven.scm.provider.jazz.command.consumer.AbstractRepositoryConsumer
-
- org.apache.maven.scm.provider.jazz.command.changelog.JazzListChangesetConsumer
-
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
public class JazzListChangesetConsumer extends AbstractRepositoryConsumer
Consume the output of the scm command for the "list changesets" operation.This parses the contents of the output and uses it to fill in the remaining information in the
entries
list.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
CHANGES_PATTERN
private static java.util.regex.Pattern
CHANGESET_PATTERN
private int
currentChangeSetIndex
private int
currentState
private java.util.List<ChangeSet>
entries
private static java.lang.String
HEADER_CHANGE_SET
private static java.lang.String
HEADER_CHANGE_SETS
private static java.lang.String
HEADER_CHANGES
private static java.lang.String
HEADER_COMPONENT
private static java.lang.String
HEADER_MODIFIED
private static java.lang.String
JAZZ_TIMESTAMP_PATTERN
private static java.lang.String
JAZZ_TIMESTAMP_PATTERN_TIME
private static int
STATE_CHANGE_SET
private static int
STATE_CHANGE_SETS
private static int
STATE_CHANGES
private static int
STATE_COMPONENT
private static int
STATE_MODIFIED
private java.lang.String
userDateFormat
-
Fields inherited from class org.apache.maven.scm.provider.jazz.command.consumer.AbstractRepositoryConsumer
fed
-
-
Constructor Summary
Constructors Constructor Description JazzListChangesetConsumer(ScmProviderRepository repo, ScmLogger logger, java.util.List<ChangeSet> entries, java.lang.String userDateFormat)
Constructor for our "scm list changeset" consumer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consumeLine(java.lang.String line)
Process one line of output from the execution of the "scm list changeset" command.private ScmFileStatus
parseChangeSetChangeState(java.lang.String state)
Parse the change state file flags from Jazz and map them to the maven SCM ones.private ScmFileStatus
parseFileChangeState(java.lang.String state)
Parse the change state file flags from Jazz and map them to the maven SCM ones.private void
processChangeSetLine(java.lang.String line)
private void
processChangesLine(java.lang.String line)
private void
processModifiedLine(java.lang.String line)
protected java.lang.String
stripDelimiters(java.lang.String text)
String the leading/trailing ", < and > from the text.-
Methods inherited from class org.apache.maven.scm.provider.jazz.command.consumer.AbstractRepositoryConsumer
getRepository, isFed, setFed, setRepository
-
Methods inherited from class org.apache.maven.scm.util.AbstractConsumer
getLogger, parseDate, parseDate, setLogger
-
-
-
-
Field Detail
-
STATE_CHANGE_SETS
private static final int STATE_CHANGE_SETS
- See Also:
- Constant Field Values
-
STATE_CHANGE_SET
private static final int STATE_CHANGE_SET
- See Also:
- Constant Field Values
-
STATE_COMPONENT
private static final int STATE_COMPONENT
- See Also:
- Constant Field Values
-
STATE_MODIFIED
private static final int STATE_MODIFIED
- See Also:
- Constant Field Values
-
STATE_CHANGES
private static final int STATE_CHANGES
- See Also:
- Constant Field Values
-
HEADER_CHANGE_SETS
private static final java.lang.String HEADER_CHANGE_SETS
- See Also:
- Constant Field Values
-
HEADER_CHANGE_SET
private static final java.lang.String HEADER_CHANGE_SET
- See Also:
- Constant Field Values
-
HEADER_COMPONENT
private static final java.lang.String HEADER_COMPONENT
- See Also:
- Constant Field Values
-
HEADER_MODIFIED
private static final java.lang.String HEADER_MODIFIED
- See Also:
- Constant Field Values
-
HEADER_CHANGES
private static final java.lang.String HEADER_CHANGES
- See Also:
- Constant Field Values
-
JAZZ_TIMESTAMP_PATTERN
private static final java.lang.String JAZZ_TIMESTAMP_PATTERN
- See Also:
- Constant Field Values
-
JAZZ_TIMESTAMP_PATTERN_TIME
private static final java.lang.String JAZZ_TIMESTAMP_PATTERN_TIME
- See Also:
- Constant Field Values
-
CHANGESET_PATTERN
private static final java.util.regex.Pattern CHANGESET_PATTERN
-
CHANGES_PATTERN
private static final java.util.regex.Pattern CHANGES_PATTERN
-
entries
private java.util.List<ChangeSet> entries
-
userDateFormat
private final java.lang.String userDateFormat
-
currentChangeSetIndex
private int currentChangeSetIndex
-
currentState
private int currentState
-
-
Constructor Detail
-
JazzListChangesetConsumer
public JazzListChangesetConsumer(ScmProviderRepository repo, ScmLogger logger, java.util.List<ChangeSet> entries, java.lang.String userDateFormat)
Constructor for our "scm list changeset" consumer.- Parameters:
repo
- The JazzScmProviderRepository being used.logger
- The ScmLogger to use.entries
- The List of ChangeSet entries that we will populate.
-
-
Method Detail
-
consumeLine
public void consumeLine(java.lang.String line)
Process one line of output from the execution of the "scm list changeset" command.- Specified by:
consumeLine
in interfaceorg.codehaus.plexus.util.cli.StreamConsumer
- Overrides:
consumeLine
in classAbstractRepositoryConsumer
- Parameters:
line
- The line of output from the external command that has been pumped to us.- See Also:
StreamConsumer.consumeLine(java.lang.String)
-
processChangeSetLine
private void processChangeSetLine(java.lang.String line)
-
processModifiedLine
private void processModifiedLine(java.lang.String line)
-
processChangesLine
private void processChangesLine(java.lang.String line)
-
stripDelimiters
protected java.lang.String stripDelimiters(java.lang.String text)
String the leading/trailing ", < and > from the text.- Parameters:
text
- The text to process.- Returns:
- The striped text.
-
parseChangeSetChangeState
private ScmFileStatus parseChangeSetChangeState(java.lang.String state)
Parse the change state file flags from Jazz and map them to the maven SCM ones."----" Character positions 0-3.
[0] is '*' or '-' Indicates that this is the current change set ('*') or not ('-'). STATE_CHANGESET_CURRENT [1] is '!' or '-' Indicates a Potential Conflict ('!') or not ('-'). STATE_POTENTIAL_CONFLICT [2] is '#' or '-' Indicates a Conflict ('#') or not ('-'). STATE_CONFLICT [3] is '@' or '$' Indicates whether the changeset is active ('@') or not ('$'). STATE_CHANGESET_ACTIVE
- Parameters:
state
- The 5 character long state string- Returns:
- The ScmFileStatus value.
-
parseFileChangeState
private ScmFileStatus parseFileChangeState(java.lang.String state)
Parse the change state file flags from Jazz and map them to the maven SCM ones."-----" Character positions 0-4. The default is '-'.
[0] is '-' or '!' Indicates a Potential Conflict. STATE_POTENTIAL_CONFLICT [1] is '-' or '#' Indicates a Conflict. STATE_CONFLICT [2] is '-' or 'a' Indicates an addition. STATE_ADD or 'd' Indicates a deletion. STATE_DELETE or 'm' Indicates a move. STATE_MOVE [3] is '-' or 'c' Indicates a content change. STATE_CONTENT_CHANGE [4] is '-' or 'p' Indicates a property change. STATE_PROPERTY_CHANGE
NOTE: [3] and [4] can only be set it [2] is NOT 'a' or 'd'.
- Parameters:
state
- The 5 character long state string- Returns:
- The SCMxxx value.
-
-