@Override public Iterable<ApplicationLink> getApplicationLinks(Class<? extends ApplicationType> type) { return applicationLinkService.getApplicationLinks(type); }
@Override public ApplicationLink getApplicationLink(ApplicationId id) throws TypeNotInstalledException { return applicationLinkService.getApplicationLink(id); }
@Override public ApplicationLink getPrimaryApplicationLink(Class<? extends ApplicationType> type) { return applicationLinkService.getPrimaryApplicationLink(type); }
@Override public Iterable<ApplicationLink> getApplicationLinks() { return applicationLinkService.getApplicationLinks(); }
public static ApplicationLink idToLink(ApplicationLinkService applicationLinkService, ApplicationId id) { try { return applicationLinkService.getApplicationLink(id); } catch (TypeNotInstalledException e) { throw new RuntimeException("Unexpected error: the Fisheye application type is not installed. Check that the Application Link Plugin is installed properly", e); } } }
@SuppressWarnings("unchecked") private ApplicationLink getPrimaryAppLinkByType(String type) throws ClassNotFoundException { Class<? extends ApplicationType> clazz = APPLINKS_TYPE_ALIASES.get(type.toLowerCase(Locale.US)); if (clazz == null) { clazz = (Class<? extends ApplicationType>) getClass().getClassLoader().loadClass(type); } return appLinkService.getPrimaryApplicationLink(clazz); }
private Iterable<ApplicationLink> getConfluenceAppLinks() { return applicationLinkService.getApplicationLinks(ConfluenceApplicationType.class); }
public ApplicationLink getAppForKey(String projectKey) { ApplicationId appId = keyToAppMap.get(projectKey); try { return appLinkService.getApplicationLink(appId); } catch (TypeNotInstalledException e) { log.error("can't find application id: " + appId + " for jira project key: " + projectKey, e); } return null; }
public FishEyeInstance getDefaultFishEyeInstance() { final ApplicationLink primaryApplicationLink = applicationLinkService.getPrimaryApplicationLink(FishEyeCrucibleApplicationType.class); if (primaryApplicationLink != null) { return getFishEyeInstance(primaryApplicationLink); } //because there may not be a primary application link configured, even tho there are application link(s), we return one of them //the code base should no longer be storing "global" properties against an application link, and hence this should be acceptable final Iterator<ApplicationLink> otherApplicationLinks = getAllFisheyeApplicationLinks().iterator(); if (otherApplicationLinks.hasNext()) { return getFishEyeInstance(otherApplicationLinks.next()); } else { return null; } }
private Iterable<ApplicationLink> getAllFisheyeApplicationLinks() { return applicationLinkService.getApplicationLinks(FishEyeCrucibleApplicationType.class); }
private ApplicationLink getApplicationLink(final ApplicationId id) { final ApplicationLink applicationLink; try { applicationLink = applicationLinkService.getApplicationLink(id); } catch (TypeNotInstalledException e) { throw new IllegalStateException(String.format( "Failed to load application link %s as type %s is no longer installed.", id, e.getType())); } return applicationLink; }
ApplicationLink appLink = applicationLinkService.getPrimaryApplicationLink(applicationType);
/** * Returns all the application links that point to a Confluence instance. * @return The application links that point to a Confluence instance. */ public Collection<ApplicationLink> getAppLinks() { return ImmutableList.copyOf(applicationLinkService.getApplicationLinks(ConfluenceApplicationType.class)); }
@Override public Communicator get(ApplicationId applicationId) { checkNotNull(applicationId); try { return get(applicationLinkService.getApplicationLink(applicationId)); } catch (TypeNotInstalledException e) { throw new IllegalArgumentException("Unable to get an ApplicationLink for " + applicationId); } }
public ApplicationLink resolve(JiraIssuesMacro.Type requestType, String requestData, Map<String, String> typeSafeParams) throws MacroExecutionException ApplicationLink primaryAppLink = appLinkService.getPrimaryApplicationLink(JiraApplicationType.class); if (primaryAppLink == null)
@Override @Nonnull public Iterable<ApplicationLink> getStashApplicationLinks() { final Iterable<ApplicationLink> applicationLinks = applicationLinkService.getApplicationLinks(StashApplicationType.class); assert null != applicationLinks; return applicationLinks; }
private ApplicationLink getApplicationLink(ApplicationId applicationId) throws TypeNotInstalledException { ApplicationLink link = applicationLinkService.getApplicationLink(applicationId); if (link == null) { throw new WebApplicationException(notFound("Applinks with ID " + applicationId + " not found")); } return link; }
public Iterable<JiraProxy> getRemoteProxies() { Iterable<ApplicationLink> remoteJiras = applicationLinkService.getApplicationLinks(JiraApplicationType.class); return Iterables.transform(remoteJiras, new Function<ApplicationLink, JiraProxy>() { @Override public JiraProxy apply(@Nullable final ApplicationLink input) { return createJiraProxy(JiraLocation.fromAppLink(input)); } }); }
@Override @Nullable public ApplicationLink getApplicationLink(@Nonnull final String serverKey) { try { return applicationLinkService.getApplicationLink(new ApplicationId(serverKey)); } catch (TypeNotInstalledException e) { // I'm not reacting to this exception. It should theoretically never happen. And no one would know what to do // with it anyway. Lets just say we didn't find the link. log.warn("Failed to retrieve application link for " + serverKey, e); return null; } }
private boolean isPointingToAnyApplinkUrl(final URI callbackUri) { return Iterables.any(applicationLinkService.getApplicationLinks(), new Predicate<ApplicationLink>() { @Override public boolean apply(ApplicationLink applicationLink) { return validateCallbackUriAgainstApplink(callbackUri, applicationLink); } }); }