public class AgentAdapter extends MessageAdapter
AgentAdapter
adapts agent side of QD to message API.
The agent side of an QD is an aggregation of agents
for all its data sources.
Thus, the AgentAdapter
can be used to represent an outside data consumer
in the specific QD.
if you are a QD publisher - use this AdapterModifier and Type | Class and Description |
---|---|
static class |
AgentAdapter.Factory
The factory for agent side of an QD.
|
MessageAdapter.AbstractFactory, MessageAdapter.CloseListener, MessageAdapter.ConfigurableFactory
AUTHENTICATION_LOGIN_REQUIRED, closeListener, doNotCloseOnErrors, messageListener, remoteEndpointId, useDescribeProtocol
Constructor and Description |
---|
AgentAdapter(DataScheme scheme,
QDStats stats)
Creates new agent adapter for specified scheme and stats.
|
AgentAdapter(QDEndpoint endpoint,
QDTicker ticker,
QDStream stream,
QDHistory history,
SubscriptionFilter filter,
QDFilter stripe,
QDStats stats)
Creates new agent adapter for specified endpoints, ticker, stream, history, filter and stats.
|
AgentAdapter(QDEndpoint endpoint,
QDTicker ticker,
QDStream stream,
QDHistory history,
SubscriptionFilter filter,
QDStats stats)
Deprecated.
|
AgentAdapter(QDTicker ticker,
QDStream stream,
QDHistory history,
SubscriptionFilter filter,
QDStats stats)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeImpl() |
protected QDAgent |
createAgent(QDCollector collector,
SubscriptionFilter filter,
String keyProperties)
This method is used internally by agent adapter to create agent for the corresponding
collector, filter, and keyProperties when the corresponding subscription arrives for a first time.
|
protected QDAgent.Builder |
createAgentBuilder(QDCollector collector,
SubscriptionFilter filter,
String keyProperties) |
DataScheme |
getScheme() |
String |
getSymbol(char[] chars,
int offset,
int length)
Returns symbol used for specified characters or
null if not found. |
AgentAdapter |
initialize(ChannelShaper... shapers)
Initializes the adapter with specified channel shapers.
|
boolean |
isProtocolDescriptorCompatible(ProtocolDescriptor desc) |
long |
nextRetrieveTime(long currentTime)
Returns next time when
MessageAdapter.retrieveMessages(MessageVisitor) shall be called. |
void |
prepareProtocolDescriptor(ProtocolDescriptor desc)
Prepares outgoing protocol descriptor.
|
void |
processDescribeProtocol(ProtocolDescriptor desc,
boolean logDescriptor)
Process incoming protocol descriptor.
|
protected void |
processSubscription(SubscriptionIterator iterator,
MessageType message) |
void |
reinitConfiguration(com.devexperts.auth.AuthSession session)
Updates the adapter configuration.
|
protected boolean |
retrieveDataMessages(MessageVisitor visitor) |
boolean |
retrieveMessages(MessageVisitor visitor)
Retrieves accumulated message into specified message visitor.
|
boolean |
supportsMixedSubscription() |
String |
toString()
Returns description of this
MessageAdapter for management and logging purposes. |
void |
updateChannel(ChannelShaper shaper)
Deprecated.
No need to use this method. It does nothing. Channels are automatically update on change
of their parameters.
|
addMask, clearMessageMask, close, getCommonScheme, getConnectionVariables, getEndpoint, getFieldReplacer, getMessageMask, getRemoteEndpointId, getRemoteHostAddress, getRemoteOptSet, getStats, getStatus, handleCorruptedMessage, handleCorruptedStream, handleUnknownMessage, hasMessageMask, intersectStripes, isAlive, isClosed, isMarkedForImmediateRestart, markForImmediateRestart, notifyListener, prepareAuthenticateProtocolDescriptor, processDescribeProtocol, reportIgnoredMessage, retrieveDescribeProtocolMessage, retrieveMask, setAuthRealm, setCloseListener, setConnectionVariables, setLoginHandler, setMessageListener, setRemoteOptSet, start, start, startImpl, useDescribeProtocol
processData, processHeartbeat, processHistoryAddSubscription, processHistoryData, processHistoryRemoveSubscription, processOtherMessage, processOtherMessage, processRecordSource, processStreamAddSubscription, processStreamData, processStreamRemoveSubscription, processTickerAddSubscription, processTickerData, processTickerRemoveSubscription, processTimeProgressReport
protected QDFilter localStripe
public static final int MESSAGE_HEARTBEAT
public static final int MESSAGE_DESCRIBE_PROTOCOL
public static final int MESSAGE_DESCRIBE_RECORDS
public static final int MESSAGE_DESCRIBE_RESERVED
public static final int MESSAGE_PART
public static final int MESSAGE_RAW_DATA
public static final int MESSAGE_TICKER_DATA
public static final int MESSAGE_TICKER_ADD_SUBSCRIPTION
public static final int MESSAGE_TICKER_REMOVE_SUBSCRIPTION
public static final int MESSAGE_STREAM_DATA
public static final int MESSAGE_STREAM_ADD_SUBSCRIPTION
public static final int MESSAGE_STREAM_REMOVE_SUBSCRIPTION
public static final int MESSAGE_HISTORY_DATA
public static final int MESSAGE_HISTORY_ADD_SUBSCRIPTION
public static final int MESSAGE_HISTORY_REMOVE_SUBSCRIPTION
public static final int MESSAGE_RMI_ADVERTISE_SERVICES
public static final int MESSAGE_RMI_DESCRIBE_SUBJECT
public static final int MESSAGE_RMI_DESCRIBE_OPERATION
public static final int MESSAGE_RMI_REQUEST
public static final int MESSAGE_RMI_CANCEL
public static final int MESSAGE_RMI_RESULT
public static final int MESSAGE_RMI_ERROR
public static final int MESSAGE_RMI_RESPONSE
public static final int MAX_SUPPORTED_MESSAGE_TYPE
public static final int MESSAGE_TEXT_FORMAT
public static final int MESSAGE_ZIP_COMPRESSION
public static final int MESSAGE_GZIP_COMPRESSION
public AgentAdapter(QDEndpoint endpoint, QDTicker ticker, QDStream stream, QDHistory history, SubscriptionFilter filter, QDFilter stripe, QDStats stats)
null
.
The resulting adapter will be initiailized
.
It will use equal weight of 1 and no aggregation for all collectors.
@Deprecated public AgentAdapter(QDEndpoint endpoint, QDTicker ticker, QDStream stream, QDHistory history, SubscriptionFilter filter, QDStats stats)
@Deprecated public AgentAdapter(QDTicker ticker, QDStream stream, QDHistory history, SubscriptionFilter filter, QDStats stats)
null
.
The resulting adapter will be initiailized
.
It will use equal weight of 1 and no aggregation for all collectors.
public AgentAdapter(DataScheme scheme, QDStats stats)
Adapter created by this constructor must be initialized
with shapers before being used.
scheme
- data schemestats
- statspublic AgentAdapter initialize(ChannelShaper... shapers)
AgentAdapter(QDTicker, QDStream, QDHistory, SubscriptionFilter, QDStats)
constructor in which case
it ia already initialized).
All channels are bound to this agent and cannot be used in other agent.shapers
- shaping configuration for adapter channelsprotected QDAgent createAgent(QDCollector collector, SubscriptionFilter filter, String keyProperties)
this
adapter's lock.
This implementation returns collector.createAgent(filter, keyProperties)
.
This method may be overriden to create agent with other filter, otherwise customize the agent
that is being created, or to keep track of created agents.collector
- collector to create agent forfilter
- subscription filter for the agentkeyProperties
- key properties for statsprotected QDAgent.Builder createAgentBuilder(QDCollector collector, SubscriptionFilter filter, String keyProperties)
public String toString()
MessageAdapter
MessageAdapter
for management and logging purposes.toString
in class MessageAdapter
public DataScheme getScheme()
getScheme
in class MessageAdapter
public String getSymbol(char[] chars, int offset, int length)
MessageConsumerAdapter
null
if not found.getSymbol
in interface SymbolCodec.Resolver
getSymbol
in class MessageConsumerAdapter
public void updateChannel(ChannelShaper shaper)
public boolean supportsMixedSubscription()
supportsMixedSubscription
in class MessageAdapter
protected void processSubscription(SubscriptionIterator iterator, MessageType message)
processSubscription
in class MessageConsumerAdapter
protected void closeImpl()
closeImpl
in class MessageAdapter
public boolean retrieveMessages(MessageVisitor visitor)
MessageProvider
true
if some messages still remains in the provider
or false
if all accumulated messages were retrieved.retrieveMessages
in interface MessageProvider
retrieveMessages
in class MessageAdapter
public void prepareProtocolDescriptor(ProtocolDescriptor desc)
MessageAdapter
super.prepareProtocolDescriptor(desc)
.prepareProtocolDescriptor
in class MessageAdapter
desc
- outgoing protocol descriptorpublic void processDescribeProtocol(ProtocolDescriptor desc, boolean logDescriptor)
MessageAdapter
super.processDescribeProtocol(desc)
.processDescribeProtocol
in interface MessageConsumer
processDescribeProtocol
in class MessageAdapter
desc
- incoming protocol descriptorlogDescriptor
- when protocol description shall be logged.public boolean isProtocolDescriptorCompatible(ProtocolDescriptor desc)
isProtocolDescriptorCompatible
in class MessageAdapter
protected boolean retrieveDataMessages(MessageVisitor visitor)
public void reinitConfiguration(com.devexperts.auth.AuthSession session)
MessageAdapter
reinitConfiguration
in class MessageAdapter
session
- the unique session.public long nextRetrieveTime(long currentTime)
MessageAdapter
MessageAdapter.retrieveMessages(MessageVisitor)
shall be called.
This method is overridden when a message has to be generated at a certain time in the future.
For immediate message delivery use MessageAdapter.addMask(long)
, which
immediately calls MessageAdapter.notifyListener()
as needed.
This implementation returns Long.MAX_VALUE
.
nextRetrieveTime
in class MessageAdapter
currentTime
- the current value of System.currentTimeMillis()
MessageAdapter.retrieveMessages(MessageVisitor)
shall be called
even if the mask of messages for immediate delivery is empty.Copyright © 2002–2025 Devexperts LLC. All rights reserved.