private Reasoning buildReasoning(final String repositoryId, final Throwable ex) { final Reasoning result = new Reasoning(repositoryId, ex.getMessage()); if (ex instanceof GroupItemNotFoundException) { final GroupItemNotFoundException ginfex = (GroupItemNotFoundException) ex; for (Entry<Repository, Throwable> memberReason : ginfex.getMemberReasons().entrySet()) { result.getMembers().add(buildReasoning(memberReason.getKey().getId(), memberReason.getValue())); } } return result; }
protected NotFoundReasoning buildNotFoundReasoning(final Repository repository, final Throwable t) { final NotFoundReasoning reasoning = new NotFoundReasoning(); reasoning.setReasonMessage(t.getMessage()); reasoning.setThrowableType(t.getClass().getName()); if (repository != null) { reasoning.setRepositoryId(repository.getId()); } if (t instanceof GroupItemNotFoundException) { final GroupItemNotFoundException ginf = (GroupItemNotFoundException) t; reasoning.setRepositoryId(ginf.getReason().getRepository().getId()); for (Map.Entry<Repository, Throwable> r : ginf.getMemberReasons().entrySet()) { reasoning.addNotFoundReasoning(buildNotFoundReasoning(r.getKey(), r.getValue())); } } return reasoning; }
protected NotFoundReasoning buildNotFoundReasoning( final Repository repository, final Throwable t ) { final NotFoundReasoning reasoning = new NotFoundReasoning(); reasoning.setReasonMessage( t.getMessage() ); reasoning.setThrowableType( t.getClass().getName() ); if ( repository != null ) { reasoning.setRepositoryId( repository.getId() ); } if ( t instanceof GroupItemNotFoundException ) { final GroupItemNotFoundException ginf = (GroupItemNotFoundException) t; reasoning.setRepositoryId( ginf.getRepository().getId() ); for ( Map.Entry<Repository, Throwable> r : ginf.getMemberReasons().entrySet() ) { reasoning.addNotFoundReasoning( buildNotFoundReasoning( r.getKey(), r.getValue() ) ); } } return reasoning; }