public interface Context extends LifeCycle
Within the same JFT application several Contexts can be created and then used to interact with one or more FastTrack servers.
This interface contains methods to create CommunicationLifeCycle objects: i.e. Connections and their related ActivityLifeCycle objects:
Methods to create their parameters are provided as well.Please note that each Connection and its related ActivityLifeCycle objects are enforced to exist in the same Context: e.g. it's not possible to create a subscription in a Context that does not contains the associated Connection.
JFT.makeContext()
,
Acceptable
ValuesRESULT_GENERIC_ERROR, RESULT_INVALID_STATUS, RESULT_OK, STATUS_INIT, STATUS_RELEASED
Modifier and Type | Method and Description |
---|---|
EntityClass |
getEntityClass(int EntityClassID)
Returns the registered EntityClass corresponding to the given
EntityClassID, if registered in this context.
|
EntityClass |
getEntityClass(String EntityClassName)
Returns the registered EntityClass in this context corresponding to
the given EntityClass Name.
|
boolean |
isRegistered(int EntityClassID)
Returns the indication that a given EntityClass (identified by an
EntityClassID ) has been registered
in this context. |
Connection |
makeConnection(ConnectionParam param,
ConnectionListener listener)
Create and returns a new connection.
|
ConnectionParam |
makeConnectionParam()
Create and returns a new connection parameter container.
|
Mask |
makeEmptyMask(int entityClassID)
Create and returns a new empty mask for a given Entity Class registered in this context.
|
EntityClassQuery |
makeEntityClassQuery(Connection connection,
EntityClassQueryParam param,
EntityClassQueryListener listener) |
EntityClassQueryParam |
makeEntityClassQueryParam() |
Filter |
makeFilter(Connection connection,
FilterParam param,
FilterListener listener)
Create and returns a new filter.
|
FilterParam |
makeFilterParam()
Create and returns a new filter parameter container.
|
MulticastConnection |
makeMulticastConnection(MulticastConnectionParam param,
MulticastConnectionListener listener) |
MulticastConnectionParam |
makeMulticastConnectionParam() |
Query |
makeQuery(Connection connection,
QueryParam param,
QueryListener listener)
Create and returns a new query.
|
QueryParam |
makeQueryParam()
Create and returns a new query parameter container.
|
Subscription |
makeSubscription(Connection connection,
SubscriptionParam param,
SubscriptionListener listener)
Create and returns a new subscription.
|
SubscriptionParam |
makeSubscriptionParam()
Create and returns a new subscription parameter container.
|
Transaction |
makeTransaction(Connection connection,
TransactionParam param,
TransactionListener listener)
Create and returns a new transaction.
|
TransactionParam |
makeTransactionParam()
Create and returns a new transaction parameter container.
|
int |
register(EntityClass entityClass)
Like
JFT.register , this method registers another EntityClass at the Context level
that increases the number of the classes managed by the library. |
int |
register(EntityClass[] entityClass)
Like
register(it.list.jft.EntityClass) , this method register an array of EntityClass. |
enumChilds, getStatus, release
int register(EntityClass entityClass)
JFT.register
, this method registers another EntityClass at the Context level
that increases the number of the classes managed by the library.
The EntityClass
registered at the Context level are visible only
through the connections created from this Context.
This could be useful when you need to create a connection
and subscribe entities from another version of the same service.
With this method you can override the entities registered with the JFT.register
as it enables you to connect and receive different versions of the same entity.
When an Entity is received, the API looks for a registered entity at the Context level and,
if not found, looks for it in the entities registered with the JFT.register
.
entityClass
- EntityClass to be registered.LifeCycle.RESULT_OK
if the operation completed
successfully,
LifeCycle.RESULT_GENERIC_ERROR
otherwise (e.g. some
entityClass
does not refer a valid
EntityClass).
int register(EntityClass[] entityClass)
register(it.list.jft.EntityClass)
, this method register an array of EntityClass.entityClass
- Array of EntityClass to be registered.LifeCycle.RESULT_OK
if the operation completed
successfully,
LifeCycle.RESULT_GENERIC_ERROR
otherwise (e.g. some
entityClass
does not refer a valid
EntityClass).
boolean isRegistered(int EntityClassID)
EntityClassID
) has been registered
in this context.
EntityClassID
- ID of the EntityClass to be checked.EntityClassID
) has been
registered. false
is returned when the
current status is LifeCycle.STATUS_INIT
.EntityClass getEntityClass(int EntityClassID)
EntityClassID
- ID of the EntityClass to be retrieved.null
is returned when the
current status is LifeCycle.STATUS_INIT
,
EntityClassID
is not
registered.EntityClass getEntityClass(String EntityClassName)
EntityClassName
- The name of the EntityClass to be retrieved.null
is returned when the
current status is LifeCycle.STATUS_INIT
,
EntityClassID
is not
registered.Mask makeEmptyMask(int entityClassID)
A mask may be used in subscriptions (SubscriptionParam.setMask()
)
or transactions (TransactionParam.setMask()
).
entityClassID
- Entity Class ID of the market class.null
is returned when the parameter entityClassID
is wrong.Connection makeConnection(ConnectionParam param, ConnectionListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
The current status of the returned connection is
STATUS_INIT
.
At the return of this method the given ConnectionParam
parameter
container is bound.
param
- connection parameter container.listener
- connection listener.null
is never returned.NullPointerException
- if some parameter is null
.IllegalArgumentException
- if Param
contains un-acceptable values.IllegalStateException
- if the current status is not
STATUS_INIT
.ConnectionParam makeConnectionParam()
Each parameter of the returned container has its value equal to
default-value as described in the corresponding ConnectionParam
.getSomething
description.
null
is returned when the
current status is not
STATUS_INIT
.Filter makeFilter(Connection connection, FilterParam param, FilterListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
The current status of the returned filter is
STATUS_INIT
.
At the return of this method the given FilterParam
parameter
container is bound.
connection
- associated connection.param
- filter parameter container.listener
- filter listener.null
is never returned.NullPointerException
- if some parameter is null
.IllegalArgumentException
- if Param
contains un-acceptable values, connection
is not
associated to
this context.IllegalStateException
- if the current status is not
STATUS_INIT
, connection
is not
Connection.STATUS_CONNECTED
.FilterParam makeFilterParam()
Each parameter of the returned container has its value equal to
default-value as described in the corresponding FilterParam
.getSomething
description.
null
is returned when the
current status is not
STATUS_INIT
.Query makeQuery(Connection connection, QueryParam param, QueryListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
The current status of the returned query is
STATUS_INIT
.
At the return of this method the given QueryParam
parameter
container is bound.
connection
- associated connection.param
- query parameter container.listener
- query listener.null
is never returned.NullPointerException
- if some parameter is null
.IllegalArgumentException
- if Param
contains un-acceptable values, connection
is not
associated to
this context.IllegalStateException
- if the current status is not
STATUS_INIT
, connection
is not
Connection.STATUS_CONNECTED
.QueryParam makeQueryParam()
Each parameter of the returned container has its value equal to
default-value as described in the corresponding QueryParam
.getSomething
description.
null
is returned when the
current status is not
STATUS_INIT
.Subscription makeSubscription(Connection connection, SubscriptionParam param, SubscriptionListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
The current status of the returned subscription
is STATUS_INIT
.
At the return of this method the given SubscriptionParam
parameter container is bound.
connection
- associated connection.param
- subscription parameter container.listener
- subscription listener.null
is never returned.NullPointerException
- if some parameter is null
.IllegalArgumentException
- if Param
contains un-acceptable values, connection
is not
associated to
this context.IllegalStateException
- if the current status is not
STATUS_INIT
, connection
is not
Connection.STATUS_CONNECTED
.SubscriptionParam makeSubscriptionParam()
Each parameter of the returned container has its value equal to
default-value as described in the corresponding SubscriptionParam
.getSomething
description.
null
is returned when the
current status is not
STATUS_INIT
.Transaction makeTransaction(Connection connection, TransactionParam param, TransactionListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
The current status of the returned transaction is
STATUS_INIT
.
At the return of this method the given TransactionParam
parameter
container is bound.
connection
- associated connection.param
- transaction parameter container.listener
- transaction listener.null
is never returned.NullPointerException
- if some parameter is null
.IllegalArgumentException
- if Param
contains un-acceptable values, connection
is not
associated to
this context.IllegalStateException
- if the current status is not
STATUS_INIT
, connection
is not
Connection.STATUS_CONNECTED
.TransactionParam makeTransactionParam()
Each parameter of the returned container has its value equal to
default-value as described in the corresponding TransactionParam
.getSomething
description.
null
is returned when the
current status is not
STATUS_INIT
.EntityClassQuery makeEntityClassQuery(Connection connection, EntityClassQueryParam param, EntityClassQueryListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
NullPointerException
IllegalArgumentException
IllegalStateException
EntityClassQueryParam makeEntityClassQueryParam()
MulticastConnection makeMulticastConnection(MulticastConnectionParam param, MulticastConnectionListener listener) throws NullPointerException, IllegalArgumentException, IllegalStateException
NullPointerException
IllegalArgumentException
IllegalStateException
MulticastConnectionParam makeMulticastConnectionParam()
Submit a bug or feature to FT\API Programming Support