/** * @return a map of the Uris to the application link. The uris will be canonicalized. */ private Map<ApplicationId, ApplicationLink> getApplicationLinksById(final Iterable<ApplicationLink> applicationLinks) { final Map<ApplicationId, ApplicationLink> applinksMap = Maps.newHashMap(); for (ApplicationLink applicationLink : applicationLinks) { applinksMap.put(applicationLink.getId(), applicationLink); } return applinksMap; }
/** * @return the globally unique, immutable ID of the server at the other * end of this link. */ public ApplicationId getApplicationId() { return entityLink.getApplicationLink().getId(); }
private void toggleProvider(ApplicationLink link, Class<? extends AuthenticationProvider> providerClass, boolean enabled) { if (enabled) { authenticationConfigurationManager.registerProvider(link.getId(), providerClass, Collections.emptyMap()); } else { authenticationConfigurationManager.unregisterProvider(link.getId(), providerClass); } }
private boolean applinksSynced() { for (ApplicationLink existing : applicationLinkService.getApplicationLinks(FishEyeCrucibleApplicationType.class)) { if (applicationLinkIdMapper.fromApplicationId(existing.getId()) == null) { log.info("Found new application link [" + existing.getId() + "] that does not have corresponding Fisheye Instance, upgrading..."); return false; } } return true; }
public URI getDisplayUrl(final ApplicationLink link, final String entity) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof GenericApplicationTypeImpl); // we don't know what kind of app the peer is, so we can't point to anything return null; } }
public URI getDisplayUrl(final ApplicationLink link, final String entity) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof GenericApplicationTypeImpl); // we don't know what kind of app the peer is, so we can't point to anything return null; } }
@PUT @Path("status/{id}") public Response put(@PathParam("id") String applinkId, final RestBasicStatus restBasicStatus) throws InvalidApplicationIdException, TypeNotInstalledException { ApplicationLink applink = applicationLinkService.getApplicationLink(restApplicationIdParser.parse(applinkId)); final Map<String, String> config = ImmutableMap.of( RestBasicStatus.USERNAME, restBasicStatus.getUsername(), RestBasicStatus.PASSWORD, restBasicStatus.getPassword()); authenticationConfigurationManager.registerProvider(applink.getId(), BasicAuthenticationProvider.class, config); return Response.ok(restBasicStatus).build(); } }
private String getConsumerKey(ApplicationLink applicationLink) { final Map<String, String> config = authenticationConfigurationManager.getConfiguration(applicationLink.getId(), OAuthAuthenticationProvider.class); if (config.containsKey(AddServiceProviderManuallyServlet.CONSUMER_KEY_OUTBOUND)) { return config.get(AddServiceProviderManuallyServlet.CONSUMER_KEY_OUTBOUND); } return consumerService.getConsumer().getKey(); }
private static boolean equivalent(final EntityLink a, final String key, final Class<? extends EntityType> type, final ApplicationId applicationId) { return a.getKey().equals(key) && a.getType().getClass().equals(type) && a.getApplicationLink().getId().equals(applicationId); }
OAuthAuthenticateResponse(ApplicationLink appLink, String authUri) { this.authUri = authUri; this.id = appLink.getId().get(); this.name = appLink.getName(); this.uri = appLink.getDisplayUrl().toString(); }
public URI getDisplayUrl(final ApplicationLink link, final String project) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof BitbucketApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "projects", project); }
public URI getDisplayUrl(final ApplicationLink link, final String repo) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof FishEyeCrucibleApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "changelog", repo); } }
public URI getDisplayUrl(final ApplicationLink link, final String entityKey) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof BambooApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "browse", entityKey); } }
public URI getDisplayUrl(final ApplicationLink link, final String charlie) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof RefAppApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "plugins", "servlet", "charlie", charlie); } }
public URI getDisplayUrl(final ApplicationLink link, final String repo) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof FishEyeCrucibleApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "changelog", repo); } }
/** * @since 3.1 */ public URI getDisplayUrl(final ApplicationLink link, final String path) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof SubversionPathEntityType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), path); } }
@EventListener public void onManifestDownloaded(@Nonnull ManifestDownloadedEvent manifestDownloaded) { Manifest manifest = manifestDownloaded.getManifest(); ApplicationLink applink = getApplinkSafe(manifest); if (applink != null) { CachedCapabilities cachedCapabilities = capabilitiesCache.get(manifest.getId()); log.debug("Updating cache for applink ID {}", applink.getId()); updateAndGet(applink, manifest, cachedCapabilities); } }
public ImmutableApplicationLink(final ApplicationLink that, final ApplicationLinkRequestFactoryFactory requestFactoryFactory) { checkNotNull(that, "that"); checkNotNull(requestFactoryFactory, "requestFactoryFactory"); this.applicationId = that.getId(); this.applicationType = that.getType(); this.name = that.getName(); this.displayUrl = that.getDisplayUrl(); this.rpcUrl = that.getRpcUrl(); this.isPrimary = that.isPrimary(); this.isSystem = that.isSystem(); this.requestFactoryFactory = requestFactoryFactory; }
protected void disableAutoConfigurableAuthenticationProviders(final ApplicationLink applicationLink, final RequestFactory requestFactory) throws AuthenticationConfigurationException { for (final AutoConfiguringAuthenticatorProviderPluginModule module : pluginAccessor.getEnabledModulesByClass(AutoConfiguringAuthenticatorProviderPluginModule.class)) { if (authenticationConfigurationManager.isConfigured( applicationLink.getId(), module.getAuthenticationProviderClass())) { module.disable(requestFactory, applicationLink); } } }