com.sap.security.api
Interface IPrincipalSearchFilter

All Known Subinterfaces:
IGroupSearchFilter, IRoleSearchFilter, IUserAccountSearchFilter, IUserSearchFilter

public interface IPrincipalSearchFilter

Title: User Management 60 This interface provides the possibility for values to be used as a search filter when calling IPrincipalFactory.getPrincipalSearchFilter(boolean,String) NOTE: For consistency reasons no leading or trailing spaces are allowed in namespaces, attribute names and String values. Copyright: Copyright (c) 2002

Version:
1.0

Field Summary
static int SEARCHMETHOD_AND
          Constant used to define the search operation.
static int SEARCHMETHOD_OR
          Constant used to define the search operation.
static java.lang.String VERSIONSTRING
           
 
Method Summary
 void clear()
          Removes all search attributes, namespaces and values.
 java.lang.String getDisplayName()
          Gets the display name to match.
 com.sap.security.api.persistence.ISearchElement getElementAt(int i)
          Deprecated. use getSearchElementAt(int) instead
 int getElementSize()
          Get the number of elements to search
 int getMaxSearchResultSize()
          Gets the max size of the search result
 java.lang.String[] getSearchAttributeNames(java.lang.String namespace)
          Get the attribute names of the set search attributes
 java.lang.String[] getSearchAttributes(java.lang.String namespace, java.lang.String attributeName)
          Get the values to match the search for the given namespace and attribute
 ISearchAttribute getSearchElementAt(int i)
          Get the ISearchAttribute at a specific position in the list of search elements.
 int getSearchMethod()
          Get the used search method.
 java.lang.String[] getSearchNamespaces()
          Get the namespaces of the set search attributes
 int getSearchOperator(java.lang.String namespace, java.lang.String attributeName, java.lang.Object attribute)
          Get the search operator of a specific criteria ISearchAttribute
 java.lang.String getSearchPrincipalType()
          Get the type of the principals to search.
 boolean isEmpty()
          Tests if this search filter has no components.
 void setDirectChild(java.lang.String principalID, int mode, boolean caseSensitive)
          Set the id of a direct child to match in the principal search.
 void setDisplayName(java.lang.String displayname, int mode, boolean caseSensitive)
          Set the displayname attribute value to match in the principal search.
 void setMaxSearchResultSize(int resultsize)
          Set the maxium size of the search result.
 void setSearchAttribute(java.lang.String namespace, java.lang.String attribute, java.lang.String value, int mode, boolean caseSensitive)
          Set the value of a attribute to match in the principal search.
 void setSearchMethod(int searchMethod)
          Set the search method.
 

Field Detail

VERSIONSTRING

public static final java.lang.String VERSIONSTRING

SEARCHMETHOD_AND

public static final int SEARCHMETHOD_AND
Constant used to define the search operation. SEARCHMETHOD_AND can be used to combine search attributes with logical operator AND

SEARCHMETHOD_OR

public static final int SEARCHMETHOD_OR
Constant used to define the search operation. SEARCHMETHOD_OR can be used to combine search attributes with logical operator OR
Method Detail

setSearchMethod

public void setSearchMethod(int searchMethod)
Set the search method. IPrincipalSearchFilter.SEARCHMETHOD_AND (default) or IPrincipalSearchFilter.SEARCHMETHOD_OR
Parameters:
searchMethod - The search method

setDirectChild

public void setDirectChild(java.lang.String principalID,
                           int mode,
                           boolean caseSensitive)
Set the id of a direct child to match in the principal search. Makes only sense for principal sets like IGroup, IRole and ICustomObjectSet
Parameters:
principalID - The unique id of the direct child
mode. - Use constants defined in ISearchAttribute
caseSensitive - The case sensitivity

setSearchAttribute

public void setSearchAttribute(java.lang.String namespace,
                               java.lang.String attribute,
                               java.lang.String value,
                               int mode,
                               boolean caseSensitive)
Set the value of a attribute to match in the principal search. If there's already a value set for the same attribute, the new value will be appended.
Parameters:
namespace - The namespace of the attribute
attribute - The name of the attribute
value - The value to match
mode. - Use constants defined in ISearchAttribute
caseSensitive - The case sensitivity

getSearchPrincipalType

public java.lang.String getSearchPrincipalType()
Get the type of the principals to search. e.g. USER,GRUP,ROLE,...
Returns:
String The type

getSearchNamespaces

public java.lang.String[] getSearchNamespaces()
Get the namespaces of the set search attributes
Returns:
String[] List of namespaces

getSearchAttributeNames

public java.lang.String[] getSearchAttributeNames(java.lang.String namespace)
Get the attribute names of the set search attributes
Parameters:
namespace - The namespace of the attributes
Returns:
String[] The list of attributes

getSearchAttributes

public java.lang.String[] getSearchAttributes(java.lang.String namespace,
                                              java.lang.String attributeName)
Get the values to match the search for the given namespace and attribute
Parameters:
namespace - The namespace of the attribute
attributeName - The attribute's name
Returns:
String[] The list of values to match in the search

getSearchOperator

public int getSearchOperator(java.lang.String namespace,
                             java.lang.String attributeName,
                             java.lang.Object attribute)
Get the search operator of a specific criteria ISearchAttribute
Parameters:
namespace - The namespace of the attribute
attributeName - The attribute's name
attribute - The value to match in the search
Returns:
int constants defined in ISearchAttribute

getSearchMethod

public int getSearchMethod()
Get the used search method. Returns IPrincipalSearchFilter.SEARCHMETHOD_AND or IPrincipalSearchFilter.SEARCHMETHOD_OR
Returns:
int The search method

clear

public void clear()
Removes all search attributes, namespaces and values.

isEmpty

public boolean isEmpty()
Tests if this search filter has no components.
Returns:
true if and only if this search filter has no search criteria specified, that is, the search filter is in its initial state; false otherwise

getElementSize

public int getElementSize()
Get the number of elements to search
Returns:
int

getElementAt

public com.sap.security.api.persistence.ISearchElement getElementAt(int i)
Deprecated. use getSearchElementAt(int) instead

Get the ISearchElement at a specific position in the list of search elements.
Parameters:
i - The index of the element in the list
Returns:
ISearchElement The search element object

getSearchElementAt

public ISearchAttribute getSearchElementAt(int i)
Get the ISearchAttribute at a specific position in the list of search elements.
Parameters:
i - The index of the element in the list
Returns:
ISearchAttribute The search element object

getDisplayName

public java.lang.String getDisplayName()
Gets the display name to match.
Returns:
String The displayname to match

setDisplayName

public void setDisplayName(java.lang.String displayname,
                           int mode,
                           boolean caseSensitive)
Set the displayname attribute value to match in the principal search. The search will be done for all attributes which participate in the creation of the displayname and the physical attribute displayname, if available.

NOTE: This method can only be used, if no other search attributes are set yet and vice versa.

Parameters:
displayname - The value which is searched in the displayname field of principals
mode - The search mode ISearchAttribute
caseSensitive - Set case sensitivity

setMaxSearchResultSize

public void setMaxSearchResultSize(int resultsize)
Set the maxium size of the search result. For an unlimited search result you have to specify a limit of '0' or smaller.

NOTE: This method can only be used, if only one search attribute is specified

Parameters:
resultsize. - The value which is used to limit the search result.

getMaxSearchResultSize

public int getMaxSearchResultSize()
Gets the max size of the search result
Returns:
int the max search result size


Copyright © 2002 SAP AG All Rights Reserved.