@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final MockPluginApplicationMetaData that = (MockPluginApplicationMetaData) o; return key.equals(that.key); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final LoaderKey loaderKey = (LoaderKey) o; if (locale != null ? !locale.equals(loaderKey.locale) : loaderKey.locale != null) { return false; } return !(applicationKey != null ? !applicationKey.equals(loaderKey.applicationKey) : loaderKey.applicationKey != null); }
@Override public boolean equals(@Nullable final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final MockApplicationRole that = (MockApplicationRole) o; //It is intentional that we only look at id. return key != null ? key.equals(that.key) : that.key == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final DefaultPluginApplicationMetaData that = (DefaultPluginApplicationMetaData) o; return key.equals(that.key); }
@Override public final boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final ApplicationEvent that = (ApplicationEvent) o; return key.equals(that.key); }
private ApplicationKey selectApplicationKeyForHelp(final Stream<ApplicationKey> availableApplications) { final ImmutableList<ApplicationKey> applicationsOtherThanCore = availableApplications.filter(e -> !ApplicationKeys.CORE.equals(e)).limit(2).collect(CollectorsUtil.toImmutableListWithCapacity(2)); return applicationsOtherThanCore.size() == 1 ? applicationsOtherThanCore.get(0) : ApplicationKeys.CORE; }
@Override public boolean apply(@Nullable final PluginApplicationMetaData input) { return input != null && input.getKey().equals(key); } });
@Override public boolean apply(final PluginApplicationMetaData input) { return input.getKey().equals(key); } });
@Override public boolean apply(@Nullable final Application input) { assert input != null; return input.getKey().equals(key); } });
@Override public boolean userOccupiesRole(@Nullable ApplicationUser user, ApplicationKey key) { return getOccupiedLicenseRolesForUser(user).stream().anyMatch(r -> r.getKey().equals(key)); }
@Override public boolean equals(@Nullable final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final ApplicationRole that = (ApplicationRole) o; return key.equals(that.key) && groups.equals(that.groups) && defaultGroups.equals(that.defaultGroups); }
@Override public Set<ApplicationRole> getOccupiedLicenseRolesForUser(@Nonnull ApplicationUser user) { notNull(user); final Set<ApplicationRole> roles = getRolesForUser(user); if (roles.size() > 1 && roles.stream().anyMatch(r -> ApplicationKeys.CORE.equals(r.getKey()))) { boolean allNonCoreRolesExceeded = roles.stream().filter(r -> !ApplicationKeys.CORE.equals(r.getKey())).allMatch(r -> isRoleLimitExceeded(r.getKey())); if (!allNonCoreRolesExceeded) { return roles.stream().filter(r -> !ApplicationKeys.CORE.equals(r.getKey())).collect(CollectorsUtil.toImmutableSet()); } } return roles; }
@Nonnull @Override public Option<ApplicationRoleDefinition> getDefined(final ApplicationKey applicationKey) { return findFirst(getDefined(), def -> def != null && def.key().equals(applicationKey)); }
@Override public final boolean equals(final Object o) { if (this == o) { return true; } if (o instanceof ApplicationRole) { final ApplicationRole that = (ApplicationRole) o; //It is intentional that we only look at the id. return getKey().equals(that.getKey()); } else { return false; } }
@Override protected boolean matchesSafely(final ApplicationRoleStore.ApplicationRoleData applicationRoleData) { return applicationRoleData.getKey().equals(key) && applicationRoleData.getGroups().equals(groups) && applicationRoleData.getDefaultGroups().equals(defaultGroups) && applicationRoleData.isSelectedByDefault() == selectedByDefault; }
private Set<ApplicationRole> calculateRolesToBeAdded(ApplicationUser user, Set<String> groupsToBeAdded) { if(log.isTraceEnabled()) { log.trace("Calculating application access for {} with groups {}", user, groupsToBeAdded); } final Set<ApplicationRole> existingUserRoles = applicationRoleManager.getRolesForUser(user); final Set<ApplicationRole> rolesToBeAdded = findEffectiveApplicationsByGroups(Optional.ofNullable(user.getDirectoryId()), groupsToBeAdded); final Set<ApplicationRole> rolesToBeAddedToThisUser = Sets.difference(rolesToBeAdded, existingUserRoles).copyInto(new HashSet<>()); final Sets.SetView<ApplicationRole> effectiveRolesAfterAdd = Sets.union(existingUserRoles, rolesToBeAdded); //check whether user has access to any other application than core if (effectiveRolesAfterAdd.stream().anyMatch(r -> !r.getKey().equals(ApplicationKeys.CORE))) { rolesToBeAddedToThisUser.remove(applicationRoleManager.getRole(ApplicationKeys.CORE).getOrNull()); } return rolesToBeAddedToThisUser; }
private boolean isPlatformApplication(final JiraApplication application) { return application.getKey().equals(applicationManager.getPlatform().getKey()); }
private boolean isNonCoreApplicationDefinition(final ApplicationRoleDefinitions.ApplicationRoleDefinition definition) { return !applicationManager.getPlatform().getKey().equals(definition.key()); }
private void clearCacheLine(final ApplicationKey key) { log.debug("Clearing the cache line {}.", key); //When users are in a group that has been associated with the platform application and another application //the user would count towards the other application and not platform application. Only when the group is //exclusively associated to platform should those users count towards platform. Because of this well always clear //platform when another application has changes. //Make sure platform cache always gets cleared and only clears once per request (expensive call) if (!ApplicationKeys.CORE.equals(key)) { appRoleCache.remove(ApplicationKeys.CORE); activeUsersCountForLicense.remove(ApplicationKeys.CORE); } appRoleCache.remove(key); activeUsersCountForLicense.remove(key); flushBillableUsersCache(); }
@ActionViewData ("success") public Map<String, Object> getData() { Application application = StreamSupport.stream(applicationManager.getApplications().spliterator(), false) .filter(app -> !ApplicationKeys.CORE.equals(app.getKey())) .findFirst() .orElseGet(applicationManager::getPlatform); return MapBuilder.<String, Object>newBuilder() .add("productName", application.getName()) .add("productVersion", application.getVersion()) .add("notMigratedGroups", notMigratedGroups()) .add("notDefinedRoles", notDefinedRoles()) .toMap(); }