public class OCSSwitchboard extends Object
Constructor and Description |
---|
OCSSwitchboard(BroadWorksServer broadWorksServer,
int switchBoardSize) |
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Disconnects all OCSClients in the Switchboard
|
boolean |
isConnected()
Returns if the OCSSwitchboard has at least 1 active OCSSocket
|
void |
login(String username,
String password)
Performs the Login Procedure for each OCS client in the switchboard
|
Future<String> |
sendMessage(String message,
long timeout)
Send a message through the OCS socket using the default timeout as
specified in the Alpaca properties file.
|
public OCSSwitchboard(BroadWorksServer broadWorksServer, int switchBoardSize) throws BroadWorksServerException, IOException
BroadWorksServerException
IOException
public boolean isConnected()
public void disconnect() throws IOException
IOException
- Thrown if an error occurs during closepublic Future<String> sendMessage(String message, long timeout)
message
- The message to send through the socket.timeout
- The message timeout in milliseconds.public void login(String username, String password) throws BroadWorksServerException
username
- The username to login aspassword
- The password to login asBroadWorksServerException
- Thrown if the login fails for any reason.Copyright © 2017 ECG. All rights reserved.