Java 类hudson.tasks.Publisher 实例源码

项目:jenkinslint-plugin    文件:ArtifactChecker.java   
public boolean executeCheck(Item item) {
    LOG.log(Level.FINE, "executeCheck " + item);

    if (item instanceof Project) {
        Project project = (Project) item;
        DescribableList<Publisher, Descriptor<Publisher>> publishersList = project.getPublishersList();
        for (Publisher publisher : publishersList) {
            if (publisher instanceof ArtifactArchiver) {
                LOG.log(Level.FINEST, "ArtifactChecker " + publisher);
                return (((ArtifactArchiver) publisher).getArtifacts() == null ||
                        (((ArtifactArchiver) publisher).getArtifacts() != null &&
                                ((ArtifactArchiver) publisher).getArtifacts().length() == 0));
            }
        }
    }
    return false;
}
项目:yaml-project-plugin    文件:AbstractRunnableItemGroup.java   
/** {@inheritDoc} */
@Override
public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() {
  // TODO(mattmoor): switch to utilize something with an atomic
  // compare/exchange semantic.
  if (publishers != null) {
    return publishers;
  }

  // NOTE: I believe this is lazily initialized vs. created in the
  // constructor so that lazy API consumers can omit an empty publisher list
  // from their serialized XML blob.
  synchronized (this) {
    if (publishers == null) {
      publishers =
          new DescribableList<Publisher, Descriptor<Publisher>>(this);
    }
  }

  return publishers;
}
项目:jenkins-inheritance-plugin    文件:InheritanceProject.java   
public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList(
        IMode mode) {
    InheritanceGovernor<DescribableList<Publisher, Descriptor<Publisher>>> gov =
            new InheritanceGovernor<DescribableList<Publisher, Descriptor<Publisher>>>(
                    "publishersList", SELECTOR.PUBLISHER, this) {
        @Override
        protected DescribableList<Publisher, Descriptor<Publisher>> castToDestinationType(Object o) {
            return castToDescribableList(o);
        }

        @Override
        public DescribableList<Publisher, Descriptor<Publisher>> getRawField(
                InheritanceProject ip) {
            return ip.getRawPublishersList();
        }

        @Override
        protected DescribableList<Publisher, Descriptor<Publisher>> reduceFromFullInheritance(
                Deque<DescribableList<Publisher, Descriptor<Publisher>>> list) {
            return InheritanceGovernor.reduceDescribableByMerge(list);
        }
    };

    return gov.retrieveFullyDerivedField(this, mode);
}
项目:delivery-pipeline-plugin    文件:BPPManualTriggerResolver.java   
public boolean isManualTrigger(AbstractProject<?, ?> project) {
    List<AbstractProject> upstreamProjects = project.getUpstreamProjects();
    for (AbstractProject upstreamProject : upstreamProjects) {
        DescribableList<Publisher, Descriptor<Publisher>> upstreamPublishersLists =
                upstreamProject.getPublishersList();
        for (Publisher upstreamPub : upstreamPublishersLists) {
            if (upstreamPub instanceof BuildPipelineTrigger) {
                String names = ((BuildPipelineTrigger) upstreamPub).getDownstreamProjectNames();
                if (ProjectUtil.getProjectList(names, project.getParent(), null).contains(project)) {
                    return true;
                }
            }
        }
    }
    return false;
}
项目:delivery-pipeline-plugin    文件:BPPManualTriggerResolver.java   
@Override
public List<AbstractProject> getUpstreamManualTriggered(AbstractProject<?, ?> project) {
    List<AbstractProject> result = new ArrayList<>();
    List<AbstractProject> upstreamProjects = project.getUpstreamProjects();
    for (AbstractProject upstream : upstreamProjects) {
        @SuppressWarnings("unchecked")
        DescribableList<Publisher, Descriptor<Publisher>> upstreamPublishersLists = upstream.getPublishersList();
        for (Publisher upstreamPub : upstreamPublishersLists) {
            if (upstreamPub instanceof BuildPipelineTrigger) {
                String names = ((BuildPipelineTrigger) upstreamPub).getDownstreamProjectNames();
                if (ProjectUtil.getProjectList(names, project.getParent(), null).contains(project)) {
                    result.add(upstream);
                }
            }
        }
    }
    return result;
}
项目:ibm-cloud-devops    文件:EventHandler.java   
public static OTCNotifier findPublisher(AbstractBuild r){
    List<Publisher> publisherList = r.getProject().getPublishersList().toList();

    //ensure that there is an OTCNotifier in the project
    for(Publisher publisher: publisherList){
        if(publisher instanceof OTCNotifier){
            return (OTCNotifier) publisher;
        }
    }

    return null;
}
项目:ibm-cloud-devops    文件:EventHandlerTest.java   
@Test
public void testFindPublisher() {
    OTCNotifier otcNotifier = mock(OTCNotifier.class);
    AbstractBuild r = mock(AbstractBuild.class);
    AbstractProject project = mock(AbstractProject.class);
    DescribableList<Publisher, Descriptor<Publisher>> describableList = mock(DescribableList.class);
    ArrayList<Publisher> publisherList = new ArrayList<Publisher>();

    publisherList.add(otcNotifier);
    when(r.getProject()).thenReturn(project);
    when(project.getPublishersList()).thenReturn(describableList);
    when(describableList.toList()).thenReturn(publisherList);

    assertEquals(otcNotifier, EventHandler.findPublisher(r));
}
项目:Jenkins-Plugin-Examples    文件:CoreStep.java   
public Collection<? extends Descriptor<?>> getApplicableDescriptors() {
    // Jenkins.instance.getDescriptorList(SimpleBuildStep) is empty, presumably because that itself is not a Describable.
    List<Descriptor<?>> r = new ArrayList<>();
    populate(r, Builder.class);
    populate(r, Publisher.class);
    return r;
}
项目:custom-notifier-plugin    文件:JobListener.java   
private JdumpService getService(AbstractBuild builder, TaskListener listener) {

        Map<Descriptor<Publisher>, Publisher> map = builder.getProject().getPublishersList().toMap();
        for (Publisher publisher : map.values()) {
            if (publisher instanceof JdumpNotifier) {
                return ((JdumpNotifier) publisher).newJdumpService(builder, listener);
            }
        }
        return null;
    }
