Search in sources :

Example 1 with AbstractFiqlSearchConditionBuilder

use of org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder in project syncope by apache.

the class NotificationWrapper method getAboutFIQLs.

public Map<String, String> getAboutFIQLs() {
    if (CollectionUtils.isEmpty(this.aboutClauses)) {
        return this.notificationTO.getAbouts();
    } else {
        Map<String, String> res = new HashMap<>();
        for (Pair<String, List<SearchClause>> pair : this.aboutClauses) {
            AbstractFiqlSearchConditionBuilder builder;
            switch(pair.getLeft()) {
                case "USER":
                    builder = SyncopeClient.getUserSearchConditionBuilder();
                    break;
                case "GROUP":
                    builder = SyncopeClient.getGroupSearchConditionBuilder();
                    break;
                default:
                    builder = SyncopeClient.getAnyObjectSearchConditionBuilder(pair.getLeft());
            }
            res.put(pair.getLeft(), SearchUtils.buildFIQL(pair.getRight(), builder));
        }
        return res;
    }
}
Also used : HashMap(java.util.HashMap) List(java.util.List) ArrayList(java.util.ArrayList) AbstractFiqlSearchConditionBuilder(org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder)

Example 2 with AbstractFiqlSearchConditionBuilder

use of org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder in project syncope by apache.

the class PushTaskWrapper method getFilters.

public Map<String, String> getFilters() {
    Map<String, String> filters = new HashMap<>();
    for (Map.Entry<String, List<SearchClause>> entry : getFilterClauses().entrySet()) {
        if (!entry.getValue().isEmpty()) {
            AbstractFiqlSearchConditionBuilder bld;
            switch(entry.getKey()) {
                case "USER":
                    bld = SyncopeClient.getUserSearchConditionBuilder();
                    break;
                case "GROUP":
                    bld = SyncopeClient.getGroupSearchConditionBuilder();
                    break;
                default:
                    bld = SyncopeClient.getAnyObjectSearchConditionBuilder(entry.getKey());
            }
            filters.put(entry.getKey(), SearchUtils.buildFIQL(entry.getValue(), bld));
        }
    }
    return filters;
}
Also used : HashMap(java.util.HashMap) List(java.util.List) Map(java.util.Map) HashMap(java.util.HashMap) AbstractFiqlSearchConditionBuilder(org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder)

Example 3 with AbstractFiqlSearchConditionBuilder

use of org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder in project syncope by apache.

the class DynRealmWrapper method getDynMembershipConds.

public Map<String, String> getDynMembershipConds() {
    final Map<String, String> res = new HashMap<>();
    if (this.dynClauses != null && !this.dynClauses.isEmpty()) {
        this.dynClauses.entrySet().stream().filter(entry -> (CollectionUtils.isNotEmpty(entry.getValue()))).forEachOrdered(entry -> {
            AbstractFiqlSearchConditionBuilder builder = AnyTypeKind.USER.name().equals(entry.getKey()) ? SyncopeClient.getUserSearchConditionBuilder() : AnyTypeKind.GROUP.name().equals(entry.getKey()) ? SyncopeClient.getGroupSearchConditionBuilder() : SyncopeClient.getAnyObjectSearchConditionBuilder(entry.getKey());
            String fiql = SearchUtils.buildFIQL(entry.getValue(), builder);
            if (fiql != null) {
                res.put(entry.getKey(), fiql);
            }
        });
    }
    return res;
}
Also used : AnyTypeKind(org.apache.syncope.common.lib.types.AnyTypeKind) List(java.util.List) SearchClause(org.apache.syncope.client.console.panels.search.SearchClause) DynRealmTO(org.apache.syncope.common.lib.to.DynRealmTO) Map(java.util.Map) HashMap(java.util.HashMap) SyncopeClient(org.apache.syncope.client.lib.SyncopeClient) AbstractFiqlSearchConditionBuilder(org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder) SearchUtils(org.apache.syncope.client.console.panels.search.SearchUtils) CollectionUtils(org.apache.commons.collections4.CollectionUtils) Serializable(java.io.Serializable) HashMap(java.util.HashMap) AbstractFiqlSearchConditionBuilder(org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder)

Aggregations

HashMap (java.util.HashMap)3 List (java.util.List)3 AbstractFiqlSearchConditionBuilder (org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder)3 Map (java.util.Map)2 Serializable (java.io.Serializable)1 ArrayList (java.util.ArrayList)1 CollectionUtils (org.apache.commons.collections4.CollectionUtils)1 SearchClause (org.apache.syncope.client.console.panels.search.SearchClause)1 SearchUtils (org.apache.syncope.client.console.panels.search.SearchUtils)1 SyncopeClient (org.apache.syncope.client.lib.SyncopeClient)1 DynRealmTO (org.apache.syncope.common.lib.to.DynRealmTO)1 AnyTypeKind (org.apache.syncope.common.lib.types.AnyTypeKind)1