public ApplicationOption(final ApplicationId id, final String name, final TypeId typeId, final String typeI18nKey, final boolean isUal, final String iconUri) { this.id = id.get(); this.name = name; this.typeId = typeId.get(); this.typeI18nKey = typeI18nKey; this.isUal = isUal; this.iconUri = iconUri; } }
private static Response linkNotFound(final Class<? extends EntityType> localType, final String localKey, final Class<? extends EntityType> remoteType, final String remoteKey, final ApplicationId applicationId) { return notFound(String.format("Couldn't find link to %s:%s (%s) from local entity %s:%s", remoteType.getName(), remoteKey, applicationId.get(), localType.getName(), localKey)); }
public static String encode(final ApplicationId applicationId, final String pageId) { final Map<String, String> values = ImmutableMap.of(APP_ID_KEY, applicationId.get(), PAGE_ID_KEY, pageId); return GlobalIdFactory.encode(KEYS, values); }
@SuppressWarnings("unused") public String getAppId() { if (appLink != null) { return appLink.getId().get(); } return ""; }
public void associate(final Integer instanceId, final ApplicationId applicationId) { //todo: think about concurrency concerns? fishEyeProperties.setText(INSTANCE_ID_TO_APPLINKS_ID, applicationId.get(), instanceId); fishEyeProperties.setText(getApplinksIdKey(applicationId), Integer.toString(instanceId, 10)); log.debug("Associated FishEye instance id [{}] to application link id [{}]", instanceId, applicationId.get()); }
private ApplicationLink getConfluenceAppLink(final String appId) { for (final ApplicationLink appLink : getConfluenceAppLinks()) { if (appLink.getId().get().equals(appId)) { return appLink; } } return null; }
private ApplicationLink getApplicationLink(final String appId) { for (final ApplicationLink appLink : applicationLinkService.getApplicationLinks(JiraApplicationType.class)) { if (appLink.getId().get().equals(appId)) { return appLink; } } return null; } }
private Iterable<? extends MigrationInstanceProperty> getApplicationLinkPropertiesFor(FishEyeInstance fishEyeInstance) { return Lists.newArrayList( new TextInstanceProperty(APPLINKS_ID_TO_INSTANCE_ID.replace(APPLICATIONLINK_ID_NEEDLE, fishEyeInstance.getApplicationId().get())), new TextInstanceProperty(INSTANCE_ID_TO_APPLINKS_ID), new BooleanInstanceProperty(com.atlassian.jirafisheyeplugin.config.fisheye.FishEyePropertyKeys.FISHEYE_INITIALISED) { @Override public Boolean getProperty(FishEyeProperties properties, FishEyeInstance fishEyeInstance) { return true; // this is a new property -- there is no existing value } } ); }
public ConfluenceApplicationLinksBean(final Iterable<ApplicationLink> appLinks) { applicationLinks = new ArrayList<ConfluenceApplicationLinkBean>(); for (final ApplicationLink appLink : appLinks) { applicationLinks.add(new ConfluenceApplicationLinkBean(appLink.getId().get(), appLink.getName())); } }
public Object putProperty(final String key, final Object value) { if (LOG.isDebugEnabled()) { String message = String.format("Putting property [%s] as [%s] for application link [%s/%s]", key, value, this.getId() != null ? this.getId().get() : null, this.getRpcUrl() != null ? this.getRpcUrl().toString() : null); LOG.debug(message); } return applicationLinkProperties.putProperty(key, value); }
OAuthAuthenticateResponse(ApplicationLink appLink, String authUri) { this.authUri = authUri; this.id = appLink.getId().get(); this.name = appLink.getName(); this.uri = appLink.getDisplayUrl().toString(); }
public Object removeProperty(final String key) { if (LOG.isDebugEnabled()) { String message = String.format("Removing property [%s] was [%s] for application link [%s/%s]", key, applicationLinkProperties.getProperty(key), this.getId() != null ? this.getId().get() : null, this.getRpcUrl() != null ? this.getRpcUrl().toString() : null); LOG.debug(message); } return applicationLinkProperties.removeProperty(key); }
@GET @Path("/instances") public Response getInstances() { List<MapEntry> instances = new ArrayList<MapEntry>(); for (FishEyeInstance instance : instanceStore.getAllFishEyeInstances()) { String id = instance.getApplicationId().get(); instances.add(new MapEntry(id, instance.getUrl())); } return createOkResponse(new FishEyeInstances(instances)); }
public boolean removeConsumerToken(final ApplicationId applicationId, final String username) { Preconditions.checkNotNull(applicationId, "applicationLink"); verifyOAuthOutgoingEnabled(applicationId); final ConsumerTokenStore.Key key = makeOAuthApplinksConsumerKey(username, applicationId.get()); if (consumerTokenStore.get(key) != null) { consumerTokenStore.remove(key); return true; } return false; }
private ApplinksCreatedEvent createEvent(EVENT_STATUS status, @Nullable String reasonName) { return new ApplinksCreatedEvent( applicationProperties.getPlatformId(), internalHostApplication.getId().get(), reasonName, status.name() ); }
public ConsumerToken getConsumerToken(final ApplicationLink applicationLink, final String username) { Preconditions.checkNotNull(username, "Username cannot be null!"); Preconditions.checkNotNull(applicationLink, "Application Link cannot be null!"); verifyOAuthOutgoingEnabled(applicationLink.getId()); return consumerTokenStore.get(makeOAuthApplinksConsumerKey(username, applicationLink.getId().get())); }
@Override protected void doServiceGet(@Nonnull HttpServletRequest request, @Nonnull HttpServletResponse response) throws ServiceException, IOException, ServletException { permissionValidationService.validateAdmin(); ApplicationLink applink = webApplinkHelper.getApplicationLink(request); validateApplink(applink); publishAnalytics(applink); render(request, response, "page-applink-edit", "applinks.page.applink.edit.main", ImmutableMap.of( "applink", applink, "applinkId", applink.getId().get(), PARAM_TITLE, applink.getName())); }
public ApplicationLinkProperties getApplicationLinkProperties(final ApplicationId id) { return new ApplicationLinkProperties(getPropertySet(String.format("%s.%s", APPLICATION_ADMIN_PREFIX, escape(id.get()))), getPropertySet(key(id)) ); }
public Map<String, String> apply(ApplicationLink from) { return ImmutableMap.of("id", from.getId().get(), "name", from.getName(), "type", i18nResolver.getText(from.getType().getI18nKey())); } })));
public static String encode(final ApplicationId applicationId, final Long issueId) { final Map<String, String> values = MapBuilder.<String, String>newBuilder() .add(APP_ID_KEY, applicationId.get()) .add(ISSUE_ID_KEY, issueId.toString()) .toMap(); return GlobalIdFactory.encode(KEYS, values); }