List of usage examples for javax.naming LimitExceededException LimitExceededException
public LimitExceededException(String explanation)
From source file:org.restcomm.connect.interpreter.rcml.Parser.java
private Tag next() throws LimitExceededException { if (iterator != null) { while (iterator.hasNext()) { final Tag tag = iterator.next(); if (Verbs.isVerb(tag)) { if (current != null && current.hasChildren()) { final List<Tag> children = current.children(); if (children.contains(tag)) { continue; }//from w w w. j a v a2 s .c o m } if (tag.name().equals(Verbs.gather) && tag.hasAttribute(GatherAttributes.ATTRIBUTE_HINTS) && !StringUtils.isEmpty(tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value())) { String hotWords = tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value(); List<String> hintList = Arrays.asList(hotWords.split(",")); if (hintList.size() > 50) { throw new LimitExceededException( "HotWords limit exceeded. There are more than 50 phrases"); } for (String hint : hintList) { if (hint.length() > 100) { throw new LimitExceededException( "HotWords limit exceeded. Hint with more than 100 characters found"); } } } current = tag; return current; } } } else { if (logger.isInfoEnabled()) { logger.info("iterator is null"); } } return null; }
From source file:playRepository.GitRepository.java
/** * Finds authors who have made changes by comparing the differences in the * revisions./* w w w . jav a2 s.c o m*/ * * This method retrieves authors by mapping author names to email addresses * of the people who last modified the line. * * @param repository * @param revA * @param revB * @return * @throws IOException * @throws GitAPIException */ public static Set<User> getRelatedAuthors(Repository repository, String revA, String revB) throws IOException, GitAPIException, LimitExceededException { Set<User> authors = new HashSet<>(); RevWalk revWalk = null; try { revWalk = new RevWalk(repository); RevCommit commitA = revWalk.parseCommit(repository.resolve(revA)); RevCommit commitB = revWalk.parseCommit(repository.resolve(revB)); List<DiffEntry> diffs = getDiffEntries(repository, commitA, commitB); if (diffs.size() > BLAME_FILE_LIMIT) { String msg = String.format( "Reject to get related authors " + "from changes because of performance issue: The " + "changes include %n files and it exceeds our limit " + "of '%n' files.", diffs.size(), BLAME_FILE_LIMIT); throw new LimitExceededException(msg); } for (DiffEntry diff : diffs) { if (isTypeMatching(diff.getChangeType(), MODIFY, DELETE)) { authors.addAll(getAuthorsFromDiffEntry(repository, diff, commitA)); } if (isTypeMatching(diff.getChangeType(), RENAME)) { authors.add(getAuthorFromFirstCommit(repository, diff.getOldPath(), commitA)); } } } finally { if (revWalk != null) { revWalk.dispose(); } } authors.remove(User.anonymous); return authors; }