Session Class Methods

The following are the Session class methods.

Syntax

broadcastSubscribe(cluster, queue, task, state, presence, method)

Description

Subscribe to broadcast messages.

Returns

Object.

Syntax

broadcastunsubscribe(type)

Description

Unsubscribe to broadcast messages.

Returns

None.

Syntax

close()

Description

Close the session with the server.

Parameters

None.

Returns

Request number.

Syntax

open()

Description

Open the session with the server.

Parameters

None.

Returns

Request number.

Syntax

registerAddress(address)

Description

Register the address to the server so that the server will report all events that occur on this address.

Parameters

Field or Control

Definition

address

The address to be registered.

Returns

Request number.

Syntax

registerBuddy(buddy)

Description

Register the buddy to the JSMCAPI so that the JSMCAPI will report all state events that occur on this buddy.

Parameters

Field or Control

Definition

buddy

The buddy to be registered.

Returns

Request number.

Syntax

registerBuddiesBulk(buddies, numRegsPerBulkReq, intervalBetweenReqs)

Description

Register multiple buddies to the JSMCAPI so that the JSMCAPI will report state events that occur for the buddies.

Parameters

Field or Control

Definition

buddies

An array of buddies

numRegPerBulkReq

Number of buddies to register in one bulk registration request.

intervalBetweenReqs

Interval in milliseconds between requests.

Returns

Request number.

Syntax

registerGroup(group)

Description

Register the group to the server so that the server will report all events that occur on this group.

Parameters

Field or Control

Definition

group

The group to be registered.

Returns

Request number.

Syntax

registerGroupsBulk(groups, numRegsPerBulkReq, intervalBetweenReqs)

Description

Register multiple groups to the server so that the server will report all events that occur on the groups.

Parameters

Field or Control

Definition

groups

An array of groups.

numRegPerBulkReq

Number of groups to register in one bulk registration request.

intervalBetweenReqs

Interval in milliseconds between requests.

Returns

Request number.

Syntax

registerUser(user)

Description

Register the user to the server so that the server will report all those events that happen on this user.

Parameters

Field or Control

Definition

user

The user to be registered.

Returns

Request number.

Syntax

setAutoRecovery(autorecover)

Description

Sets the auto recovery feature of the queue server connection to off.

Parameters

Field or Control

Definition

autoRecover

Recover.

Syntax

statPublish(userStat, groupStat)

Description

Sets the statistics publishing levels for the queue server.

Parameters

Field or Control

Definition

userStat

Either 0, 1, or 2 for UserStatistics publishing.

Enter 0 for no statistics publishing, 1 for Statistics1 publishing, and 2 for Statistics2 and Statistic1 publishing.

groupStat

Either 0, 1, or 2 for GroupStatistics publishing.

Enter 0 for no statistics publishing, 1 for Statistics1 publishing, and 2 for Statistics2 and Statistic1 publishing.

Returns

Request number.

Syntax

unRegisterAddress(address)

Description

Unregister the address from the server so that the server will not report any events about this address.

Parameters

Field or Control

Definition

address

The address to be unregistered.

Returns

Request number.

Syntax

unregisterBuddy(buddy)

Description

Unregister the buddy from the JSMCAPI so that the JSMCAPI will not report any events about the buddy state change.

Parameters

Field or Control

Definition

buddy

The buddy to be unregistered.

Returns

Request number.

Syntax

unregisterGroup(group)

Description

Unregister the group from the server so that the server will not report any events about this group.

Parameters

Field or Control

Definition

group

The group to be unregistered.

Returns

Request number.

Syntax

unregisterUser(user)

Description

Unregister the user from the server so that the server will not report any events to this user.

Parameters

Field or Control

Definition

user

The user to be unregistered.

Returns

Request number.