RemoveUserFromApplicationValidationResult(final ApplicationUser userToRemove, final Set<String> applicationGroupNames) { super(new SimpleErrorCollection()); this.userToRemove = userToRemove; this.applicationGroupNames = applicationGroupNames; }
/** * Instantiates this class with given user and new empty error collection. * The I18nHelper will be created from the User supplied. * * @param user user */ public JiraServiceContextImpl(ApplicationUser user) { this(user, new SimpleErrorCollection()); }
RemoteVersionLinkListResult(final List<RemoteVersionLink> remoteVersionLinks) { super(new SimpleErrorCollection()); this.remoteVersionLinks = remoteVersionLinks; }
UpdateUserValidationResult(final ApplicationUser user) { super(new SimpleErrorCollection()); this.user = user; }
@Override public void startDocument() throws SAXException { log.debug("Starting Document"); entityCount = 0; errorCollection = new SimpleErrorCollection(); }
@Internal HistoryMetadataResult(@Nullable HistoryMetadata historyMetadata) { super(new SimpleErrorCollection()); this.historyMetadata = historyMetadata; }
DeleteValidationResult(final Version version, final String globalId) { super(new SimpleErrorCollection()); this.version = version; this.versionId = version.getId(); this.globalId = globalId; }
public BulkEditCommandResult(final long bulkEditTime, final ErrorCollection errorCollection) { Assertions.notNull("errorCollection", errorCollection); this.bulkEditTime = bulkEditTime; this.errorCollection = new SimpleErrorCollection(errorCollection); }
public static UpdateValidationResult ok(final IssueTypeUpdateInput issueTypeUpdateInput, final IssueType issueType) { return new UpdateValidationResult(new SimpleErrorCollection(), some(issueTypeUpdateInput), some(issueType)); } }
CreateUserValidationResult(final String username, final String password, final String email, final String fullname, final Long directoryId, @Nullable final Set<ApplicationKey> applicationKeys) { super(new SimpleErrorCollection()); this.createUserRequest = CreateUserRequest .withUserDetails(null, username, password, email, fullname) .inDirectory(directoryId); this.passwordErrors = ImmutableList.of(); this.applicationKeys = applicationKeys; }
/** * Transforms the errors into a {@link ErrorCollection}. * @return An ErrorCollection. */ public ErrorCollection toErrorCollection() { SimpleErrorCollection errorCollection = new SimpleErrorCollection(); errorCollection.addErrors(errors); errorCollection.addErrorMessages(errorMessages); return errorCollection; } }
private Option<ErrorCollection> errorCollection(final String field, final String text, final ErrorCollection.Reason reason) { final ErrorCollection errorCollection = new SimpleErrorCollection(); errorCollection.addError(field, text, reason); return some(errorCollection); }
private ErrorCollection checkArguments(String transitionName, JiraWorkflow jiraWorkflow) { ErrorCollection errorCollection = new SimpleErrorCollection(); I18nHelper i18n = jiraAuthenticationContext.getI18nHelper(); checkActionAndWorkflow(transitionName, jiraWorkflow, errorCollection, i18n); return errorCollection; }
@Override public WhitelistResult updateRules(final WhitelistUpdateValidationResult result) { notNull("result", result); if(!result.isValid()) { throw new IllegalStateException("Validation result has to be valid!"); } return new WhitelistResult(new SimpleErrorCollection(), whitelistManager.updateRules(result.getRules(), result.getDisabled())); }
private <T> ServiceOutcome<T> outcomeForReason(Reason reason, String text) { final SimpleErrorCollection simpleErrorCollection = new SimpleErrorCollection(); simpleErrorCollection.addErrorMessage(text); simpleErrorCollection.addReason(reason); return from(simpleErrorCollection, null); }
boolean licenseInvalidForIssueCreation(ApplicationUser user, ErrorCollection errorCollection, I18nHelper i18n) { final SimpleErrorCollection errorCollection1 = new SimpleErrorCollection(); issueCreationHelperBean.validateLicense(user, errorCollection1, i18n); if (errorCollection1.hasAnyErrors()) { errorCollection.addErrorCollection(errorCollection1); return true; } return false; }
private SimpleErrorCollection genericPermissionCheck(ApplicationUser user, String errorMessage){ final SimpleErrorCollection ec = new SimpleErrorCollection(); if (!permissionManager.hasPermission(Permissions.ADMINISTER, user)) { ec.addErrorMessage(i18nHelper.getText(errorMessage)); } return ec; }
private ErrorCollection validateNoUsageOfRoleInComments(final ProjectRole projectRole) { ErrorCollection errorCollection = new SimpleErrorCollection(); long countForCommentsRestrictedByRole = commentManager.getCountForCommentsRestrictedByRole(projectRole.getId()); if (countForCommentsRestrictedByRole != 0) { errorCollection.addErrorMessage(getText("rest.role.used.in.comments"), ErrorCollection.Reason.CONFLICT); } return errorCollection; }
private Either<Project, ErrorCollection> notifyProjectTypeUpdated(ApplicationUser user, Project project, ProjectTypeKey oldProjectType, ProjectTypeKey newProjectType) { boolean notificationWasSuccessful = projectTypeUpdatedNotifier.notifyAllHandlers(user, project, oldProjectType, newProjectType); if (!notificationWasSuccessful) { // rollback the project type update, since something went wrong on one of the project type update handlers projectManager.updateProjectType(user, project, oldProjectType); return Either.right(new SimpleErrorCollection("admin.errors.project.type.update.error", Reason.SERVER_ERROR)); } return Either.left(project); }
@Override public DeleteUserValidationResult validateDeleteUser(final ApplicationUser loggedInUser, final String username) { final I18nHelper i18nBean = getI18nBean(loggedInUser); final ErrorCollection errors = new SimpleErrorCollection(); if (username == null || username.length() == 0) { errors.addError("username", i18nBean.getText("admin.errors.users.cannot.delete.due.to.invalid.username")); return new DeleteUserValidationResult(errors); } return validateDeleteUser(loggedInUser, userManager.getUserByName(username)); }