/** * @return the remote project-level entity key (e.g. JRA, JIRAEXT) */ public String getEntityKey() { return entityLink.getKey(); }
private Iterable<String> getJiraEntityLinkKeys(ApplicationLink appLink, Object entity) { List<String> keys = new LinkedList<>(); Iterable<EntityLink> entityLinks = entityLinkService.getEntityLinks(entity, JiraProjectEntityType.class); for (EntityLink link : entityLinks) { if (link.getApplicationLink().equals(appLink)) { keys.add(link.getKey()); } } return keys; } }
@Override public boolean apply(@Nullable EntityLink entityLink) { return entityLink != null && applicationId.equals(entityLink.getApplicationLink().getId()) && remoteKey.equals (entityLink.getKey()); } };
public EntityLink makePrimary(final String localKey, final Class<? extends EntityType> localType, final EntityLink newPrimary) { checkNotNull(localKey); checkNotNull(localType); checkNotNull(newPrimary); //confirm that the entity is actually linked to from the specified local entity if (getEntityLink(localKey, localType, newPrimary.getKey(), newPrimary.getType().getClass(), newPrimary.getApplicationLink().getId()) == null) { throw new IllegalArgumentException(String.format( "Can not make %s the new primary, not linked to from local entity %s:%s", newPrimary, localType, localKey)); } makePrimaryImpl(localKey, localType, newPrimary); return newPrimary; }
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); }
.append("' AND job.").append(NAME).append(" = '").append(entityLink.getKey()).append("')");
public String apply(final EntityLink from) { final Map<String, String> propertyMap = new HashMap<String, String>(); propertyMap.put(KEY, from.getKey()); propertyMap.put(NAME, from.getName()); propertyMap.put(TYPE, getTypeId(from.getType()).get()); propertyMap.put(TYPE_I18N, from.getType().getI18nKey()); propertyMap.put(APPLICATION_ID, from.getApplicationLink().getId().get()); final StringWriter sw = new StringWriter(); try { new JSONObject(propertyMap).write(sw); } catch (JSONException e) { throw new RuntimeException(e); } return sw.getBuffer().toString(); } }));
private static boolean equivalent(final EntityLink a, final EntityLink b) { return equivalent(a, b.getKey(), b.getType().getClass(), b.getApplicationLink().getId()); }
private void makePrimaryImpl(final String localKey, final Class<? extends EntityType> localType, final EntityLink newEntity) { final String primaryPropertyKey = primaryPropertyKey(getTypeId(newEntity.getType())); final Properties primary = new Properties(); primary.put(KEY, newEntity.getKey()); primary.put(APPLICATION_ID, newEntity.getApplicationLink().getId().get()); if (LOG.isDebugEnabled()) { String message = String.format("Set primary link for [%s] [%s] as [%s]", localKey, lookUpTypeId(localType), primary); LOG.debug(message); } propertyService.getLocalEntityProperties(localKey, lookUpTypeId(localType)).putProperty(primaryPropertyKey, primary); }
if (!existingRepos.contains(entity.getKey())) { log.debug(format("Found new repository entity link [%s] in application link [%s]. Adding to fisheye repository store", entity.getKey(), applinksInstance)); fishEyeRepositoryStore.addRepository(entity.getKey(), oldInstance.getId()); } else { existingRepos.remove(entity.getKey()); entity.getKey())); fishEyeRepositoryStore.associateProjectWithRepository(project.getKey(), entity.getKey(), oldInstance.getId());
private FishEyeRepository createRepository(EntityLink link) { return createRepository( link.getApplicationLink().getId(), link.getApplicationLink(), link.getKey() ); }
@Override public EntityLinkReference apply(@Nullable EntityLink link) { if (link == null) { return null; } else { return new EntityLinkReference(link.getKey(), link.getName(), link.getApplicationLink().getId().get(), link.isPrimary()); } } }));
public boolean refersTo(final EntityLink link) { return refersTo(link.getKey(), getTypeId(link.getType()), link.getApplicationLink().getId()); } }
private String key(final EntityLink entity) { return String.format("%s.%s.%s.%s", ENTITY_PREFIX, escape(entity.getApplicationLink().getId().get()), escape(getTypeId(entity.getType()).get()), escape(entity.getKey()) ); }
.deleteApplicationEntityLink(getTypeId(remoteEntity.getType()), remoteEntity.getKey(), getTypeId(localType), localKey, internalHostApplication.getId().get(), true) .toString();
final String warning = i18nResolver.getText("applinks.ual.upgrade.reciprocate.entitylinks.failed", entityLink.getKey(), // "FOO"
public EntityLinkEntity(final EntityLink entity) { this(entity.getApplicationLink().getId(), entity.getKey(), TypeId.getTypeId(entity.getType()), entity.getName(), entity.getDisplayUrl(), IconUriResolver.resolveIconUri(entity.getType()), entity.getType().getIconUrl(), entity.isPrimary()); }
.applicationLink(to) .type(oldEntityLink.getType()) .key(oldEntityLink.getKey()) .name(oldEntityLink.getName()) .primary(oldEntityLink.isPrimary())