org.exoplatform.services.xmpp.connection
Interface XMPPSession

All Known Implementing Classes:
XMPPSessionImpl

public interface XMPPSession

Created by The eXo Platform SAS.

Version:
$Id: $
Author:
Vitaly Parfonov

Method Summary
 void addBuddy(java.lang.String username, java.lang.String nickname, java.lang.String group)
          Add new buddy to roster.
 boolean addTransport(Transport transport, java.lang.String remoteUser, java.lang.String remotePassword, boolean autoLogin)
          Check is Transport supported and add it to List of available transports.
 void askForSubscription(java.lang.String username, java.lang.String nickname)
          Ask for subscription to user with given name.
 void banUser(java.lang.String room, java.lang.String username, java.lang.String reason)
           
 void changeAvailabilityStatusInRoom(java.lang.String room, java.lang.String status, java.lang.String mode)
          Change status in the room (e.g Extend Away).
 void changeNickname(java.lang.String room, java.lang.String nickname)
          Change nickname in the room.
 void changeSubject(java.lang.String room, java.lang.String newSubject)
          Change subject of the room.
 boolean cleanBuddiesList()
          Clean buddies list.
 void close()
          Close current connection and send notification to buddies.
 org.jivesoftware.smackx.muc.MultiUserChat configRoom(java.lang.String room, ConfigRoomBean configRoom)
          Configure the group chat.
 FormBean createRoom(java.lang.String room, java.lang.String nickname)
          Create new group chat.
 void declineRoom(java.lang.String room, java.lang.String inviter, java.lang.String reason)
          Decline the invitation to the room.
 java.lang.Boolean destroyRoom(java.lang.String room, java.lang.String reason, java.lang.String altRoom)
          Destroy the group chat.
 java.util.List<HistoricalMessage> getAllHistory(java.lang.String usernameto, java.lang.String usernamefrom, boolean isGroupChat)
          Get history.
 java.util.List<org.jivesoftware.smack.packet.Presence> getBuddiesPresense()
          Get list of Presence for all buddies for current user.
 org.jivesoftware.smack.RosterEntry getBuddy(java.lang.String name)
          Return the roster entry by the name of user.
 FormBean getConfigFormRoom(java.lang.String room)
          get configuration form for group chat.
 org.jivesoftware.smack.XMPPConnection getConnection()
           
 java.util.List<HistoricalMessage> getHistoryBetweenDate(java.lang.String usernameto, java.lang.String usernamefrom, boolean isGroupChat, java.util.Date dateFrom, java.util.Date dateTo)
          Get history between two date.
 java.util.List<HistoricalMessage> getHistoryFromDateToNow(java.lang.String usernameto, java.lang.String usernamefrom, boolean isGroupChat, java.util.Date dateFrom)
          Get history between the date and current time.
 java.util.List<Interlocutor> getInterlocutors(java.lang.String username)
          Get all interlocutors of user.
 java.util.List<java.lang.String> getJoinedRooms()
          Get already joined rooms.
 org.jivesoftware.smackx.muc.MultiUserChat getMultiUserChat(java.lang.String room)
           
 java.util.List<HistoricalMessage> getNotRecieveMessages()
          Get all not received message.
 org.jivesoftware.smackx.muc.RoomInfo getRoomInfo(java.lang.String room)
           
 FullRoomInfoBean getRoomInfoBean(java.lang.String room)
          Get full information about room.
 org.jivesoftware.smackx.Form getSearchForm(java.lang.String searchService)
          Get form for searching users.
 java.util.List<java.lang.String> getSearchServices()
           
 UserInfo getUserInfo(java.lang.String userID)
          Get the information about user by user id.
 java.lang.String getUsername()
          Get the username.
 java.lang.Boolean inviteToRoom(java.lang.String room, java.lang.String invitee, java.lang.String reason)
          Invite to the room.
 java.lang.Boolean isJoin(java.lang.String room)
          True if join in the room.
 void joinRoom(java.lang.String room, java.lang.String nickname, java.lang.String password)
          Join to the group chat.
 void kickUser(java.lang.String room, java.lang.String nickname, java.lang.String reason)
           
 java.lang.Boolean leaveRoom(java.lang.String room)
          Leave the room.
 void manageAffiliation(java.lang.String room, java.lang.String username, java.lang.String affiliation, java.lang.String command)
           
 void manageRole(java.lang.String room, java.lang.String nickname, java.lang.String role, java.lang.String command)
          The manage role of user in the room.
 void messageReceive(java.lang.String messageId)
          Set that message is received.
 void removeAllTransport()
          Remove all transport subscribed for current user.
 boolean removeBuddy(java.lang.String fullUserID)
          Remove remote user from contacts list.
 boolean removeTransport(Transport transport)
          Remove transport from available list.
 org.jivesoftware.smackx.ReportedData searchUser(java.lang.String search, boolean byUsername, boolean byName, boolean byEmail, java.lang.String searchService)
           
 void sendMessage(org.jivesoftware.smack.packet.Message message)
          Send message.
 void sendMessageToMUC(java.lang.String room, java.lang.String body)
          Send message to the room.
 void sendPresence(org.jivesoftware.smack.packet.Presence presence)
          Change presence for current user.
 void subscribeUser(java.lang.String fullUserID)
          Subscribe remote user and send message to that user.
 void subscribeUser(java.lang.String forUser, java.lang.String serviceName)
          Subscribe remote user and send message to that user.
 void unsubscribeUser(java.lang.String fullUserID)
          Unsubscribe remote user and send message to that user.
 void unsubscribeUser(java.lang.String forUser, java.lang.String serviceName)
          Unsubscribe remote user and send message to that user.
 void updateBuddy(java.lang.String username, java.lang.String nickname, java.lang.String group)
          Update the buddy in roster.
 

