com.sas.services.information
Interface FilterInterface

All Known Implementing Classes:
AuthorFilter, ChannelFilter, ChannelPathFilter, ContentFilter, ContentSubscriberFilter, EventSubscriberFilter, Filter, GuidFilter, HttpServerFilter, IdFilter, KeywordFilter, LogicalServerFilter, MessageQueueFilter, PackageFilter, PathFilter, PersonFilter, PhysicalTableFilter, RemarksFilter, ServerFilter, StoredProcessFilter, StoredProcessReportFilter, SubscriberFilter

public interface FilterInterface

The FilterInterface describes a means for setting and getting information used to limit the results of a search against a repository. While it would be nice to make it completely repository-neutral, there are concepts and mechanisms that just don't translate.


Field Summary
static int BASE_SCOPE
           
static java.lang.String FILTERCOMPONENT_UNSUPPORTED
          This string will be returned from a Filter method that returns a search string as an indicator that one more more filter components were not supported for the repository type that was searched.
static int FLAG_OVERRIDE
          Most searches use a default set of flags that generally result in the most useful results set.
static int ONELEVEL_SCOPE
           
static java.lang.String PROTOCOL_DAV
           
static java.lang.String PROTOCOL_HIBERNATE
           
static java.lang.String PROTOCOL_IPOD
           
static java.lang.String PROTOCOL_LDAP
           
static java.lang.String PROTOCOL_OMI
          This is a list of the known repository protocols.
static int SUBTREE_SCOPE
           
 
Method Summary
 void addProtocol(java.lang.String protocol)
          Add a protocol string to the list to be searched (e.g., "omi", "dav").
 void addSearchOption(java.lang.String name, java.lang.Object option)
          Add a search option.
 java.lang.String getDAVBase()
          Get the DAV search base.
 java.lang.String getDAVBasicSearchString()
          Get the filter in the form of a DAV basicsearch XML request.
 int getDAVScope()
          Get the scope of the search for DAV searches.
 java.lang.String getDAVSQLString()
          Get the filter in the form of a DAV SQL XML request.
 java.lang.String getDAVType()
          Get the DAV specific type.
 java.lang.String getExplicitSearchString()
          Get the explicit search string set by the client.
 FilterComponent getFilterComponent()
          Get the FilterComponent for this filter.
 java.lang.String getFilterString()
          Gets a generic filter string.
 java.lang.String getJCRXPathString()
          Get an XPath string to use to filter a search against OMR.
 java.lang.String getName()
          Get the name of the object to look for.
 int getOMRFlags()
          Get the flags to pass to the OMR GetMetadata operation.
 java.lang.String getOMROption()
          Get the OMR option string.
 java.lang.String getOMRRepository()
          Get the ID of the repository to search.
 java.lang.String getOMRSearchString()
          Returns the OMR specific search string for this filter.
 java.lang.String getOMRTemplate()
          Get a template string used to format the data coming back from OMR.
 java.lang.String getOMRType()
          Get the OMR specific type.
 java.util.List getProtocols()
          Get the List of protocols that were set to be searched.
 java.lang.String getRdbmsTable()
          Get the relational database table to search.
 java.util.Map getSearchOptions()
          Get the Map of search options for this Filter.
 java.lang.String getType()
          Get the type of object to search for.
 java.lang.String getXMLSelectString()
          Get the filter in the form of an XMLSelect statement.
 java.lang.String getXPathString()
          Get an XPath string to use to filter a search against OMR.
 void removeProtocol(java.lang.String protocol)
          Remove a protocol from the list.
 void removeSearchOption(java.lang.String name)
          Remove the named search option.
 void setDAVBase(java.lang.String base)
          Set the DAV search base.
 void setDAVScope(int scope)
          Set the DAV search scope.
 void setExplicitSearchString(java.lang.String protocol, java.lang.String searchString)
          If the client knows exactly the search string they want to use, they may set it here.
 void setFilterComponent(FilterComponent component)
          Add a component to this filter.
 void setName(java.lang.String name)
          Set the name of the object to search for.
 void setOMRFlags(int flags)
          Set flags to pass to the OMR GetMetadata operation.
 void setOMROption(java.lang.String option)
          Set the OMR option string.
 void setOMRRepository(java.lang.String reposid)
          Set the ID of the repository to search.
 void setOMRTemplate(java.lang.String template)
          Set the OMR template.
 void setProtocols(java.util.List protocols)
          Set the list of protocols to search.
 void setRdbmsTable(java.lang.String table)
          For Relational searches, set the table name to search.
 void setType(java.lang.String type)
          Set the type to search for.
 

