|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetscape.ldap.util.LDAPFilter
Represents an LDAP search filter, which includes the string-based representation of the filter and other information retrieved from the LDAP filter configuration file (or from a buffer in memory or from a URL).
Although this class provides methods to create and modify LDAP filters, in most cases, you do not need to use these methods. In most situations, these classes are used to access individual filters from filter configuration files.
For example, you might do the following:
LDAPFilterDescriptor
constructor to
read the filter configuration file into memory.
getFilters
method to get a list of
filters that match the search criteria. This list of filters
is represented by an LDAPFilterList
object.
LDAPFilter
object), and apply the filter to
a search.
For an example of using an object of this class and for more information on the filter configuration file syntax, see the documentation for LDAPFilterDescriptor.
LDAPFilterDescriptor
,
LDAPFilterList
Constructor Summary | |
LDAPFilter(java.lang.String strMatchPattern,
java.lang.String strDelimiter,
java.lang.String strFilterTemplate,
java.lang.String strDescription,
int nScope)
Constructs an LDAPFilter object. |
|
LDAPFilter(java.lang.String strMatchPattern,
java.lang.String strDelimiter,
java.lang.String strFilterTemplate,
java.lang.String strDescription,
java.lang.String strScope)
Constructs an LDAPFilter object. |
Method Summary | |
java.lang.Object |
clone()
Makes a copy of this LDAPFilter object. |
(package private) java.lang.String |
convertMatchPattern(java.lang.String strMatchPattern)
The ldapfilter.conf specifies match patterns in a funny way. |
(package private) void |
createFilterString(java.lang.String strValue,
java.lang.String strPrefix,
java.lang.String strSuffix)
Create the filter string which can be used in LDAPConnection.search() and others given the parameter strValue. |
java.lang.String |
getDelimiter()
Return this filter's delimiter. |
java.lang.String |
getDescription()
Return this filter's description. |
java.lang.String |
getFilter()
Returns the filter string. |
java.lang.String |
getFilter(java.lang.String strValue)
Create a filter string given a string value. |
java.lang.String |
getFilter(java.lang.String strValue,
java.lang.String strPrefix,
java.lang.String strSuffix)
Create a filter string given a string value. |
java.lang.String |
getFilterTemplate()
Return this filter's filter template. |
java.lang.String |
getLineNumber()
Return this filter's line number. |
java.lang.String |
getMatchPattern()
Return this filter's match pattern. |
java.lang.String |
getScope()
Return this filter's scope. |
void |
setFilterAffixes(java.lang.String strPrefix,
java.lang.String strSuffix)
|
(package private) void |
setLine(int nLine)
Set the line number from which this filter was created. |
void |
setupFilter(java.lang.String strValue)
Sets up the filter string, given the string strValue . |
void |
setupFilter(java.lang.String strValue,
java.lang.String strPrefix,
java.lang.String strSuffix)
Sets up the filter string, given the string strValue . |
java.lang.String |
toString()
Print out a string representation of the LDAPFilter. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LDAPFilter(java.lang.String strMatchPattern, java.lang.String strDelimiter, java.lang.String strFilterTemplate, java.lang.String strDescription, int nScope) throws java.lang.IllegalArgumentException
LDAPFilter
object. In most situations,
you do not need to construct an LDAPFilter object. Instead, you
work with LDAPFilter
objects created from the
LDAPFilter
objects and LDAPFilterDescriptor
objects.
This constructor uses the integer value for a search scope in
addition to other information to construct an LDAPFilter
object. The integer value of the search scope can be one of the
following:
LDAPConnection.SCOPE_BASE
LDAPConnection.SCOPE_ONE
LDAPConnection.SCOPE_SUB
illegalArgumentException
.
public LDAPFilter(java.lang.String strMatchPattern, java.lang.String strDelimiter, java.lang.String strFilterTemplate, java.lang.String strDescription, java.lang.String strScope) throws java.lang.IllegalArgumentException
LDAPFilter
object. In most situations,
you do not need to construct an LDAPFilter object. Instead, you
work with LDAPFilter
objects created from the
LDAPFilter
objects and LDAPFilterDescriptor
objects.
This constructor uses the string value for a search scope in
addition to other information to construct an LDAPFilter
object. The string value of the search scope can be one of the
following:
"base"
"onelevel"
"subtree"
illegalArgumentException
.
Method Detail |
public java.lang.String toString()
For example, suppose you called the method in this way:
System.out.println(filter.toString());The resulting output might look like this:
matchPtn: "@" delim: " " filttmpl: "(mail=%v*)" descript: "start of email address" scope: "LDAPConnection.SCOPE_SUB" line: "32" FILTER: "(mail=babs@aceindustry.com*)"
public void setupFilter(java.lang.String strValue, java.lang.String strPrefix, java.lang.String strSuffix)
strValue
.
If the strPrefix
and strSuffix
arguments
are non-null strings, they are prepended and appended
to the filter string (respectively).
This string, which is available through the getFilter()
method, should be suitable for use as search criteria when
calling the LDAPConnection.search()
method.
Notes:
LDAPFilterDescriptor.setFilterAffixes
method, so you
need to explicitly define any filter prefixes or suffixes here.
LDAPFilterDescriptor.setFilterAffixes(java.lang.String, java.lang.String)
,
setFilterAffixes(java.lang.String, java.lang.String)
public void setupFilter(java.lang.String strValue)
strValue
.
This string, which is available through the getFilter()
method, should be suitable for use as search criteria when
calling the LDAPConnection.search()
method.
Note: If you want to specify a filter prefix and suffix,
you need to explicitly define them by calling the
setFilterAffixes()
method.
LDAPFilterDescriptor.setFilterAffixes(java.lang.String, java.lang.String)
,
setFilterAffixes(java.lang.String, java.lang.String)
void createFilterString(java.lang.String strValue, java.lang.String strPrefix, java.lang.String strSuffix)
public java.lang.Object clone()
LDAPFilter
object.
void setLine(int nLine)
java.lang.String convertMatchPattern(java.lang.String strMatchPattern)
public java.lang.String getFilter()
setupFilter()
,
getFilter (strValue)
, or getFilter (strValue,
strPrefix, strSuffix )
methods.
setupFilter(java.lang.String, java.lang.String, java.lang.String)
,
getFilter()
public java.lang.String getFilter(java.lang.String strValue)
This is the same as doing:
setupFilter ( strValue ); getFilter();
public java.lang.String getFilter(java.lang.String strValue, java.lang.String strPrefix, java.lang.String strSuffix)
This is the same as doing:
setupFilter ( strValue, strPrefix, strSuffix ); getFilter();
public java.lang.String getMatchPattern()
public java.lang.String getDelimiter()
public java.lang.String getFilterTemplate()
public java.lang.String getDescription()
public java.lang.String getScope()
public java.lang.String getLineNumber()
public void setFilterAffixes(java.lang.String strPrefix, java.lang.String strSuffix)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |