Package jadex.bridge.service.types.chat
Interface IChatGuiService
-
- All Known Implementing Classes:
ChatService
public interface IChatGuiService
Service for connecting a user interface to a running chat service.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IFuture<java.lang.Void>
acceptFile(java.lang.String id, java.lang.String filename)
Accept a waiting file transfer.IFuture<java.lang.Void>
cancelTransfer(java.lang.String id)
Cancel an ongoing file transfer.IIntermediateFuture<IChatService>
findUsers()
Search for available chat services.IIntermediateFuture<TransferInfo>
getFileTransfers()
Get a snapshot of the currently managed file transfers.IFuture<byte[]>
getImage()
Get the avatar image.IFuture<java.lang.String>
getNickName()
Get the user name.IIntermediateFuture<IChatService>
message(java.lang.String text, IComponentIdentifier[] receivers, boolean self)
Post a message.IFuture<java.lang.Void>
rejectFile(java.lang.String id)
Reject a waiting file transfer.IFuture<java.lang.Void>
sendFile(java.lang.String fname, byte[] data, IComponentIdentifier cid)
Send a file to the target component via bytes.IFuture<java.lang.Void>
sendFile(java.lang.String filename, IComponentIdentifier cid)
Send a local file to the target component.IFuture<java.lang.Void>
setImage(byte[] image)
Set the avatar image.IFuture<java.lang.Void>
setNickName(java.lang.String nick)
Set the user name.IIntermediateFuture<IChatService>
status(java.lang.String status, byte[] image, IComponentIdentifier[] receivers)
Post a status change.ISubscriptionIntermediateFuture<ChatEvent>
subscribeToEvents()
Subscribe to events from the chat service.
-
-
-
Method Detail
-
setNickName
IFuture<java.lang.Void> setNickName(java.lang.String nick)
Set the user name.
-
getNickName
IFuture<java.lang.String> getNickName()
Get the user name.
-
setImage
IFuture<java.lang.Void> setImage(byte[] image)
Set the avatar image.
-
getImage
IFuture<byte[]> getImage()
Get the avatar image.
-
subscribeToEvents
ISubscriptionIntermediateFuture<ChatEvent> subscribeToEvents()
Subscribe to events from the chat service.- Returns:
- A future publishing chat events as intermediate results.
-
findUsers
IIntermediateFuture<IChatService> findUsers()
Search for available chat services.- Returns:
- The currently available remote services.
-
message
IIntermediateFuture<IChatService> message(java.lang.String text, IComponentIdentifier[] receivers, boolean self)
Post a message. Searches for available chat services and posts the message to all.- Parameters:
text
- The text message.receivers
- The receivers the message should be sent to.self
- Flag if message should also be sent to service itself.- Returns:
- The remote services, to which the message was successfully posted.
-
status
IIntermediateFuture<IChatService> status(java.lang.String status, byte[] image, IComponentIdentifier[] receivers)
Post a status change.- Parameters:
status
- The new status or null for no change.image
- The new avatar image or null for no change.receivers
- The receivers.
-
getFileTransfers
IIntermediateFuture<TransferInfo> getFileTransfers()
Get a snapshot of the currently managed file transfers.
-
sendFile
IFuture<java.lang.Void> sendFile(java.lang.String filename, IComponentIdentifier cid)
Send a local file to the target component.- Parameters:
filename
- The file name.cid
- The id of a remote chat component.
-
sendFile
IFuture<java.lang.Void> sendFile(java.lang.String fname, byte[] data, IComponentIdentifier cid)
Send a file to the target component via bytes.- Parameters:
filepath
- The file path, local to the chat component.cid
- The id of a remote chat component.
-
acceptFile
IFuture<java.lang.Void> acceptFile(java.lang.String id, java.lang.String filename)
Accept a waiting file transfer.- Parameters:
id
- The transfer id.filename
- The location of the file (possibly changed by user).
-
rejectFile
IFuture<java.lang.Void> rejectFile(java.lang.String id)
Reject a waiting file transfer.- Parameters:
id
- The transfer id.
-
cancelTransfer
IFuture<java.lang.Void> cancelTransfer(java.lang.String id)
Cancel an ongoing file transfer.- Parameters:
id
- The transfer id.
-
-