|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.incesoft.botplatform.sdk.support.DefaultRobotSession
public class DefaultRobotSession
Field Summary |
---|
Fields inherited from interface com.incesoft.botplatform.sdk.RobotSession |
---|
OPEN_MODE_CONV_OPEN, OPEN_MODE_ROBOT, OPEN_MODE_TIMEOUT, OPEN_MODE_UNKONW |
Constructor Summary | |
---|---|
DefaultRobotSession(DefaultRobotServer server)
|
|
DefaultRobotSession(DefaultRobotServer server,
java.lang.String robotId,
RobotUser user,
java.lang.String sessionID)
|
Method Summary | |
---|---|
void |
addUser(RobotUser user)
|
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 |
java.lang.String |
getSessionID()
|
RobotUser |
getUser()
Get a user's reference in session |
RobotUser |
getUser(java.lang.String userid)
Get a user's reference in session |
int |
getUserCount()
|
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. |
RobotUser |
removeUser(java.lang.String user)
|
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 |
setActivityOpened(boolean activityOpened)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this session, using the name specified. |
void |
setClosed(boolean closed)
|
void |
setOpenMode(int openMode)
|
void |
setRobot(java.lang.String robot)
|
void |
setSessionID(java.lang.String sessionID)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRobotSession(DefaultRobotServer server)
public DefaultRobotSession(DefaultRobotServer server, java.lang.String robotId, RobotUser user, java.lang.String sessionID)
Method Detail |
---|
public void send(java.lang.String message) throws RobotException
RobotSession
send
in interface RobotSession
RobotException
public RobotMessage createMessage()
RobotSession
createMessage
in interface RobotSession
RobotMessage
public RobotUser getUser()
RobotSession
getUser
in interface RobotSession
RobotUser
public void addUser(RobotUser user)
public RobotUser removeUser(java.lang.String user)
public int getUserCount()
public RobotUser getUser(java.lang.String userid)
RobotSession
getUser
in interface RobotSession
userid
- user id
RobotUser
public java.util.Collection<RobotUser> getUsers()
RobotSession
getUsers
in interface RobotSession
public boolean isClosed()
RobotSession
isClosed
in interface RobotSession
public void setClosed(boolean closed)
public int getOpenMode()
RobotSession
getOpenMode
in interface RobotSession
public void setOpenMode(int openMode)
public java.lang.String getRobot()
RobotSession
getRobot
in interface RobotSession
public void setRobot(java.lang.String robot)
public void setAttribute(java.lang.String name, java.lang.Object value)
RobotSession
setAttribute
in interface RobotSession
name
- the name to which the object is bound; cannot be nullvalue
- the object to be boundpublic java.lang.Object getAttribute(java.lang.String name)
RobotSession
getAttribute
in interface RobotSession
name
- a string specifying the name of the object
public java.lang.Object removeAttribute(java.lang.String name)
RobotSession
removeAttribute
in interface RobotSession
name
- the name of the object to remove from this session
public java.util.Iterator<java.lang.String> getAttributeNames()
RobotSession
getAttributeNames
in interface RobotSession
public boolean isActivityOpened()
RobotSession
isActivityOpened
in interface RobotSession
public void setActivityOpened(boolean activityOpened)
public void send(RobotMessage message) throws RobotException
RobotSession
send
in interface RobotSession
message
- RobotMessage
RobotException
public void sendNudge() throws RobotException
RobotSession
sendNudge
in interface RobotSession
RobotException
public void sendActivity(java.lang.String data) throws RobotException
RobotSession
sendActivity
in interface RobotSession
data
- network resource to be shown (generally are webpages or pictures)
RobotException
public void sendActivity(java.lang.String data, java.lang.String friendlyName) throws RobotException
RobotSession
sendActivity
in interface RobotSession
data
- network resource to be shown (generally are webpages or pictures)friendlyName
- friendly name which represents the network resource in the activity invitation
RobotException
public void sendTyping() throws RobotException
RobotSession
sendTyping
in interface RobotSession
RobotException
public void sendFile(java.lang.String uri) throws RobotException
RobotSession
sendFile
in interface RobotSession
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
RobotException
public void sendFile(java.lang.String uri, java.lang.String friendlyName) throws RobotException
RobotSession
sendFile
in interface RobotSession
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
public void sendFileAcceptance(java.lang.String transferId, java.lang.String saveUrl) throws RobotException
RobotSession
sendFileAcceptance
in interface RobotSession
transferId
- id of the current file transfer.saveUrl
- a url to receive a HTTP POST request to get the data of the file.
RobotException
public void sendFileRejection(java.lang.String transferId) throws RobotException
RobotSession
sendFileRejection
in interface RobotSession
transferId
- id of the current file transfer.
RobotException
public void sendFileCancellation(java.lang.String transferId) throws RobotException
RobotSession
sendFileCancellation
in interface RobotSession
RobotException
public void sendInk(byte[] inkData) throws RobotException
RobotSession
sendInk
in interface RobotSession
inkData
- data of the ink message.
RobotException
public void sendWink(java.lang.String uri) throws RobotException
RobotSession
sendWink
in interface RobotSession
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
RobotException
public void sendWink(java.lang.String uri, java.lang.String stamp) throws RobotException
RobotSession
sendWink
in interface RobotSession
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
public void sendVoiceclip(java.lang.String uri) throws RobotException
RobotSession
sendVoiceclip
in interface RobotSession
uri
- unique name of the resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
RobotException
public void sendWebcam(java.lang.String serverIP, int serverPort, int recipientid, int sessionid) throws RobotException
RobotSession
sendWebcam
in interface RobotSession
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
public void inviteUser(java.lang.String user) throws RobotException
RobotSession
inviteUser
in interface RobotSession
RobotException
public void sendActivity(int appid, java.lang.String appname, java.lang.String data) throws RobotException
RobotSession
sendActivity
in interface RobotSession
appid
- id of the MSN Activityappname
- name of the MSN Activitydata
- network resource to be shown (generally are webpages or pictures)
RobotException
public void close() throws RobotException
RobotSession
close
in interface RobotSession
RobotException
public java.lang.String getSessionID()
public void setSessionID(java.lang.String sessionID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |