public class

GroupChat

extends Object
java.lang.Object
   ↳ com.gsma.services.rcs.chat.GroupChat

Class Overview

Group chat

Summary

Nested Classes
enum GroupChat.ParticipantStatus Group chat participant status  
enum GroupChat.ReasonCode Group chat state reason code  
enum GroupChat.State Group chat state  
Public Methods
String getChatId()
RcsService.Direction getDirection()
Returns the direction of the group chat
int getMaxParticipants()
Returns the max number of participants in the group chat.
Map<ContactIdGroupChat.ParticipantStatus> getParticipants()
Returns the map of participants and associated status .
GroupChat.ReasonCode getReasonCode()
Returns the reason code of the state of the group chat
ContactId getRemoteContact()
Returns the remote contact
GroupChat.State getState()
Returns the state of the group chat
String getSubject()
Returns the subject of the group chat
long getTimestamp()
Returns the local timestamp of when the group chat invitation was initiated for outgoing group chats or the local timestamp of when the group chat invitation was received for incoming group chat invitations.
void inviteParticipants(Set<ContactId> participants)
Invite additional participants to this group chat.
boolean isAllowedToInviteParticipant(ContactId participant)
Returns true if it is possible to invite the specified participant to the group chat right now, else returns false.
boolean isAllowedToInviteParticipants()
Returns true if it is possible to invite additional participants to the group chat right now, else returns false.
boolean isAllowedToLeave()
Returns true if it is possible to leave this group chat.
boolean isAllowedToSendMessage()
Returns true if it is possible to send messages in the group chat right now, else returns false.
void leave()
Leaves a group chat willingly and permanently.
void openChat()
open the chat conversation.
ChatMessage sendMessage(Geoloc geoloc)
Sends a geoloc message
ChatMessage sendMessage(String text)
Sends a text message to the group
void setComposingStatus(boolean ongoing)
This method should be called to notify the stack of if there is ongoing composing or not in this GroupChat.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public String getChatId ()

Since: API Level 1.5

Returns
  • chat Id
Throws
RcsGenericException Returns the chat ID

public RcsService.Direction getDirection ()

Since: API Level 1.5

Returns the direction of the group chat

Returns
  • Direction
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public int getMaxParticipants ()

Since: API Level 1.5

Returns the max number of participants in the group chat. This limit is read during the conference event subscription and overrides the provisioning parameter.

Returns
  • int

public Map<ContactIdGroupChat.ParticipantStatus> getParticipants ()

Since: API Level 1.5

Returns the map of participants and associated status .

Returns
  • Map<ContactId, ParticipantStatus>
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public GroupChat.ReasonCode getReasonCode ()

Since: API Level 1.5

Returns the reason code of the state of the group chat

Returns
  • ReasonCode
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public ContactId getRemoteContact ()

Since: API Level 1.5

Returns the remote contact

Returns
  • ContactId
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public GroupChat.State getState ()

Since: API Level 1.5

Returns the state of the group chat

Returns
  • State
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException
See Also

public String getSubject ()

Since: API Level 1.5

Returns the subject of the group chat

Returns
  • String
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getTimestamp ()

Since: API Level 1.5

Returns the local timestamp of when the group chat invitation was initiated for outgoing group chats or the local timestamp of when the group chat invitation was received for incoming group chat invitations.

Returns
  • long
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public void inviteParticipants (Set<ContactId> participants)

Since: API Level 1.5

Invite additional participants to this group chat.

Parameters
participants List of participants
Throws
RcsPermissionDeniedException
RcsPersistentStorageException
RcsGenericException
RcsPermissionDeniedException
RcsPersistentStorageException

public boolean isAllowedToInviteParticipant (ContactId participant)

Since: API Level 1.5

Returns true if it is possible to invite the specified participant to the group chat right now, else returns false.

Parameters
participant the contact ID
Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public boolean isAllowedToInviteParticipants ()

Since: API Level 1.5

Returns true if it is possible to invite additional participants to the group chat right now, else returns false.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public boolean isAllowedToLeave ()

Since: API Level 1.5

Returns true if it is possible to leave this group chat.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public boolean isAllowedToSendMessage ()

Since: API Level 1.5

Returns true if it is possible to send messages in the group chat right now, else returns false.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public void leave ()

Since: API Level 1.5

Leaves a group chat willingly and permanently. The group chat will continue between other participants if there are enough participants.

Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public void openChat ()

Since: API Level 1.5

open the chat conversation.
Note: if it is an incoming pending chat session and the parameter IM SESSION START is 0 then the session is accepted now.

public ChatMessage sendMessage (Geoloc geoloc)

Since: API Level 1.5

Sends a geoloc message

Parameters
geoloc Geoloc info
Returns
  • ChatMessage
Throws
RcsPermissionDeniedException
RcsPersistentStorageException
RcsGenericException
RcsPermissionDeniedException
RcsPersistentStorageException

public ChatMessage sendMessage (String text)

Since: API Level 1.5

Sends a text message to the group

Parameters
text Message
Returns
  • ChatMessage
Throws
RcsPermissionDeniedException
RcsPersistentStorageException
RcsGenericException
RcsPermissionDeniedException
RcsPersistentStorageException

public void setComposingStatus (boolean ongoing)

Since: API Level 1.5

This method should be called to notify the stack of if there is ongoing composing or not in this GroupChat. If there is an ongoing chat session established with the remote side corresponding to this GroupChat this means that a call to this method will send the 'is-composing' event or the 'is-not-composing' event to the remote side. However since this method can be called at any time even when there is no chat session established with the remote side or when the stack is not even connected to the IMS server then the stack implementation needs to hold the last given information (i.e. composing or not composing) in memory and then send it later when there is an established session available to relay this information on. Note: if this GroupChat corresponds to an incoming pending chat session and the parameter IM SESSION START is 1 then the session is accepted before sending the 'is-composing' event.

Parameters
ongoing True is client application is composing