org.osgi.framework.Filter Interface Reference

Inherited by org.knopflerfish.framework.FilterImpl.

List of all members.


Detailed Description

An RFC 1960-based Filter.

Filter objects can be created by calling BundleContext#createFilter with the chosen filter string.

A Filter object can be used numerous times to determine if the match argument matches the filter string that was used to create the Filter object.

Some examples of LDAP filters are:

      "(cn=Babs Jensen)"
      "(!(cn=Tim Howes))"
      "(&(" + Constants.OBJECTCLASS + "=Person)(|(sn=Jensen)(cn=Babs J*)))"
      "(o=univ*of*mich*)"
 

Version:
Revision
1.14
Since:
1.1
See also:
"Framework specification for a description of the filter string syntax."

Definition at line 45 of file Filter.java.


Public Member Functions

boolean match (ServiceReference reference)
 Filter using a service's properties.
boolean match (Dictionary dictionary)
 Filter using a Dictionary object.
String toString ()
 Returns this Filter object's filter string.
boolean equals (Object obj)
 Compares this Filter object to another object.
int hashCode ()
 Returns the hashCode for this Filter object.
boolean matchCase (Dictionary dictionary)
 Filter with case sensitivity using a Dictionary object.

Member Function Documentation

boolean org.osgi.framework.Filter.match ( ServiceReference  reference  ) 

Filter using a service's properties.

The filter is executed using the keys and values of the referenced service's properties. The keys are case insensitively matched with the filter.

Parameters:
reference The reference to the service whose properties are used in the match.
Returns:
true if the service's properties match this filter; false otherwise.

Referenced by org.osgi.service.condpermadmin.BundleLocationCondition.getCondition(), and org.osgi.util.tracker.ServiceTracker.Tracked.serviceChanged().

boolean org.osgi.framework.Filter.match ( Dictionary  dictionary  ) 

Filter using a Dictionary object.

The Filter is executed using the Dictionary object's keys and values. The keys are case insensitively matched with the filter.

Parameters:
dictionary The Dictionary object whose keys are used in the match.
Returns:
true if the Dictionary object's keys and values match this filter; false otherwise.
Exceptions:
IllegalArgumentException If dictionary contains case variants of the same key name.

String org.osgi.framework.Filter.toString (  ) 

Returns this Filter object's filter string.

The filter string is normalized by removing whitespace which does not affect the meaning of the filter.

Returns:
Filter string.

Referenced by org.osgi.util.tracker.ServiceTracker.open().

boolean org.osgi.framework.Filter.equals ( Object  obj  ) 

Compares this Filter object to another object.

Parameters:
obj The object to compare against this Filter object.
Returns:
If the other object is a Filter object, then returns this.toString().equals(obj.toString();false otherwise.

int org.osgi.framework.Filter.hashCode (  ) 

Returns the hashCode for this Filter object.

Returns:
The hashCode of the filter string; that is, this.toString().hashCode().

boolean org.osgi.framework.Filter.matchCase ( Dictionary  dictionary  ) 

Filter with case sensitivity using a Dictionary object.

The Filter is executed using the Dictionary object's keys and values. The keys are case sensitively matched with the filter.

Parameters:
dictionary The Dictionary object whose keys are used in the match.
Returns:
true if the Dictionary object's keys and values match this filter; false otherwise.
Since:
1.3


The documentation for this interface was generated from the following file:
Generated on Mon Jan 11 21:19:24 2010 for OpenMobileIS by  doxygen 1.5.4