Sunday, March 4, 2012

OIM 11.1.1.5 Develop Connectors using ICF and SPI APIS.. Part 3

OIM 11.1.1.5 Develop Connectors using ICF and SPI APIS.. Part3:: Implement Filters

This connector supports only the ContainsAllValuesFilter operation. Implement the ContainsAllValuesFilter operation The following code illustrates the sample implementation of org.identityconnectors.framework.common.objects.filter.AbstractFilterTranslator<T> that defines the filter operation.

 package org.identityconnectors.flatfile.filteroperations;

import java.util.HashMap;
import java.util.Map;

import org.identityconnectors.framework.common.objects.Attribute;
import org.identityconnectors.framework.common.objects.filter.AbstractFilterTranslator;
import org.identityconnectors.framework.common.objects.filter.ContainsAllValuesFilter;

public class ContainsAllValuesImpl extends AbstractFilterTranslator<Map<String, String>> {
    @Override
    protected Map<String, String> createContainsAllValuesExpression(ContainsAllValuesFilter filter,
                                                                    boolean not) {
        Map<String, String> containsAllMap = new HashMap<String, String>();
        Attribute attr = filter.getAttribute();
        containsAllMap.put(attr.getName(), attr.getValue().get(0).toString());
        return containsAllMap;
    }
}

 

OCI Knowledge Series: OCI Infrastructure components

  Oracle Cloud Infrastructure (OCI) provides a comprehensive set of infrastructure services that enable you to build and run a wide range of...