edu.internet2.middleware.ldappc.util
Class LdapSearchFilter

java.lang.Object
  extended by edu.internet2.middleware.ldappc.util.LdapSearchFilter

public class LdapSearchFilter
extends Object

This holds the elements for performing a Ldap search on a given base with a specified scope and search filter.


Nested Class Summary
static class LdapSearchFilter.OnNotFound
          When a subject is not found, either fail (throw an LdappcException), warn (log), or ignore (do nothing).
 
Constructor Summary
LdapSearchFilter(String base, int scope, String filter, LdapSearchFilter.OnNotFound onNotFound, boolean multipleResults)
          Construct a LdapSearchFilter with the given parameters.
 
Method Summary
 String getBase()
          Gets the base DN.
 String getFilter()
          Get the search filter.
 boolean getMultipleResults()
          Get whether or not multiple provisioned objects for a subject are allowed.
 LdapSearchFilter.OnNotFound getOnNotFound()
          Get desired behavior when a subject is not found.
 int getScope()
          Get the search scope.
 void setBase(String base)
          Set the base DN.
 void setFilter(String filter)
          Set the search filter.
 void setMultipleResults(boolean multipleResults)
           
 void setOnNotFound(LdapSearchFilter.OnNotFound onNotFound)
           
 void setScope(int scope)
          Set the search scope.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LdapSearchFilter

public LdapSearchFilter(String base,
                        int scope,
                        String filter,
                        LdapSearchFilter.OnNotFound onNotFound,
                        boolean multipleResults)
Construct a LdapSearchFilter with the given parameters.

Parameters:
base - DN of the search base
scope - Scope of the search
filter - Ldap search filter
onNotFound - action to perform when a subject can not be found
multipleResults - allow multiple provisioned objects for a subject
Method Detail

setBase

public void setBase(String base)
             throws IllegalArgumentException
Set the base DN.

Parameters:
base - DN of the base entry
Throws:
IllegalArgumentException - thrown if base is null.

getBase

public String getBase()
Gets the base DN.

Returns:
DN of the base

setScope

public void setScope(int scope)
              throws IllegalArgumentException
Set the search scope. Either SearchControls.OBJECT_SCOPE, SearchControls.ONELEVEL_SCOPE, or SearchControls.SUBTREE_SCOPE.

Parameters:
scope - Search scope
Throws:
IllegalArgumentException - thrown if an invalid scope is provided

getScope

public int getScope()
Get the search scope.

Returns:
Search scope

getFilter

public String getFilter()
Get the search filter.

Returns:
Search filter

setFilter

public void setFilter(String filter)
               throws IllegalArgumentException
Set the search filter.

Parameters:
filter - Search filter
Throws:
IllegalArgumentException - thrown if filter is null.

getOnNotFound

public LdapSearchFilter.OnNotFound getOnNotFound()
Get desired behavior when a subject is not found.

Returns:
onNotFound

setOnNotFound

public void setOnNotFound(LdapSearchFilter.OnNotFound onNotFound)

getMultipleResults

public boolean getMultipleResults()
Get whether or not multiple provisioned objects for a subject are allowed.

Returns:
true if multiple results are allowed, defaults to false

setMultipleResults

public void setMultipleResults(boolean multipleResults)

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2011 Internet2. All Rights Reserved.