项目:plot-plugin    文件:PlotPipelineDescriptor.java   
/**
 * Called when the user saves the project configuration.
 */
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData)
        throws FormException {
    PlotPipelinePublisher publisher = new PlotPipelinePublisher(true);
    for (Object data : SeriesFactory.getArray(formData.get("plots"))) {
        publisher.addPlot(bindPlot((JSONObject) data, req));
    }
    return publisher;
}
项目:aptly-plugin    文件:AptlyPublisher.java   
/**
* This method is called by hudson if the user has clicked the add button of the Aptly site hosts point in the System Configuration
* web page. It's create a new instance of the {@link AptlyPublisher} class and added all configured ftp sites to this instance by calling
* the method {@link AptlyPublisher#getEntries()} and on it's return value the addAll method is called.
*
* {@inheritDoc}
*
* @param req
*          {@inheritDoc}
* @return {@inheritDoc}
* @see hudson.model.Descriptor#newInstance(org.kohsuke.stapler.StaplerRequest)
*/
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData) {
   AptlyPublisher pub = new AptlyPublisher();
   try {
        List<PackageItem> entries = req.bindJSONToList(PackageItem.class, formData.get("packageItems"));
        pub.getPackageItems().addAll(entries);
   } catch (Exception e) {
       LOG.severe(">> bindJSONToList Exception: " + e.getMessage());
       return null;
   }
   return pub;
}
项目:jenkins-telegram-plugin    文件:TelegramNotifier.java   
@Override
public boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener) {
    if (startNotification) {
        Map<Descriptor<Publisher>, Publisher> map = build.getProject().getPublishersList().toMap();
        for (Publisher publisher : map.values()) {
            if (publisher instanceof TelegramNotifier) {
                logger.info("Invoking Started...");
                new ActiveNotifier((TelegramNotifier) publisher, listener).started(build);
            }
        }
    }
    return super.prebuild(build, listener);
}
项目:jenkins-telegram-plugin    文件:TelegramListener.java   
@SuppressWarnings("unchecked")
FineGrainedNotifier getNotifier(AbstractProject project, TaskListener listener) {
    Map<Descriptor<Publisher>, Publisher> map = project.getPublishersList().toMap();
    for (Publisher publisher : map.values()) {
        if (publisher instanceof TelegramNotifier) {
            return new ActiveNotifier((TelegramNotifier) publisher, (BuildListener)listener);
        }
    }
    return new DisabledNotifier();
}
项目:jenkins-mattermost-plugin    文件:MattermostNotifier.java   
@Override
public boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener) {
    if (startNotification) {
        Map<Descriptor<Publisher>, Publisher> map = build.getProject().getPublishersList().toMap();
        for (Publisher publisher : map.values()) {
            if (publisher instanceof MattermostNotifier) {
                logger.info("Invoking Started...");
                new ActiveNotifier((MattermostNotifier)publisher, listener).started(build);
            }
        }
    }
    return super.prebuild(build, listener);
}
项目:jenkins-mattermost-plugin    文件:MattermostListener.java   
@SuppressWarnings("unchecked")
FineGrainedNotifier getNotifier(AbstractProject project, TaskListener listener) {
    Map<Descriptor<Publisher>, Publisher> map = project.getPublishersList().toMap();
    for (Publisher publisher : map.values()) {
        if (publisher instanceof MattermostNotifier) {
            return new ActiveNotifier((MattermostNotifier) publisher, (BuildListener)listener);
        }
    }
    return new DisabledNotifier();
}
项目:jenkinslint-plugin    文件:JavadocChecker.java   
public boolean executeCheck(Item item) {
    if (item instanceof Project) {
        DescribableList<Publisher, Descriptor<Publisher>> publishersList = ((Project) item).getPublishersList();
        for (Publisher publisher : publishersList) {
            if (publisher instanceof hudson.tasks.JavadocArchiver) {
                return ( ((JavadocArchiver) publisher).getJavadocDir() == null ||
                         ( ((JavadocArchiver) publisher).getJavadocDir() != null &&
                           ((JavadocArchiver) publisher).getJavadocDir().length() == 0 ));
            }
        }
    }
    return false;
}
项目:sumologic-jenkins-plugin    文件:SumoBuildNotifier.java   
@SuppressWarnings("unchecked")
public static SumoBuildNotifier getNotifier(AbstractProject project) {
  Map<Descriptor<Publisher>, Publisher> map = project.getPublishersList().toMap();
  for (Publisher publisher : map.values()) {
    if (publisher instanceof SumoBuildNotifier) {
      return (SumoBuildNotifier) publisher;
    }
  }
  return null;
}
项目:github-integration-plugin    文件:DslIntegrationTest.java   
private void verifyPublishers(DescribableList<Publisher, Descriptor<Publisher>> publishers) {
    assertThat("Should add publisher", publishers, hasSize(2));

    assertThat("Should add status publisher", publishers.get(0), instanceOf(GitHubPRBuildStatusPublisher.class));
    assertThat("Should add 2 packages",
            ((GitHubPRBuildStatusPublisher) publishers.get(0)).getStatusMsg().getContent(),
            equalTo(JOB_DSL_PUBLISHER_TEXT_CONTENT));

    assertThat("Has comment publisher", publishers.get(1), instanceOf(GitHubPRCommentPublisher.class));
    GitHubPRCommentPublisher commentPublisher = (GitHubPRCommentPublisher) publishers.get(1);

    assertThat("Comment matches", commentPublisher.getComment().getContent(), equalTo("comment"));
    assertThat("Only failed builds", commentPublisher.getStatusVerifier().getBuildStatus(), equalTo(Result.FAILURE));
    assertThat("Publish marked as failure", commentPublisher.getErrorHandler().getBuildStatus(), equalTo(Result.FAILURE));
}
项目:grapes-jenkins-plugin    文件:GrapesPlugin.java   
/**
 * Returns the Grapes Notifier instance of a project (null if there is none)
 *
 * @param project AbstractProject<?, ?>
 * @return GrapesNotifier
 */
