private boolean shouldReplicate(final Project.NameKey project, ReplicationState... states) { try { return threadScoper .scope( new Callable<Boolean>() { @Override public Boolean call() throws NoSuchProjectException { return shouldReplicate(controlFor(project)); } }) .call(); } catch (NoSuchProjectException err) { stateLog.error(String.format("source project %s not available", project), err, states); } catch (Exception e) { Throwables.propagateIfPossible(e); throw new RuntimeException(e); } return false; }
private boolean shouldReplicate( final Project.NameKey project, final String ref, ReplicationState... states) { try { return threadScoper .scope( new Callable<Boolean>() { @Override public Boolean call() throws NoSuchProjectException { ProjectControl projectControl = controlFor(project); return shouldReplicate(projectControl) && (PushOne.ALL_REFS.equals(ref) || projectControl.controlForRef(ref).isVisible()); } }) .call(); } catch (NoSuchProjectException err) { stateLog.error(String.format("source project %s not available", project), err, states); } catch (Exception e) { throw Throwables.propagate(e); } return false; }