@Test public void relationships() { String fiql = new UserFiqlSearchConditionBuilder(). inRelationships("ca20ffca-1305-442f-be9a-3723a0cd88ca").query(); assertEquals(SpecialAttr.RELATIONSHIPS + "==ca20ffca-1305-442f-be9a-3723a0cd88ca", fiql); RelationshipCond relationshipCond = new RelationshipCond(); relationshipCond.setAnyObject("ca20ffca-1305-442f-be9a-3723a0cd88ca"); SearchCond leaf = SearchCond.getLeaf(relationshipCond); assertEquals(leaf, SearchCondConverter.convert(VISITOR, fiql)); }
public static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { if (realms != null && realms.length > 0) { visitor.setRealm(realms[0]); } SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } }
SearchCondConverter { public static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { if (realms != null && realms.length > 0) { visitor.setRealm(realms[0]); } SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } }
SearchCondConverter { public static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { if (realms != null && realms.length > 0) { visitor.setRealm(realms[0]); } SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } private  SearchCondConverter(); }
SearchCondConverter { public static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { if (realms != null && realms.length > 0) { visitor.setRealm(realms[0]); } SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } private  SearchCondConverter(); static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms); }
SearchCondConverter { public static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { if (realms != null && realms.length > 0) { visitor.setRealm(realms[0]); } SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } private  SearchCondConverter(); static SearchCond convert(final SearchCondVisitor visitor, final String fiql, final String... realms);  }