public class RocketChatClientImpl extends Object implements RocketChatClient
Please note, this client does not cache any of the results.
| Constructor and Description |
|---|
RocketChatClientImpl(String serverUrl,
String user,
String password)
Initialize a new instance of the client providing the server's url along with username and
password to use.
|
| Modifier and Type | Method and Description |
|---|---|
Room[] |
getChannels() |
User |
getUser(String userId)
Retrieves a
User from the Rocket.Chat server. |
User[] |
getUsers()
Gets all of the users from a Rocket.Chat server, if you have a ton this will
take some time.
|
void |
send(Room room,
String message)
sends a message to a channel
|
void |
send(String channelName,
String message)
sends a message to a channel
|
public RocketChatClientImpl(String serverUrl, String user, String password)
serverUrl - of the Rocket.Chat server, with or without it ending in "/api/"user - which to authenticate withpassword - of the user to authenticate withpublic User[] getUsers() throws IOException
RocketChatClientgetUsers in interface RocketChatClientUsersIOException - is thrown if there was a problem connecting, including if the result
wasn't successfulpublic User getUser(String userId) throws IOException
RocketChatClientUser from the Rocket.Chat server.getUser in interface RocketChatClientuserId - of the user to retrieveUserIOException - is thrown if there was a problem connecting, including if the result
wasn't successful or there is no userpublic Room[] getChannels() throws IOException
getChannels in interface RocketChatClientIOException - in case of communication errors with the RocketChat server backendpublic void send(Room room, String message) throws sun.security.validator.ValidatorException, IOException
RocketChatClientsend in interface RocketChatClientroom - to use (aka channel)message - to sendsun.security.validator.ValidatorException - in case of SSL errorsIOException - in case of communication errors with the RocketChat server backendpublic void send(String channelName, String message) throws sun.security.validator.ValidatorException, IOException
RocketChatClientsend in interface RocketChatClientchannelName - to usemessage - to sendsun.security.validator.ValidatorException - in case of SSL errorsIOException - in case of communication errors with the RocketChat server backendCopyright © 2016. All rights reserved.