public interface EntityFilter
Usually, fasttrack serverices implements a default filter to restrict the set of values notified by a Subscription, based on full or partial key values.
To use this you must set the
filter type value
as
TYPE_ENTITYFILTER and the
Entity Class ID
used by
subscription. The filter returned by
makeFilter
can be safely casted to EntityFilter.
After that, it may be used in a subcription
setting an empty EntityKey
whill will be used
to set filter key values. Please note, you must create and set up different filters for
different subscriptions; a filter is not allowed to be used for many subscription simultaneously.
To change filter value you may call:
set method
doesn't perform any action for this class.
You should call flush after many filter operations to force any buffered action to be sent to the server.
Filter
,
FilterParam
,
FilterListener
Field Summary | |
---|---|
static int |
TYPE_ENTITYFILTER
The filter type value. |
Fields inherited from interface Filter |
---|
STATUS_CREATED, STATUS_CREATING, STATUS_DESTROYED, STATUS_DESTROYING |
Fields inherited from interface ActivityLifeCycle |
---|
RESULT_INVALID_CONNECTION_STATUS |
Fields inherited from interface LifeCycle |
---|
RESULT_GENERIC_ERROR, RESULT_INVALID_STATUS, RESULT_OK, STATUS_INIT, STATUS_RELEASED |
Method Summary | |
---|---|
int |
add(EntityKey entityKey)
Add the EntityKey to the filter. |
int |
del(EntityKey entityKey)
Remove the EntityKey from the filter. |
int |
flush()
Send to the server any buffered filter action. |
int |
reset()
Remove all the key values from the filter. |
Methods inherited from interface Filter |
---|
create, destroy, set |
Methods inherited from interface ActivityLifeCycle |
---|
getConnection |
Methods inherited from interface CommunicationLifeCycle |
---|
getContext, getListener, getParam |
Methods inherited from interface LifeCycle |
---|
enumChilds, getStatus, release |
Field Detail |
---|
static final int TYPE_ENTITYFILTER
Method Detail |
---|
int add(EntityKey entityKey)
entityKey
- the partial or full EntityKey.
RESULT_OK
if the operation completed
successfully,
RESULT_INVALID_STATUS
if the
current status is not Filter.STATUS_CREATED
,
RESULT_INVALID_CONNECTION_STATUS
if the associated Connection
current status is not
Connection.STATUS_CONNECTED
,
RESULT_GENERIC_ERROR
otherwise.
int del(EntityKey entityKey)
entityKey
- the partial or full EntityKey.
RESULT_OK
if the operation completed
successfully,
RESULT_INVALID_STATUS
if the
current status is not Filter.STATUS_CREATED
,
RESULT_INVALID_CONNECTION_STATUS
if the associated Connection
current status is not
Connection.STATUS_CONNECTED
,
RESULT_GENERIC_ERROR
otherwise.
int reset()
RESULT_OK
if the operation completed
successfully,
RESULT_INVALID_STATUS
if the
current status is not Filter.STATUS_CREATED
,
RESULT_INVALID_CONNECTION_STATUS
if the associated Connection
current status is not
Connection.STATUS_CONNECTED
,
RESULT_GENERIC_ERROR
otherwise.
int flush()
RESULT_OK
if the operation completed
successfully,
RESULT_INVALID_STATUS
if the
current status is not Filter.STATUS_CREATED
,
RESULT_INVALID_CONNECTION_STATUS
if the associated Connection
current status is not
Connection.STATUS_CONNECTED
,
RESULT_GENERIC_ERROR
otherwise.