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); }
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()); }
private FishEyeRepository createRepository(EntityLink link) { return createRepository( link.getApplicationLink().getId(), link.getApplicationLink(), link.getKey() ); }
/** * @return the globally unique, immutable ID of the server at the other * end of this link. */ public ApplicationId getApplicationId() { return entityLink.getApplicationLink().getId(); }
public boolean apply(final EntityLink input) { if (link.getId().equals(input.getApplicationLink().getId())) { // we're going to delete this - check if it is a primary link we're going to need to reassign if (!typesForWhichToReassignPrimaries.contains(input.getType().getClass())) { final PrimaryRef primary = getPrimaryRef(localEntity.getKey(), getTypeId(localEntity.getType()), getTypeId(input.getType())); if (primary.refersTo(input)) { typesForWhichToReassignPrimaries.add(input.getType().getClass()); } } removedEntityLinks.add(input); return false; } else { //this is not the link you are looking for, move along return true; } } }));
/** * @return the remote project-level entity key (e.g. JRA, JIRAEXT) */ public String getEntityKey() { return entityLink.getKey(); }
public EntityType getEntityType() { return entityLink.getType(); }
public boolean apply(final EntityLink input) { return input.isPrimary(); } });
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; } }
/** * @return the type of the application e.g. "fecru" */ public ApplicationType getApplicationType() { return entityLink.getApplicationLink().getType(); }
public boolean apply(final EntityLink input) { return typeOfRemoteEntities.isAssignableFrom(input.getType().getClass()); } });
@Override public boolean apply(@Nullable EntityLink entityLink) { return entityLink != null && entityLink.isPrimary(); } };
private static boolean equivalent(final EntityLink a, final EntityLink b) { return equivalent(a, b.getKey(), b.getType().getClass(), b.getApplicationLink().getId()); }
@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()); } } }));
@Override public boolean apply(@Nullable EntityLink entityLink) { return entityLink != null && applicationId.equals(entityLink.getApplicationLink().getId()) && remoteKey.equals (entityLink.getKey()); } };
@Override public boolean apply(@Nullable EntityLink entityLink) { return entityLink != null && entityLink.getApplicationLink().getId().equals(applicationId); } });
@GET @Path("primaryLinks/{type}/{key}") public Response getEntityLinks(@PathParam("type") final TypeId localTypeId, @PathParam("key") final String localKey) { final EntityType localType = typeAccessor.loadEntityType(localTypeId.get()); checkPermissionToManageEntityLink(localKey, localType); final Map<String, Set<EntityLinkEntity>> linkMap = new HashMap<String, Set<EntityLinkEntity>>(); for (final EntityLink link : entityLinkService.getEntityLinksForKey(localKey, localType.getClass())) { Set<EntityLinkEntity> links = linkMap.get(link.getType().getI18nKey()); if (links == null) { links = new TreeSet<EntityLinkEntity>(PRIMARY_FIRST); linkMap.put(link.getType().getI18nKey(), links); } links.add(new EntityLinkEntity(link)); } return ok(linkMap); }