當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。