/** * Mandatory fields are: * - id (the remote issue link must exist) * - issueId * - title * - url * * @param remoteIssueLink * @throws UpdateException */ private void validateMandatoryFieldsForUpdate(final RemoteIssueLink remoteIssueLink) throws UpdateException { if (remoteIssueLink.getId() == null) { throw new UpdateException(missingMandatoryFieldMessage("id")); } final Result result = validateMandatoryFields(remoteIssueLink); if (!result.isValid()) { throw new UpdateException(result.getMessage()); } }
/** * Mandatory fields are: * - issueId * - title * - url * * @param remoteIssueLink * @throws CreateException */ private void validateMandatoryFieldsForCreate(final RemoteIssueLink remoteIssueLink) throws CreateException { final Result result = validateMandatoryFields(remoteIssueLink); if (!result.isValid()) { throw new CreateException(result.getMessage()); } }
private void validateUrlsForCreate(final RemoteIssueLink remoteIssueLink) throws CreateException { final Result result = validateUrls(remoteIssueLink); if (!result.isValid()) { throw new CreateException(result.getMessage()); } }
private void validateFieldLengthsForCreate(final RemoteIssueLink remoteIssueLink) throws CreateException { final Result result = validateFieldLengths(remoteIssueLink); if (!result.isValid()) { throw new CreateException(result.getMessage()); } }
private void validateGlobalIdForUpdate(final Issue issue, final String oldGlobalId, final String newGlobalId) throws UpdateException { // Validate only if it has changed if (!isEqual(oldGlobalId, newGlobalId)) { final Result result = validateGlobalId(issue, newGlobalId); if (!result.isValid()) { throw new UpdateException(result.getMessage()); } } }
private void validateFieldLengthsForUpdate(final RemoteIssueLink remoteIssueLink) throws UpdateException { final Result result = validateFieldLengths(remoteIssueLink); if (!result.isValid()) { throw new UpdateException(result.getMessage()); } }
private void validateGlobalIdsForGet(final Collection<String> globalIds) throws GetException { Result result = validateGlobalIds(globalIds); if (!result.isValid()) { throw new GetException(result.getMessage()); } }
private void validateGlobalIdForCreate(final Issue issue, final String globalId) throws CreateException { final Result result = validateGlobalId(issue, globalId); if (!result.isValid()) { throw new CreateException(result.getMessage()); } }
private void validateUrlsForUpdate(final RemoteIssueLink remoteIssueLink) throws UpdateException { final Result result = validateUrls(remoteIssueLink); if (!result.isValid()) { throw new UpdateException(result.getMessage()); } }