Class AbstractMavenArtifactChoiceListProvider

    • Constructor Detail

      • AbstractMavenArtifactChoiceListProvider

        public AbstractMavenArtifactChoiceListProvider​(String artifactId)
        Initializes the choicelist with at the artifactId.
        artifactId - the artifactId is the minimum required information.
    • Method Detail

      • getChoiceList

        public List<String> getChoiceList()
        Specified by:
        getChoiceList in class jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
      • createServiceInstance

        public abstract IVersionReader createServiceInstance()
        Different implementation will return different IVersionReader instances.
        the source of the artifacts.
      • getCredentials

        public static com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl getCredentials​(String pCredentialId)
        Returns the UsernamePasswordCredentialsImpl for the given CredentialId
        pCredentialId - the internal jenkins id for the credentials
        the credentials for the ID or NULL
      • readURL

        public static Map<String,​String> readURL​(IVersionReader pInstance,
                                                       String pRepositoryId,
                                                       String pGroupId,
                                                       String pArtifactId,
                                                       String pPackaging,
                                                       String pClassifier,
                                                       boolean pInverseFilter,
                                                       String pFilterExpression,
                                                       boolean pReverseOrder)
        Retrieves the versions from the given source.
        pInstance - the artifact repository service.
        pRepositoryId - the repositoryId
        pGroupId - the groupId of the artifact
        pArtifactId - the artifactId
        pPackaging - the packaging
        pClassifier - the classifier
        pInverseFilter - true if the result should contain artifacts which don't match the pFilterExpression regexp false if the result should contain artifacts which match the pFilterExpression regexp
        pFilterExpression - Regexp applied on the artifacts for further selection of what should be returned. Empty string acts like .*.
        pReverseOrder - true if the result should be reversed.
        never null
      • filterArtifacts

        public static List<String> filterArtifacts​(List<String> pChoices,
                                                   boolean pInverseFilter,
                                                   String pFilterExpression)
        Returns a new list containing/excluding the matching artifacts based on whether inversion was required.
        pChoices - List of artifacts to filter. This function won't change its elements.
        pInverseFilter - Decides whether the pFilterExpression should be negated. If true then only non matching artifacts will be returned.
        pFilterExpression - A regular expression which will be applied to the whole artifact string. Empty string and null are treated as perfect match (value of inverse is still considered).
        A new list of matching artifacts only
        PatternSyntaxException - If pFilterExpression parameter is not a valid regular expression
      • toMap

        public static Map<String,​String> toMap​(List<String> pChoices)
        Cuts of the first parts of the URL and only returns a smaller set of items.
        pChoices - the list which is transformed to a map
        the map containing the short url as Key and the long url as value.
      • onBuildCompletedWithValue

        public void onBuildCompletedWithValue​(AbstractBuild<?,​?> build,
                                              jp.ikedam.jenkins.plugins.extensible_choice_parameter.ExtensibleChoiceParameterDefinition def,
                                              String value)
        onBuildCompletedWithValue in class jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
      • onBuildTriggeredWithValue

        public void onBuildTriggeredWithValue​(AbstractProject<?,​?> job,
                                              jp.ikedam.jenkins.plugins.extensible_choice_parameter.ExtensibleChoiceParameterDefinition def,
                                              String value)
        onBuildTriggeredWithValue in class jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
      • setGroupId

        public void setGroupId​(String groupId)
      • setArtifactId

        public void setArtifactId​(String artifactId)
      • setPackaging

        public void setPackaging​(String packaging)
      • setClassifier

        public void setClassifier​(String classifier)
      • setInverseFilter

        public void setInverseFilter​(boolean inverseFilter)
      • setFilterExpression

        public void setFilterExpression​(String filterExpression)
      • setReverseOrder

        public void setReverseOrder​(boolean reverseOrder)
      • setRepositoryId

        public void setRepositoryId​(String repositoryId)
      • getGroupId

        public String getGroupId()
      • getArtifactId

        public String getArtifactId()
      • getPackaging

        public String getPackaging()
      • getClassifier

        public String getClassifier()
      • getInverseFilter

        public boolean getInverseFilter()
      • getFilterExpression

        public String getFilterExpression()
      • getReverseOrder

        public boolean getReverseOrder()
      • getRepositoryId

        public String getRepositoryId()