|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.qtp.AbstractMessageConnector
com.devexperts.qd.qtp.file.FileConnector
@MessageConnectorSummary(info="Connects to a file.", addressFormat="file:", properties={"format -- file format (one of \"binary\", \"text\" or \"blob: public class FileConnector: \")","ignoretime -- ignore \".time\" files even if they present","start -- time to start playing from (if \".time\" file exists)","stop -- time to stop playing","delayed -- delay relatively to current time (basically same as \"start=- \")","cycle -- cycle playback","readAs -- overrides the type of read messages (one of \"ticker_data\", \"stream_data\", \"history_data\", or \"raw_data\", works for binary tape files only)"})
Reads messages from a specified URL or file. By default when reading from some file ".time" file with corresponding name is also read and the messages times are taken from it to mimic delays of original messages. If there is no ".time" file found then all messages are given out at once. It is possible to ignore ".time" files by using boolean option "ignoretime".
Field Summary |
---|
Fields inherited from class com.devexperts.qd.qtp.AbstractMessageConnector |
---|
DEFAULT_READ_AGGREGATION_SIZE, DEFAULT_RECONNECT_DELAY, log |
Constructor Summary | |
---|---|
FileConnector(com.devexperts.connector.proto.ApplicationConnectionFactory factory,
java.lang.String address)
Creates new file connector. |
|
FileConnector(MessageAdapter.Factory factory,
java.lang.String address)
Deprecated. use FileConnector(com.devexperts.connector.proto.ApplicationConnectionFactory , String) |
Method Summary | |
---|---|
java.lang.String |
getAddress()
Returns address string of this connector. |
int |
getConnectionCount()
Returns number of established connections. |
long |
getDelayActual()
|
TimePeriod |
getDelayed()
|
long |
getDelayTime()
|
com.devexperts.transport.stats.EndpointStats |
getEndpointStats()
Returns statistics for this message connector. |
FileFormat |
getFormat()
|
MessageType |
getReadAs()
|
java.util.Date |
getStart()
|
MessageConnectorState |
getState()
Returns message connector state. |
java.util.Date |
getStop()
|
TimestampsType |
getTime()
|
boolean |
isActive()
Returns true if connector is started (not stopped). |
boolean |
isCycle()
|
boolean |
isIgnoreTime()
|
void |
setAddress(java.lang.String address)
|
void |
setCycle(boolean cycle)
|
void |
setDelayed(TimePeriod delay)
|
void |
setFormat(FileFormat format)
|
void |
setIgnoreTime(boolean ignore)
|
void |
setReadAs(MessageType readAs)
|
void |
setStart(java.util.Date time)
|
void |
setStop(java.util.Date time)
|
void |
setTime(TimestampsType time)
|
void |
start()
Starts connector (connection is immediately established). |
void |
stop()
Stops connector (connection is immediately dropped). |
Methods inherited from class com.devexperts.qd.qtp.AbstractMessageConnector |
---|
addClosedConnectionStats, addMessageConnectorListener, getFactory, getLogging, getName, getReconnectDelay, getStats, getThreadPriority, notifyMessageConnectorListeners, reconfigure, removeMessageConnectorListener, restart, setName, setReconnectDelay, setStats, setThreadPriority, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.devexperts.qd.qtp.MessageConnectorMBean |
---|
getName, getReconnectDelay, getThreadPriority, restart, setName, setReconnectDelay, setThreadPriority |
Constructor Detail |
---|
@Deprecated public FileConnector(MessageAdapter.Factory factory, java.lang.String address)
FileConnector(com.devexperts.connector.proto.ApplicationConnectionFactory , String)
factory
- message adapter factory to useaddress
- address of file to use
java.lang.NullPointerException
- if factory
or address
is null
public FileConnector(com.devexperts.connector.proto.ApplicationConnectionFactory factory, java.lang.String address)
factory
- application connection factory to useaddress
- address of file to use
java.lang.NullPointerException
- if factory
or address
is null
Method Detail |
---|
public void start()
MessageConnectorMBean
start
in interface MessageConnectorMBean
start
in class AbstractMessageConnector
public void stop()
MessageConnectorMBean
stop
in interface MessageConnectorMBean
stop
in class AbstractMessageConnector
public java.lang.String getAddress()
MessageConnectorMBean
getAddress
in interface MessageConnectorMBean
public void setAddress(java.lang.String address)
setAddress
in interface FileConnectorMBean
public FileFormat getFormat()
getFormat
in interface FileConnectorMBean
public void setFormat(FileFormat format)
setFormat
in interface FileConnectorMBean
public boolean isActive()
MessageConnectorMBean
isActive
in interface MessageConnectorMBean
public MessageConnectorState getState()
MessageConnectorMBean
getState
in interface MessageConnectorMBean
public int getConnectionCount()
MessageConnectorMBean
getConnectionCount
in interface MessageConnectorMBean
public com.devexperts.transport.stats.EndpointStats getEndpointStats()
MessageConnectorMBean
getEndpointStats
in interface MessageConnectorMBean
getEndpointStats
in class AbstractMessageConnector
public java.util.Date getStart()
getStart
in interface FileConnectorMBean
public void setStart(java.util.Date time)
setStart
in interface FileConnectorMBean
public java.util.Date getStop()
getStop
in interface FileConnectorMBean
public void setStop(java.util.Date time)
setStop
in interface FileConnectorMBean
public long getDelayTime()
@Monitored(name="delayed", description="Configured delaying time period") public TimePeriod getDelayed()
getDelayed
in interface FileConnectorMBean
public void setDelayed(TimePeriod delay)
setDelayed
in interface FileConnectorMBean
public TimestampsType getTime()
public void setTime(TimestampsType time)
public boolean isIgnoreTime()
isIgnoreTime
in interface FileConnectorMBean
public void setIgnoreTime(boolean ignore)
setIgnoreTime
in interface FileConnectorMBean
public boolean isCycle()
isCycle
in interface FileConnectorMBean
public void setCycle(boolean cycle)
setCycle
in interface FileConnectorMBean
public MessageType getReadAs()
getReadAs
in interface FileConnectorMBean
public void setReadAs(MessageType readAs)
setReadAs
in interface FileConnectorMBean
@Monitored(name="delay_actual", description="Actual delay in ms or delay time if not connected yet") public long getDelayActual()
getDelayActual
in interface FileConnectorMBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |