com.incesoft.botplatform.sdk
Interface RobotServer

All Known Implementing Classes:
DefaultRobotServer

public interface RobotServer

Robot server can be created by RobotServerFactory. Multiple Robot Servers is recommended, when there are large numbers of users. Robot Servers can run on one or more physical machines.

Author:
LiBo

Method Summary
 void addConnectionListener(RobotConnectionListener listener)
          Deprecated. Add robot server connection listener
 void addUser(java.lang.String robot, java.lang.String user, java.lang.String inviteMessage)
          Add a user to your bot
 RobotMessage createMessage()
          Create a message
 void createSession(java.lang.String robot, java.lang.String user)
          Create a robot session.
 boolean isReconnectedSupport()
          check whether reconnection is supported .
 void login(java.lang.String spid, java.lang.String sppwd)
          Calling this function, Robot Server will login BOTPLATFORM.
 void login(java.lang.String spid, java.lang.String sppwd, long timeout)
          Calling this function, Robot Server will login BOTPLATFORM.
 void logout()
          Robot server logout BOTPLATFORM
 void pushMessage(java.lang.String robot, java.lang.String user, RobotMessage message)
          Push message to user.
 void removeConnectionistener(RobotConnectionListener listener)
          Deprecated. Remove robot server connection listener
 void requestContactList(java.lang.String robot)
          Get the contact list of the specified robot.
 void requestResource(java.lang.String robot, java.lang.String user, RobotResource resource, java.lang.String saveUrl)
          Get the resouce, the data of the resource file will be posted to a url specified.
 void setColorScheme(int colorScheme)
          set all robots' color scheme.
 void setColorScheme(java.lang.String robotAccount, int colorScheme)
          set a specified robot's color scheme.
 void setDisplayName(java.lang.String displayName)
          Set all robots's display name
 void setDisplayName(java.lang.String robotAccount, java.lang.String displayName)
          Set display name of a specified robot account.
 void setDisplayPicture(java.lang.String displayPicture)
          Set all robots' display picture
 void setDisplayPicture(java.lang.String robotAccount, java.lang.String displayPicture)
          Set display picture of a specified robot account.
 void setDisplayPictureEx(java.lang.String displayPicture, java.lang.String deluxePicture)
          Set all robots' display picture
 void setDisplayPictureEx(java.lang.String robotAccount, java.lang.String displayPicture, java.lang.String deluxePicture)
          Set display picture of a specified robot account.
 void setPersonalMessage(java.lang.String personalMessage)
          Set all robots' personal message
 void setPersonalMessage(java.lang.String robotAccount, java.lang.String personalMessage)
          Set personal message of a specified robot account.
 void setReconnectedSupport(boolean b)
          Set reconnection support.
 void setRobotHandler(RobotHandler handler)
          Set robot server event handler
 void setScene(java.lang.String scene)
          Send all robots' scene.
 void setScene(java.lang.String robotAccount, java.lang.String scene)
          set scene of a specified robot.
 

Method Detail

login

void login(java.lang.String spid,
           java.lang.String sppwd)
           throws RobotException
Calling this function, Robot Server will login BOTPLATFORM. It's a synchronous operation, using default timeout(1 minute). During the login process, if no exception raises, login succeeds. Otherwise, please catch the exception and check exception message explains why login failed.

Parameters:
spid - The unique ID assigned by INCESOFT
sppwd - The password assigned by INCESOFT
Throws:
RobotException

login

void login(java.lang.String spid,
           java.lang.String sppwd,
           long timeout)
           throws RobotException
Calling this function, Robot Server will login BOTPLATFORM. It's a synchronous operation, using assigned timeout. During the login process, if no exception raises, login succeeds. Otherwise, please catch the exception and check exception message explains why login failed.

Parameters:
spid - The unique ID assigned by INCESOFT
sppwd - The password assigned by INCESOFT
timeout - Login timeout, the unit is millisecond
Throws:
RobotException

logout

void logout()
Robot server logout BOTPLATFORM


setReconnectedSupport

void setReconnectedSupport(boolean b)
Set reconnection support. Default setting is true. When network errors occur, Robot Server will login BOTPLATFORM again automatically.


isReconnectedSupport

boolean isReconnectedSupport()
check whether reconnection is supported .


setRobotHandler

void setRobotHandler(RobotHandler handler)
Set robot server event handler


addConnectionListener

void addConnectionListener(RobotConnectionListener listener)
Deprecated. Add robot server connection listener


removeConnectionistener

void removeConnectionistener(RobotConnectionListener listener)
Deprecated. Remove robot server connection listener


setDisplayName

void setDisplayName(java.lang.String displayName)
                    throws RobotException
Set all robots's display name

Parameters:
displayName - a preferred name preferred
Throws:
RobotException

setDisplayName

void setDisplayName(java.lang.String robotAccount,
                    java.lang.String displayName)
                    throws RobotException
Set display name of a specified robot account.

Parameters:
displayName - a preferred display name
robotAccount - specify a robot account to be modified.
Throws:
RobotException

setPersonalMessage

void setPersonalMessage(java.lang.String personalMessage)
                        throws RobotException
Set all robots' personal message

Parameters:
personalMessage -
Throws:
RobotException

setPersonalMessage

void setPersonalMessage(java.lang.String robotAccount,
                        java.lang.String personalMessage)
                        throws RobotException
Set personal message of a specified robot account.

Parameters:
personalMessage - a preferred personal message
robotAccount - specify a robot account to be modified.
Throws:
RobotException

setDisplayPicture

void setDisplayPicture(java.lang.String displayPicture)
                       throws RobotException
Set all robots' display picture

Parameters:
displayPicture - unique name of the dp resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
Throws:
RobotException

setDisplayPicture

void setDisplayPicture(java.lang.String robotAccount,
                       java.lang.String displayPicture)
                       throws RobotException
Set display picture of a specified robot account.

Parameters:
displayPicture - unique name of the dp resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
robotAccount - specify a robot account to be modified.
Throws:
RobotException

setDisplayPictureEx

void setDisplayPictureEx(java.lang.String displayPicture,
                         java.lang.String deluxePicture)
                         throws RobotException
Set all robots' display picture

Parameters:
displayPicture - unique name of the dp resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
deluxePicture - unique name of the ddp resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
Throws:
RobotException

setDisplayPictureEx

void setDisplayPictureEx(java.lang.String robotAccount,
                         java.lang.String displayPicture,
                         java.lang.String deluxePicture)
                         throws RobotException
Set display picture of a specified robot account.

Parameters:
robotAccount - specify a robot account to be modified.
displayPicture - unique name of the dp resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
deluxePicture - unique name of the ddp resource pre-uploaded to BOTPLATFORM and verified by BOTPLATFORM
Throws:
RobotException

setScene

void setScene(java.lang.String scene)
              throws RobotException
Send all robots' scene.

Parameters:
scene - uri of the scene
Throws:
RobotException

setScene

void setScene(java.lang.String robotAccount,
              java.lang.String scene)
              throws RobotException
set scene of a specified robot.

Parameters:
robotAccount - specify a robot account to be modified
scene - uri of the scene
Throws:
RobotException

setColorScheme

void setColorScheme(int colorScheme)
                    throws RobotException
set all robots' color scheme.

Parameters:
colorScheme - a preferred color
Throws:
RobotException

setColorScheme

void setColorScheme(java.lang.String robotAccount,
                    int colorScheme)
                    throws RobotException
set a specified robot's color scheme.

Parameters:
robotAccount - specify a robot account to be modified
colorScheme - a preferred color
Throws:
RobotException

createSession

void createSession(java.lang.String robot,
                   java.lang.String user)
                   throws RobotException
Create a robot session.

Parameters:
robot - robot id
user - user id
Throws:
RobotException

pushMessage

void pushMessage(java.lang.String robot,
                 java.lang.String user,
                 RobotMessage message)
                 throws RobotException
Push message to user. may be msn offline message,email message, etc.

Parameters:
robot - robot id
user - user id
message - message
Throws:
RobotException

requestContactList

void requestContactList(java.lang.String robot)
                        throws RobotException
Get the contact list of the specified robot.

Parameters:
robot - robot id
Throws:
RobotException

requestResource

void requestResource(java.lang.String robot,
                     java.lang.String user,
                     RobotResource resource,
                     java.lang.String saveUrl)
                     throws RobotException
Get the resouce, the data of the resource file will be posted to a url specified.

Parameters:
robot - robot id
user - user id
resource - the resource to get.
saveUrl - a url receives a HTTP POST request which contains the resource data.
Throws:
RobotException

createMessage

RobotMessage createMessage()
Create a message

Returns:
RobotMessage RobotMessage

addUser

void addUser(java.lang.String robot,
             java.lang.String user,
             java.lang.String inviteMessage)
Add a user to your bot

Parameters:
robot - robot id
user - user id
inviteMessage - a message shown on the invite panel