|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.qtp.ChannelShaper
public class ChannelShaper
This class represents configuration of a single data channel within AgentAdapter
.
It includes collector, subscription filter, data filter, relative weight and aggregation period.
Each channel may specify executor to be used for subscription processing (i.e. filtering) -
it is required when subscription filtering is a heavy operation (e.g. requires database access).
Channel may change its parameters except for subscription executor to new values anytime.
The changes of data filter, weight or aggregation period are immediately effective
and do not require re-creation of agent (i.e. no interruption of data stream happens).
The changes of collector or subscription filter require re-creation of agent which
result with brief data stream interruption. The re-creation of agent will happen
upon data or subscription message processing; it can be forced via invocation of
AgentAdapter.updateChannel(com.devexperts.qd.qtp.ChannelShaper)
method.
Constructor Summary | |
---|---|
ChannelShaper(java.util.concurrent.Executor subscriptionExecutor,
QDCollector collector,
SubscriptionFilter subscriptionFilter,
RecordFilter dataFilter)
Creates new channel shaper with specified parameters. |
|
ChannelShaper(QDCollector collector,
SubscriptionFilter subscriptionFilter)
Creates new channel shaper with specified collector and filter. |
|
ChannelShaper(QDContract contract,
java.util.concurrent.Executor subscriptionExecutor)
Creates new channel shaper with specified contract and subscription executor. |
Method Summary | |
---|---|
long |
getAggregationPeriod()
Returns aggregation period in milliseconds for this channel data. |
QDCollector |
getCollector()
Returns collector currently used by the channel. |
QDContract |
getContract()
Returns contract of the channel. |
RecordFilter |
getDataFilter()
Returns data filter currently used by the channel. |
java.util.concurrent.Executor |
getSubscriptionExecutor()
Returns executor for subscription processing used by the channel or null if none specified. |
SubscriptionFilter |
getSubscriptionFilter()
Returns subscription filter currently used by the channel. |
int |
getWeight()
Returns relative weight of this channel data within the adapter for shaping. |
void |
setAggregationPeriod(long aggregationPeriod)
Sets aggregation period for this channel data. |
void |
setCollector(QDCollector collector)
Sets collector for the channel. |
void |
setDataFilter(RecordFilter dataFilter)
Sets data filter for the channel. |
void |
setSubscriptionFilter(SubscriptionFilter subscriptionFilter)
Sets subscription filter for the channel. |
void |
setWeight(int weight)
Sets relative weight of this channel data within the adapter for shaping. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChannelShaper(QDContract contract, java.util.concurrent.Executor subscriptionExecutor)
contract
- channel contract; may not be null
subscriptionExecutor
- subscription executor; may be null
java.lang.NullPointerException
- if contract
is null
public ChannelShaper(QDCollector collector, SubscriptionFilter subscriptionFilter)
collector
- channel collector; may not be null
subscriptionFilter
- subscription filter; may be null
java.lang.NullPointerException
- if collector
is null
public ChannelShaper(java.util.concurrent.Executor subscriptionExecutor, QDCollector collector, SubscriptionFilter subscriptionFilter, RecordFilter dataFilter)
null
.
subscriptionExecutor
- subscription executor; may be null
collector
- channel collector; may not be null
subscriptionFilter
- subscription filter; may be null
dataFilter
- data filter; may be null
java.lang.NullPointerException
- if collector
is null
Method Detail |
---|
public QDContract getContract()
public java.util.concurrent.Executor getSubscriptionExecutor()
null
if none specified.
null
public final QDCollector getCollector()
null
public void setCollector(QDCollector collector)
null
in which case no agent will be created for the channel.
Change of collector will trigger re-creation of agent.
collector
- channel collector; may be null
public final SubscriptionFilter getSubscriptionFilter()
null
public void setSubscriptionFilter(SubscriptionFilter subscriptionFilter)
null
in which case all subscription will be accepted.
Change of subscription filter will trigger re-creation of agent.
subscriptionFilter
- subscription filter; may be null
public RecordFilter getDataFilter()
null
public void setDataFilter(RecordFilter dataFilter)
null
in which case all data will be accepted.
Change of data filter is immediate and will not trigger re-creation of agent.
dataFilter
- data filter; may be null
public int getWeight()
public void setWeight(int weight)
weight
- relative weight
java.lang.IllegalArgumentException
- if weight is less than 1 or greater than 100.public long getAggregationPeriod()
public void setAggregationPeriod(long aggregationPeriod)
aggregationPeriod
- in milliseconds
java.lang.IllegalArgumentException
- if aggregation period is negative or greater than 24 hours.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |