当前位置: 首页>>代码示例>>Java>>正文


Java Publisher类代码示例

本文整理汇总了Java中hudson.tasks.Publisher的典型用法代码示例。如果您正苦于以下问题:Java Publisher类的具体用法?Java Publisher怎么用?Java Publisher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Publisher类属于hudson.tasks包,在下文中一共展示了Publisher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeCheck

import hudson.tasks.Publisher; //导入依赖的package包/类
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;
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:18,代码来源:ArtifactChecker.java

示例2: getPublishersList

import hudson.tasks.Publisher; //导入依赖的package包/类
/** {@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;
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:22,代码来源:AbstractRunnableItemGroup.java

示例3: getPublishersList

import hudson.tasks.Publisher; //导入依赖的package包/类
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);
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:26,代码来源:InheritanceProject.java

示例4: isManualTrigger

import hudson.tasks.Publisher; //导入依赖的package包/类
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;
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:17,代码来源:BPPManualTriggerResolver.java

示例5: getUpstreamManualTriggered

import hudson.tasks.Publisher; //导入依赖的package包/类
@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;
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:19,代码来源:BPPManualTriggerResolver.java

示例6: findPublisher

import hudson.tasks.Publisher; //导入依赖的package包/类
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;
}
 
开发者ID:IBM,项目名称:ibm-cloud-devops,代码行数:13,代码来源:EventHandler.java

示例7: testFindPublisher

import hudson.tasks.Publisher; //导入依赖的package包/类
@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));
}
 
开发者ID:IBM,项目名称:ibm-cloud-devops,代码行数:16,代码来源:EventHandlerTest.java

示例8: getApplicableDescriptors

import hudson.tasks.Publisher; //导入依赖的package包/类
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;
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:8,代码来源:CoreStep.java

示例9: getService

import hudson.tasks.Publisher; //导入依赖的package包/类
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;
    }
 
开发者ID:wanyukang,项目名称:custom-notifier-plugin,代码行数:11,代码来源:JobListener.java

示例10: newInstance

import hudson.tasks.Publisher; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:MarkusDNC,项目名称:plot-plugin,代码行数:13,代码来源:PlotPipelineDescriptor.java

示例11: newInstance

import hudson.tasks.Publisher; //导入依赖的package包/类
/**
* 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;
}
 
开发者ID:zgyarmati,项目名称:aptly-plugin,代码行数:25,代码来源:AptlyPublisher.java

示例12: prebuild

import hudson.tasks.Publisher; //导入依赖的package包/类
@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);
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:14,代码来源:TelegramNotifier.java

示例13: getNotifier

import hudson.tasks.Publisher; //导入依赖的package包/类
@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();
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:11,代码来源:TelegramListener.java

示例14: prebuild

import hudson.tasks.Publisher; //导入依赖的package包/类
@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);
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:14,代码来源:MattermostNotifier.java

示例15: getNotifier

import hudson.tasks.Publisher; //导入依赖的package包/类
@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();
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:11,代码来源:MattermostListener.java


注:本文中的hudson.tasks.Publisher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。