private void checkout(ClientMessage message){
        if (message != null){
            String function = message.getFunction();
            if (function.equals("post")) {
                node.propose(message.getArgument());
                if (node.getStatus())
                    log("post received, voting...");
                else
                    sendToClient("Server Node in failure");
            }
            else if (function.equals("read")){
                if (node.getStatus())
                    sendToClient(node.getTweets());
                else
                    sendToClient("Server Node in failure");
            }
            else if (function.equals("fail")){
                node.fail();
                sendToClient("node failed");
            }
            else if (function.equals("unfail")){
                node.recover();
                try {
                    sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }
                if (node.getStatus()){
                    sendToClient("node recovered");
                }
                else {

                    sendToClient("Server not fully recovered, try unfail again!");
                }
            }
        else
            log("Unknown client message received!");
        }
    }