public static GrapesNotifier getGrapesNotifier(final AbstractProject<?, ?> project){
    for(Publisher publisher : project.getPublishersList()){
        if(publisher instanceof GrapesNotifier){
           return (GrapesNotifier) publisher;
        }
    }

    return null;
}
项目:yaml-project-plugin    文件:YamlProjectFactory.java   
@DataBoundConstructor
public YamlProjectFactory(String yamlPath,
    AbstractRestriction restriction,
    @Nullable List<Publisher> publishers) {
  this.yamlPath = checkNotNull(yamlPath);
  this.restriction = checkNotNull(restriction);
  this.publishers = publishers;
}
项目:yaml-project-plugin    文件:YamlMultiBranchProject.java   
/** {@inheritDoc} */
@Override
protected BranchProjectFactory<YamlProject<T>, YamlBuild<T>>
    newProjectFactory() {
  return new YamlProjectFactory(YamlProject.DEFAULT_YAML,
      new NoRestriction(), ImmutableList.<Publisher>of());
}
项目:yaml-project-plugin    文件:AbstractRunnableItemGroup.java   
/** {@inheritDoc} */
@Override
protected void submit(StaplerRequest req, StaplerResponse rsp)
    throws IOException, ServletException, FormException {
  super.submit(req, rsp);

  final JSONObject json = req.getSubmittedForm();

  getBuildWrappersList().rebuild(req, json, BuildWrappers.getFor(this));
  getPublishersList().rebuildHetero(req, json, Publisher.all(), "publisher");
}
项目:yaml-project-plugin    文件:YamlProjectFactoryTest.java   
@Before
public void setUp() throws Exception {
  MockitoAnnotations.initMocks(this);

  underTest = new YamlProjectFactory(YAML_PATH, RESTRICTION,
      ImmutableList.<Publisher>of(new Mailer()));
}
项目:jenkins    文件:PushPublisher.java   
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException {
    try {
        JSONObject pushJSON = formData.getJSONObject("remoteImageStrategy");

        RemoteImageStrategy remoteImageStrategy = RemoteImageStrategy.DO_NOT_USE;
        String remoteImageName = null;
        String dateFormat = null;
        boolean appendDate = false;
        String organization = null;
        boolean overwriteOrganization = false;

        if (pushJSON != null && !pushJSON.isNullObject()) {
            String remoteImageStrategyName = pushJSON.getString("value");
            remoteImageStrategy = RemoteImageStrategy.valueOf(remoteImageStrategyName);
            organization = getKeyOrDefault(pushJSON, "organization");
            overwriteOrganization = getBoolOrDefault(pushJSON, "overwriteOrganization");
            remoteImageName = getKeyOrDefault(pushJSON, "remoteImageName");
            dateFormat = getKeyOrDefault(pushJSON, "dateFormat");
            appendDate = getBoolOrDefault(pushJSON, "appendDate");
        }

        return new PushPublisher(remoteImageStrategy, organization, overwriteOrganization, remoteImageName, dateFormat, appendDate);
    } catch (JSONException ex) {
        throw new IllegalStateException("Error while parsing data form", ex);
    }
}
项目:jenkins-inheritance-plugin    文件:InheritanceProject.java   
/**
 * {@inheritDoc}
 */
