Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fxcm.messaging
Class ConnectionManagerEx

    java.lang.Object
      com.fxcm.messaging.ConnectionManagerEx

    public class ConnectionManagerEx

extends Object

ConnectionManagerEx class is a client side singleton manager for communication sessions. It supports multiple sessions within the same client side JVM space.

Constructor Summary
`ConnectionManagerEx()`

Method Summary
`static void` | `cleanup()` Cleans up Communication Manager.
`static void` | `cleanup(IUserSession aUserSession)` close and remove from session list
`static IUserSession` | `createUserSession(String aHostDescriptorURL, String aHostName, String aLoginID, String aPassword, String aStationName)` Creates a new empty user session with remote service with host descriptior only.
`static IUserSession` | `createUserSession(String aHostDescriptorURL, String aHostName, String aServiceName, String aLoginID, String aPassword, String aStationName)` Creates a new empty user session with remote service by its name and host descriptior.
`static IUserSession` | `createUserSession(String aHostDescriptorURL, String aHostName, String aServiceName, String aLoginID, String aPassword, String aStationName, com.fxcm.messaging.util.IConnectionManager aConnectionManager)` Creates a new empty user session with remote service by its name and host descriptior.
`static IMessageFactory` | `getMessageFactory()` Obtains instance of message factory
`static IUserSession` | `getUserSession(String aSessionID)` Obtains User Session by its ID
`static Enumeration` | `getUserSessions(String aSessionID)` Obtains all User Sessions with the same ID
`static String` | `getVersion()` Obtains vesrion number of SDK.
`static void` | `init(Properties aProps)` Initializes based on properties bundle.
`static void` | `init(String aProperitesFileName)` Initialzes based on the properties file name.
`static void` | `setAsync(boolean aFlag)` Specifies whether async mode of TCP/IP.
`static void` | `setBasicProxyAuthorization(String aUserID, String aPassword)` Specifies user id and password to be used by a proxy server for basic authorization.
`static void` | `setBatchSize(int aNumberOfMessagesInBatch)` Sets maximum number of messages allowed in one retrieval batch.
`static void` | `setDebug(boolean aFlag)` Deprecated. Do not use setDebug anymore. Use commons logging instead. setDebug is EMPTY!
`static void` | `setHttpTimeout(int aTimeout)` Specifies timeout fot HTTP based sessions.
`static void` | `setInterval(long aMilliSec)` Sets poll interval for automatic data retrieval in milliseconds.
`static void` | `setListenAdminMessages(boolean aFlag)` Specifies Message Listener mode.
`static void` | `setMsgFlags(long aMsgFlags)` Sets the message flags
`static void` | `setNoReconnectAttempts(int aAttempts)` Sets number of attempts to restore a session.
`static void` | `setNoReloginAttempts(int aAttempts)` Sets number of attempts to restore a connection / relogin.
`static void` | `setProxyAuthenticationRealm(String aProxyAuthenticationRealm)` Sets proxy authentication real
`static void` | `setProxyOverHTTP11(boolean aFlag)` Forcing usage of HTTP 1.1 protocol.
`static void` | `setProxyServer(String aAddress, int aPort)` Specifies how to connect to the remote server through a proxy server.
`static void` | `setProxyType(String aProxyType)` Sets the type of the proxy being used for the HTTP
`static void` | `setReconnectTimeout(int aTimeout)` Sets timeout between attempts of session restoring.
`static void` | `setReloginTimeout(int aTimeout)` Sets timeout between attempts of relogin.
`static void` | `setSecurePreferable(boolean aFlag)` Specifies whether secure connection is preferable.
`static void` | `setTcpTimeout(int aTimeout)` Specifies timeout fot TCP/IP based sessions.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConnectionManagerEx

    public ConnectionManagerEx()

Method Detail

### init

    public static void init(String aProperitesFileName)

  Initialzes based on the properties file name.

  See `init(Properties)` for list of property names.

  Parameters:
    `aProperitesFileName` - name of properties file