Method Detail

addTransport

boolean addTransport(Transport transport,
                     java.lang.String remoteUser,
                     java.lang.String remotePassword,
                     boolean autoLogin)
Check is Transport supported and add it to List of available transports. User can use remote accounts on other IM servers. (ICQ, Yahoo, etc).

Parameters:
transport - the name of transport
remoteUser - the username
remotePassword - the password
autoLogin - not working now
Returns:
true if successfully

addBuddy

void addBuddy(java.lang.String username,
              java.lang.String nickname,
              java.lang.String group)
              throws org.jivesoftware.smack.XMPPException
Add new buddy to roster.

Parameters:
username - the username
nickname - the nickname
group - the group
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

askForSubscription

void askForSubscription(java.lang.String username,
                        java.lang.String nickname)
Ask for subscription to user with given name.

Parameters:
username - the username
nickname - the nickname
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

getBuddy

org.jivesoftware.smack.RosterEntry getBuddy(java.lang.String name)
Return the roster entry by the name of user.

Parameters:
name - the username
Returns:
the rosterEntry

updateBuddy

void updateBuddy(java.lang.String username,
                 java.lang.String nickname,
                 java.lang.String group)
                 throws org.jivesoftware.smack.XMPPException
Update the buddy in roster.

Parameters:
username - the useranme
nickname - the nickanme
group - the group
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

cleanBuddiesList

boolean cleanBuddiesList()
                         throws org.jivesoftware.smack.XMPPException
Clean buddies list.

Returns:
true if all user removed from the list of user false otherwise.
Throws:
org.jivesoftware.smack.XMPPException

close

void close()
Close current connection and send notification to buddies.


getBuddiesPresense

java.util.List<org.jivesoftware.smack.packet.Presence> getBuddiesPresense()
Get list of Presence for all buddies for current user.

Returns:
list of Presence.

getConnection

org.jivesoftware.smack.XMPPConnection getConnection()
Returns:
XMPPConnection.

createRoom

FormBean createRoom(java.lang.String room,
                    java.lang.String nickname)
                    throws org.jivesoftware.smack.XMPPException
Create new group chat.

Parameters:
room - the room name
nickname - the nickname in this room
Returns:
new MultiUserChat
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

getConfigFormRoom

FormBean getConfigFormRoom(java.lang.String room)
                           throws org.jivesoftware.smack.XMPPException
get configuration form for group chat.

Parameters:
room - the room name
Returns:
the configuration form of MultiUserChat
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

configRoom

org.jivesoftware.smackx.muc.MultiUserChat configRoom(java.lang.String room,
                                                     ConfigRoomBean configRoom)
                                                     throws org.jivesoftware.smack.XMPPException
Configure the group chat.

Parameters:
room - the room name
configRoom - the configuration of group chat
Returns:
the MultiUserChat
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

joinRoom

void joinRoom(java.lang.String room,
              java.lang.String nickname,
              java.lang.String password)
              throws org.jivesoftware.smack.XMPPException
Join to the group chat.

Parameters:
room - the room name
nickname - the nickname
password - the password
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

destroyRoom

java.lang.Boolean destroyRoom(java.lang.String room,
                              java.lang.String reason,
                              java.lang.String altRoom)
                              throws org.jivesoftware.smack.XMPPException
Destroy the group chat.

Parameters:
room - the room name
reason - the reason
altRoom - the name of alter room
Returns:
true if success
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

getRoomInfoBean

FullRoomInfoBean getRoomInfoBean(java.lang.String room)
                                 throws org.jivesoftware.smack.XMPPException
Get full information about room.

Parameters:
room - the name of room
Returns:
the fullRoomInfoBean
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

leaveRoom

java.lang.Boolean leaveRoom(java.lang.String room)
                            throws org.jivesoftware.smack.XMPPException
Leave the room.

Parameters:
room - the room name
Returns:
true if successfully
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

declineRoom

void declineRoom(java.lang.String room,
                 java.lang.String inviter,
                 java.lang.String reason)
Decline the invitation to the room.

Parameters:
room - the room
inviter - the inviter
reason - the reason
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

inviteToRoom

java.lang.Boolean inviteToRoom(java.lang.String room,
                               java.lang.String invitee,
                               java.lang.String reason)
                               throws org.jivesoftware.smack.XMPPException
Invite to the room.

Parameters:
room - the room name
invitee - the invitee
reason - the reason
Returns:
true if successfully
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

manageRole

void manageRole(java.lang.String room,
                java.lang.String nickname,
                java.lang.String role,
                java.lang.String command)
                throws org.jivesoftware.smack.XMPPException
The manage role of user in the room.

Parameters:
chat -
nickname - the nickname
role - the role
command - the command (grant or revoke)
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

manageAffiliation

void manageAffiliation(java.lang.String room,
                       java.lang.String username,
                       java.lang.String affiliation,
                       java.lang.String command)
                       throws org.jivesoftware.smack.XMPPException
Parameters:
chat -
username - the username
affiliation - the affiliate
command - the command (grant or revoke)
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

kickUser

void kickUser(java.lang.String room,
              java.lang.String nickname,
              java.lang.String reason)
              throws org.jivesoftware.smack.XMPPException
Parameters:
chat -
nickname - the nickname
reason - the reason
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

banUser

void banUser(java.lang.String room,
             java.lang.String username,
             java.lang.String reason)
             throws org.jivesoftware.smack.XMPPException
Parameters:
chat -
username - the username
reason - the reason
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

getSearchForm

org.jivesoftware.smackx.Form getSearchForm(java.lang.String searchService)
                                           throws org.jivesoftware.smack.XMPPException
Get form for searching users.

Parameters:
searchService - the name of searchService
Returns:
the Form.
Throws:
org.jivesoftware.smack.XMPPException

getSearchServices

java.util.List<java.lang.String> getSearchServices()
Returns:
the List of search services names.

getUserInfo

UserInfo getUserInfo(java.lang.String userID)
Get the information about user by user id.

Parameters:
userID - the user id
Returns:
the userInfo

getUsername

java.lang.String getUsername()
Get the username.

Returns:
the username;

removeAllTransport

void removeAllTransport()
                        throws org.jivesoftware.smack.XMPPException
Remove all transport subscribed for current user.

Throws:
org.jivesoftware.smack.XMPPException

removeBuddy

boolean removeBuddy(java.lang.String fullUserID)
                    throws org.jivesoftware.smack.XMPPException
Remove remote user from contacts list.

Parameters:
fullUserID - the full ID of remote user.
Returns:
true if user removed successful false otherwise.
Throws:
org.jivesoftware.smack.XMPPException

removeTransport

boolean removeTransport(Transport transport)
                        throws org.jivesoftware.smack.XMPPException
Remove transport from available list. For user it minds close connection with remote users which were available through this transport (ICQ, Yahoo, etc).

Parameters:
transport - the Transport.
Returns:
true if successfully
Throws:
org.jivesoftware.smack.XMPPException

searchUser

org.jivesoftware.smackx.ReportedData searchUser(java.lang.String search,
                                                boolean byUsername,
                                                boolean byName,
                                                boolean byEmail,
                                                java.lang.String searchService)
                                                throws org.jivesoftware.smack.XMPPException
Parameters:
search - the search string.
byUsername - search in useranme
byName - search in name
byEmail - search in mail
searchService - the SearchService name.
Returns:
the list of users which match for searching string.
Throws:
org.jivesoftware.smack.XMPPException

sendMessage

void sendMessage(org.jivesoftware.smack.packet.Message message)
Send message.

Parameters:
message - the message

sendMessageToMUC

void sendMessageToMUC(java.lang.String room,
                      java.lang.String body)
                      throws org.jivesoftware.smack.XMPPException
