com.zion.jbuddy.msn
Interface IMsnActivitySession


public interface IMsnActivitySession

Allows the client to open Activity Sessions with users. An Activity may be a game (like Tic Tac Toe) or other application (such as Calendar Sharing).


Creating an Activity Session

The following code creates (and initializes) an outgoing "Tic Tac Toe" session.

IMsnActivitySession session = msnClient.getActivityService().createSession("recipient@hotmail.com", 10331358, "Tic Tac Toe Classic");
session.addActivitySessionListener(myActivitySessionListener);
session.invite();

Note: Tic Tac Toe Classic is just one of the many applications that run on top of Activity Sessions. This API allows you to create sessions and send/receive session commands. No application code is provided for specific applications such as Tic Tac Toe.

Since:
6.0

Method Summary
 void accept()
          Accepts the incoming invitation and initiates this Activity Session.
 void addActivitySessionListener(IMsnActivitySessionListener listener)
          Registers a listener to receive events from this session.
 void close()
          Closes this Activity Session.
 void decline()
          Declines the incoming invitation.
 int getAppId()
          Returns the ID of the application being used in this Activity.
 String getAppName()
          Returns the name of the application being used in this Activity.
 IMsnClient getClient()
          Returns the client associated with this Activity.
 String getParticipant()
          Returns the participant (end user) in this Activity.
 void invite()
          Invites the participant (recipient) to this Activity Session.
 boolean isOnline()
          Returns true if the session is connected and ready.
 boolean isOutgoing()
          Returns true if this is an outgoing session (meaning the client sent the invitation).
 void removeActivitySessionListener(IMsnActivitySessionListener listener)
          Stops a listener from receiving events from this session.
 void sendCommand(String command)
          Sends a command to this Activity Session.
 

Method Detail

getAppId

int getAppId()
Returns the ID of the application being used in this Activity.


getAppName

String getAppName()
Returns the name of the application being used in this Activity.


getClient

IMsnClient getClient()
Returns the client associated with this Activity.


getParticipant

String getParticipant()
Returns the participant (end user) in this Activity.


isOutgoing

boolean isOutgoing()
Returns true if this is an outgoing session (meaning the client sent the invitation). Otherwise, returns false, indicating that the client received the invitation.


addActivitySessionListener

void addActivitySessionListener(IMsnActivitySessionListener listener)
Registers a listener to receive events from this session.


removeActivitySessionListener

void removeActivitySessionListener(IMsnActivitySessionListener listener)
Stops a listener from receiving events from this session.


isOnline

boolean isOnline()
Returns true if the session is connected and ready.


invite

void invite()
            throws IOException
Invites the participant (recipient) to this Activity Session.

Throws:
IOException - if isOutgoing() == false, or there was a problem communicating with the server

accept

void accept()
            throws IOException
Accepts the incoming invitation and initiates this Activity Session.

Throws:
IOException - if isOutgoing() == true, or there was a problem communicating with the server

decline

void decline()
             throws IOException
Declines the incoming invitation.

Throws:
IOException - if isOutgoing() == true, or there was a problem communicating with the server

sendCommand

void sendCommand(String command)
                 throws IOException
Sends a command to this Activity Session. The syntax of the command depends on the Activity application being used.

Throws:
IOException - if there was a problem communicating with the server

close

void close()
Closes this Activity Session. If this session is outgoing, and an invitation was sent but not yet accepted or declined, the invitation will be canceled.



JBuddy is a trademark of Zion Software, LLC in the US and other countries.
Copyright 2000-2010 Zion Software, LLC All Rights Reserved.