All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.att.research.xacml.std.pip.engines.ldap.LDAPResolver Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
/*
 *
 *          Copyright (c) 2013,2019  AT&T Knowledge Ventures
 *                     SPDX-License-Identifier: MIT
 */
package com.att.research.xacml.std.pip.engines.ldap;

import java.util.List;

import javax.naming.directory.SearchResult;

import com.att.research.xacml.api.Attribute;
import com.att.research.xacml.api.pip.PIPEngine;
import com.att.research.xacml.api.pip.PIPException;
import com.att.research.xacml.api.pip.PIPFinder;
import com.att.research.xacml.api.pip.PIPRequest;
import com.att.research.xacml.std.pip.engines.ConfigurableResolver;

/**
 * LDAPResolver is the interface used by the {@link com.att.research.xacml.std.pip.engines.ldap.LDAPEngine} to convert
 * a request for a XACML attribute into an LDAP query string, including retrieving any required attributes needed to construct
 * the query string, and convert the response into a collection of {@link com.att.research.xacml.api.Attribute}s.
 * 
 * @author car
 * @version $Revision$
 */
public interface LDAPResolver extends ConfigurableResolver {
	/**
	 * Gets the base String to be used in the search method of a {@link javax.naming.directory.DirectoryContext}.
	 * 
	 * @param pipEngine the {@link com.att.research.xacml.api.pip.PIPEngine} making the request
	 * @param pipRequest the PIPRequest to convert
	 * @param pipFinder the {@link com.att.research.xacml.api.pip.PIPFinder} to use when resolving required attributes
	 * @return the base String or null if the PIPRequest cannot be satisfied by this LDAPResolver
	 */
	public String getBase(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
	
	/**
	 * Converts the given PIPRequest into an LDAP filter string to use
	 * in the search method of a {@link javax.naming.directory.DirectoryContext}.
	 * 
	 * @param pipEngine the PIPEngine making the request
	 * @param pipRequest the PIPRequest to convert
	 * @param pipFinder the PIPFinder to use when resolving required attributes
	 * @return the filter string to use or null if the given PIPRequest cannot be satisfied by this LDAPResolver
	 * @throws PIPException if there is an error retrieving any required attributes
	 */
	public String getFilterString(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
	
	/**
	 * Converts a {@link javax.naming.directory.SearchResult} into a List of {@link com.att.research.xacml.api.Attribute}s.
	 * 
	 * @param searchResult the SearchResult to convert
	 * @return a List of Attributes or null if the SearchResult connot be converted.
	 * @throws PIPException if there is an error decoding the SearchResult
	 */
	public List decodeResult(SearchResult searchResult) throws PIPException;
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy