|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bloomberglp.blpapi.SessionOptions
public final class SessionOptions
To use non-default options on a Session, create a SessionOptions instance and set the required options and then supply it when creating a Session.
Currently the following options are supported
serverHost - The hostname or the ip address of the API server serverPort - The port number where the API server accepts connections maxSendCacheSize - Maximum number of bytes that will be cached by the Session before requests will fail maxEventQueueSize - The maximum number of events that can be buffered by the Session. The value of maxEventQueueSize must be greater than zero. maxPendingRequests - The maximum number of requests that can be pending allowMultipeCorrelatorsPerMsg - If a message is to be delivered for multiple correlators then deliver one message with all correlators folded into that one message slowConsumerWarningHiWaterMark - Set the fraction of 'maxEventQueueSize' at which "slow consumer" events will be generated. A warning event will be generated when the number of outstanding undelivered events passes above 'slowConsumerWarningHiWaterMark * maxEventQueueSize'. The following is applicable 0.0 < slowConsumerWarningHiWaterMark <= 1.0. Further, at the time that Session.start() is called, it must be the case that slowConsumerWarningLoWaterMark * maxEventQueueSize < slowConsumerWarningHiWaterMark * maxEventQueueSize. slowConsumerWarningLoWaterMark - Set the fraction of 'maxEventQueueSize' at which "slow consumer cleared" events will be generated. A warning cleared event will be generated when the number of outstanding undelivered events drops below 'slowConsumerWarningLoWaterMark * maxEventQueueSize'. The following is applicable 0.0 <= slowConsumerWarningLoWaterMark < 1.0. Further, at the time that Session.start() is called, it must be the case that slowConsumerWarningLoWaterMark * maxEventQueueSize < slowConsumerWarningHiWaterMark * maxEventQueueSize. defaultSubscriptionService - The name of the service to be used by default for subscriptions defaultTopicPrefix - The name of the topic prefix to be used for subscriptions if one is not provided clientMode - seeSessionOptions.ClientMode
serverAddresses - List of server addresses (hostname and port) where the API servers are running. autoRestartOnDisconnection - On disconnection from the back end should the session connect again to the next available API server numStartAttempts - The number of connection failures before session gives give up on connection connectTimeout - Timeout in milliseconds for session to establish a connection defaultKeepAliveInactivityTime - Amount of time in milliseconds without any read activity on the connection before the library will ping the peer (requires compatible server). defaultKeepAliveResponseTimeout - Timeout for the ping response in milliseconds. The peer will be declared "dead" if no ping response (or other data) is received within response timeout interval after the ping (requires compatible server). keepAliveEnabled - Whether all keep-alive mechanisms, both from the client to the server and from the server to the client, should be enabled. recordSubscriptionDataReceiveTimes - Should the receipt time (accessed viaMessage.timeReceivedMillis()
) be recorded for subscription data messages.
Nested Class Summary | |
---|---|
static class |
SessionOptions.ClientMode
Enumerations describing client mode of Session |
static class |
SessionOptions.ServerAddress
|
Constructor Summary | |
---|---|
SessionOptions()
Construct a SessionOption with well defined defaults for various options Currently the following defaults are applied |
Method Summary | |
---|---|
java.lang.String |
authenticationOptions()
Returns authentication options as a string. |
boolean |
getAllowMultipleCorrelatorsPerMsg()
Returns the value of the allow multiple correlators per message option in this instance. |
boolean |
getAutoRestartOnDisconnection()
Returns if enabled to automatically restart connection on disconnection. |
SessionOptions.ClientMode |
getClientMode()
Returns the value of the client mode option in this instance. |
int |
getConnectTimeout()
Returns the value of the connection timeout option in this instance in milliseconds. |
int |
getDefaultKeepAliveInactivityTime()
Returns the interval (in milliseconds) a connection has to remain inactive (receive no data) before a keep alive probe will be sent. |
int |
getDefaultKeepAliveResponseTimeout()
Returns the time (in milliseconds) the library will wait for response to a keep alive probe before declaring it lost. |
java.lang.String[] |
getDefaultServices()
Deprecated. as of 3.7.0, use getDefaultSubscriptionService()
instead |
java.lang.String |
getDefaultSubscriptionService()
Returns the default subscription service option. |
java.lang.String |
getDefaultTopicPrefix()
Returns the default topic prefix option. |
int |
getMaxEventQueueSize()
Returns the value of maximum outstanding undelivered events that the session is configured with. |
int |
getMaxOutstandingRequests()
Returns the value of maximum outstanding requests that the session is configured with. |
int |
getMaxPendingRequests()
Returns the value of the maximum pending request option in this instance. |
int |
getMaxSendCacheSize()
|
boolean |
getRecordSubscriptionDataReceiveTimes()
Returns if the receipt time (accessed via Message.timeReceivedMillis() ) should be recorded for
subscription data messages. |
SessionOptions.ServerAddress[] |
getServerAddresses()
Returns the list of server addresses that this session is configured to connect to. |
java.lang.String |
getServerHost()
Returns the value of the server host option in this instance. |
int |
getServerPort()
Returns the server port that this session connects to. |
float |
getSlowConsumerWarningHiWaterMark()
Returns the fraction of maxEventQueueSize at which "slow consumer" event will be generated. |
float |
getSlowConsumerWarningLoWaterMark()
Returns the fraction of maxEventQueueSize at which "slow consumer cleared" event will be generated. |
int |
numStartAttempts()
Return the maximum number of attempts to retry establishing each connection (so that at least one connection has been established) when starting the session. |
void |
setAllowMultipleCorrelatorsPerMsg(boolean allowMultipleCorrelatorsPerMsg)
Sets whether the Session is allowed to associate more than one CorrelationId with a Message to the specified 'allowMultipleCorrelatorsPerMsg'. |
void |
setAuthenticationOptions(java.lang.String authOptions)
Sets the specified 'authOptions' as authentication option. |
void |
setAutoRestartOnDisconnection(boolean autoRestartOnDisconnection)
Sets option of automatically restarting connection if disconnected. |
void |
setClientMode(SessionOptions.ClientMode clientMode)
Sets how to connect to the API. |
void |
setConnectTimeout(int timeoutMilliSeconds)
Sets the connection timeout in milliseconds when connecting to the API. |
void |
setDefaultKeepAliveInactivityTime(int inactivityMsecs)
Sets to the specified 'inactivityMsecs' the amount of time in milli-seconds that no traffic can be received on a connection before the ping-based keep-alive mechanism is triggered; if no traffic is received for this duration then a keep-alive ping is sent to the remote end to solicit a response. |
void |
setDefaultKeepAliveResponseTimeout(int timeoutMsecs)
Sets the default keep live response timeout interval in milliseconds. |
void |
setDefaultSubscriptionService(java.lang.String defaultSubscriptionService)
Sets the default service for subscriptions which do not specify a subscription server to the specified 'serviceIdentifier'. |
void |
setDefaultTopicPrefix(java.lang.String defaultTopicPrefix)
Sets the default topic prefix to be used when a subscription does not specify a prefix to the specified 'prefix'. |
void |
setKeepAliveEnabled(boolean isEnabled)
|
void |
setMaxEventQueueSize(int eventQueueSize)
Sets the maximum number of outstanding un-delivered events per session to the specified 'eventQueueSize'. |
void |
setMaxPendingRequests(int pendingRequests)
Sets the maximum number of requests which can be pending (submitted but have not received a final response (e.g Event.EventType.RESPONSE
) to the specified 'maxPendingRequests'. |
void |
setMaxSendCacheSize(int writeCacheSize)
|
void |
setNumStartAttempts(int numStartAttempts)
Sets the maximum number of attempts to start a session by connecting a server. |
void |
setRecordSubscriptionDataReceiveTimes(boolean shouldRecord)
Sets if the receipt time (accessed via Message.timeReceivedMillis() ) should be recorded for
subscription data messages. |
void |
setServerAddresses(SessionOptions.ServerAddress[] serverAddresses)
Sets the list of server address to the specified 'serverAddresses'. |
void |
setServerHost(java.lang.String serverHost)
Sets the API server host to connect to. |
void |
setServerPort(int serverPort)
Set the port to connect to the specified 'port'. |
void |
setSlowConsumerWarningHiWaterMark(float slowConsumerWarningHiWaterMark)
Sets the point at which "slow consumer" events will be generated, using the specified 'highWaterMark' as a fraction of 'maxEventQueueSize'; the default value is 0.75. |
void |
setSlowConsumerWarningLoWaterMark(float slowConsumerWarningLoWaterMark)
Sets the point at which "slow consumer cleared" events will be generated, using the specified 'loWaterMark' as a fraction of 'maxEventQueueSize'; the default value is 0.5. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionOptions()
serverHost = "127.0.0.1"
serverPort = 8194
maxSendCacheSize = 128MB
maxEventQueueSize =
maxPendingRequests = 1024
allowMultipeCorrelatorsPerMsg = false
slowConsumerWarningHiWaterMark = 0.75
slowConsumerWarningLoWaterMark = 0.50
defaultSubscriptionService = "//blp/mktdata"
defaultTopicPrefix = "/ticker/"
clientMode = SessionOptions.ClientMode.AUTO
keepAliveEnabled = true
Method Detail |
---|
public int getMaxEventQueueSize()
public int getMaxOutstandingRequests()
public int getMaxPendingRequests()
public java.lang.String getServerHost()
public int getServerPort()
public SessionOptions.ServerAddress[] getServerAddresses()
public boolean getAutoRestartOnDisconnection()
true
if configured to restart connection on
disconnection and false
otherwise.public java.lang.String authenticationOptions()
public int numStartAttempts()
public int getMaxSendCacheSize()
public boolean getAllowMultipleCorrelatorsPerMsg()
public float getSlowConsumerWarningHiWaterMark()
public float getSlowConsumerWarningLoWaterMark()
public java.lang.String[] getDefaultServices()
getDefaultSubscriptionService()
instead
public java.lang.String getDefaultSubscriptionService()
SubscriptionList
for more information.
public java.lang.String getDefaultTopicPrefix()
SubscriptionList
for more information.
public SessionOptions.ClientMode getClientMode()
public int getConnectTimeout()
public int getDefaultKeepAliveInactivityTime()
public int getDefaultKeepAliveResponseTimeout()
public boolean getRecordSubscriptionDataReceiveTimes()
Message.timeReceivedMillis()
) should be recorded for
subscription data messages.
public void setMaxEventQueueSize(int eventQueueSize)
eventQueueSize
- the value to be setpublic void setMaxPendingRequests(int pendingRequests)
Event.EventType.RESPONSE
) to the specified 'maxPendingRequests'. If the number of pending
requests exceeds the specified threshold, subsequent call to
Session.sendRequest(com.bloomberglp.blpapi.Request, com.bloomberglp.blpapi.CorrelationID)
will generate
RequestQueueOverflowException
.
The default is 1024.
pendingRequests
- the value to be setpublic void setServerHost(java.lang.String serverHost)
serverHost
- the value to be setpublic void setServerPort(int serverPort)
serverPort
- the value to be setpublic void setServerAddresses(SessionOptions.ServerAddress[] serverAddresses)
serverAddresses
- the value to be setpublic void setAutoRestartOnDisconnection(boolean autoRestartOnDisconnection)
autoRestartOnDisconnection
- the value to be setpublic void setAuthenticationOptions(java.lang.String authOptions)
authOptions
- the value to be setpublic void setMaxSendCacheSize(int writeCacheSize)
public void setAllowMultipleCorrelatorsPerMsg(boolean allowMultipleCorrelatorsPerMsg)
allowMultipleCorrelatorsPerMsg
- the value to be setpublic void setSlowConsumerWarningHiWaterMark(float slowConsumerWarningHiWaterMark)
slowConsumerWarningHiWaterMark
- the value to be setpublic void setSlowConsumerWarningLoWaterMark(float slowConsumerWarningLoWaterMark)
slowConsumerWarningLoWaterMark
- the value to be setpublic void setDefaultSubscriptionService(java.lang.String defaultSubscriptionService)
^//[-_.a-zA-Z0-9]+/[-_.a-zA-Z0-9]+$
.
The default is "//blp/mktdata".
For more information on when this will be used see 'QUALIFYING
SUBSCRIPTION STRINGS' section in SubscriptionList
.
defaultSubscriptionService
- the value to be setpublic void setDefaultTopicPrefix(java.lang.String defaultTopicPrefix)
SubscriptionList
.
defaultTopicPrefix
- the value to be setpublic void setClientMode(SessionOptions.ClientMode clientMode)
SessionOptions.ClientMode.AUTO
.
In SessionOptions.ClientMode.AUTO
mode will try to connect to the desktop API
but fall back to the server API if the desktop is not available.
SessionOptions.ClientMode.DAPI
always connects to the desktop API and will fail
if it is not available.
SessionOptions.ClientMode.SAPI
always connects to the server API and will fail
if it is not available.
clientMode
- the value to be setpublic void setConnectTimeout(int timeoutMilliSeconds)
timeoutMilliSeconds
- the value to be setpublic void setNumStartAttempts(int numStartAttempts)
numStartAttempts
- the value to be setpublic void setDefaultKeepAliveInactivityTime(int inactivityMsecs)
interval
- the value to be setpublic void setDefaultKeepAliveResponseTimeout(int timeoutMsecs)
timeout
- the value to be setpublic void setKeepAliveEnabled(boolean isEnabled)
public void setRecordSubscriptionDataReceiveTimes(boolean shouldRecord)
Message.timeReceivedMillis()
) should be recorded for
subscription data messages.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |