|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RobotSession
A session between robot and user. When user opens a conversation window or reconnect after session timeout, a session starts. During the session, SP can send message to user. When users close a conversation window or session timeout, a session ends and SP cannot send any messages.
Field Summary | |
---|---|
static int |
OPEN_MODE_CONV_OPEN
A flag indicates that a new conversation started by user. |
static int |
OPEN_MODE_ROBOT
A flag indicates that a new conversation started by robot. |
static int |
OPEN_MODE_TIMEOUT
A flag indicates that a new conversation started by reconnecting after session timeout. |
static int |
OPEN_MODE_UNKONW
A flag indicates that a new conversation started by unkonw reason. |
Method Summary | |
---|---|
void |
close()
Close this session. |
RobotMessage |
createMessage()
Create a message |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name. |
java.util.Iterator<java.lang.String> |
getAttributeNames()
Returns an Iterator of String objects containing the names of all the objects bound to this session |
int |
getOpenMode()
Get the open mode of session |
java.lang.String |
getRobot()
Get the robot account(MSN Passport) associated with this session |
RobotUser |
getUser()
Get a user's reference in session |
RobotUser |
getUser(java.lang.String userid)
Get a user's reference in session |
java.util.Collection<RobotUser> |
getUsers()
Get a users' collection in session |
void |
inviteUser(java.lang.String user)
Invite a user into the current conversation. |
boolean |
isActivityOpened()
Check whether the activity window opened. |
boolean |
isClosed()
Check whether the session is closed. |
java.lang.Object |
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. |
void |
send(RobotMessage message)
Send RobotMessage |
void |
send(java.lang.String message)
Send plain text message |
void |
sendActivity(int appid,
java.lang.String appname,
java.lang.String data)
Send activity data to the MSN Activity window. |
void |
sendActivity(java.lang.String data)
Show the content of network resource in MSN Activity window |
void |
sendActivity(java.lang.String data,
java.lang.String friendlyName)
Show the content of network resource in MSN Activity window |
void |
sendFile(java.lang.String uri)
Send a file |
void |
sendFile(java.lang.String uri,
java.lang.String friendlyName)
Send a file |
void |
sendFileAcceptance(java.lang.String transferId,
java.lang.String saveUrl)
Accept a file transfer request, and a url should be specified for saving the file data. |
void |
sendFileCancellation(java.lang.String transferId)
Cancel a file transfer. |
void |
sendFileRejection(java.lang.String transferId)
Reject a file transfer request. |
void |
sendInk(byte[] inkData)
Send a ink message |
void |
sendNudge()
Send nudge |
void |
sendTyping()
Send a typing infomation which will be presented on the bottom of the conversation panel |
void |
sendVoiceclip(java.lang.String uri)
Send a voice clip |
void |
sendWebcam(java.lang.String serverIP,
int serverPort,
int recipientid,
int sessionid)
Send webcam Once the connection is established, the client that connected to the other peer should authenticate himself with sending the message (no header, no nothing) : "recipientid=X&sessionid=Y\r\n\r\n" The other peer should then send (if correctly authenticated) the message "connected\r\n\r\n" The connecting peer should also send "connected\r\n\r\n" From this point the connection is done and The connecting peer is authenticated Subsequently, the server may send the encoded data of the webcam in mimic format |
void |
sendWink(java.lang.String uri)
Send a msn default wink |
void |
sendWink(java.lang.String uri,
java.lang.String stamp)
Send a customized wink |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this session, using the name specified. |
Field Detail |
---|
static final int OPEN_MODE_UNKONW
static final int OPEN_MODE_CONV_OPEN
static final int OPEN_MODE_TIMEOUT
static final int OPEN_MODE_ROBOT
Method Detail |
---|
void send(java.lang.String message) throws RobotException
message
-
RobotException
void send(RobotMessage message) throws RobotException
message
- RobotMessage
RobotException
void sendNudge() throws RobotException
RobotException
void sendActivity(java.lang.String data) throws RobotException
data
- network resource to be shown (generally are webpages or pictures)
RobotException
void sendActivity(java.lang.String data, java.lang.String friendlyName) throws RobotException
data
- network resource to be shown (generally are webpages or pictures)friendlyName
- friendly name which represents the network resource in the activity invitation
RobotException
void sendActivity(int appid, java.lang.String appname, java.lang.String data) throws RobotException
appid
- id of the MSN Activityappname
- name of the MSN Activitydata
- network resource to be shown (generally are webpages or pictures)
RobotException
boolean isActivityOpened()
void sendTyping() throws RobotException
RobotException
RobotMessage createMessage()
RobotMessage
RobotUser getUser()
RobotUser
RobotUser getUser(java.lang.String userid)
userid
- user id
RobotUser
java.util.Collection<RobotUser> getUsers()
java.lang.String getRobot()
int getOpenMode()
boolean isClosed()
void close() throws RobotException
RobotException
void setAttribute(java.lang.String name, java.lang.Object value)
name
- the name to which the object is bound; cannot be nullvalue
- the object to be boundjava.lang.Object getAttribute(java.lang.String name)
name
- a string specifying the name of the object
java.lang.Object removeAttribute(java.lang.String name)
name
- the name of the object to remove from this session
java.util.Iterator<java.lang.String> getAttributeNames()
void inviteUser(java.lang.String user) throws RobotException
user
-
RobotException
void sendFile(java.lang.String uri) throws RobotException
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
RobotException
void sendFile(java.lang.String uri, java.lang.String friendlyName) throws RobotException
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORMfriendlyName
- friendly name which represents the file in the file transfer invitation
RobotException
void sendFileAcceptance(java.lang.String transferId, java.lang.String saveUrl) throws RobotException
transferId
- id of the current file transfer.saveUrl
- a url to receive a HTTP POST request to get the data of the file.
RobotException
void sendFileRejection(java.lang.String transferId) throws RobotException
transferId
- id of the current file transfer.
RobotException
void sendFileCancellation(java.lang.String transferId) throws RobotException
transferId
-
RobotException
void sendInk(byte[] inkData) throws RobotException
inkData
- data of the ink message.
RobotException
void sendWink(java.lang.String uri) throws RobotException
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
RobotException
void sendWink(java.lang.String uri, java.lang.String stamp) throws RobotException
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORMstamp
- base64 encoded signature of the file.It is a S/MIME signature of the Base64 encoded hash of the Content cabinet file and is signed by the MSN Content Authority.
RobotException
void sendVoiceclip(java.lang.String uri) throws RobotException
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
RobotException
void sendWebcam(java.lang.String serverIP, int serverPort, int recipientid, int sessionid) throws RobotException
serverIP
- webcam resource server IP addressserverPort
- webcam resource server portrecipientid
- the authentication info, should be between 100 and 199sessionid
- the authentication info, should be between 9000 and 9999
RobotException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |