OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.omg.dds.topic.ContentFilteredTopic< TYPE > Interface Template Reference

ContentFilteredTopic is a specialization of TopicDescription that allows for content-based subscriptions. More...

Inheritance diagram for org.omg.dds.topic.ContentFilteredTopic< TYPE >:
Inheritance graph
Collaboration diagram for org.omg.dds.topic.ContentFilteredTopic< TYPE >:
Collaboration graph

Public Member Functions

public< OTHER > TopicDescription< OTHER > cast ()
 Cast this topic description to the given type, or throw an exception if the cast fails. More...
 
void close ()
 Dispose the resources held by this object. More...
 
ServiceEnvironment getEnvironment ()
 
List< String > getExpressionParameters ()
 This operation returns the expression parameters associated with the ContentFilteredTopic, that is, the parameters specified on the last successful call to setExpressionParameters(List), or if setExpressionParameters(List) was never called, the parameters specified when the ContentFilteredTopic was created. More...
 
String getFilterExpression ()
 The filter expression associated with the ContentFilteredTopic, that is, the expression specified when the ContentFilteredTopic was created. More...
 
String getName ()
 Returns the name used to create the TopicDescription. More...
 
DomainParticipant getParent ()
 Returns the org.omg.dds.domain.DomainParticipant to which the TopicDescription belongs. More...
 
Topic<? extends TYPE > getRelatedTopic ()
 The org.omg.dds.topic.Topic associated with the ContentFilteredTopic, that is, the Topic specified when the ContentFilteredTopic was created. More...
 
String getTypeName ()
 Returns the type name used to create the TopicDescription. More...
 
TypeSupport< TYPE > getTypeSupport ()
 Returns the org.omg.dds.type.TypeSupport used to create this TopicDescription. More...
 
void setExpressionParameters (List< String > expressionParameters)
 This operation changes the expression parameters associated with the ContentFilteredTopic. More...
 
void setExpressionParameters (String... expressionParameters)
 This operation changes the expression parameters associated with the ContentFilteredTopic. More...
 

Detailed Description

ContentFilteredTopic is a specialization of TopicDescription that allows for content-based subscriptions.

ContentFilteredTopic describes a more sophisticated subscription that indicates the subscriber does not want to necessarily see all values of each instance published under the org.omg.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 filterExpression with parameters expressionParameters.

  • The filterExpression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The expressionParameters attribute is a sequence of strings that give values to the "parameters" (i.e., "%n" tokens) in the filterExpression. The number of supplied parameters must fit with the requested values in the filterExpression (i.e., the number of "%n" tokens).

The selection of the content is done using the SQL based filter with parameters to adapt the filter clause.

Parameters
<TYPE>The concrete type of the data that will be published and/ or subscribed by the readers and writers that use this topic description.
Example

// Default creation of a Topic
Topic<Foo> topic = participant.createTopic("TopicName", Foo.class);

// Creation of a ContentFilteredTopic (assume Foo contains a x and y element). List<String> params = new ArrayList<String>(); params.add("200"); params.add("1000"); String filter = "x &gt; %0 AND y &lt; %1"; // Create the contentFilteredTopic. ContentFilteredTopic<Foo> cfTopic = participant.createContentFilteredTopic("FilteredTopicName", topic,filter,params);

// create Filtered DataReader
DataReader<Foo> reader = sub.createDataReader(cfTopic,drQos);

Definition at line 71 of file ContentFilteredTopic.java.

Member Function Documentation

◆ cast()

public<OTHER> TopicDescription<OTHER> org.omg.dds.topic.TopicDescription< TYPE >.cast ( )
inherited

Cast this topic description to the given type, or throw an exception if the cast fails.

Parameters
<OTHER>The type of the data exchanged on this topic, according to the caller.
Returns
this topic description
Exceptions
ClassCastExceptionif the cast fails

◆ close()

void org.omg.dds.topic.TopicDescription< TYPE >.close ( )
inherited

Dispose the resources held by this object.

A TopicDescription cannot be closed if it is in use by any org.omg.dds.pub.DataWriters or org.omg.dds.sub.DataReaders. With respect to org.omg.dds.topic.Topics specifically: a Topic cannot be closed if it has any remaining org.omg.dds.topic.ContentFilteredTopics or org.omg.dds.topic.MultiTopics related to it.

See also
org.omg.dds.core.Entity::close()

Implemented in org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >, and org.opensplice.dds.topic.TopicDescriptionExt< TYPE >.

◆ getEnvironment()

ServiceEnvironment org.omg.dds.core.DDSObject.getEnvironment ( )
inherited
Returns
the org.omg.dds.core.ServiceEnvironment object that directly or indirectly was used to create this object.

