public RestApplicationLink(@Nonnull ApplicationLink link) { super(link); this.system = link.isSystem(); this.primary = link.isPrimary(); }
@Nullable @Override public Object provide(@Nonnull String key, @Nonnull ApplicationLink applink) throws ServiceException { if (EDITABLE.equals(key)) { // only system links are currently not editable return !applink.isSystem(); } else if (V3_EDITABLE.equals(key)) { try { applinkStatusValidationService.checkEditable(applink); return true; } catch (ApplinkStatusException e) { return false; } } throw new IllegalArgumentException(format("Unsupported key: '%s'", key)); } }
@Override @Nullable public ApplinkErrorType verifyLocalCompatibility(@Nonnull ApplicationLink applicationLink) { if (applicationLink.isSystem()) { return ApplinkErrorType.SYSTEM_LINK; } if (applicationLink.getType() instanceof GenericApplicationType) { return ApplinkErrorType.GENERIC_LINK; } if (!(applicationLink.getType() instanceof BuiltinApplinksType)) { return ApplinkErrorType.NON_ATLASSIAN; } return null; } }
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; }
webPanels.getWebPanels(), getEntityTypeIdsForApplication(applicationLink), applicationLink.isSystem());
public ApplicationLinkEntity(final ApplicationLink applicationLink, final Link self) { this(applicationLink.getId(), TypeId.getTypeId(applicationLink.getType()), applicationLink.getName(), applicationLink.getDisplayUrl(), applicationLink.getType().getIconUrl(), resolveIconUri(applicationLink.getType()), applicationLink.getRpcUrl(), applicationLink.isPrimary(), applicationLink.isSystem(), self); }
public ApplicationLinkEntity(final ApplicationId id, final TypeId typeId, final String name, final URI displayUrl, final URI iconUrl, final URI iconUri, final URI rpcUrl, final Boolean primary, final Boolean isSystem, final Link self) { this.id = id; this.typeId = typeId; this.name = name; this.displayUrl = displayUrl; this.iconUrl = iconUrl; this.iconUri = iconUri; this.isPrimary = primary; this.isSystem = isSystem; this.iconUri = iconUri; if (!isSystem()) { this.rpcUrl = rpcUrl; } addLink(self); }