Field Detail

PROTOCOL_OMI

static final java.lang.String PROTOCOL_OMI
This is a list of the known repository protocols. It is not necessarily exhaustive as new repository implementations may be added.

See Also:
Constant Field Values

PROTOCOL_DAV

static final java.lang.String PROTOCOL_DAV
See Also:
Constant Field Values

PROTOCOL_LDAP

static final java.lang.String PROTOCOL_LDAP
See Also:
Constant Field Values

PROTOCOL_IPOD

static final java.lang.String PROTOCOL_IPOD
See Also:
Constant Field Values

PROTOCOL_HIBERNATE

static final java.lang.String PROTOCOL_HIBERNATE
See Also:
Constant Field Values

BASE_SCOPE

static final int BASE_SCOPE
See Also:
Constant Field Values

ONELEVEL_SCOPE

static final int ONELEVEL_SCOPE
See Also:
Constant Field Values

SUBTREE_SCOPE

static final int SUBTREE_SCOPE
See Also:
Constant Field Values

FILTERCOMPONENT_UNSUPPORTED

static final java.lang.String FILTERCOMPONENT_UNSUPPORTED
This string will be returned from a Filter method that returns a search string as an indicator that one more more filter components were not supported for the repository type that was searched. For instance, the GT and LT operators are not supported for OMI repositories.

See Also:
Constant Field Values

FLAG_OVERRIDE

static final int FLAG_OVERRIDE
Most searches use a default set of flags that generally result in the most useful results set. Calling a method like setOMRFlags will add to those flags, but if you want to completely override them and use only those flags you provide, OR this flag value with your flags and only yours will be used.

See Also:
Constant Field Values
Method Detail

setFilterComponent

void setFilterComponent(FilterComponent component)
Add a component to this filter.

Parameters:
component - The new component to add to this filter.

getFilterComponent

FilterComponent getFilterComponent()
Get the FilterComponent for this filter.

Returns:
The FilterComponent.

setType

void setType(java.lang.String type)
Set the type to search for.

Parameters:
type - The object type to search for.

getOMRType

java.lang.String getOMRType()
Get the OMR specific type. By default, this will be the type set by setType, but subclasses may override this so different type strings can be used for OMR and LDAP.

Returns:
The OMR type string.

getDAVType

java.lang.String getDAVType()
Get the DAV specific type. By default, this will be the type set by setType, but subclasses may override this so different type strings can be used for OMR, LDAP and DAV.

Returns:
The LDAP type string.

getType

java.lang.String getType()
Get the type of object to search for.

Returns:
The object type to search for.

setName

void setName(java.lang.String name)
Set the name of the object to search for.

Parameters:
name - The object name.

getName

java.lang.String getName()
Get the name of the object to look for.

Returns:
The object name.

getFilterString

java.lang.String getFilterString()
Gets a generic filter string.

Returns:
a String describing the filter.

getOMRSearchString

java.lang.String getOMRSearchString()
Returns the OMR specific search string for this filter. This string is identical to the the xml select statement, just minus the XMLSelect begin and end tags. This allows the search string to be plugged into either an xml select string or a template search.

Returns:
a search string to be used within an xml select statement or template search

getXMLSelectString

java.lang.String getXMLSelectString()
Get the filter in the form of an XMLSelect statement.

Returns:
An XMLSelect string to pass to OMR.

getXPathString

java.lang.String getXPathString()
Get an XPath string to use to filter a search against OMR.

Returns:
An XPath selection string.

getJCRXPathString

java.lang.String getJCRXPathString()
Get an XPath string to use to filter a search against OMR.

Returns:
An XPath selection string.

getOMRTemplate

java.lang.String getOMRTemplate()
Get a template string used to format the data coming back from OMR.

Returns:
A data template to pass to OMR.