@Override
public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList() {
    //Note: Between Jenkins 1.509 and 1.625, the "synchronized" requirement
    //was dropped from this method, removing a source of deadlocks.
    return this.getPublishersList(IMode.AUTO);
}
项目:jenkins-inheritance-plugin    文件:InheritanceProject.java   
public String getSVGDetail() {
    List<ParameterDefinition> pLst = this.getParameters(IMode.LOCAL_ONLY);
    if (pLst == null) {
        return "";
    }
    StringBuilder b = new StringBuilder();
    for (ParameterDefinition pd : pLst) {
        if (pd == null) { continue; }
        b.append(pd.getName());
        ParameterValue pv = pd.getDefaultParameterValue();
        if (pv != null && pv instanceof StringParameterValue) {
            b.append(": ");
            b.append(((StringParameterValue)pv).value);
        }
        b.append('\n');
    }

    if (b.length() > 0) {
        b.append("\r\n");
    }

    List<Builder> builders = this.getBuilders();
    String str = (builders == null || builders.size() != 1) ? "steps" : "step";
    int num = (builders == null) ? 0 : builders.size();
    b.append(String.format(
            "%d build %s\n", num, str
    ));

    DescribableList<Publisher, Descriptor<Publisher>> pubs = this.getPublishersList();
    str = (pubs == null || pubs.size() != 1) ? "publishers" : "publisher";
    num = (pubs == null) ? 0 : pubs.size();
    b.append(String.format(
            "%d %s", num, str
    ));



    return b.toString();
}
项目:xldeploy-plugin    文件:RepositoryUtilsTest.java   
@Test
public void shouldRetrieveOverridingCredentialFromProject() throws Exception {
    Folder f = r.jenkins.createProject(Folder.class, "folder1");
    UsernamePasswordCredentialsImpl credentials =
            new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, ID, DESCRIPTION, USERNAME,
                    PASSWORD);
    getFolderStore(f).addCredentials(Domain.global(), credentials);

    // Matches what's sent from ui
    Credential overridingCredentialProvided = new Credential(null, "", null, credentials.getId(), null, true);
    DeployitNotifier.DeployitDescriptor descriptor = new DeployitNotifier.DeployitDescriptor();

    DeployitNotifier notifierSpy = spy(new DeployitNotifier("AdminGlobal1", "app1", null, null, null, null, false, null, overridingCredentialProvided));
    doReturn(descriptor).when(notifierSpy).getDescriptor();
    doReturn(overridingCredentialProvided).when(notifierSpy).getOverridingCredential();

    FreeStyleProject freeStyleProjectSpy = spy(new FreeStyleProject(f, "folder1/proj1"));
    freeStyleProjectSpy.addPublisher(notifierSpy);

    DescribableList<Publisher, Descriptor<Publisher>> publisherListMock = mock(DescribableList.class);
    doReturn(notifierSpy).when(publisherListMock).get(any(DeployitNotifier.DeployitDescriptor.class));
    doReturn(publisherListMock).when(freeStyleProjectSpy).getPublishersList();

    Credential overridingCredential = RepositoryUtils.retrieveOverridingCredentialFromProject(freeStyleProjectSpy);
    assertEquals(USERNAME, overridingCredential.getUsername());
    assertEquals(PASSWORD, overridingCredential.getPassword().getPlainText());
}
项目:jenkins-wordpress-plugin    文件:DescriptorImpl.java   
@Override
public Publisher newInstance(StaplerRequest req, JSONObject json) throws FormException {
    String endpointUrl = json.optString("endpointUrl");
    if (endpointUrl == null || endpointUrl.isEmpty()) {
        endpointUrl = this.endpointUrl;
    }
    String username = json.optString("username");
    if (username == null || username.isEmpty()) {
        username = this.username;
    }
    String password = json.optString("password");
    if (password == null || password.isEmpty()) {
        password = this.password;
    }
    String category = json.getString("category");
    if (category == null || category.isEmpty()) {
        category = this.category;
    }
    String tags = json.getString("tags");
    if (tags == null || tags.isEmpty()) {
        tags = this.tags;
    }
    boolean smartNotify = json.getBoolean("smartNotify");

    try {

        return new WordpressNotifier(endpointUrl, username, password, category, tags, smartNotify);

    } catch (Exception e) {
        String message = "Failed to initialize WordPress Notifier - check your WordPress Notifier configuration settings: " + e.getMessage();
        LOGGER.log(Level.WARNING, message, e);
        throw new FormException(message, e, "");
    }
}
项目:plot-plugin    文件:PlotPipelinePublisher.java   
/**
 * Called by Jenkins.
 */
