Class 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 Detail

      • 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
      • 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 interface org.codehaus.plexus.util.cli.StreamConsumer
        Overrides:
        consumeLine in class AbstractRepositoryConsumer
        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.