class ConstraintChecker {

    public void check(Text table, byte[] visibility) throws ConstraintViolationException {
        // fast return if we are not configured
        if (!isConfigured) {
            return;
        }
        
        Collection<VisibilityConstraint> tableConstraints = constraints.get(table);
        
        if (tableConstraints != null && !tableConstraints.isEmpty()) {
            for (VisibilityConstraint constraint : tableConstraints) {
                if (!constraint.isValid(visibility)) {
                    throw new ConstraintViolationException(table, constraint);
                }
            }
        }
    }

    private  ConstraintChecker(Multimap<Text,VisibilityConstraint> constraints);

}