refactoring to rest app, fixed removal of simple update state logic that was causing a loop for CoreClient

This commit is contained in:
Blake J. Harnden 2018-09-12 21:32:40 -07:00
parent 46730ce216
commit 2593d97cab
5 changed files with 77 additions and 162 deletions

View file

@ -20,6 +20,8 @@ public interface ICoreClient {
boolean start() throws IOException;
void updateState(SessionState state);
boolean setState(SessionState state) throws IOException;
GetServices getServices() throws IOException;

View file

@ -158,6 +158,10 @@ public class CoreRestClient implements ICoreClient {
return setState(SessionState.INSTANTIATION);
}
@Override
public void updateState(SessionState state) {
sessionState = state;
}
@Override
public boolean setState(SessionState state) throws IOException {

View file

@ -46,7 +46,7 @@ public class CoreWebSocket {
SessionState state = SessionState.get(event.getEventType().getValue());
if (state != null) {
logger.info("event updating session state: {}", state);
controller.getCoreClient().setState(state);
controller.getCoreClient().updateState(state);
}
} catch (IOException ex) {
logger.error("error getting core event", ex);