it.list.jft.event
Interface ConnectionOpenEvent

All Superinterfaces:
ConnectionEvent, Event

public interface ConnectionOpenEvent
extends ConnectionEvent

Server-answer to Connection.open().

This event must be handled by ConnectionListener.onConnectionOpen().


Field Summary
static int RESULT_ALREADY_LOGGED
          Failure-code: user already logged.
static int RESULT_EXCEED_SESSION
          Failure-code: too much open sessions with the server.
static int RESULT_INVALID_AUTH_KEY
          Failure-code: bad configuration key associated to the connection.
static int RESULT_INVALID_CLIENTID
          Failure-code: bad client ID associated to the connection.
static int RESULT_INVALID_PASSWORD
          Failure-code: bad password associated to the connection.
static int RESULT_INVALID_PROFILE
          Failure-code: invalid profile.
static int RESULT_INVALID_REVISION
          Failure-code: bad application version associated to the connection.
static int RESULT_INVALID_SERVER_STATUS
          Failure-code: the server is in a status (e.g. still in a start-up state) in which connections are not allowed.
static int RESULT_INVALID_SERVICE
          Failure-code: bad user type associated to the connection.
static int RESULT_INVALID_USERNAME
          Failure-code: bad user name associated to the connection.
static int RESULT_INVALID_USERTYPE
          Failure-code: bad user type associated to the connection.
 
Fields inherited from interface Event
RESULT_GENERIC_ERROR, RESULT_OK
 
Method Summary
 int getActiveConnectionType()
           
 int getBusinessServiceID()
          Returns the business service ID associated to this connection.
 int getClientServiceID()
          Returns the client service ID associated to this connection.
 int getEnvironment()
          Returns an indication of the FastTrack server environment (e.g.: Production, Testing, etc...).
 int getFTID()
          Returns the FastTrack Server ID.
 int[] getMarketRevision()
          Returns the version of the server.
 int getSystemDate()
          Returns the system date of the server.
 Date getSystemDateTime()
          Returns the system date and time of the server.
 int getSystemTime()
          Returns the system time of the server.
 
Methods inherited from interface ConnectionEvent
getConnection
 
Methods inherited from interface Event
getResult
 

Field Detail

RESULT_INVALID_PASSWORD

static final int RESULT_INVALID_PASSWORD
Failure-code: bad password associated to the connection.

See Also:
Constant Field Values

RESULT_INVALID_USERNAME

static final int RESULT_INVALID_USERNAME
Failure-code: bad user name associated to the connection.

See Also:
Constant Field Values

RESULT_INVALID_REVISION

static final int RESULT_INVALID_REVISION
Failure-code: bad application version associated to the connection.

See Also:
Constant Field Values

RESULT_ALREADY_LOGGED

static final int RESULT_ALREADY_LOGGED
Failure-code: user already logged.

See Also:
Constant Field Values

RESULT_INVALID_CLIENTID

static final int RESULT_INVALID_CLIENTID
Failure-code: bad client ID associated to the connection.

See Also:
Constant Field Values

RESULT_INVALID_SERVER_STATUS

static final int RESULT_INVALID_SERVER_STATUS
Failure-code: the server is in a status (e.g. still in a start-up state) in which connections are not allowed.

See Also:
Constant Field Values

RESULT_EXCEED_SESSION

static final int RESULT_EXCEED_SESSION
Failure-code: too much open sessions with the server.

See Also:
Constant Field Values

RESULT_INVALID_PROFILE

static final int RESULT_INVALID_PROFILE
Failure-code: invalid profile.

See Also:
Constant Field Values

RESULT_INVALID_AUTH_KEY

static final int RESULT_INVALID_AUTH_KEY
Failure-code: bad configuration key associated to the connection.

See Also:
Constant Field Values

RESULT_INVALID_USERTYPE

static final int RESULT_INVALID_USERTYPE
Failure-code: bad user type associated to the connection.

See Also:
Constant Field Values

RESULT_INVALID_SERVICE

static final int RESULT_INVALID_SERVICE
Failure-code: bad user type associated to the connection.

See Also:
Constant Field Values
Method Detail

getClientServiceID

int getClientServiceID()
Returns the client service ID associated to this connection.

The client service ID is one of the elements that identify a TransactionID.

This method must be called only when the result is Event.RESULT_OK.

Returns:
the client service ID associated to this connection.
-1 is returned when the result is not Event.RESULT_OK.
See Also:
TransactionID.belongsTo(it.list.jft.Connection)

getBusinessServiceID

int getBusinessServiceID()
Returns the business service ID associated to this connection.

The business service ID is one of the elements that identify a TransactionID.

This method must be called only when the result is Event.RESULT_OK.

Returns:
the business service ID associated to this connection.
-1 is returned when the result is not Event.RESULT_OK.
See Also:
TransactionID.belongsTo(it.list.jft.Connection)

getSystemDate

int getSystemDate()
Returns the system date of the server.

The value returned reflects the date in which the server opened the connection.

The returned value is an int whose decimal representation is: YYYYMMDD (i.e.: year*10000 + month*100 + day).

This method must be called only when the result is Event.RESULT_OK.

Returns:
the system date of the server.
-1 is returned when the result is not Event.RESULT_OK.
See Also:
getSystemDateTime()

getSystemTime

int getSystemTime()
Returns the system time of the server.

The value returned reflects the time in which the server opened the connection.

The returned value is an int whose decimal representation is: HHMMSScc (i.e.: hours*1000000 + minutes*10000 + seconds*100 + hundreds).

This method must be called only when the result is Event.RESULT_OK.

Returns:
the system time of the server.
-1 is returned when the result is not Event.RESULT_OK.
See Also:
getSystemDateTime()

getSystemDateTime

Date getSystemDateTime()
Returns the system date and time of the server.

The value returned reflects the date and time in which the server opened the connection.

This method must be called only when the result is Event.RESULT_OK.

This utility method is defined in terms of getSystemDate() and getSystemTime() as follows:
int date = getSystemDate();
int time = getSystemTime();
if(date == -1 || time == -1)
  return -1;
Calendar cal = Calendar.getInstance();
cal.set(date/10000, date%10000/100-1, date%100, time/1000000, time%1000000/10000, time%1000/100);
return new Date(cal.getTimeInMillis() + time%100*10);

Returns:
the system date and time of the server.
-1 is returned when the result is not Event.RESULT_OK.

getMarketRevision

int[] getMarketRevision()
Returns the version of the server.

A version is always represented by a three-dimensional array; e.g. the version 2.0.3 is represented by:
int[] version = {2, 0, 3};

This method must be called only when the result is Event.RESULT_OK.

Returns:
the version of the server.
null is returned when the result is not Event.RESULT_OK.

getFTID

int getFTID()
Returns the FastTrack Server ID.

Each FastTrack server in the world is identified by an unique FastTrack Server ID.

This method must be called only when the result is Event.RESULT_OK.

Returns:
the FastTrack Server ID.
-1 is returned when the result is not Event.RESULT_OK.

getEnvironment

int getEnvironment()
Returns an indication of the FastTrack server environment (e.g.: Production, Testing, etc...).

the precise meaning of this value depends on the particular FastTrack server and it is documented in the corresponding manual.

This method must be called only when the result is Event.RESULT_OK.

Returns:
an indication of the FastTrack server environment.
-1 is returned when the result is not Event.RESULT_OK.

getActiveConnectionType

int getActiveConnectionType()


Submit a bug or feature to FT\API Programming Support<\font>