ContentFilteredTopic Interface Reference
[Topics]

<<interface>> Specialization of com.rti.dds.topic.TopicDescription that allows for content-based subscriptions. More...

Inheritance diagram for ContentFilteredTopic:

TopicDescription

List of all members.

Public Member Functions

String get_filter_expression ()
 Get the filter_expression.
void get_expression_parameters (StringSeq parameters)
 Get the expression_parameters.
void set_expression_parameters (StringSeq parameters)
 Set the expression_parameters.
Topic get_related_topic ()
 Get the related_topic.
void append_to_expression_parameter (int index, String val)
 <<eXtension>> Appends a string term to the specified parameter string.
void remove_from_expression_parameter (int index, String val)
 <<eXtension>> Removes a string term from the specified parameter string.


Detailed Description

<<interface>> Specialization of com.rti.dds.topic.TopicDescription that allows for content-based subscriptions.

It describes a more sophisticated subscription that indicates a com.rti.dds.subscription.DataReader does not want to necessarily see all values of each instance published under the com.rti.dds.topic.Topic. Rather, it wants to see only the values whose contents satisfy certain criteria. This class therefore can be used to request content-based subscriptions.

The selection of the content is done using the filter_expression with parameters expression_parameters.

Queries and Filters Syntax describes the syntax of filter_expression and expression_parameters.

Note on Content-Based Filtering and Sparse Value Types

If you are a user of the Dynamic Data API, you may define sparse value types; that is, types for which every data sample need not include a value for every field defined in the type. (See TCKind.TK_SPARSE and TypeCodeFactory.create_sparse_tc.) In order for a filter expression on a field to be well defined, that field must be present in the data sample. That means that you will only be able to perform a content-based filter on fields that are marked as TypeCode.KEY_MEMBER or TypeCode.NONKEY_REQUIRED_MEMBER.


Member Function Documentation

String get_filter_expression (  ) 

Get the filter_expression.

Return the filter_expression associated with the com.rti.dds.topic.ContentFilteredTopic.

Returns:
the filter_expression.

void get_expression_parameters ( StringSeq  parameters  ) 

Get the expression_parameters.

Return the expression_parameters associated with the com.rti.dds.topic.ContentFilteredTopic. expression_parameters is either specified on the last successful call to com.rti.dds.topic.ContentFilteredTopic.set_expression_parameters or, if that method is never called, the parameters specified when the com.rti.dds.topic.ContentFilteredTopic was created.

Parameters:
parameters <<inout>> the filter expression parameters. Cannot be NULL.
Exceptions:
One of the Standard Return Codes
See also:
com.rti.dds.domain.DomainParticipant.create_contentfilteredtopic

com.rti.dds.topic.ContentFilteredTopic.set_expression_parameters

void set_expression_parameters ( StringSeq  parameters  ) 

Set the expression_parameters.

Change the expression_parameters associated with the com.rti.dds.topic.ContentFilteredTopic.

Parameters:
parameters <<in>> the filter expression parameters Cannot be NULL.. Length of sequence cannot be greater than 100.
Exceptions:
One of the Standard Return Codes

Topic get_related_topic (  ) 

Get the related_topic.

Return the com.rti.dds.topic.Topic specified when the com.rti.dds.topic.ContentFilteredTopic was created.

Returns:
The com.rti.dds.topic.Topic assocated with the com.rti.dds.topic.ContentFilteredTopic.

void append_to_expression_parameter ( int  index,
String  val 
)

<<eXtension>> Appends a string term to the specified parameter string.

Appends the input string to the end of the specified parameter string, separated by a comma. If the original parameter string is enclosed in quotation marks (''), the resultant string will also be enclosed in quotation marks.

This method can be used in expression parameters associated with MATCH operators in order to add a pattern to the match pattern list. For example, if the filter expression parameter value is:

'IBM'

Then append_to_expression_parameter(0, "MSFT") would generate the new value:

'IBM,MSFT'

Parameters:
index <<in>> The index of the parameter string to be modified. The first index is index 0. When using the DomainParticipant.STRINGMATCHFILTER_NAME filter, index must be 0.
val <<in>> The string term to be appended to the parameter string.
Exceptions:
One of the Standard Return Codes

void remove_from_expression_parameter ( int  index,
String  val 
)

<<eXtension>> Removes a string term from the specified parameter string.

Removes the input string from the specified parameter string. To be found and removed, the input string must exist as a complete term, bounded by comma separators or the strong boundary. If the original parameter string is enclosed in quotation marks (''), the resultant string will also be enclosed in quotation marks. If the removed term was the last entry in the string, the result will be a string of empty quotation marks.

This method can be used in expression parameters associated with MATCH operators in order to remove a pattern from the match pattern list. For example, if the filter expression paremeter value is:

'IBM,MSFT'

Then remove_from_expression_parameter(0, "IBM") would generate the expression:

'MSFT'

Parameters:
index <<in>> The index of the parameter string to be modified. The first index is index 0. When using the DomainParticipant.STRINGMATCHFILTER_NAME filter, index must be 0.
val <<in>> The string term to be removed from the parameter string.
Exceptions:
One of the Standard Return Codes


RTI Connext Java API Version 4.5f Copyright © 17 Mar 2012 Real-Time Innovations, Inc