Send message to the room.

Parameters:
room - the room name
body - the body of message
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

sendPresence

void sendPresence(org.jivesoftware.smack.packet.Presence presence)
Change presence for current user.

Parameters:
presence - the new Presence.

subscribeUser

void subscribeUser(java.lang.String fullUserID)
Subscribe remote user and send message to that user.

Parameters:
fullUserID - the full ID of remote user.

subscribeUser

void subscribeUser(java.lang.String forUser,
                   java.lang.String serviceName)
Subscribe remote user and send message to that user.

Parameters:
forUser - the remote user.
serviceName - the service name.

unsubscribeUser

void unsubscribeUser(java.lang.String fullUserID)
Unsubscribe remote user and send message to that user.

Parameters:
fullUserID - the full ID of remote user.

unsubscribeUser

void unsubscribeUser(java.lang.String forUser,
                     java.lang.String serviceName)
Unsubscribe remote user and send message to that user.

Parameters:
forUser - the remote user.
serviceName - the service name.

getAllHistory

java.util.List<HistoricalMessage> getAllHistory(java.lang.String usernameto,
                                                java.lang.String usernamefrom,
                                                boolean isGroupChat)
Get history.

Parameters:
usernameto - the username who recive message
usernamefrom - the username who send message
isGroupChat - is the group chat
Returns:
list of historyMessages

getHistoryBetweenDate

java.util.List<HistoricalMessage> getHistoryBetweenDate(java.lang.String usernameto,
                                                        java.lang.String usernamefrom,
                                                        boolean isGroupChat,
                                                        java.util.Date dateFrom,
                                                        java.util.Date dateTo)
Get history between two date.

Parameters:
usernameto - the username who recive message
usernamefrom - the username who send message
isGroupChat - is the group chat
dateFrom - the begin
dateTo - the end
Returns:
list of historyMessages

getHistoryFromDateToNow

java.util.List<HistoricalMessage> getHistoryFromDateToNow(java.lang.String usernameto,
                                                          java.lang.String usernamefrom,
                                                          boolean isGroupChat,
                                                          java.util.Date dateFrom)
Get history between the date and current time.

Parameters:
usernameto - the username who recive message
usernamefrom - the username who send message
isGroupChat - is the group chat
dateFrom - the begin
Returns:
list of historyMessages

getInterlocutors

java.util.List<Interlocutor> getInterlocutors(java.lang.String username)
Get all interlocutors of user.

Parameters:
username - thr username
Returns:
list

messageReceive

void messageReceive(java.lang.String messageId)
Set that message is received.

Parameters:
messageId - the id of message

getNotRecieveMessages

java.util.List<HistoricalMessage> getNotRecieveMessages()
Get all not received message.

Returns:
list of not received message

getMultiUserChat

org.jivesoftware.smackx.muc.MultiUserChat getMultiUserChat(java.lang.String room)
                                                           throws org.jivesoftware.smack.XMPPException
Parameters:
room - the name of room
Returns:
the MultiuserChat
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

isJoin

java.lang.Boolean isJoin(java.lang.String room)
                         throws org.jivesoftware.smack.XMPPException
True if join in the room.

Parameters:
room - the room name
Returns:
true if joined to the room
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

getJoinedRooms

java.util.List<java.lang.String> getJoinedRooms()
Get already joined rooms.

Returns:
the joined rooms

changeSubject

void changeSubject(java.lang.String room,
                   java.lang.String newSubject)
                   throws org.jivesoftware.smack.XMPPException
Change subject of the room.

Parameters:
room - the room name
newSubject - the new subject
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

changeAvailabilityStatusInRoom

void changeAvailabilityStatusInRoom(java.lang.String room,
                                    java.lang.String status,
                                    java.lang.String mode)
                                    throws org.jivesoftware.smack.XMPPException
Change status in the room (e.g Extend Away).

Parameters:
room - the room name
status - the status
mode - the mode
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

changeNickname

void changeNickname(java.lang.String room,
                    java.lang.String nickname)
                    throws org.jivesoftware.smack.XMPPException
Change nickname in the room.

Parameters:
room - the room name
nickname - the new nickname
Throws:
org.jivesoftware.smack.XMPPException - the XMPPException

getRoomInfo

org.jivesoftware.smackx.muc.RoomInfo getRoomInfo(java.lang.String room)
                                                 throws org.jivesoftware.smack.XMPPException
Throws:
org.jivesoftware.smack.XMPPException


Copyright © 2010 eXo Platform SAS. All Rights Reserved.