private JobService connect(String host, String username, String password) {
JobService service = null;
try {
Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
service = auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
} catch (NotBoundException e) {
logger.error("Job service not found at remote host.", e);
} catch (RemoteException e) {
logger.error("Could not connect to job service.", e);