public static String encodeTo(Item item) { return encodeTo(item,item.getFullDisplayName()); }
public static String getRelativeNameFrom(@CheckForNull Item p, @CheckForNull ItemGroup g, boolean useDisplayName) { if (p == null) return null; if (g == null) return useDisplayName ? p.getFullDisplayName() : p.getFullName(); String separationString = useDisplayName ? " » " : "/";
new Object[]{job.getFullDisplayName(), veto} ); return; System.arraycopy(additionalActions, 0, queueActions, 1, additionalActions.length); if (p.scheduleBuild2(p.getQuietPeriod(), queueActions) != null) { LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Triggering "+name); } else { LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Job is already in the queue");
/** * {@inheritDoc} */ @Override public void writeBody(PrintWriter w) { w.println("Scheduled polling of " + project.getFullDisplayName()); } }
/** * {@inheritDoc} */ @Override public void writeBody(PrintWriter w) { w.println("Scheduled " + project.getFullDisplayName()); } }
/** * {@inheritDoc} */ @Override public void writeBody(PrintWriter w) { w.println("Scheduled " + project.getFullDisplayName()); } }
@Override public String modelHyperlinkNoteEncodeTo(@Nullable Item item) { return item == null ? "#null#" : item.getFullDisplayName(); } }
/** * {@inheritDoc} */ @Override public void writeBody(PrintWriter w) { w.println("Scheduled polling of " + project.getFullDisplayName()); } }
@Nonnull @Override public String modelHyperlinkNoteEncodeTo(@Nullable Item item) { return item == null ? "#null#" : item.getFullDisplayName(); } }
public static String encodeTo(Item item) { return encodeTo(item,item.getFullDisplayName()); }
@Override public void run() { for (Item job : Jenkins.getInstance().getAllItems(Item.class)) { GitHubPushTrigger trigger = triggerFrom(job, GitHubPushTrigger.class); if (trigger != null) { String fullDisplayName = job.getFullDisplayName(); LOGGER.debug("Considering to poke {}", fullDisplayName); if (GitHubRepositoryNameContributor.parseAssociatedNames(job) .contains(changedRepository)) { LOGGER.info("Poked {}", fullDisplayName); trigger.onPost(GitHubTriggerEvent.create() .withTimestamp(event.getTimestamp()) .withOrigin(event.getOrigin()) .withTriggeredByUser(pusherName) .build() ); } else { LOGGER.debug("Skipped {} because it doesn't have a matching repository.", fullDisplayName); } } } } });
/** * Returns the full display name of the {@link #getContext()}. * * @return the full display name of the {@link #getContext()}. */ public String getContextFullDisplayName() { String n; if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof Jenkins) { n = context.getDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } return n; }
public void observe(Item item) { if (item instanceof Folder) { // only interested in non-folders in order to prevent double counting return; } HealthReport report = getHealthReport(item); if (report != null && (worst == null || report.getScore() < worst.getScore())) { worst = new HealthReport(report.getScore(), report.getIconUrl(), Messages._Folder_HealthWrap(item.getFullDisplayName(), report.getLocalizableDescription())); } }
public void observe(Item item) { if (item instanceof Folder) { // only interested in non-folders in order to prevent double counting return; } HealthReport report = getHealthReport(item); if (report != null && (worst == null || report.getScore() < worst.getScore())) { worst = new HealthReport(report.getScore(), report.getIconUrl(), Messages._Folder_HealthWrap(item.getFullDisplayName(), report.getLocalizableDescription())); } }
/** * Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default * implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from * {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative * {@link #getContext()} that is outside of the normal tree then that implementation is responsible for * overriding this method to produce the correct display name. * * @return the display name. * @since 2.0 */ public final String getContextDisplayName() { ModelObject context = getContext(); if (context instanceof Item) { return ((Item) context).getFullDisplayName(); } else if (context instanceof Jenkins) { return ((Jenkins) context).getDisplayName(); } else if (context instanceof ItemGroup) { return ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName()); } else { return context.getDisplayName(); } }
/** * Returns the full display name of the {@link #getContext()}. * * @return the full display name of the {@link #getContext()}. */ public String getContextFullDisplayName() { String n; if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof Jenkins) { n = context.getDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } return n; }
/** * Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default * implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from * {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative * {@link #getContext()} that is outside of the normal tree then that implementation is responsible for * overriding this method to produce the correct display name. * * @return the display name. * @since 2.0 */ public final String getContextDisplayName() { ModelObject context = getContext(); if (context instanceof Item) { return ((Item) context).getFullDisplayName(); } else if (context instanceof Jenkins) { return ((Jenkins) context).getDisplayName(); } else if (context instanceof ItemGroup) { return ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName()); } else { return context.getDisplayName(); } }
/** * Returns the {@link Item#getFullDisplayName()} or nearest approximation. * * @return the {@link Item#getFullDisplayName()} or nearest approximation. */ public final String getFullDisplayName() { String n; ModelObject context = getStore().getContext(); if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } if (n.length() == 0) { return getDisplayName(); } else { return n + " \u00BB " + getDisplayName(); } }
/** * Returns the {@link Item#getFullDisplayName()} or nearest approximation. * * @return the {@link Item#getFullDisplayName()} or nearest approximation. */ public final String getFullDisplayName() { String n; ModelObject context = getStore().getContext(); if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } if (n.length() == 0) { return getDisplayName(); } else { return n + " \u00BB " + getDisplayName(); } }
@CheckForNull private static FormValidation checkForDuplicates(String value, ModelObject context, ModelObject object) { CredentialsMatcher withId = CredentialsMatchers.withId(value); for (CredentialsStore store : CredentialsProvider.lookupStores(object)) { if (!store.hasPermission(CredentialsProvider.VIEW)) { continue; } ModelObject storeContext = store.getContext(); for (Domain domain : store.getDomains()) { for (Credentials match : CredentialsMatchers.filter(store.getCredentials(domain), withId)) { if (storeContext == context) { return FormValidation.error("This ID is already in use"); } else { CredentialsScope scope = match.getScope(); if (scope != null && !scope.isVisible(context)) { // scope is not exported to child contexts continue; } return FormValidation.warning("The ID ‘%s’ is already in use in %s", value, storeContext instanceof Item ? ((Item) storeContext).getFullDisplayName() : storeContext.getDisplayName()); } } } } return null; }