setOMRTemplate

void setOMRTemplate(java.lang.String template)
Set the OMR template.

Parameters:
template - The template to pass to OMR to format results.

getOMROption

java.lang.String getOMROption()
Get the OMR option string.

Returns:
An option string to pass to OMR.

setOMROption

void setOMROption(java.lang.String option)
Set the OMR option string.

Parameters:
option - The string to pass to OMR as options.

setOMRFlags

void setOMRFlags(int flags)
Set flags to pass to the OMR GetMetadata operation.

Parameters:
flags - Flag(s) to set on the GetMetadata.

getOMRFlags

int getOMRFlags()
Get the flags to pass to the OMR GetMetadata operation.

Returns:
The OMI flags.

getOMRRepository

java.lang.String getOMRRepository()
Get the ID of the repository to search. If this isn't set, all the repositories for the server will be searched.

Returns:
The repository to search.

setOMRRepository

void setOMRRepository(java.lang.String reposid)
Set the ID of the repository to search. If this doesn't get set, all the repositories that the server holds will be searched.

Parameters:
reposid - The ID of the repository to search.

setDAVBase

void setDAVBase(java.lang.String base)
Set the DAV search base.

Parameters:
base - The search base for searches represented by this filter.

getDAVBase

java.lang.String getDAVBase()
Get the DAV search base.

Returns:
The search base for searches represented by this filter.

getDAVScope

int getDAVScope()
Get the scope of the search for DAV searches.

Returns:
The search scope.

setDAVScope

void setDAVScope(int scope)
Set the DAV search scope.

Parameters:
scope - The new scope of the search.

getDAVBasicSearchString

java.lang.String getDAVBasicSearchString()
Get the filter in the form of a DAV basicsearch XML request.

Returns:
An XML basicsearch request to pass to a DAV server.

getDAVSQLString

java.lang.String getDAVSQLString()
Get the filter in the form of a DAV SQL XML request.

Returns:
A DAV SQL request to pass to a DAV server.

setRdbmsTable

void setRdbmsTable(java.lang.String table)
For Relational searches, set the table name to search.

Parameters:
table - The relational table to search for objects.

getRdbmsTable

java.lang.String getRdbmsTable()
Get the relational database table to search.

Returns:
The relational table String.

addProtocol

void addProtocol(java.lang.String protocol)
Add a protocol string to the list to be searched (e.g., "omi", "dav"). Repositories whose protocol is not in this list will not perform the search. If the protocol list is empty, it will be ignored.

Parameters:
protocol - A protocol string to control the types of repositories to search.

removeProtocol

void removeProtocol(java.lang.String protocol)
Remove a protocol from the list.

Parameters:
protocol - The protocol string to remove.

setProtocols

void setProtocols(java.util.List protocols)
Set the list of protocols to search. This list controls the types of repositories that will be searched. Repository instances whose protocol does not match any in the list will ignore the search request.

Parameters:
protocols - A List of protocol Strings (e.g., "omi", "dav").

getProtocols

java.util.List getProtocols()
Get the List of protocols that were set to be searched.

Returns:
A List of protocol Strings.

setExplicitSearchString

void setExplicitSearchString(java.lang.String protocol,
                             java.lang.String searchString)
If the client knows exactly the search string they want to use, they may set it here. The FilterComponents will be ignored in favor of this string. Since search strings are specific to a given repository implementation, the protocol is required.

Parameters:
protocol - The protocol for which the search string is to be used.
searchString - The search string to be used for the search.

getExplicitSearchString

java.lang.String getExplicitSearchString()
Get the explicit search string set by the client. This overrides the filter components.

Returns:
The search String to use.

addSearchOption

void addSearchOption(java.lang.String name,
                     java.lang.Object option)
Add a search option. Search options are generally protocol-specific, so details of what options are supported are described in the repository implementation documentation.

Parameters:
name - The name of the option to be added.
option - The option value. This is usually a String, but may be other object types.

removeSearchOption

void removeSearchOption(java.lang.String name)
Remove the named search option.

Parameters:
name - The name of the option to remove.

getSearchOptions

java.util.Map getSearchOptions()
Get the Map of search options for this Filter.

Returns:
The search options Map.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.