### init

    public static void init(Properties aProps)

  Initializes based on properties bundle.

  Registered properties names:
  - com.fxcm.messaging.IConnectionManager.NoReloginAttempts Number of attempts to restore a connection ( via relogin).
  - com.fxcm.messaging.IConnectionManager.ReloginTimeout Timeout between attempts of relogin in ms.
  - com.fxcm.messaging.IConnectionManager.NoReconnectAttempts Number of attempts to restore a session.
  - com.fxcm.messaging.IConnectionManager.ReconnectTimeout Timeout between attempts of session restoring in ms.
  - com.fxcm.messaging.IConnectionManager.BatchSize Maximum number of messages allowed in one retrieval batch.
  - com.fxcm.messaging.IConnectionManager.PollInterval Interval between of data retrieval in ms.
  - com.fxcm.messaging.IConnectionManager.ProxyServer Remote proxy server name or IP address.
  - com.fxcm.messaging.IConnectionManager.ProxyPort Remote proxy server IP port.
  - com.fxcm.messaging.IConnectionManager.ProxyUserID Remote proxy server login ID.
  - com.fxcm.messaging.IConnectionManager.ProxyPassword Remote proxy server login password.
  - com.fxcm.messaging.IConnectionManager.ProxyRealm Remote proxy server realm name.
  - com.fxcm.messaging.IConnectionManager.ProxyType Remote proxy server type.
  - com.fxcm.messaging.IConnectionManager.ProxyHTTP11 Forces to use HTTP 1.1 for thru proxy communications.
  - com.fxcm.messaging.IConnectionManager.TcpTimeout TCP timeout in ms.
  - com.fxcm.messaging.IConnectionManager.HttpTimeout HTTP timeout in ms.
  - com.fxcm.messaging.IConnectionManager.AdminMessages Forces to pass administrative messages onto User Session listeners.
  - com.fxcm.messaging.IConnectionManager.LogLevel Log Level (0 for silent mode and 4 - to enable debug logs.
  - com.fxcm.messaging.IConnectionManager.LogFile Log file name, reserved for future implementations.
  - com.fxcm.messaging.IConnectionManager.SecurePreferable Forces to use secure connections.
  - com.fxcm.messaging.IConnectionManager.AsyncPreferable Forces to use asynchronous connections.
  - com.fxcm.messaging.IConnectionManager.MessageFlags Set of message flags. See `IFixDefs.CHANNEL_*` for possible values.
  - com.fxcm.messaging.IConnectionManager.SyncRequestTimeout Timeout of processing of synchronous requests in ms.
  - com.fxcm.messaging.IConnectionManager.AppInfoApplication Name

  Parameters:
    `aProps` - a properties bundle

### getVersion

    public static String getVersion()

  Obtains vesrion number of SDK.

  Returns:
    major.minor.build string

### setNoReloginAttempts

    public static void setNoReloginAttempts(int aAttempts)

  Sets number of attempts to restore a connection / relogin.

  Parameters:
    `aAttempts` - should be more then 0, deafult 3

### setReloginTimeout

    public static void setReloginTimeout(int aTimeout)

  Sets timeout between attempts of relogin.

  Parameters:
    `aTimeout` - timeout in ms, mininum 3000, deafult 20000

### setNoReconnectAttempts

    public static void setNoReconnectAttempts(int aAttempts)

  Sets number of attempts to restore a session.

  Parameters:
    `aAttempts` - should be more then 0, deafult 3

### setReconnectTimeout

    public static void setReconnectTimeout(int aTimeout)

  Sets timeout between attempts of session restoring.

  Parameters:
    `aTimeout` - timeout in ms, mininum 500, deafult 2000

### setInterval

    public static void setInterval(long aMilliSec)

  Sets poll interval for automatic data retrieval in milliseconds.

  Parameters:
    `aMilliSec` - new value of polling interval, minimum 2000, default 2000

### setBatchSize

    public static void setBatchSize(int aNumberOfMessagesInBatch)

  Sets maximum number of messages allowed in one retrieval batch.

  Parameters:
    `aNumberOfMessagesInBatch` - number of messages allowed in one batch, minimum 1, default 20

### setProxyServer

    public static void setProxyServer(String aAddress,
                                      int aPort)

  Specifies how to connect to the remote server through a proxy server. Note:This setting has effect for HTTP protocol only.

  Parameters:
    `aAddress` - an address of the proxy server.
    `aPort` - a port of the proxy server.

### setBasicProxyAuthorization

    public static void setBasicProxyAuthorization(String aUserID,
                                                  String aPassword)

  Specifies user id and password to be used by a proxy server for basic authorization.

  Parameters:
    `aUserID` - an user id.
    `aPassword` - an user password.

### setProxyAuthenticationRealm

    public static void setProxyAuthenticationRealm(String aProxyAuthenticationRealm)

  Sets proxy authentication real

  Parameters:
    `aProxyAuthenticationRealm` - Proxy Autentication Realm

### setProxyType

    public static void setProxyType(String aProxyType)

  Sets the type of the proxy being used for the HTTP

  Parameters:
    `aProxyType` - Proxy Type

### setProxyOverHTTP11

    public static void setProxyOverHTTP11(boolean aFlag)

  Forcing usage of HTTP 1.1 protocol.

  Parameters:
    `aFlag` - `true` enables HTTP 1.1 proxy tunneling

### setTcpTimeout

    public static void setTcpTimeout(int aTimeout)

  Specifies timeout fot TCP/IP based sessions.

  Parameters:
    `aTimeout` - timeout to setup, more then 0, 0 means default (180000 ms)

### setHttpTimeout

    public static void setHttpTimeout(int aTimeout)

  Specifies timeout fot HTTP based sessions.

  Parameters:
    `aTimeout` - timeout to setup, more then 0, 0 means default (180000 ms)

### setListenAdminMessages

    public static void setListenAdminMessages(boolean aFlag)

  Specifies Message Listener mode.

  Parameters:
    `aFlag` - defines whether message listener is able to process admin messages or not

### setSecurePreferable

    public static void setSecurePreferable(boolean aFlag)

  Specifies whether secure connection is preferable.

  Parameters:
    `aFlag` - secure flag to setup

### setAsync

    public static void setAsync(boolean aFlag)

  Specifies whether async mode of TCP/IP.

  Parameters:
    `aFlag` - async flag to setup

### setMsgFlags

    public static void setMsgFlags(long aMsgFlags)

  Sets the message flags

  Parameters:
    `aMsgFlags` - See `IFixDefs.CHANNEL_*` for possible values.

### getMessageFactory

    public static IMessageFactory getMessageFactory()

  Obtains instance of message factory

  Returns:
    singleton instance

### createUserSession

    public static IUserSession createUserSession(String aHostDescriptorURL,
                                                 String aHostName,
                                                 String aServiceName,
                                                 String aLoginID,
                                                 String aPassword,
                                                 String aStationName)

  Creates a new empty user session with remote service by its name and host descriptior.

  Parameters:
    `aHostDescriptorURL` - url of remote configuration (xml) file
    `aHostName` - name of the host defined in server configuration file.
    `aServiceName` - name of application service "PriceServer" or "NewsServer"
    `aLoginID` - an user id
    `aPassword` - an user password
    `aStationName` - end user station(application) name
  Returns:
    user session (not connected)

### createUserSession

    public static IUserSession createUserSession(String aHostDescriptorURL,
                                                 String aHostName,
                                                 String aServiceName,
                                                 String aLoginID,
                                                 String aPassword,
                                                 String aStationName,
                                                 com.fxcm.messaging.util.IConnectionManager aConnectionManager)

  Creates a new empty user session with remote service by its name and host descriptior.

  Parameters:
    `aHostDescriptorURL` -
    `aHostName` -
    `aServiceName` -
    `aLoginID` -
    `aPassword` -
    `aStationName` -
    `aConnectionManager` -
  Returns:
    user session (not connected)

### createUserSession

    public static IUserSession createUserSession(String aHostDescriptorURL,
                                                 String aHostName,
                                                 String aLoginID,
                                                 String aPassword,
                                                 String aStationName)

  Creates a new empty user session with remote service with host descriptior only.

  Simple uses `aServiceName = aHostName`

  Parameters:
    `aHostDescriptorURL` - url of remote configuration (xml) file
    `aHostName` - name of the host defined in server configuration file.
    `aLoginID` - an user id
    `aPassword` - an user password
    `aStationName` - end user station(application) name
  Returns:
    user session

### getUserSession

    public static IUserSession getUserSession(String aSessionID)

  Obtains User Session by its ID

  Parameters:
    `aSessionID` - session ID
  Returns:
    User session object or `null` if session is not found

### getUserSessions

    public static Enumeration getUserSessions(String aSessionID)

  Obtains all User Sessions with the same ID

  Parameters:
    `aSessionID` - session ID
  Returns:
    User session Enumeration. It can be empty

### cleanup

    public static void cleanup()

  Cleans up Communication Manager.

  Drops all active sessions and closes all communication channels and reset static variables

### cleanup

    public static void cleanup(IUserSession aUserSession)

  close and remove from session list

  Parameters:
    `aUserSession` -

### setDebug

    public static void setDebug(boolean aFlag)

  Deprecated. Do not use setDebug anymore. Use commons logging instead. setDebug is EMPTY!

  Turns on/off debug mode.

  Parameters:
    `aFlag` - debug flag

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 FXCM, LLC. All Rights Reserved.