@Override
public BuildStepDescriptor<Publisher> getDescriptor() {
    return DESCRIPTOR;
}
项目:jenkins-deployment-manager-plugin    文件:CloudDeploymentDeleter.java   
/**
 * {@inheritDoc}
 */
@Override
public boolean isApplicable(Descriptor descriptor) {
  // Only allow this within the context of publishers
  return Publisher.class.isAssignableFrom(descriptor.clazz);
}
项目:influxdb-plugin    文件:InfluxDbPublisher.java   
@Override
public BuildStepDescriptor<Publisher> getDescriptor() {
    return DESCRIPTOR;
}
项目:influxdb-plugin    文件:DescriptorImpl.java   
@Override
public Publisher newInstance(@CheckForNull StaplerRequest req, @Nonnull JSONObject formData) {
    InfluxDbPublisher publisher = new InfluxDbPublisher();
    req.bindParameters(publisher, "publisherBinding.");
    return publisher;
}
项目:zee-jenkins    文件:ZeeDescriptor.java   
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData)
        throws FormException {
    return super.newInstance(req, formData);
}
项目:zfj-jenkins    文件:ZfjDescriptor.java   
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData)
        throws FormException {
    return super.newInstance(req, formData);
}
项目:plugin-stats-plugin    文件:PluginStatsAction.java   
private void queryProject(Project job, Hashtable<String, InstalledPlugin> installedPluginSet) {
    if (job != null) {
       // Query Builders
        if (job.getBuilders() != null && job.getBuilders().size() > 0) {
            for (int i = 0; i < job.getBuilders().size(); i++) {
                LOG.log(Level.FINE, "getBuilders " + addJob(job.getName(), job.getShortUrl(), job.getBuilders().get(i).getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getBuilders is empty");
        }

        if (job.getBuildWrappersList() != null && job.getBuildWrappersList().size() > 0) {
            DescribableList<BuildWrapper, Descriptor<BuildWrapper>> wrappersList = job.getBuildWrappersList();
            Iterator<BuildWrapper> buildWrapperIterator = wrappersList.iterator();
            while (buildWrapperIterator.hasNext()) {
                BuildWrapper buildWrapper = buildWrapperIterator.next();
                LOG.log(Level.FINE, "getBuildWrappers " + addJob(job.getName(), job.getShortUrl(), buildWrapper.getClass(), installedPluginSet));
            }

        } else {
            LOG.log(Level.FINE, "getBuildWrappers is empty");
        }

        if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
            DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
            Iterator<Publisher> publisherIterator = publisherList.iterator();
            while (publisherIterator.hasNext()) {
                Publisher publisher = publisherIterator.next();
                LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getPublishersList is empty");
        }

        if (job.getScm() != null) {
            LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
        } else {
            LOG.log(Level.FINE, "getScm is empty");
        }

        if (job.getTriggers() != null && job.getTriggers().size() > 0) {
            Iterator<Trigger> triggerIterator =  job.getTriggers().values().iterator();
            while (triggerIterator.hasNext()) {
                Trigger trigger = triggerIterator.next();
                LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getTriggers is empty");
        }

        if (job.getProperties() !=null && job.getProperties().size() > 0){
            Map<JobPropertyDescriptor,JobProperty> properties = job.getProperties();
            for (Map.Entry<JobPropertyDescriptor,JobProperty> entry : properties.entrySet()) {
                LOG.log(Level.FINE, "getProperties " + addJob(job.getName(), job.getShortUrl(), entry.getKey().getClass(), installedPluginSet));
            }
        }else {
            LOG.log(Level.FINE, "getProperties is empty");
        }

        if (job.getAllActions() != null && job.getAllActions().size() > 0) {
            for (Action action : job.getAllActions()) {
                LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getAllActions is empty");
        }

    } else {
        LOG.log(Level.FINE, "PROJECT is null");
    }
}
项目:plugin-stats-plugin    文件:PluginStatsAction.java   
private void queryMatrixProject(MatrixProject job, Hashtable<String, InstalledPlugin> installedPluginSet) {
    if (job != null) {
        if (job.getBuilders() != null && job.getBuilders().size() > 0) {
            for (int i = 0; i < job.getBuilders().size(); i++) {
                LOG.log(Level.FINE, "getBuilders " + addJob(job.getName(), job.getShortUrl(), job.getBuilders().get(i).getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getBuilders is empty");
        }

        if (job.getBuildWrappersList() != null && job.getBuildWrappersList().size() > 0) {
            DescribableList<BuildWrapper, Descriptor<BuildWrapper>> wrappersList = job.getBuildWrappersList();
            Iterator<BuildWrapper> buildWrapperIterator = wrappersList.iterator();
            while (buildWrapperIterator.hasNext()) {
                BuildWrapper buildWrapper = buildWrapperIterator.next();
                LOG.log(Level.FINE, "getBuildWrappers " + addJob(job.getName(), job.getShortUrl(), buildWrapper.getClass(), installedPluginSet));
            }

        } else {
            LOG.log(Level.FINE, "getBuildWrappers is empty");
        }

        if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
            DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
            Iterator<Publisher> publisherIterator = publisherList.iterator();
            while (publisherIterator.hasNext()) {
                Publisher publisher = publisherIterator.next();
                LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getPublishersList is empty");
        }

        if (job.getScm() != null) {
            LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
        } else {
            LOG.log(Level.FINE, "getScm is empty");
        }

        if (job.getTriggers() != null && job.getTriggers().size() > 0) {
            Iterator<Trigger<?>> triggerIterator =  job.getTriggers().values().iterator();
            while (triggerIterator.hasNext()) {
                Trigger trigger = triggerIterator.next();
                LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getTriggers is empty");
        }

        // TODO: Query Properties
        if (job.getProperties() !=null && job.getProperties().size() > 0){
            LOG.log(Level.FINE, "getProperties is " + job.getProperties().size());
            for (int j = 0; j < job.getProperties().size(); j++) {
                LOG.log(Level.FINE, "getProperties " +job.getProperties().get(j));//+ /+ addJob(job, job.getProperties().get(j).getClass(), installedPluginSet));
            }
        }else {
            LOG.log(Level.FINE, "getProperties is empty");
        }

        if (job.getAllActions() != null && job.getAllActions().size() > 0) {
            for (Action action : job.getAllActions()) {
                LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getAllActions is empty");
        }

    } else {
        LOG.log(Level.FINE, "PROJECT is null");
    }
}
项目:plugin-stats-plugin    文件:PluginStatsAction.java   
private void queryMavenProject(MavenModuleSet job, Hashtable<String, InstalledPlugin> installedPluginSet) {
    if (job != null) {

        if (job.getBuildWrappersList() != null && job.getBuildWrappersList().size() > 0) {
            DescribableList<BuildWrapper, Descriptor<BuildWrapper>> wrappersList = job.getBuildWrappersList();
            Iterator<BuildWrapper> buildWrapperIterator = wrappersList.iterator();
            while (buildWrapperIterator.hasNext()) {
                BuildWrapper buildWrapper = buildWrapperIterator.next();
                LOG.log(Level.FINE, "getBuildWrappers " + addJob(job.getName(), job.getShortUrl(), buildWrapper.getClass(), installedPluginSet));
            }

        } else {
            LOG.log(Level.FINE, "getBuildWrappers is empty");
        }

        if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
            DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
            Iterator<Publisher> publisherIterator = publisherList.iterator();
            while (publisherIterator.hasNext()) {
                Publisher publisher = publisherIterator.next();
                LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getPublishersList is empty");
        }

        if (job.getScm() != null) {
            LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
        } else {
            LOG.log(Level.FINE, "getScm is empty");
        }

        if (job.getTriggers() != null && job.getTriggers().size() > 0) {
            Iterator<Trigger<?>> triggerIterator =  job.getTriggers().values().iterator();
            while (triggerIterator.hasNext()) {
                Trigger trigger = triggerIterator.next();
                LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getTriggers is empty");
        }

        if (job.getProperties() !=null && job.getProperties().size() > 0){
            Map<JobPropertyDescriptor, JobProperty<? super MavenModuleSet>> properties = job.getProperties();
            for (Map.Entry<JobPropertyDescriptor, JobProperty<? super MavenModuleSet>> entry : properties.entrySet()) {
                LOG.log(Level.FINE, "getProperties " + addJob(job.getName(), job.getShortUrl(), entry.getKey().getClass(), installedPluginSet));
            }
        }else {
            LOG.log(Level.FINE, "getProperties is empty");
        }

        if (job.getAllActions() != null && job.getAllActions().size() > 0) {
            for (Action action : job.getAllActions()) {
                LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getAllActions is empty");
        }

    } else {
        LOG.log(Level.FINE, "PROJECT is null");
    }
}
项目:plugin-stats-plugin    文件:PluginStatsAction.java   
private void queryMultibranchProject(FreeStyleMultiBranchProject job, Hashtable<String, InstalledPlugin> installedPluginSet) {
    if (job != null) {
        if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
            DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
            Iterator<Publisher> publisherIterator = publisherList.iterator();
            while (publisherIterator.hasNext()) {
                Publisher publisher = publisherIterator.next();
                LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getPublishersList is empty");
        }

        if (job.getScm() != null) {
            LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
        } else {
            LOG.log(Level.FINE, "getScm is empty");
        }

        if (job.getTriggers() != null && job.getTriggers().size() > 0) {
            Iterator<Trigger<?>> triggerIterator =  job.getTriggers().values().iterator();
            while (triggerIterator.hasNext()) {
                Trigger trigger = triggerIterator.next();
                LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getTriggers is empty");
        }

        if (job.getProperties() !=null && job.getProperties().size() > 0){
            Map<JobPropertyDescriptor, JobProperty<? super FreeStyleProject>> properties = job.getProperties();
            for (Map.Entry<JobPropertyDescriptor, JobProperty<? super FreeStyleProject>> entry : properties.entrySet()) {
                LOG.log(Level.FINE, "getProperties " + addJob(job.getName(), job.getShortUrl(), entry.getKey().getClass(), installedPluginSet));
            }
        }else {
            LOG.log(Level.FINE, "getProperties is empty");
        }

        if (job.getAllActions() != null && job.getAllActions().size() > 0) {
            for (Action action : job.getAllActions()) {
                LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
            }
        } else {
            LOG.log(Level.FINE, "getAllActions is empty");
        }

    } else {
        LOG.log(Level.FINE, "PROJECT is null");
    }
}
项目:pyjenkins    文件:MockProject.java   
@Override
public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() {
    return null;
}
项目:phabricator-jenkins-plugin    文件:TestUtils.java   
public static Publisher getDefaultXUnitPublisher() {
    return new JUnitResultArchiver(
            JUNIT_XML
    );
}