String password = args[1];
String ipAddress = args[2];
Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
log.info("Client session: {}", clientSession);
for (int i = 0; i < 2; i++) {
TimeUnit.SECONDS.sleep(30);
CoinsetterResponse heartbeatResponse = clientSessionService.heartbeat(clientSession.getUuid());
log.info("hearbeat: {}", heartbeatResponse);
}
CoinsetterResponse logoutResponse = clientSessionService.logout(clientSession.getUuid());
log.info("logout: {}", logoutResponse);
try {
CoinsetterResponse heartbeatResponse = clientSessionService.heartbeat(clientSession.getUuid());
log.info("hearbeat: {}", heartbeatResponse);
} catch (CoinsetterException e) {
log.info("{}", e.getMessage());
}
}