Implemented in org.omg.dds.core.ServiceEnvironment, org.opensplice.dds.sub.ReflectionDataReader< TYPE, OUT_TYPE >, org.opensplice.dds.core.ModifiableTimeImpl, org.opensplice.dds.pub.ReflectionDataWriter< TYPE >, org.opensplice.dds.core.DurationImpl, org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >, org.opensplice.dds.sub.ReadConditionImpl< TYPE >, org.opensplice.dds.core.EntityQosImpl< T extends QosPolicy >, org.opensplice.dds.type.TypeSupportImpl< TYPE >, org.opensplice.dds.topic.PublicationBuiltinTopicDataImpl, org.opensplice.dds.topic.SubscriptionBuiltinTopicDataImpl, org.opensplice.dds.topic.TopicBuiltinTopicDataImpl, org.opensplice.dds.domain.DomainParticipantFactoryImpl, org.opensplice.dds.core.QosProviderImpl, org.opensplice.dds.core.status.OfferedIncompatibleQosStatusImpl, org.opensplice.dds.core.status.RequestedIncompatibleQosStatusImpl, org.opensplice.dds.core.InstanceHandleImpl, org.opensplice.dds.core.StatusConditionImpl< T extends Entity<?, ?>, org.opensplice.dds.core.status.LivelinessChangedStatusImpl, org.opensplice.dds.core.status.PublicationMatchedStatusImpl, org.opensplice.dds.core.status.SubscriptionMatchedStatusImpl, org.opensplice.dds.sub.SampleImpl< TYPE >, org.opensplice.dds.core.policy.ShareImpl, org.opensplice.dds.core.status.OfferedDeadlineMissedStatusImpl, org.opensplice.dds.core.status.SampleRejectedStatusImpl, org.opensplice.dds.core.WaitSetImpl, org.opensplice.dds.topic.ParticipantBuiltinTopicDataImpl, org.opensplice.dds.core.status.RequestedDeadlineMissedStatusImpl, org.opensplice.dds.topic.BuiltinTopicKeyImpl, org.opensplice.dds.core.GuardConditionImpl, org.opensplice.dds.core.event.AllDataDisposedEventImpl< TYPE >, org.opensplice.dds.core.policy.QosPolicyCountImpl, org.opensplice.dds.core.status.InconsistentTopicStatusImpl, org.opensplice.dds.core.status.LivelinessLostStatusImpl, org.opensplice.dds.core.status.SampleLostStatusImpl, org.opensplice.dds.core.policy.QosPolicyImpl, org.opensplice.dds.core.status.AllDataDisposedStatusImpl, org.opensplice.dds.core.IllegalArgumentExceptionImpl, org.opensplice.dds.core.InconsistentPolicyExceptionImpl, org.opensplice.dds.core.policy.PolicyFactoryImpl, org.opensplice.dds.core.policy.TypeConsistencyEnforcementImpl, org.opensplice.dds.core.PreconditionNotMetExceptionImpl, org.opensplice.dds.core.AlreadyClosedExceptionImpl, org.opensplice.dds.core.IllegalOperationExceptionImpl, org.opensplice.dds.core.ImmutablePolicyExceptionImpl, org.opensplice.dds.core.NotEnabledExceptionImpl, org.opensplice.dds.core.OutOfResourcesExceptionImpl, org.opensplice.dds.core.DDSExceptionImpl, org.opensplice.dds.core.status.DataAvailableStatusImpl, and org.opensplice.dds.core.status.DataOnReadersStatusImpl.

◆ getExpressionParameters()

List<String> org.omg.dds.topic.ContentFilteredTopic< TYPE >.getExpressionParameters ( )

This operation returns the expression parameters associated with the ContentFilteredTopic, that is, the parameters specified on the last successful call to setExpressionParameters(List), or if setExpressionParameters(List) was never called, the parameters specified when the ContentFilteredTopic was created.

Returns
an unmodifiable list.
See also
#setExpressionParameters(List)

Implemented in org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.

◆ getFilterExpression()

String org.omg.dds.topic.ContentFilteredTopic< TYPE >.getFilterExpression ( )

The filter expression associated with the ContentFilteredTopic, that is, the expression specified when the ContentFilteredTopic was created.

Returns
the filter expression

Implemented in org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.

◆ getName()

String org.omg.dds.topic.TopicDescription< TYPE >.getName ( )
inherited

Returns the name used to create the TopicDescription.

Returns
the name.

Implemented in org.opensplice.dds.topic.TopicImpl< TYPE >, and org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.

◆ getParent()

◆ getRelatedTopic()

Topic<? extends TYPE> org.omg.dds.topic.ContentFilteredTopic< TYPE >.getRelatedTopic ( )

The org.omg.dds.topic.Topic associated with the ContentFilteredTopic, that is, the Topic specified when the ContentFilteredTopic was created.

Returns
the org.omg.dds.topic.Topic associated with the ContentFilteredTopic

Implemented in org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.

◆ getTypeName()

String org.omg.dds.topic.TopicDescription< TYPE >.getTypeName ( )
inherited

Returns the type name used to create the TopicDescription.

Returns
the type name

Implemented in org.opensplice.dds.topic.TopicImpl< TYPE >, and org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.

◆ getTypeSupport()

◆ setExpressionParameters() [1/2]

void org.omg.dds.topic.ContentFilteredTopic< TYPE >.setExpressionParameters ( List< String >  expressionParameters)

This operation changes the expression parameters associated with the ContentFilteredTopic.

Parameters
expressionParametersThe expressionParameters attribute is a collection of strings that give values to the "parameters" (i.e., "%n" tokens) in the queryExpression. The number of supplied parameters must fit with the requested values in the queryExpression (i.e., the number of "%n" tokens).
See also
getExpressionParameters()

Implemented in org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.

◆ setExpressionParameters() [2/2]

void org.omg.dds.topic.ContentFilteredTopic< TYPE >.setExpressionParameters ( String...  expressionParameters)

This operation changes the expression parameters associated with the ContentFilteredTopic.

Parameters
expressionParametersThe expressionParameters attribute is a sequence of strings that give values to the "parameters" (i.e., "%n" tokens) in the queryExpression. The number of supplied parameters must fit with the requested values in the queryExpression (i.e., the number of "%n" tokens).
See also
getExpressionParameters() NOTE: This operation is not yet implemented. It is scheduled for a future release.

Implemented in org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >.


The documentation for this interface was generated from the following file: